'Add the UUID from blkid into the /etc/fstab

Need to add the UUID of the disk into the /etc/fstab file.

Input

cat /blkid | awk '{print $2}' | <TODO:>

UUID=e3vm2eea-9oe6-4k01-420f-554fd5frc0 
UUID=e4vm2eea-9oe6-4j01-420f-143fx5fkc0 
UUID=e5vm2eea-9oe6-4i01-420f-154fd5lhc0

Expected Output :

<file system> <mount point>   <type default value>  <options default value>       <dump default value>  <pass default value>
UUID=e3vm2eea-9oe6-4k01-420f-554fd5frc0 /part/1 ext4  acl,rw,noatime 0 2
UUID=e4vm2eea-9oe6-4j01-420f-143fx5fkc0 /part/2 ext4 acl,rw,noatime 0 2
UUID=e5vm2eea-9oe6-4i01-420f-154fd5lhc0 /part/3 ext4 acl,rw,noatime 0 2

Along with UUID need to add the mount partitions, type, option, dump, pass and Mount Partitions is dynamic (1,2,3) All should expect in shell command.



Solution 1:[1]

like this ?

# blkid | awk '{print $2" /part/"NR" ext4 acl,rw,noatime 0 2"}'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 p305