Skip to contentSkip to conversation

e2fsadm and fstab

linux-lvm Jan Niehusmann 3 participants 7 messages Sep 22, 2000 – Sep 26, 2000

lore
Share & tools
lore
#0 lore raw

Is the following behaviour wanted?

If a filesystem is listed in /etc/fstab, but currently not mounted, e2fsadm checks for the availability of ext2online, and if it doesn't find it, it aborts with an error message. The check is in e2fsadm.c, lines 275ff.

IMHO it doesn't matter if a fs is mentioned in fstab. If it's not mounted, we can resize it without ext2online.

Jan

#1 lore raw
Quoted 5 lines · Jan

Is the following behaviour wanted?

If a filesystem is listed in /etc/fstab, but currently not mounted, e2fsadm checks for the availability of ext2online, and if it doesn't find it, it aborts with an error message. The check is in e2fsadm.c, lines 275ff.

This sounds like a bug I added then fixed in my local version of e2fsadm. It is not in the original e2fsadm. I will post a patch and upload a new SRPM.

Basically, I check /etc/fstab to do mountpoint -> device renaming for unmounted filesystems, and /proc/mounts and /etc/mtab for mounted filesystems. It's no great loss if you simply remove /etc/fstab from the list in e2fsadm of places to check for devices/filesystems for now. It just means you need to give the LV name always instead of optionally giving the mountpoint.

Cheers, Andreas

Signature · 3 lines
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
#2 lore raw
Quoted 3 lines · Andreas Dilger

This sounds like a bug I added then fixed in my local version of e2fsadm. It is not in the original e2fsadm. I will post a patch and upload a new SRPM.

You're right, I'm using the patches from your SRPM.

Quoted 3 lines

Basically, I check /etc/fstab to do mountpoint -> device renaming for unmounted filesystems, and /proc/mounts and /etc/mtab for mounted filesystems.

BTW, 2.4 allows more than one filesystem mounted on the same mountpoint. Is this case handled correctly?

Jan

#3 lore raw
Quoted 6 lines · Jan
Quoted 3 lines

Basically, I check /etc/fstab to do mountpoint -> device renaming for unmounted filesystems, and /proc/mounts and /etc/mtab for mounted filesystems.

BTW, 2.4 allows more than one filesystem mounted on the same mountpoint. Is this case handled correctly?

Yes, it shouldn't be a problem, because there is only 1 device, so you can have multiple mountpoint->device mappings, but it is the device (LV) that has the LVM resizing done on it, and I assume there us still only 1 superblock between all of the mountpoints, so the fs resizing should be OK.

Cheers, Andreas

Signature · 3 lines
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
#4 lore raw
In reply to Jan Niehusmann
Quoted 2 lines · Jan Niehusmann

BTW, 2.4 allows more than one filesystem mounted on the same mountpoint. Is this case handled correctly?

It doesn't really support multiple filesystems on one mountpoint. Yes, you can mount something multoiple times on the same point, but you will only be able to use the last mounted one. Al Viro is still working on union mounts.
To prevent the user from doing baad things when resizing I will add support for detecting multiple filesystem on the same mountpoint to my lvmadm tool.

Christoph

P.S. to Andreas: those filesystems do not share the superblock.

Signature · 1 line
Always remember that you are unique.  Just like everyone else.
#5 lore raw
Quoted 4 lines · Christoph Hellwig

It doesn't really support multiple filesystems on one mountpoint. Yes, you can mount something multoiple times on the same point, but you will only be able to use the last mounted one. Al Viro is still working on union mounts.

Yes I know.
mount /dev/a /mnt/
mount /dev/b /mnt/

now ls /mnt/ shows the contents of device b.

/proc/mounts shows both mounts. If I use e2fsadm on /mnt/, which one of the filesystems should be resized?

Probably it should say someting like '/mnt/ is ambiguous' and do nothing. Currently, it picks the first one, which is actually invisible in the filesystem. This is not the expected behaviour, I think.

Jan

#6 lore raw
In reply to Jan Niehusmann

Jan,

Quoted 4 lines · Andreas Dilger
Quoted 3 lines

This sounds like a bug I added then fixed in my local version of e2fsadm. It is not in the original e2fsadm. I will post a patch and upload a new SRPM.

I had a look at this, and the correct fix is rather easy. Where we are checking all of the mount files, you need to move

          if (strcmp(*mntfile, MNTTAB)) {

up abount 12 lines, so that it looks like this:

          if (strcmp(*mntfile, MNTTAB)) {
	     if ( lvm_find_command (cmd_online) == NULL) {
	        lvm_path_error ( cmd_online, "online resize");

This way, it will not assume a filesystem is mounted, if it is only found in MNTTAB (/etc/fstab), but we can still do mountpoint -> device mapping. As you pointed out, it is possible with 2.4 to have multiple device -> mountpoint mappings, but I can't see any sane reason to do so yet, so it won't be fixed until we know how they will be used.

Cheers, Andreas

Signature · 3 lines
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert