FS#30325 - [util-linux] mount doesn't skip fstab entries of fstype ignore

Attached to Project: Arch Linux
Opened by Agnelo de la Crotche (Agnelo de la Crotche) - Sunday, 17 June 2012, 06:46 GMT
Last edited by Dave Reisner (falconindy) - Monday, 18 June 2012, 13:23 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Dave Reisner (falconindy)
Tom Gundersen (tomegun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: Activating swap fails at boot when the entry 'ignore' is present in /etc/fstab.

Example:

# /etc/fstab: static file system information.
# <fs> <mount point> <type> <options> <dump> <pass>
#none /dev/shm tmpfs nodev,nosuid 0 0
#tmpfs /tmp tmpfs nodev,nosuid 0 0
# /dev/sda5
UUID=ba9db764-a47e-48d9-b6f9-b627b57c0287 none swap defaults 0 0
# /dev/sdb5
UUID=58d404ac-4335-4e9a-909f-77bac92b67ea none swap defaults 0 0
#
# /dev/sda13
UUID=23c64367-0f52-4195-881b-1e25854ad5a5 / ext3 defaults 0 1
# /dev/sda14
UUID=316f757e-ab9b-4afb-a19d-1c4212d4c0f1 /usr/local ext4 defaults 0 2
# /dev/sda15
UUID=44390563-9c7a-4bd1-b6dc-7c0a6f22a96e /var ext4 defaults 0 2
# /dev/sda8
UUID=6b116a7c-5ce2-4e9e-91ab-9e38f7ed407e /home ext4 defaults 0 2
# /dev/sda12
UUID=dbaa1f6f-d25e-46a1-b83a-e38af016ec69 /tmp ext4 defaults 0 2
# /dev/sda17
UUID=b999058e-9bf7-4010-94d6-57d1e4565adc /srv ext4 defaults 0 2
# /dev/sdb13
UUID=9f05053e-2478-4577-9300-7d508485969e /misc ext3 defaults 0 2
#
# ignore BSD primary partitions
/dev/sda2 none ignore
/dev/sda3 none ignore
/dev/sdb2 none ignore
/dev/sdb3 none ignore
#

The last 4 partitions are BSD primary partitions. They are containers for BSD slices, just like the DOS extended partition for DOS/Linux logical partitions. They don't contain a file system and are unmountable. However they show up in nautilus, unless you hide them in /etc/fstab whith the option 'ignore'. One can write a udev rule to hide these partitions. It works with dolphin but not with nautilus.


I know the issue has been reported already and closed as 'not beeing a bug' because of syntax errors in /etc/fstab or UUID for non existing devices. But in this case, the option ignore is valid. Commenting out the lines using this option in /etc/fstab makes the "Activating swap" failure go away but also prevents these partitions from being ignored by file managers, such as nautilus, thunar or pcman.

This task depends upon

Closed by  Dave Reisner (falconindy)
Monday, 18 June 2012, 13:23 GMT
Reason for closing:  Won't fix
Additional comments about closing:  This isn't a supported feature of the new mount implementation. fstab(5) will be updated to remove the reference to this option.
Comment by Dave Reisner (falconindy) - Sunday, 17 June 2012, 13:58 GMT
Did this ever work? I realize that this is documented by fstab(5), but I'm going back several years in util-linux history and can find no evidence that swapon (or mount) ever supported this option.

I've got a patch to make this work, and I'll submit it upstream, but I'm still curious where this _was_ working for you.
Comment by Agnelo de la Crotche (Agnelo de la Crotche) - Sunday, 17 June 2012, 15:12 GMT
Hi!
What other info do you need? I cas post my entire /etc/fstab (which is a lot longer), but what makes a difference is commenting out these 4 lines:

/dev/sda2 none ignore
/dev/sda3 none ignore
/dev/sdb2 none ignore
/dev/sdb3 none ignore

I got the same issue on three machines running ArchLinux and util-linux 2.21.2. I never saw this error before. I probably would have noticed, because I reboot quite often. It is probably due to this new util-linux version. However this version has a cool improvement: it is able to read and use the UUID of ufs partitions and so, one can now mount such partitions by UUID in /etc/fstab. I just noticed by running blkid. I always had to mount ufs partitions by device name before, with all the problems it involves.

I'm using 'ignore' for BSD primary partitions in /etc/fstab on all Linux/Unix multi-boot machines and with several Linux distros (openSUSE, Fedora, Ubuntu). OpenSUSE still has util-linux 2.20.1 and I see no problem there. I don't know about the other distros. I could tell you later as soon as I'm able to reboot these systems.

One could look at the bug from another angle and say that those file managers (nautilus, pcman, thunar) should take udev rules in account or not try to display BSD primary partitions. However I think it's a good thing that they read /etc/fstab. It makes it very convenient to hide partitions from the desktop ... for whatever reason.

Maybe it bothers swapon because these partitions use the same mount point (none) as swap partitions. If so the problem is not using 'ignore' but 'none' (?). But I'm quite sure it's new.
Comment by Dave Reisner (falconindy) - Sunday, 17 June 2012, 15:18 GMT
> what makes a difference is commenting out these 4 lines:
Right, that's what I'm saying. util-linux does not support "ignore" for the 3rd field in /etc/fstab. Using "none" in the second field should be reserved for swap partitions (though swapon really just ignores this field).

I'd be curious to see the output of 'mount -av' from the other distros.
Comment by Dave Reisner (falconindy) - Sunday, 17 June 2012, 15:26 GMT
I also suspect that, like many other bug reports, you're suffering from a visual "one off" error here. swapon should not be failing. It's mounting of local filesystems that's failing. swapon will already ignore any entry in /etc/fstab that isn't explicitly marked 'swap' in the third field.
Comment by Agnelo de la Crotche (Agnelo de la Crotche) - Sunday, 17 June 2012, 16:57 GMT
> I'd be curious to see the output of 'mount -av' from the other distros.

OK. Here's /etc/fstab on one machine. Other distros use a similar one, except that the file systems being auto mounted are not the same and all other file systems not belonging to the distro - ufs or ext3/4 - have the option 'noauto'. Also /etc/fstab in other distros include mount bind entries to export their file systems with nfs4 (which explains the output farther down). The two vfat partitions have the same UUID. Thats' why I mount them by device name. But it's irrelevant. I use UUID for ufs partitions only in ArchLinux with the latest util-linux, because it wasn't possible with earlier versions.

/etc/fstab (ArchLinux)

# /etc/fstab: static file system information.
# generated by niginstall - Sun Jun 17 00:45:48 PDT 2012
# <fs> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
devpts /dev/pts devpts defaults 0 0
shm /dev/shm tmpfs nodev,nosuid 0 0
# /dev/sda5
UUID=205124c1-ee94-4d5d-998e-a507351731ba none swap defaults 0 0
# /dev/sdb5
UUID=c224505c-6233-404f-a706-308138573fce none swap defaults 0 0
#
# /dev/sdb6
UUID=d0f134b3-a468-4f72-95aa-cd09c498ba8c / ext3 defaults 0 1
# /dev/sdb7
UUID=0e9cefcd-5e38-4ac7-8de8-749433ac9f59 /var ext4 defaults 0 2
# /dev/sdb8
UUID=7ccc6cbb-89dd-4e5e-827e-4ae23d3f19b3 /usr/local ext4 defaults 0 2
# /dev/sda8
UUID=677d9a84-4382-4192-aca1-691e3b41d83c /home ext3 defaults 0 2
# /dev/sda11
UUID=b5bd3c31-cc83-4058-a485-41850c1c5bf9 /tmp ext4 defaults 0 2
# /dev/sda15
UUID=1faaff22-d9ab-4a29-b04c-c7bce19e300e /srv ext4 defaults 0 2
# /dev/sdb12
UUID=a556486d-f7fe-4161-8a97-6daff6b03a87 /misc ext3 defaults 0 2
#
# ignore FreeBSD primaries
/dev/sda2 none ignore
/dev/sda3 none ignore
/dev/sdb2 none ignore
/dev/sdb3 none ignore
#
# Ubuntu
# /dev/sda6
UUID=4c0b16ab-6184-4d5c-8546-0b05ff3e5dcb /usr/local/mnt/ubuntu ext4 defaults,noauto,nodev 0 2
# /dev/sda7
UUID=e5f8a2f8-ae95-4072-9be8-64cfc0f5da4a /usr/local/mnt/ubuntu/usr/local ext4 defaults,noauto,nodev 0 2
#
# openSUSE
# /dev/sda9
UUID=08a61a8a-b03d-4e27-b5aa-3780b3830e5c /usr/local/mnt/suse ext4 defaults,noauto,nodev 0 2
# /dev/sda10
UUID=d31f9c29-6169-4ea3-b69e-8aa0bda056ae /usr/local/mnt/suse/local ext4 defaults,noauto,nodev 0 2
#
# Fedora
# /dev/sda12
UUID=172a208b-0c6b-428b-b703-704bb078210e /usr/local/mnt/fedora ext4 defaults,noauto,nodev 0 2
# /dev/sda13
UUID=37958e1c-8074-4e1c-b52b-c33725d02537 /usr/local/mnt/fedora/usr/local ext4 defaults,noauto,nodev 0 2
#
# Debian
# /dev/sda14
UUID=0e1f8f2f-e9bc-4fdc-b917-b599fa7b1620 /usr/local/mnt/debian ext3 defaults,noauto,nodev 0 2
# /dev/sdb9
UUID=bbc5c1b6-56f6-4af1-a482-0d3a674df9b5 /usr/local/mnt/debian/usr ext3 defaults,noauto,nodev 0 2
# /dev/sdb10
UUID=245f9ef8-3937-4baa-9748-4664bec34d67 /usr/local/mnt/debian/usr/local ext3 defaults,noauto,nodev 0 2
# /dev/sdb11
UUID=222c7f62-2a7f-41a1-aa39-95167768d853 /usr/local/mnt/debian/var ext4 defaults,noauto,nodev 0 2
#
# DOS
# UUID=476A-FA21
/dev/sda1 /usr/local/mnt/c vfat uid=1001,gid=1001,umask=0133,noauto 0 0
# UUID=476A-FA21
/dev/sdb1 /usr/local/mnt/d vfat uid=1001,gid=1001,umask=0133,noauto 0 0
#
# BSD
# /dev/sda27
UUID=4c13df47a173aad0 /usr/local/mnt/bsd/share ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sda28
UUID=4c13df468000397c /usr/local/mnt/bsd/home ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sda29
UUID=4d03965943d4c57d /usr/local/mnt/bsd/tmp ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sdb13
UUID=4773dd451d97f645 /usr/local/mnt/bsd/src ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sdb14
UUID=496b164831d164a0 /usr/local/mnt/bsd/data ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sdb15
UUID=4c20030b672ddf92 /usr/local/mnt/bsd/alt/home ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sdb18
UUID=4c20030df63d7376 /usr/local/mnt/bsd/alt/tmp ufs ro,ufstype=44bsd,noauto 0 0
#
# OpenBSD
# /dev/sda20
UUID=4c13df456f83e5df /usr/local/mnt/openbsd ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sda21
UUID=4c13df4a0f9a2bd4 /usr/local/mnt/openbsd/usr ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sda22
UUID=4c13df4e95c2c8f1 /usr/local/mnt/openbsd/var ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sdb16
UUID=4c200308d3b18ed5 /usr/local/mnt/openbsd/alt ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sdb17
UUID=4c20030fb9d386ff /usr/local/mnt/openbsd/alt/var ufs ro,ufstype=44bsd,noauto 0 0
#
# NetBSD
# /dev/sda24
UUID=4d0396580b927c9a /usr/local/mnt/netbsd ufs ro,ufstype=ufs2,noauto 0 0
# /dev/sda25
UUID=4d03965c61fbb36d /usr/local/mnt/netbsd/var ufs ro,ufstype=ufs2,noauto 0 0
# /dev/sda26
UUID=4d03965b7e80e519 /usr/local/mnt/netbsd/usr ufs ro,ufstype=ufs2,noauto 0 0
# /dev/sdb23
UUID=4bc2b81325d896e5 /usr/local/mnt/netbsd/alt ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sdb24
UUID=4bc2b816430be504 /usr/local/mnt/netbsd/alt/var ufs ro,ufstype=ufs2,noauto 0 0
#
# FreeBSD
# /dev/sda16
UUID=4f6c6ea0b7eb2b42 /usr/local/mnt/freebsd ufs ro,ufstype=ufs2,noauto 0 0
# /dev/sda18
UUID=4f6c6eaf391492b6 /usr/local/mnt/freebsd/var ufs ro,ufstype=ufs2,noauto 0 0
# /dev/sda19
UUID=4f6c6ebd33125282 /usr/local/mnt/freebsd/usr ufs ro,ufstype=ufs2,noauto 0 0
# /dev/sda23
UUID=4d03dfd9b4ac5d1b /usr/local/mnt/freebsd/alt2 ufs ro,ufstype=ufs2,noauto 0 0
# /dev/sdb19
UUID=477cbba1247af735 /usr/local/mnt/freebsd/alt ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sdb21
UUID=477cbd775721c361 /usr/local/mnt/freebsd/alt/var ufs ro,ufstype=44bsd,noauto 0 0
# /dev/sdb22
UUID=477cbd71832a4a70 /usr/local/mnt/freebsd/alt/usr ufs ro,ufstype=44bsd,noauto 0 0
#
# Removables
/dev/fd0 /media/floppy0 auto user,noauto 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 ro,user,noauto,unhide 0 0
/dev/sr1 /media/cdrom1 udf,iso9660 ro,user,noauto,unhide 0 0


# mount -av (ArchLinux - util-linux 2.21.2)

/proc : already mounted
/dev/pts : already mounted
/dev/shm : already mounted
none : ignored
none : ignored
/ : ignored
/var : already mounted
/usr/local : already mounted
/home : already mounted
/tmp : already mounted
/srv : already mounted
/misc : already mounted
mount: mount point none does not exist
mount: mount point none does not exist
mount: mount point none does not exist
mount: mount point none does not exist
/usr/local/mnt/ubuntu : ignored
/usr/local/mnt/ubuntu/usr/local: ignored
/usr/local/mnt/suse : ignored
/usr/local/mnt/suse/local: ignored
/usr/local/mnt/fedora : ignored
/usr/local/mnt/fedora/usr/local: ignored
/usr/local/mnt/debian : ignored
/usr/local/mnt/debian/usr: ignored
/usr/local/mnt/debian/usr/local: ignored
/usr/local/mnt/debian/var: ignored
/usr/local/mnt/c : ignored
/usr/local/mnt/d : ignored
/usr/local/mnt/bsd/share : ignored
/usr/local/mnt/bsd/home : ignored
/usr/local/mnt/bsd/tmp : ignored
/usr/local/mnt/bsd/src : ignored
/usr/local/mnt/bsd/data : ignored
/usr/local/mnt/bsd/alt/home: ignored
/usr/local/mnt/bsd/alt/tmp: ignored
/usr/local/mnt/openbsd : ignored
/usr/local/mnt/openbsd/usr: ignored
/usr/local/mnt/openbsd/var: ignored
/usr/local/mnt/openbsd/alt: ignored
/usr/local/mnt/openbsd/alt/var: ignored
/usr/local/mnt/netbsd : ignored
/usr/local/mnt/netbsd/var: ignored
/usr/local/mnt/netbsd/usr: ignored
/usr/local/mnt/netbsd/alt: ignored
/usr/local/mnt/netbsd/alt/var: ignored
/usr/local/mnt/freebsd : ignored
/usr/local/mnt/freebsd/var: ignored
/usr/local/mnt/freebsd/usr: ignored
/usr/local/mnt/freebsd/alt2: ignored
/usr/local/mnt/freebsd/alt: ignored
/usr/local/mnt/freebsd/alt/var: ignored
/usr/local/mnt/freebsd/alt/usr: ignored
/media/floppy0 : ignored
/media/cdrom0 : ignored
/media/cdrom1 : ignored


# mount -av (openSUSE 12.1 - util-linux 2.20.1)

mount: UUID=d31f9c29-6169-4ea3-b69e-8aa0bda056ae already mounted on /local
mount: UUID=677d9a84-4382-4192-aca1-691e3b41d83c already mounted on /home
mount: UUID=b5bd3c31-cc83-4058-a485-41850c1c5bf9 already mounted on /tmp
mount: UUID=1faaff22-d9ab-4a29-b04c-c7bce19e300e already mounted on /srv
mount: UUID=a556486d-f7fe-4161-8a97-6daff6b03a87 already mounted on /misc
mount: proc already mounted on /proc
mount: devpts already mounted on /dev/pts
mount: / already mounted on /export/nfs4
mount: /local already mounted on /export/nfs4/local
mount: /home already mounted on /export/nfs4/home
mount: /tmp already mounted on /export/nfs4/tmp
mount: /srv already mounted on /export/nfs4/srv
mount: /misc already mounted on /export/nfs4/misc

# mount -av (Fedora 16 - util-linux 2.20.1)

mount: UUID=37958e1c-8074-4e1c-b52b-c33725d02537 already mounted on /usr/local
mount: UUID=677d9a84-4382-4192-aca1-691e3b41d83c already mounted on /home
mount: UUID=b5bd3c31-cc83-4058-a485-41850c1c5bf9 already mounted on /tmp
mount: UUID=1faaff22-d9ab-4a29-b04c-c7bce19e300e already mounted on /srv
mount: UUID=a556486d-f7fe-4161-8a97-6daff6b03a87 already mounted on /misc
mount: tmpfs already mounted on /dev/shm
mount: devpts already mounted on /dev/pts
mount: sysfs already mounted on /sys
mount: proc already mounted on /proc
mount: / already mounted on /export/nfs4
mount: /usr/local already mounted on /export/nfs4/usr/local
mount: /home already mounted on /export/nfs4/home
mount: /tmp already mounted on /export/nfs4/tmp
mount: /srv already mounted on /export/nfs4/srv
mount: /misc already mounted on /export/nfs4/misc

# mount -av (Ubuntu 11.10 - util-linux 2.19.1)

mount: proc already mounted on /proc
mount: UUID=e5f8a2f8-ae95-4072-9be8-64cfc0f5da4a already mounted on /usr/local
mount: UUID=677d9a84-4382-4192-aca1-691e3b41d83c already mounted on /home
mount: UUID=b5bd3c31-cc83-4058-a485-41850c1c5bf9 already mounted on /tmp
mount: UUID=1faaff22-d9ab-4a29-b04c-c7bce19e300e already mounted on /srv
mount: UUID=a556486d-f7fe-4161-8a97-6daff6b03a87 already mounted on /misc
mount: / already mounted on /export/nfs4
mount: /usr/local already mounted on /export/nfs4/usr/local
mount: /home already mounted on /export/nfs4/home
mount: /srv already mounted on /export/nfs4/srv
mount: /misc already mounted on /export/nfs4/misc
Comment by Agnelo de la Crotche (Agnelo de la Crotche) - Sunday, 17 June 2012, 17:04 GMT
> I also suspect that, like many other bug reports, you're suffering from a visual "one off" error here.

If you mean that the error is only 'visual', yes. Looks like the bug is actually the error message itself at boot time and doesn't come from swapon. If I do swapon -av manually, I don't get this error message.
Comment by Dave Reisner (falconindy) - Sunday, 17 June 2012, 17:20 GMT
Yeah, this is just a straight up regression compared to the old mount that you're getting in the other distros. The fstab parser would explicitly avoid !strcmp(mnt->mnt_type, MNTTYPE_IGNORE), where MNTTYPE_IGNORE is merely a define for "ignore" in /usr/include/mntent.h. This means the patch I sent upstream should be correct.

http://article.gmane.org/gmane.linux.utilities.util-linux-ng/6030
Comment by Agnelo de la Crotche (Agnelo de la Crotche) - Sunday, 17 June 2012, 19:14 GMT
> The fstab parser would explicitly avoid !strcmp(mnt->mnt_type, MNTTYPE_IGNORE), where MNTTYPE_IGNORE is merely a define for "ignore" in /usr/include/mntent.h. This means the patch I sent upstream should be correct.

Sounds good. Thank you.
Comment by Dave Reisner (falconindy) - Monday, 18 June 2012, 13:23 GMT
Spoke with upstream udev/systemd/util-linux and we came to the conclusion that this is a rather silly idea. Support will not be implemented. If you need to specify a filesystem that isn't in use, add 'noauto' to the options, or just comment the line out.

Loading...