I'm very curious (and not entirely pleased) by how different /etc/fstab is in Fedora when compared to almost any other Linux distro I've used. For example, the following is a fairly complex /etc/fstab from an old version of SuSE:
# Device Mountpoint FStype Options Dump fsckorder# /dev/hda1 none swap defaults 0 0 /dev/hda2 / ext2 defaults 1 1 /dev/hda3 /boot ext2 defaults 2 2 /dev/hda5 /home ext2 defaults 2 2 /dev/hda6 /tmp ext2 defaults 2 2 /dev/hda7 /usr ext2 defaults 2 2 /dev/hda8 /var ext2 defaults 2 2 /dev/hdc /cdrom cd9660 ro,noauto 0 0 /dev/hdd /cdrom1 cd9660 ro,noauto 0 0
Now compare that to my current FC3 installation:
# This file is edited by fstab-sync - see 'man fstab-sync' for details LABEL=/1 / ext3 defaults 1 1 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 LABEL=SWAP-hda2 swap swap defaults 0 0 /dev/hdd /media/cdrecorder auto pamconsole,ro,exec,noauto,managed 0 0 /dev/hdc /media/cdrecorder2 auto pamconsole,ro,exec,noauto,managed 0 0
What's confusing to me here is that, in Fedora, I can't figure out which partition is mounted where. Is my / partition /dev/hda3, or /dev/hda5, or ??? Ditto for swap, or any other partition. If I wanted to make some change in the partition table (for example, adding a /home partition) I have no idea how I could get /etc/fstab to recognize it.
I've tried making some sense out of fstab-sync, but so far it's pretty opague. Where does Fedora store the partition information? Anybody know some links that can explain this messy filesystem table?
Thanks in advance, Robert
Robert Storey wrote:
What's confusing to me here is that, in Fedora, I can't figure out which partition is mounted where. Is my / partition /dev/hda3, or /dev/hda5, or ??? Ditto for swap, or any other partition. If I wanted to make some change in the partition table (for example, adding a /home partition) I have no idea how I could get /etc/fstab to recognize it.
I've tried making some sense out of fstab-sync, but so far it's pretty opague. Where does Fedora store the partition information? Anybody know some links that can explain this messy filesystem table?
If you just run the command "mount" (you don't have to be root), you'll see which partitions are mounted where. You can use either hardcoded partition names such as "/dev/hda7" or filesystem label references such as "LABEL=/home" in /etc/fstab; either will work OK. You can assign a label to a partition when you create the filesystem on it by using the -L option in mke2fs, and you can set or change the label of an existing partition using the -L option in tune2fs.
Paul.
On Monday 31 January 2005 07:35, Paul Howarth wrote:
Robert Storey wrote:
What's confusing to me here is that, in Fedora, I can't figure out which partition is mounted where. Is my / partition /dev/hda3, or /dev/hda5, or ??? Ditto for swap, or any other partition. If I wanted to make some change in the partition table (for example, adding a /home partition) I have no idea how I could get /etc/fstab to recognize it.
I've tried making some sense out of fstab-sync, but so far it's pretty opague. Where does Fedora store the partition information? Anybody know some links that can explain this messy filesystem table?
If you just run the command "mount" (you don't have to be root), you'll see which partitions are mounted where. You can use either hardcoded partition names such as "/dev/hda7" or filesystem label references such as "LABEL=/home" in /etc/fstab; either will work OK. You can assign a label to a partition when you create the filesystem on it by using the -L option in mke2fs, and you can set or change the label of an existing partition using the -L option in tune2fs.
or display and change labels with e2label
But why label in the first place? I wondered about that for a while and came to this conclusion: If a drive in an Intel-like box is changed from master to slave or primary IDE channel to secondary or some other combination then the device name changes, e.g., /dev/hda1 to /dev/hdb1. When booting after this change without fixing /etc/fstab, mount cannot find /dev/hda1 because of its new location at /dev/hdb1. By labeling partitions and using the labels in /etc/fstab, mount will search all available partitions for the one with the name specified in /etc/fstab (or mount command). This eliminates the problem of device names changing when modifying the drive configuration.
Labeling does introduce a problem: What happens if 2 partitions have the same label? Which one does mount choose? I do not know the algorithm but I do know that mount does not know which one you want to use. In the technical college where I taught Unix/Linux system administration we had removable IDE drives in our lab machines. (standard IDE drives in a tray that slides into a bay the in cabinet. works good. I use them at home too) I had a removable drive bay on my office machine. A couple of times I had to make some repairs to corrupted student drives. Since the drives are not hot-swappable I would power down my machine, insert the student's drive, power up and boot. Their partition labels were the same as on my internal IDE drive and as a result would bet mounted instead of my partitions. After a couple time of messing with that I changed the /etc/fstab file on my system to use device names instead of labels.
fsck also recognizes the labels, probably other disk related commands too.
paul
Paul F. Almquist wrote:
Labeling does introduce a problem: What happens if 2 partitions have the same label? Which one does mount choose? I do not know the algorithm but I do know that mount does not know which one you want to use. In the technical college where I taught Unix/Linux system administration we had removable IDE drives in our lab machines. (standard IDE drives in a tray that slides into a bay the in cabinet. works good. I use them at home too) I had a removable drive bay on my office machine. A couple of times I had to make some repairs to corrupted student drives. Since the drives are not hot-swappable I would power down my machine, insert the student's drive, power up and boot. Their partition labels were the same as on my internal IDE drive and as a result would bet mounted instead of my partitions. After a couple time of messing with that I changed the /etc/fstab file on my system to use device names instead of labels.
fsck also recognizes the labels, probably other disk related commands too.
paul
In such cases , I strongly suggest changing the labels. Here I used to have FC2 and FC3 test releases (during FC3 test) installed. The root for FC2 was labeled / , the one for FC3 was labeled fc3/ . And the same way for other partitions. Now , if you need to insert another disk with the same labels , you can always change the root=LABEL=/ part on grub to point to the right device. This change can be done at boot time (just press "a" on grub screen) and it probably will fix the issue, since the kernel will know exactly which partition to use on boot time.
-- Pedro Macedo
On Monday 31 January 2005 13:33, Pedro Fernandes Macedo wrote:
Paul F. Almquist wrote:
Labeling does introduce a problem: What happens if 2 partitions have the same label? Which one does mount choose? I do not know the algorithm but I do know that mount does not know which one you want to use. In the technical college where I taught Unix/Linux system administration we had removable IDE drives in our lab machines. (standard IDE drives in a tray that slides into a bay the in cabinet. works good. I use them at home too) I had a removable drive bay on my office machine. A couple of times I had to make some repairs to corrupted student drives. Since the drives are not hot-swappable I would power down my machine, insert the student's drive, power up and boot. Their partition labels were the same as on my internal IDE drive and as a result would bet mounted instead of my partitions. After a couple time of messing with that I changed the /etc/fstab file on my system to use device names instead of labels.
fsck also recognizes the labels, probably other disk related commands too.
paul
In such cases , I strongly suggest changing the labels. Here I used to have FC2 and FC3 test releases (during FC3 test) installed. The root for FC2 was labeled / , the one for FC3 was labeled fc3/ . And the same way for other partitions. Now , if you need to insert another disk with the same labels , you can always change the root=LABEL=/ part on grub to point to the right device. This change can be done at boot time (just press "a" on grub screen) and it probably will fix the issue, since the kernel will know exactly which partition to use on boot time.
That would take care of getting the right root partition but what about the case where, for example, /usr was in a separate partition on each disk with the same labels?
Fortunately I rarely had to deal with the problem and since I retired last May I won't likely run into to it again.
paul
On Mon, 2005-01-31 at 15:32 -0600, Paul F. Almquist wrote:
On Monday 31 January 2005 13:33, Pedro Fernandes Macedo wrote:
Paul F. Almquist wrote:
Labeling does introduce a problem: What happens if 2 partitions have the same label? Which one does mount choose? I do not know the algorithm
It doesn't. The conflict cannot be resolved, and it will hang
but I do know that mount does not know which one you want to use. In the technical college where I taught Unix/Linux system administration we had removable IDE drives in our lab machines. (standard IDE drives in a tray that slides into a bay the in cabinet. works good. I use them at home too) I had a removable drive bay on my office machine. A couple of times I had to make some repairs to corrupted student drives. Since the drives are not hot-swappable I would power down my machine, insert the student's drive, power up and boot. Their partition labels were the same as on my internal IDE drive and as a result would bet mounted instead of my partitions. After a couple time of messing with that I changed the /etc/fstab file on my system to use device names instead of labels.
fsck also recognizes the labels, probably other disk related commands too.
paul
In such cases , I strongly suggest changing the labels. Here I used to have FC2 and FC3 test releases (during FC3 test) installed. The root for FC2 was labeled / , the one for FC3 was labeled fc3/ . And the same way for other partitions. Now , if you need to insert another disk with the same labels , you can always change the root=LABEL=/ part on grub to point to the right device. This change can be done at boot time (just press "a" on grub screen) and it probably will fix the issue, since the kernel will know exactly which partition to use on boot time.
That would take care of getting the right root partition but what about the case where, for example, /usr was in a separate partition on each disk with the same labels?
It is for that reason, that I seldom use labels. A machine that has drives already labeled at boot time will give new partitions created new labels. Swapping different drives in with conflicting labels will always cause a problem when labels are used in fstab for mounting.
I always put the partition name in fstab instead of using labels and thus do not have the conflict.
In general, different partitions with the same label will always conflict when labels are used.
Fortunately I rarely had to deal with the problem and since I retired last May I won't likely run into to it again.
paul
Paul F. Almquist paul@almquist.name Eau Claire, WI USA
On Mon, 2005-01-31 at 19:20 -0600, Jeff Vian wrote:
On Mon, 2005-01-31 at 15:32 -0600, Paul F. Almquist wrote:
On Monday 31 January 2005 13:33, Pedro Fernandes Macedo wrote:
Paul F. Almquist wrote:
Labeling does introduce a problem: What happens if 2 partitions have the same label? Which one does mount choose? I do not know the algorithm
It doesn't. The conflict cannot be resolved, and it will hang
but I do know that mount does not know which one you want to use. In the technical college where I taught Unix/Linux system administration we had removable IDE drives in our lab machines. (standard IDE drives in a tray that slides into a bay the in cabinet. works good. I use them at home too) I had a removable drive bay on my office machine. A couple of times I had to make some repairs to corrupted student drives. Since the drives are not hot-swappable I would power down my machine, insert the student's drive, power up and boot. Their partition labels were the same as on my internal IDE drive and as a result would bet mounted instead of my partitions. After a couple time of messing with that I changed the /etc/fstab file on my system to use device names instead of labels.
fsck also recognizes the labels, probably other disk related commands too.
paul
In such cases , I strongly suggest changing the labels. Here I used to have FC2 and FC3 test releases (during FC3 test) installed. The root for FC2 was labeled / , the one for FC3 was labeled fc3/ . And the same way for other partitions. Now , if you need to insert another disk with the same labels , you can always change the root=LABEL=/ part on grub to point to the right device. This change can be done at boot time (just press "a" on grub screen) and it probably will fix the issue, since the kernel will know exactly which partition to use on boot time.
That would take care of getting the right root partition but what about the case where, for example, /usr was in a separate partition on each disk with the same labels?
It is for that reason, that I seldom use labels. A machine that has drives already labeled at boot time will give new partitions created new labels. Swapping different drives in with conflicting labels will always cause a problem when labels are used in fstab for mounting.
I always put the partition name in fstab instead of using labels and thus do not have the conflict.
Swapping drives around when you have hard-coded partition names in fstab will also cause problems; drives can change device names and then not be mountable. The gist of it is that if you're adding in extra drives (and particularly if you're removing drives), you'd better know what you're doing or you could have problems. The same goes for adding and removing partitions, though filesystem labels are a bit more robust than partition names in that case.
Paul.
On Wed, 2005-02-02 at 21:30 -0600, jim branagan wrote:
Labeling does introduce a problem: What happens if 2 partitions have the same label? Which one does mount choose? I do not know the algorithm
It doesn't. The conflict cannot be resolved, and it will hang
Actually it says 'press any key to continue' but that just reboots with the same problem.
In such cases , I strongly suggest changing the labels. Here I used to have FC2 and FC3 test releases (during FC3 test) installed. The root for FC2 was labeled / , the one for FC3 was labeled fc3/ . And the same way for other partitions. Now , if you need to insert another disk with the same labels , you can always change the root=LABEL=/ part on grub to point to the right device. This change can be done at boot time (just press "a" on grub screen) and it probably will fix the issue, since the kernel will know exactly which partition to use on boot time.
That would take care of getting the right root partition but what about the case where, for example, /usr was in a separate partition on each disk with the same labels?
Even if you use only hard-coded device names in /etc/fstab and /boot/grub/grub.conf, linux will crap out and dump you into run level 3 if there are any duplicate labels
This is bull! I have often had multiple disks that are labeled the same (especially /boot and /) and as long as I have the device names in fstab and grub.conf I have never had a problem.
It is for that reason, that I seldom use labels. A machine that has drives already labeled at boot time will give new partitions created new labels. Swapping different drives in with conflicting labels will always cause a problem when labels are used in fstab for mounting.
I always put the partition name in fstab instead of using labels and thus do not have the conflict.
Swapping drives around when you have hard-coded partition names in fstab will also cause problems; drives can change device names and then not be mountable. The gist of it is that if you're adding in extra drives (and particularly if you're removing drives), you'd better know what you're doing or you could have problems. The same goes for adding and removing partitions, though filesystem labels are a bit more robust than partition names in that case.
Paul.
Swapping drives around between PC's always requires fstab changes with or without labels; otherwise EIDE devices never change names unless they are physically moved to a different IDE bus or switched between master and slave.
Often, but not always. If the drive is moved from primary master in one machine to the same location in the other, no changes are required. the same applies to any ide bus location as long as it is moved to the identical location on the second machine.
I agree labels are useful for USB and Firewire drives, but they should probably never be labeled with names like '/' and '/tmp' that are likely to be reused on many different drives. Unfortunately the Fedora installers (FC1, FC2 and FC3) like to create multiple partitions with just these sorts of labels - ONCE it created a partion labeled '/1', but most times I've ended up with a difficult to boot machine with multiple 'LABEL=/' partitions.
In my experience, IF the previously labeled drive is in the system and you do another install it will ALWAYS label the new / as /1 ( or rather /n where n is the next unused number). The new labels are also used in fstab and grub.conf so there is no problem.
If the labeled drive is not connected at the time of OS install you will wind up with duplicate labels when you connect the other drive and that always leads to boot problems unless your fstab and grub.conf have the device names
Labels would be a lot more useful if more applications displayed both device and label (and mount point). When df displays only labels and fdisk displays only device names, I have to look up what parameters to give which tool to print labels for devices, and hand-map between the two.
e2label tells you what label is on the specified partition.
It would also be very nice if I could tell fstab which partitions are critical, and which should be ignored if not present, rather than causing fatal errors. Currently I seem to only be able to do this if I don't mind mounting all non-critical partitions manually after boot.
AFAIK, the only fatal errors occur if / or some other mandatory partition (such as (maybe) /var or /usr) fail to mount. Otherwise it just fails to mount, posts an error in the log, and continues on using the mount point without the mounted filesystem.
you could script that easily by specifying noauto for those you consider non-critical, then put mount lines for them in rc.local
-- fedora-list mailing list fedora-list@redhat.com To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list