Skip to contentSkip to conversation

A few small findmnt/mount issues

DISCUSSION Roger Leigh 2 participants 2 messages Mar 14, 2013 Util-Linux package

lore
Share & tools
lore
#0 lore raw

Hi,

Just noticed a few minor deficiencies:

- findmnt does not have column types for DUMP and PASS, so it's not possible to get at all the fstab information when using the --fstab option, unless there's a way of doing this I'm unaware of. For completeness, it would be very useful to be able to retrieve all fstab(5) fields. This would mean all access to mtab and fstab can go via findmnt in our init scripts.

- utab isn't updated on remount for _netdev:
If I have an fstab entry with _netdev in the fs_mntopts, this will get stored in utab when I run "mount /foo". However, if I want to add the option after mount and use
"mount -o remount,_netdev /foo", this does not cause utab to be updated.

While this might appear contrived, we do actually make use of this when filesystems mounted in an initramfs using busybox mount are remounted with additional options from fstab with the util-linux mount after init starts. When we had a static mtab, the _netdev option would have been added at this point; with utab, we would ideally like to be able to update the option via the mount interface. Tested this with 2.20.1, but looking at the source looks like it's probably still present unless I misunderstood it. May also affect other mount options?

Is there a preferred bugtracker you would like things like this reporting, or is here OK?

Kind regards,
Roger

Signature · 4 lines
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800
maintainer
#1 lore raw
Quoted 6 lines · Roger Leigh

- findmnt does not have column types for DUMP and PASS, so it's not possible to get at all the fstab information when using the --fstab option, unless there's a way of doing this I'm unaware of. For completeness, it would be very useful to be able to retrieve all fstab(5) fields. This would mean all access to mtab and fstab can go via findmnt in our init scripts.

Good idea. Implemented:

$ findmnt --fstab -o TARGET,FREQ,PASSNO
TARGET      FREQ PASSNO
/              1      1
/boot          1      2
/boot/efi      0      0
/home          1      2
/home/kzak     1      2
swap           0      0
/mnt/backup    0      0
/mnt/petra     0      0
/mnt/kzak      0      0
Quoted 6 lines

- utab isn't updated on remount for _netdev:
If I have an fstab entry with _netdev in the fs_mntopts, this will get stored in utab when I run "mount /foo". However, if I want to add the option after mount and use
"mount -o remount,_netdev /foo", this does not cause utab to be updated.

Hmm.. works for me (2.22.2 as well as mount(8) from git tree).

  # mount /dev/sdb /mnt/test 
  # cat /run/mount/utab
  # mount -o remount,_netdev /mnt/test
  # cat /run/mount/utab
  SRC=/dev/sdb TARGET=/mnt/test OPTS=_netdev

It would be nice to have reproducible example or/and debug output from the library:

LIBMOUNT_DEBUG=0xffff mount -o remount,_netdev ....

Quoted 2 lines

While this might appear contrived, we do actually make use of this when filesystems mounted in an initramfs using busybox mount are

BTW, is it really so attractive to use busybox in initramfs? IMHO the best way is to consolidate all possible utils and use the same code everywhere. (It does not mean that busybox is bad thing, but mix utils and environments is often problematic...)

Quoted 1 line

interface. Tested this with 2.20.1, but looking at the source

Hmm... this is really old release. Update ;-)

Quoted 5 lines

looks like it's probably still present unless I misunderstood it. May also affect other mount options?

Is there a preferred bugtracker you would like things like this reporting, or is here OK?

Mailing list is OK.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com