I was just quickly running up a small linux server to use as a backup server at a remote site, and added a new disk to an existing install.
Since it’s at a remote site, I don’t want the chance of it barfing on boot, so I definitely want to specify my partition by UUID.
The UUID is used to identify a device, independently from its device name. Especially useful when mounting physical disks, it’s also useful for LVM volumes, etc.
[showmyads]
There are a few ways to get the UUID, but by far the easiest is to simply do an ls -l in /dev/disk/by-uuid.
1 2 3 4 5 6 7 8 9 |
root@backup01:~# ls -l /dev/disk/by-uuid/ total 0 lrwxrwxrwx 1 root root 10 Apr 10 14:24 16d28c61-49a6-42c0-a392-32f8853c692c -> ../../sda5 lrwxrwxrwx 1 root root 10 Apr 10 14:24 200a1573-a5cd-484f-9740-beaf661868b5 -> ../../sda7 lrwxrwxrwx 1 root root 10 Apr 10 14:24 70a2da02-1c69-4a6f-9a76-6a2b72add1cc -> ../../dm-0 lrwxrwxrwx 1 root root 10 Apr 10 14:24 bf778a70-2777-4683-9d38-60f081bd432a -> ../../sda1 lrwxrwxrwx 1 root root 10 Apr 10 14:24 c951126d-2d1b-40fa-83a4-ca7e1c7af11b -> ../../sda6 lrwxrwxrwx 1 root root 10 Apr 10 14:24 dc64f458-a4e9-47d3-a11a-eb92c1df760b -> ../../sda9 lrwxrwxrwx 1 root root 10 Apr 10 14:24 e711e321-0971-423c-b1f5-5f296a3d5f7a -> ../../sda8 |
In my case, I’m pointing at a LVM Logical Volume, so I can take a guess that I’m looking for dm-0, but to be sure, I want to check in /dev/mapper:
1 2 3 4 |
root@backup01:~# ls -l /dev/mapper/ total 0 crw------- 1 root root 10, 59 Apr 10 14:24 control lrwxrwxrwx 1 root root 7 Apr 10 14:24 VG1-Vol1 -> ../dm-0 |
Yep, so to mount that new volume in fstab, I want to add a line like the following:
1 |
UUID=70a2da02-1c69-4a6f-9a76-6a2b72add1cc /export ext3 defaults 0 2 |
Leave a Reply