LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Question about fstab, fdisk, and parted? (https://www.linuxquestions.org/questions/linux-newbie-8/question-about-fstab-fdisk-and-parted-4175444671/)

anon091 01-08-2013 10:39 AM

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!

suicidaleggroll 01-08-2013 10:49 AM

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.

johnsfine 01-08-2013 10:55 AM

Quote:

Originally Posted by suicidaleggroll (Post 4865477)
fstab can't use the GPT partition table, hence the warnings. You can still use fstab

I'm sure you meant to type fdisk. But a beginner might be confused about what you meant, since fstab was a different aspect of the same question.

DavidMcCann 01-08-2013 10:59 AM

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.

anon091 01-08-2013 11:38 AM

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.

suicidaleggroll 01-08-2013 11:48 AM

Quote:

Originally Posted by johnsfine (Post 4865481)
I'm sure you meant to type fdisk. But a beginner might be confused about what you meant, since fstab was a different aspect of the same question.

Good catch, stupid typos...brain thinks one thing, hands type another.

suicidaleggroll 01-08-2013 11:58 AM

Quote:

Originally Posted by rjo98 (Post 4865506)
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.

Thad E Ginataom 01-08-2013 12:03 PM

"/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.

anon091 01-08-2013 01:43 PM

Thanks for all the replies guys


All times are GMT -5. The time now is 12:45 AM.