Question about fstab, fdisk, and parted?
Hi guys. Dealing with my first brand new linux server ever. Looking at old servers, the fstab has LABEL=/home1 for example on my old server, but on my new one, it has a bunch of UUID=long string in the first column. I don't know if that's good or bad, what would you say?
Also, if I do a fdisk -l on the new server, it has a bunch of these warnings in it. Does that mean parted has replaced fdisk on newer hardware/OS's? WARNING: GPT (GUID Partition Table) detected on '/dev/mapper/mpathc'! The util fdisk doesn't support GPT. Use GNU Parted. Also, last question, say I only have the UUID of a volume, how do I know what /dev/sda# that actually is? Looks like blkid does it, just found it! |
Referencing the drive by its UUID in fstab is more reliable than by device name (/dev/sda1, etc) because device names can change, the UUID won't. LABEL works too, but I don't use it often, UUID is better I think.
fdisk can't use the GPT partition table, hence the warnings. You can still use fdisk to print info about the connected devices as you have, but don't try to use it to modify the partition table for those devices that use GPT, use parted instead. The main advantage of GPT is that it can handle partitions >2TB, which is why it's becoming more and more widely used. |
Quote:
|
fdisk is really obsolete. The man page says "fdisk doesn’t understand GUID Partition Table (GPT) and it is not designed for large partitions. In particular case use more advanced GNU
parted(8)." UUID seems to be all the fashion in Linux now. I gather the argument is that if you move your drives around, /dev/something will change it's meaning but the UUID won't. You can always alter fstab if you feel nostalgic: the system will still work. |
Thanks for the replies everyone. I never used parted before, and only ever do a -l to fdisk and don't understand 90% of it anyway haha.
So reading your replies led to a follow-up question/scenario, slightly off topic. Say I have file system problems and have to boot into single user mode. If I do a df -h it won't show me my volumes, so I would do a more /etc/fstab to see the UUID, then do a blkid to find out what /dev/sda# the volume I want to check is, then I can e2fsck that /dev/sda#, right? Guess I'm missing the basic understanding of how fdisk, fstab, gparted, blkid all tie together. Too bad all that info isn't in one spot for my simple mind haha. |
Quote:
|
Quote:
fstab is simply a config file that tells the OS what partitions it should automount, where, and with what options. blkid tells you the UUID and filesystem type for a device. |
"/dev/something" is a lot easier to type when making or editing /etc/fstab entries by hand.
Even so, I now use the UUIDs. One can refer to the human-readable device names in comments Warning to beginners: /etc/fstab is one of those files that can stop your system booting. It can be anything from a horrible typo to failing to include an instruction not to wait for a device than might not be connected. Before editing /etc/fstab make a copy. Just... Quote:
Quote:
Even now I enforce this rule on myself when editing system files. |
Thanks for all the replies guys
|
All times are GMT -5. The time now is 12:45 AM. |