Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
Last edited by anon091; 01-08-2013 at 10:44 AM.
Reason: found blkid
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.
Last edited by suicidaleggroll; 01-08-2013 at 11:42 AM.
Reason: typo
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.
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.
fdisk and parted do basically the same thing, creating, deleting, and resizing partitions. The main difference is parted can use the GPT partition table which can handle >2TB partitions, fdisk can't.
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.
Distribution: Ubuntu 12.04 with KXStudio, MATE & Compiz
Posts: 46
Rep:
"/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:
$ sudo cp /etc/fstab /etc/fstab.0
Because it is a lot easier to...
Quote:
$ sudo cp /etc/fstab.0 /etc/fstab
...if you have to boot into a shell than it is to dig around, possibly with uncertain vi skills, trying to find your error. Revert to known-to-work copy --- and then try again.
Even now I enforce this rule on myself when editing system files.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.