Getting UUID of a partition for use in /etc/fstab

To get UUID of a partition use the command

blkid /dev/sdXX

Example

me@ubuntudevmach:~/$ blkid /dev/sdb1

/dev/sdb1: UUID="405d2966-6826-4942-baa4-244f24aa31c3" TYPE="ext4" PTUUID="775559d3" PTTYPE="dos"

This is useful when editing /etc/fstab to direct a partition to a folder

Example of directing a partition to be used as the /home folder

UUID=405d2966-6826-4942-baa4-244f24aa31c3 /home ext4 errors=remount-ro 0 1
This entry was posted in Linux commandline and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *