LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-08-2013, 10:39 AM   #1
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Rep: Reputation: 49
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!

Last edited by anon091; 01-08-2013 at 10:44 AM. Reason: found blkid
 
Old 01-08-2013, 10:49 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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
 
1 members found this post helpful.
Old 01-08-2013, 10:55 AM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by suicidaleggroll View Post
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.
 
1 members found this post helpful.
Old 01-08-2013, 10:59 AM   #4
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,137

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
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.
 
1 members found this post helpful.
Old 01-08-2013, 11:38 AM   #5
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
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.
 
Old 01-08-2013, 11:48 AM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by johnsfine View Post
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.
 
Old 01-08-2013, 11:58 AM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by rjo98 View Post
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.
 
1 members found this post helpful.
Old 01-08-2013, 12:03 PM   #8
Thad E Ginataom
Member
 
Registered: Mar 2011
Distribution: Ubuntu 12.04 with KXStudio, MATE & Compiz
Posts: 46

Rep: Reputation: 8
"/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.
 
1 members found this post helpful.
Old 01-08-2013, 01:43 PM   #9
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
Thanks for all the replies guys
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fdisk v/s parted pinga123 Linux - Newbie 4 02-28-2011 04:35 AM
fdisk vs parted L1nuxn00b703 Linux - Newbie 2 09-08-2009 09:13 PM
fdisk, parted, and gparted lawrence_lee_lee Linux - Software 3 06-15-2008 08:26 AM
cannot use 100% of hard disk, fdisk / parted / partition question lucastic Linux - Hardware 5 12-02-2005 08:58 PM
fdisk, parted questions? darkleaf Linux - Software 2 10-14-2004 04:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration