Linux - GeneralThis 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
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.
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
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.
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
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.
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
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.
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.