My recent (re)build of my old Intel Pentium 4 system to run in my Linux system has a slight problem with jumping drive points e.g one minute my /home drive on /dev/sdb1 suddent goes to /dev/sda1 after a reboot etc, etc. A way around it is to use UUID in place of the /dev/sdx notation in your fstab. I’ve been meaning to investigate this method but have finally made to.
UUID or Universally Unique Identifier is a unique ID used in software where the number generate has a small chance of occuring twice. It’s like a random hexadecimal based on factors like time, mouse movement etc to generate the number and using those factors it can re-identify the class, object or in this case the HDD.
UUID overcomes the lack of hardware abstration when referencing hardware. For example the HDD can be connected to any SATA / PATA socket and Linux (in general) names them in order of detection or in order of socket. If drive A was plugged into SATA 1 then Linux would recognise it on /dev/sda
. If Drive A is re-plugged into SATA 2 the drive might change to /dev/sdb. The UUID over comes the changes to drives from a physical point of view. It labels the drive it self and therefore the same drive would have the same ID no matter which socket or device point.
In Ubuntu 8.04 including previous and newer versions store the mount points in /etc/fstab
file. It’s best to create a copy of this file incase something goes wrong:
sudo cp /etc/fstab ~/fstab.bak
This will make a backup copy of fstab to your home directory.
To list the UUID for partitions connected to the system use the command sudo blkid
. Copy the UUID for the partition you want and replace the directive /dev/sda1 (or the partition you want to replace / use) with the hexadecimal e.g:
/dev/hda11 /media/Macintosh_HD hfsplus rw,exec,auto,users 0 0
with UUID:
UUID=crj15eca-5b2s-48ad-9735-eae5ac14bc90 /media/Macintosh_HD hfsplus rw,exec,auto,users 0 0
It’s a much better way of letting the computer keeping tab of which HDD is which but can be harder for a human to tell which one is which.