Looking for UUID numbers Partition, Hard drive and Removable Disc

UUID or Universally Unique Identifier usually used on linux operating system. UUID is used to mount media (hard drive). UUID function to create an alias name of the hard disk, partition of the hard drive, removable media. For example /dev/sda1 with alias UUID BA0CC49E0CC456D3. Where the UUID usually used ? In fstab. FSTAB is used to mount the media every time you boot into your system.






$ cat /etc/fstab
result :
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# 
proc                                       /proc        proc  defaults           0  0  
# / was on /dev/sda7 during installation
UUID=52eda015-3ae9-48c8-ac95-d2987d09290a  /            ext4  errors=remount-ro  0  1  
# swap was on /dev/sda8 during installation
UUID=7cde522e-abcf-481f-b6f0-1cb6be185275  none         swap  sw                 0  0  
/dev/sda5                                  /media/sda5  ntfs  defaults           0  0  
/dev/sda1                                  /media/sda1  ntfs  defaults           0  0  
#/dev/sdb       /media/fda auto defaults,noauto  0  2
#/dev/sdb1       /media/fdb auto defaults,noauto  0  2
#/dev/sdc       /media/fdc auto defaults,noauto  0  2
#/dev/sd1       /media/fdd auto defaults,noauto  0  2

What's so special to use UUID, the UUID we can change the hard drive slot without disrupting our system. So, even if we change the position of the hard disk slot, the OS still will be mounting to the right media. Different if we use a direct mount (/dev/sda1, ....) to the hard drive if slot change, our system will have problems.

How to find UUID:

Type this command on your terminal or console:
$ ls -l /dev/disk/by-uuid

The result is:



Okay, if you know UUID number. Now edit your /etc/fstab, replace writings (eg) the previous "/ dev/sda5" to "UUID = 2CF49FB4F49F7F30" (from the above result)

Before:
/dev/sda5                      /media/sda5  ntfs  defaults           0  0

After :
UUID = 2CF49FB4F49F7F30        /media/sda5  ntfs  defaults           0  0

hopefully help, and good luck.

Comments