Should machinectl do this?

Petter Adsen petter at synth.no
Mon Apr 6 14:45:34 UTC 2015


On Mon, 6 Apr 2015 10:23:55 -0400
Tom H <tomh0665 at gmail.com> wrote:

> On Mon, Apr 6, 2015 at 2:26 AM, Petter Adsen <petter at synth.no> wrote:
> >
> > If you fire up a VM with machinectl, it mounts the guest filesystem
> > on the host through a loopback device. After shutting the guest
> > down, also with machinectl, the filesystem is left mounted, and the
> > loopback device open.
> >
> > Shouldn't machinectl clean this up after itself? Is this a bug or a
> > feature?
> 
> It's "loop" not "loopback". The latter's a networking term.

Sorry :)

> What do you mean by mounting "the" guest filesystem through a loop
> device?

root at monster:~# machinectl start fedora
root at monster:~# machinectl list
MACHINE CLASS     SERVICE
fedora  container nspawn 

1 machines listed.
root at monster:~# df
<snip>
/dev/loop0p1                  ext4      2,9G  348M  2,4G
13% /media/petter/c3dbe26e-e200-496e-af8e-d3071afe1a29
<snip>
root at monster:~# ls /media/petter/c3dbe26e-e200-496e-af8e-d3071afe1a29/
bin   dev  home  lib64       media  opt   root  sbin  sys  usr
boot  etc  lib   lost+found  mnt    proc  run   srv   tmp  var

> Do you mean that you're bind-mounting a host directory in the guest?

I only start the guest. I'm not bind-mounting anything. machinectl does
this by itself.

> What commands are you running to start and stop the container?

See above, plus:
root at monster:~# machinectl poweroff fedora
root at monster:~# machinectl list
MACHINE CLASS SERVICE

0 machines listed.
root at monster:~# df
/dev/loop0p1                  ext4      2,9G  348M  2,4G
13% /media/petter/c3dbe26e-e200-496e-af8e-d3071afe1a29

So, my question basically is, since machinectl mounts this, shouldn't
it unmount when the guest is shut down? If I start the guest again, it
mounts the image a second time.

Maybe I'm just confused here, it just seems to me that machinectl
should clean up when it does a clean shutdown, which is what "poweroff"
is said to be in the man page.

Petter

-- 
"I'm ionized"
"Are you sure?"
"I'm positive."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20150406/f463476d/attachment.sig>


More information about the ubuntu-users mailing list