Operating System - Linux
1753706 Members
4702 Online
108799 Solutions
New Discussion юеВ

need to use blkid's UUID in fstab

 
SOLVED
Go to solution
MSwift
Regular Advisor

need to use blkid's UUID in fstab

Could someone please let know the need to use UUID in fstab. Is that way suppose to be better? Please help..

Thanks

Mike.
4 REPLIES 4
Goran┬аKoruga
Honored Contributor

Re: need to use blkid's UUID in fstab

Hello.

It depends on your definition of "better".

In general, the advantage is that it should work even if your device name changes.

Even the fstab(5) man page tells you:

This will make the system more robust: adding or removing a SCSI disk changes the disk device name but not the filesystem volume label.

Regards,
Goran
Matti_Kurkela
Honored Contributor
Solution

Re: need to use blkid's UUID in fstab

In general, there is no strict requirement to use UUIDs. Even if some Linux distribution uses UUIDs by default, you can revert to traditional device names if you wish.

(If a Linux distribution provides special GUI tools that rely on filesystem UUIDs in /etc/fstab, those might obviously be broken if you revert to traditional names. However, if you care about the difference, you probably prefer not to use GUI "wizards" anyway...)

UUIDs are better if you won't always know what the exact device name will be. For example, if your system uses traditional partitions (instead of LVM) on SAN devices, or your portable demo system uses external Firewire disks you might not always plug in in the exact same order, or when you're preparing to swap your disk controller to a different model.

When you use UUIDs in /etc/fstab, the mount command will go through all disk devices known to the system (as listed in /proc/partitions) and look for the specified UUID.

UUIDs are not so good if you have multiple clones (copies made with Ghost, dd or a similar tool) of a single filesystem available and you must ensure a particular one is chosen.

In short, UUIDs are just one more tool. It's the responsibility of the system administrator to understand when UUIDs are helpful, and when they are not.

MK
MK
Alzhy
Honored Contributor

Re: need to use blkid's UUID in fstab

If you have a large environment and you cross present SAN disks a lot and use LVM heavily - etc. -- then UUID based fstab entries is ACTUALLY Good Practice.

One very solid erason I can think of is to pinpoint without doubt that a disk has the correct filesystem on it or an LVOL really belongs to a particular VG and that is what you really want.

The UUID is a very "unique" representation that it is utterly impossible another server willl have a blkid/UUID that will be the same. It is a VERY large randomly generated values whose duplication by the planets 1 Billion Linux machines could possibly duplicate by chance...

So there ya go --- Ease in identifcation....

It is and always has been my standard. We do have strict fstab standards though as follows:

#/dev/mapper/lnx0001-oracle:
UUID="c9d7f33c-4621-44d9-b3c2-90fe5e7ad62e" /oracle ext3 defaults 1 2

#/dev/mapper/XPLUN00a04dp1:
UUID="4e953ee6-3351-43be-886d-86a600d01687" /oraback ocfs2 defaults 1 2

We always add the underlying device lvol or disk name following the UUID fstab entry.


CHeers!

Hakuna Matata.
MSwift
Regular Advisor

Re: need to use blkid's UUID in fstab

Thanks all. Good explanations!

Thanks

Mike.