Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #180667

Re: unmount sys/fs/cgroup/systemd after chroot, without rebooting

From Sam Kuper <sam.kuper@uclmail.net>
Newsgroups linux.debian.user
Subject Re: unmount sys/fs/cgroup/systemd after chroot, without rebooting
Date 2017-05-04 01:10 +0200
Message-ID <tDbzb-3Ao-7@gated-at.bofh.it> (permalink)
References <tD5WO-8gC-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 03/05/2017, Sam Kuper <sam.kuper@uclmail.net> wrote:
> [...] I then exit the `chroot`, and my trouble begins. I find that I can
> unmount `/mnt/dev` and `/mnt/proc`, **but not `/mnt/sys`**. The latter
> refuses to unmount because it contains `/mnt/sys/fs/cgroup/systemd`,
> which the system for some reason thinks is "in use". [...]
>
> - How can I unmount `/mnt/sys` after the chroot, without rebooting?
> [...]
>
> VIRTUAL_FILESYSTEM_DIRS=(dev proc sys)
>
> for i in "${VIRTUAL_FILESYSTEM_DIRS[@]}"; do
>     # Make mountpoints for virtual filesystems on target drive
>     mkdir /mnt/"$i"
>     mount --rbind /"$i"  /mnt/"$i"
> done

Adding `mount --make-rslave /mnt/"$i"` after the `mount --rbind /"$i"
/mnt/"$i"` line does the trick. Thanks to @Mioriin at
https://unix.stackexchange.com for the suggestion :)

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

unmount sys/fs/cgroup/systemd after chroot, without rebooting Sam Kuper <sam.kuper@uclmail.net> - 2017-05-03 19:10 +0200
  Re: unmount sys/fs/cgroup/systemd after chroot, without rebooting Sam Kuper <sam.kuper@uclmail.net> - 2017-05-04 01:10 +0200

csiph-web