LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-17-2011, 01:51 AM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,373

Rep: Reputation: Disabled
new fstab format?


I just looked in the fstab file on my new Debian installation, because I wanted to edit it so a separate partition would be used for /home. But the format is different from what I've seen in the past on my other Linux installations. The contents are:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/sda5 during installation
UUID=cd9b49f1-836b-446e-bfd2-7c3613bae496 /               ext3    errors=remount-ro 0       1
# swap was on /dev/sda2 during installation
UUID=fa50d342-46e0-41b2-a163-b679a397e5b6 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
/dev/sdb1       /media/usb0     auto    rw,user,noauto  0       0
I expected it to look like this:
Code:
# Pluggable devices are handled by uDev, they are not in fstab
/dev/sda7 / ext3 defaults,noatime 1 1
/dev/sda2 swap swap sw,pri=1 0 0
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0622 0 0
/dev/sda1 /home auto defaults,noatime 1 2
# Dynamic entries below
/dev/sda3 /mnt/sda3 ext3 noauto,users,exec,relatime 0 0
/dev/sda5 /mnt/sda5 ext3 noauto,users,exec,relatime 0 0
/dev/sda6 /mnt/sda6 ext3 noauto,users,exec,relatime 0 0
/dev/sdb1 /mnt/sdb1 vfat noauto,users,gid=users,dmask=002,fmask=113,relatime 0 0
/dev/cdrom /media/cdrom udf,iso9660 noauto,users,exec,ro 0 0
/dev/sr0 /media/cdrom udf,iso9660 noauto,users,exec,ro 0 0
Has the format of fstab been changed, as grub was changed to grub 2 sometime recently? I don't know how to edit this new format, and the line I'm looking for isn't there. I want to tag /sda1 as the /home partition, but it (and none of the sda1 partitions) are mentioned. I suppose they've been moved to another file? If so, what is it?

Last edited by newbiesforever; 10-17-2011 at 01:55 AM.
 
Old 10-17-2011, 01:57 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
fstab has been using universally unique identifiers (UUID) for quite awhile now in many, if not most, distros. It still understands the sd*[0-9] syntax too. The blkid command will provide you the UUID for each hard drive partition. So too will ls -l /dev/disk/by-uuid
 
1 members found this post helpful.
Old 10-17-2011, 01:59 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
those partitions clearly are mentioned, what do you think

UUID=cd9b49f1-836b-446e-bfd2-7c3613bae496 / ext3 errors=remount-ro 0 1

is as it's clearly mounting an ext3 partition to /

the use of UUID's mean that if you reconnect that drive as sdb, or mess with partitions, it'll still be found without issue. it IS the same format.
 
Old 10-17-2011, 10:54 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
The use of UUIDs can have its drawbacks. I have a guest partition for testing new distros. If the installer changes its UUID, or that of the swap partition (and it has happened), my main distro won't boot. Nowadays, I re-write my fstab to use /dev designations.
 
Old 10-17-2011, 11:16 AM   #5
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,373

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by weibullguy View Post
fstab has been using universally unique identifiers (UUID) for quite awhile now in many, if not most, distros. It still understands the sd*[0-9] syntax too. The blkid command will provide you the UUID for each hard drive partition. So too will ls -l /dev/disk/by-uuid
Quote:
Originally Posted by DavidMcCann View Post
The use of UUIDs can have its drawbacks. I have a guest partition for testing new distros. If the installer changes its UUID, or that of the swap partition (and it has happened), my main distro won't boot. Nowadays, I re-write my fstab to use /dev designations.
I see...so until I get the hang of the new syntax, I am not required to use it?

MEPIS 11 and antiX must not be using the new format yet, because the Fstab files on my installations of those are written in the old format.

Last edited by newbiesforever; 10-17-2011 at 11:22 AM.
 
Old 10-17-2011, 02:36 PM   #6
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by newbiesforever View Post
I see...so until I get the hang of the new syntax, I am not required to use it?
... the Fstab files on my installations of those are written in the old format.
I have not heard anywhere that the UUID format is "preferred" or the way of the future. It's just another option and you don't need to convert to it

From man fstab (my bold):
Quote:
Instead of giving the device explicitly, one may indicate the (ext2 or xfs) filesystem that is to be mounted by its UUID
or volume label (cf. e2label(8) or xfs_admin(8)), writing LABEL=<label> or UUID=<uuid>, e.g., `LABEL=Boot' or
`UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'. This will make the system more robust: adding or removing a SCSI disk
changes the disk device name but not the filesystem volume label.
 
Old 10-17-2011, 03:28 PM   #7
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,373

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by SecretCode View Post
I have not heard anywhere that the UUID format is "preferred" or the way of the future. It's just another option and you don't need to convert to it

From man fstab (my bold):
Great. The other way is less complicated, at least in my opinion.
 
Old 10-17-2011, 04:01 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
pen and paper is "less complicated". So is DOS 6.2.
 
Old 10-17-2011, 04:45 PM   #9
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,373

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
pen and paper is "less complicated". So is DOS 6.2.
No one was proposing to use pen and paper instead of a computer, good sir; and if you're seriously suggesting that preferring simplicity would or should lead me to quit using computers at all, that's probably a slippery-slope argument. There's a difference between the top of the slope and the bottom. So some things are less complicated than others, eh? Really!--I never would have guessed.

Anyway, When something I've been doing works fine, such as the old Fstab format or KDE 3, I generally have no interest in changing it. The programmmers out there can fool around with these things all they want to, because that's their hobby and/or line of work; but it's not mine, so on my computer, unless I feel like doing something new just for the hell of it, I'll pass on using this other Fstab format.

Last edited by newbiesforever; 10-17-2011 at 04:57 PM.
 
Old 10-18-2011, 01:16 AM   #10
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
The main point of UUID is that it will mount that partition, and only that partition, even if something happens to alter the device entry, and it will also prevent mounting if someone swaps out the drive with another one. It will only fail if you do something to change the UUID, as mentioned.

It was added to provide a more hardware-specific way to handle block devices; one that's not dependent on bus location or order of detection.

By the way, as kind of a middle ground, you can also designate the partition to mount by label. If a partition with the given label is detected, the system will mount it to that location, again no matter what the /dev entry says. But it's a bit weaker than UUID because it's not uncommon for multiple drives with identically-labeled partitions to exist.

Of course that can come in useful too, at times.

Last edited by David the H.; 10-18-2011 at 01:22 AM. Reason: some rewording
 
1 members found this post helpful.
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/fstab format?? domp Red Hat 3 04-07-2007 05:37 PM
binds in fstab for chrooted ftp users (format help please) crazytigger Linux - Newbie 1 05-03-2006 07:14 PM
binds in fstab for chrooted ftp users (format help please) crazytigger Linux - Networking 1 05-03-2006 07:13 PM
fstab file format - numbers at the end jjisnow Linux - Newbie 3 03-23-2004 06:54 PM
WARNING: Bad format on line 10 of /etc/fstab thetwin Linux - Newbie 22 03-05-2003 12:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:37 PM.

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