Re: Can not move tmpfs mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 24, 2015 at 10:05:42PM -0500, Phillip Susi wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> mount --move fails with -EINVAL on tmpfs mounts.  Is there some reason
> for this, or is it a long standing kernel bug?

Are you sure the problem is tmpfs? I guess you have problem with
propagation flags (shared vs. private), probably systemd based system
where all is shared by default.

# mount -t tmpfs tmpfs  /mnt/test

# strace -e mount mount --move /mnt/test /mnt/test2
mount("/mnt/test", "/mnt/test2", 0x563e27385f00, MS_MGC_VAL|MS_MOVE, NULL) = -1 EINVAL (Invalid argument)
mount: bad option. Note that moving a mount residing under a shared
       mount is unsupported.

See the mount(8) output message (it's also in mount(8) man page),
let's fix it:

# findmnt -o TARGET,PROPAGATION /mnt
TARGET PROPAGATION
/mnt   shared

# mount --make-private /mnt

# strace -e mount mount --move /mnt/test /mnt/test2 
mount("/mnt/test", "/mnt/test2", 0x55a092f54f00, MS_MGC_VAL|MS_MOVE, NULL) = 0


Note that the problem is not with the mountpoint (/mnt/test in my
example), but with parent -- unfortunately usually "/" ("/mnt" in my
example).

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux