Christoffer Kjølbæk I have a blog, therefore I am…

14Aug/100

Using UUID for USB harddrives in fstab

If you use a number of USB hard drives attached to a server (or desktop), you will notice that they (can) come up with different device names after each reboot. Because of the different names, it is difficult to use the names in /etc/fstab. To avoid this problem, it is possible to use UUID instead, which is an unique id number for each partition.

If you fstab line for the USB disk looks like

/dev/sdc2 /nas/data ext3 errors=remount-ro 0 1

You should get the UUID of /dev/sdc2 by running

blkid /dev/sdb2

Which gives something like

/dev/sdb2: LABEL="maxtor_b_data" UUID="b7a042b2-60c6-4116-8324-065a3d23520d" TYPE="ext3"

Change the fstab line to

UUID=b7a042b2-60c6-4116-8324-065a3d23520d /nas/data ext3 errors=remount-ro 0 1

And you are ready to go :)

Kommentarer (0) Trackbacks (0)

Ingen kommentarer endnu.


Læg en kommentar


Ingen trackbacks endnu.