Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Phillip Susi <psusi@ubuntu.com>
Cc: util-linux <util-linux@vger.kernel.org>
Subject: Re: Can not move tmpfs mounts
Date: Wed, 25 Nov 2015 10:39:35 +0100	[thread overview]
Message-ID: <20151125093935.GF4955@ws.net.home> (raw)
In-Reply-To: <56552586.2040007@ubuntu.com>

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@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2015-11-25  9:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25  3:05 Can not move tmpfs mounts Phillip Susi
2015-11-25  9:39 ` Karel Zak [this message]
2015-11-27 23:20   ` Phillip Susi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151125093935.GF4955@ws.net.home \
    --to=kzak@redhat.com \
    --cc=psusi@ubuntu.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox