Re: /etc/mtab and per-process namespaces

From: Michael Tokarev (mjt_at_tls.msk.ru)
Date: 10/04/05

  • Next message: David Leimbach: "Re: /etc/mtab and per-process namespaces"
    Date:	Tue, 04 Oct 2005 23:49:05 +0400
    To: Christoph Hellwig <hch@infradead.org>
    
    

    Christoph Hellwig wrote:
    > I suspect not one cares about /etc/mtab. It's a pretty horrible
    > interface. Use /proc/self/mounts if your care about the mount table
    > for your current namespace, it's guranteed uptodate.

    Well, it's uptodate, but it isn't the same as mtab. Like:

       /tmp/test on /mnt/test type ext2 (rw,loop=/dev/loop/0)
    (mtab), vs
       /dev/loop/0 /mnt/test ext2 rw 0 0

    or:

      tmpfs on /dev type tmpfs (rw,size=10M,mode=0755)
    vs
      tmpfs /dev tmpfs rw 0 0

    ie, sometimes, mtab format is more useful. Also, with the
    above example with loop device, umount is able to delete the
    loop device for loop-mounts.

    Another funky example:

       losetup /dev/loop/0 /tmp/test
       cd /dev/loop
       mount 0 /mnt/test

    now, mtab shows:

       /dev/loop/0 /mnt/test ext2 rw 0 0

    while /proc/mounts shows

       0 /mnt/test ext2 rw 0 0

    which is rather useless.

    /mjt
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: David Leimbach: "Re: /etc/mtab and per-process namespaces"

    Relevant Pages

    • Re: CLONE_NEWNS and mount command?
      ... omission of loop device number (used ... than mtab: mtab only lists those options which has been specified ... tries to access mounted filesystems, ... Omitting that entry from /etc/mtab fixes the problem. ...
      (Linux-Kernel)
    • Re: Q re /proc/bus/i2c
      ... > Well, I was gonna quote that too, but apparently my entry in ... > rc.sysinit doesn't record it in mtab. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)