chesty / overlayroot

mounts an overlay file system over root
GNU General Public License v2.0
166 stars 38 forks source link

Missing mounts after "rootwork" #6

Closed brunoaduarte closed 5 years ago

brunoaduarte commented 5 years ago

Whenever i connect to the Raspberry Pi with "overlayroot" thru SSH, run "rootwork", "exit" and then disconnect, i cannot SSH again, i get this error.

ubuntu@DESKTOP:~$ ssh pi@192.168.15.22
pi@192.168.15.22's password:
PTY allocation request failed on channel 0

After exiting "rootwork" /dev/pts/0 is not there anymore.

Before rootwork

pi@raspberrypiB:~ $ grep --color devpts /proc/mounts
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0

After rootwork

pi@raspberrypiB:~ $ grep --color devpts /proc/mounts
pi@raspberrypiB:~ $

I can only SSH again if i manually reboot it.

I've made a pull request with the fix for this.

brunoaduarte commented 5 years ago

Just found another bug, cannot "sudo reboot" after "rootwork"

pi@raspberrypiB:~ $ rootwork
chroot(/overlay/lower)/:# exit
exit
pi@raspberrypiB:~ $ sudo reboot
A dependency job for reboot.target failed. See 'journalctl -xe' for details.
Failed to open /dev/initctl: No such device or address
Failed to talk to init daemon.
Mar 03 19:39:50 raspberrypiB systemd[1]: systemd-initctl.service: Failed with result 'exit-code'.
Mar 03 19:39:50 raspberrypiB systemd[1]: systemd-initctl.service: Failed to create cgroup /system.slice/systemd-initctl.service: No such file or directory
Mar 03 19:39:50 raspberrypiB systemd[1]: Started /dev/initctl Compatibility Daemon.
-- Subject: Unit systemd-initctl.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit systemd-initctl.service has finished starting up.
--
-- The start-up result is done.
Mar 03 19:39:50 raspberrypiB systemd[1088]: systemd-initctl.service: Failed at step CGROUP spawning /lib/systemd/systemd-initctl: No such file or directory
-- Subject: Process /lib/systemd/systemd-initctl could not be executed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The process /lib/systemd/systemd-initctl could not be executed and failed.
--
-- The error number returned by this process is 2.
Mar 03 19:39:50 raspberrypiB systemd[1]: systemd-initctl.service: Main process exited, code=exited, status=219/CGROUP
Mar 03 19:39:50 raspberrypiB systemd[1]: systemd-initctl.service: Unit entered failed state.
Mar 03 19:39:50 raspberrypiB systemd[1]: systemd-initctl.service: Failed with result 'exit-code'.
Mar 03 19:39:50 raspberrypiB systemd[1]: systemd-initctl.service: Failed to create cgroup /system.slice/systemd-initctl.service: No such file or directory
Mar 03 19:39:50 raspberrypiB systemd[1]: Started /dev/initctl Compatibility Daemon.
-- Subject: Unit systemd-initctl.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit systemd-initctl.service has finished starting up.
--
-- The start-up result is done.
Mar 03 19:39:50 raspberrypiB systemd[1089]: systemd-initctl.service: Failed at step CGROUP spawning /lib/systemd/systemd-initctl: No such file or directory
-- Subject: Process /lib/systemd/systemd-initctl could not be executed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The process /lib/systemd/systemd-initctl could not be executed and failed.
--
-- The error number returned by this process is 2.
Mar 03 19:39:50 raspberrypiB systemd[1]: systemd-initctl.service: Main process exited, code=exited, status=219/CGROUP
Mar 03 19:39:50 raspberrypiB systemd[1]: systemd-initctl.service: Unit entered failed state.
Mar 03 19:39:50 raspberrypiB systemd[1]: systemd-initctl.service: Failed with result 'exit-code'.
Mar 03 19:39:50 raspberrypiB systemd[1]: systemd-initctl.service: Start request repeated too quickly.
Mar 03 19:39:50 raspberrypiB systemd[1]: Failed to start /dev/initctl Compatibility Daemon.
-- Subject: Unit systemd-initctl.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit systemd-initctl.service has failed.
chesty commented 5 years ago

Thanks, Bruno,

I haven't tested rootwork for a while, I changed how the mounts and umounts worked a few months ago but I can't test atm.

would you might running sudo bash -x rootwork and check what umount commands are run, please?

brunoaduarte commented 5 years ago

Sure, here it is

pi@raspberrypiB:~ $ bash -x rootwork
+ '[' -z '' ']'
+ ROOT=/overlay/lower
+ '[' '!' -d /overlay/lower ']'
+ sudo mount -o remount,rw /overlay/lower
+ mountpoint -q /boot
+ sudo mount -o remount,rw /boot
+ for DIR in dev boot run proc sys
+ '[' -d /overlay/lower/dev ']'
+ mountpoint -q /overlay/lower/dev
+ sudo mount --rbind /dev /overlay/lower/dev
+ for DIR in dev boot run proc sys
+ '[' -d /overlay/lower/boot ']'
+ mountpoint -q /overlay/lower/boot
+ sudo mount --rbind /boot /overlay/lower/boot
+ for DIR in dev boot run proc sys
+ '[' -d /overlay/lower/run ']'
+ mountpoint -q /overlay/lower/run
+ sudo mount --rbind /run /overlay/lower/run
+ for DIR in dev boot run proc sys
+ '[' -d /overlay/lower/proc ']'
+ mountpoint -q /overlay/lower/proc
+ sudo mount --rbind /proc /overlay/lower/proc
+ for DIR in dev boot run proc sys
+ '[' -d /overlay/lower/sys ']'
+ mountpoint -q /overlay/lower/sys
+ sudo mount --rbind /sys /overlay/lower/sys
+ sudo IMCHROOTED=/overlay/lower chroot /overlay/lower
chroot(/overlay/lower)/:#

and after exit

chroot(/overlay/lower)/:# exit
exit
+ for DIR in run proc sys boot dev
+ mountpoint -q /overlay/lower/run
+ sudo umount -lf /overlay/lower/run
+ for DIR in run proc sys boot dev
+ mountpoint -q /overlay/lower/proc
+ sudo umount -lf /overlay/lower/proc
+ for DIR in run proc sys boot dev
+ mountpoint -q /overlay/lower/sys
+ sudo umount -lf /overlay/lower/sys
+ for DIR in run proc sys boot dev
+ mountpoint -q /overlay/lower/boot
+ sudo umount -lf /overlay/lower/boot
+ for DIR in run proc sys boot dev
+ mountpoint -q /overlay/lower/dev
+ sudo umount -lf /overlay/lower/dev
+ mountpoint -q /boot
+ sudo mount -o remount,ro /boot
+ sudo mount -o remount,ro /overlay/lower
+ sudo mount -t devpts devpts /dev/pts
+ exit 0
chesty commented 5 years ago

Thanks.

I don't understand what umount -l does exactly, I know what the man page says it does but it appears to be umounting /dev/pts when umount -lf /overlay/lower/dev is run.

I don't mind doing this, but if you have the time and interest would you mind rebooting, and run mount and see what file systems are mounted, ie /dev /dev/pts /run /run/lock, etc

then on the mount for loop list all the appropriate file systems so intead of

for DIR in dev boot run proc sys; do

it would be

for DIR in dev dev/pts boot run run/lock proc sys; do

then rather than mount --rbind, mount --bind

then on the umount for loop list the file systems in reverse

for DIR in run/lock run proc sys boot dev/pts dev; do

and remove the -l in the umount command, so umount -f

chesty commented 5 years ago

actually, I think a better way would be to leave the for loops as is and --rbind as it is, and in the umount for loop do something like for D in

for D in `find /run -type d | tac`;do mountpoint -q "$D" && umount -f "$D"; done

EDIT: hmmm, that's not a good approach either. maybe just don't umount them at all.

I tried

for D in `mount | awk '/\/overlayroot\/lower\// {print $3 }'| tac`; do umount $D; done

but it fails to umount some directories is /sys

chesty commented 5 years ago

how about this? not tested

#!/bin/bash

if [ -z "$1" ]; then
    ROOT="/overlay/lower"
else
    ROOT="$1"
fi

if [ ! -d "$ROOT" ]; then
    echo "$ROOT directory not found"
    exit 1
fi

sudo mount -o remount,rw "$ROOT" || { echo "error remounting $ROOT rw"; exit 1; }
mountpoint -q /boot && sudo mount -o remount,rw /boot || { echo "error remounting /boot rw"; exit 1; }

for DIR in boot run; do
    test -d "$ROOT/$DIR" && ! mountpoint -q "$ROOT/$DIR" && sudo mount --rbind /"$DIR" "$ROOT/$DIR"
done

test -d "$ROOT/sys" && ! mountpoint -d "$ROOT/sys" && mount -t sysfs sysfs "$ROOT/sys" 
test -d "$ROOT/proc" && ! mountpoint -d "$ROOT/proc" && mount -t proc proc "$ROOT/proc"
test -d "$ROOT/dev" && ! mountpoint -d "$ROOT/dev" && mount -t devfs devfs "$ROOT/dev" 

sudo IMCHROOTED="$ROOT" chroot "$ROOT"

mountpoint -q "$ROOT/sys" && umount -f "$ROOT/sys" 
mountpoint -q "$ROOT/proc" && umount -f "$ROOT/proc"
mountpoint -q "$ROOT/dev" && umount -f "$ROOT/dev"

for DIR in run boot; do
    if mountpoint -q "$ROOT/$DIR"; then
        for INNER_DIR in `find /"$DIR" -type d | tac`; do 
            mountpoint -q "$INNER_DIR" && umount -f "$INNER_DIR" 
        done
    fi
done

if mountpoint -q /boot; then
    sudo mount -o remount,ro /boot
fi

sudo mount -o remount,ro "$ROOT"

exit 0
brunoaduarte commented 5 years ago

@chesty I saved the new script under "newrootwork"

pi@raspberrypiB:~ $ newrootwork
/overlay/lower/sys is not a mountpoint
mount: only root can use "--types" option
/overlay/lower/proc is not a mountpoint
mount: only root can use "--types" option
/overlay/lower/dev is not a mountpoint
mount: only root can use "--types" option
chroot(/overlay/lower)/:# exit
exit
find: ‘/run/cups/certs’: Permission denied
find: ‘/run/samba/ncalrpc/np’: Permission denied
find: ‘/run/systemd/inaccessible’: Permission denied
umount: only root can use "--force" option
umount: only root can use "--force" option
umount: only root can use "--force" option
umount: only root can use "--force" option
umount: only root can use "--force" option
pi@raspberrypiB:~ $

and running with sudo

pi@raspberrypiB:~ $ sudo bin/newrootwork
/overlay/lower/sys is not a mountpoint
/overlay/lower/proc is not a mountpoint
/overlay/lower/dev is not a mountpoint
mount: unknown filesystem type 'devfs'
chroot(/overlay/lower)/:# exit
exit
umount: /run/user/1000: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
umount: /run: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
pi@raspberrypiB:~ $

Here's the "mount" output you asked for

pi@raspberrypiB:~ $ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=213960k,nr_inodes=53490,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=44388k,mode=755)
overlay on / type overlay (rw,relatime,lowerdir=/overlay/lower,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /overlay type tmpfs (rw,relatime)
/dev/mmcblk0p2 on /overlay/lower type ext4 (ro,relatime,data=ordered)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=44384k,mode=700,uid=1000,gid=1000)
pi@raspberrypiB:~ $

I corrected newrootwork to execute mount, umount and find as sudo, here's the output running "bash -x newrootwork"

pi@raspberrypiB:~ $ bash -x newrootwork
+ '[' -z '' ']'
+ ROOT=/overlay/lower
+ '[' '!' -d /overlay/lower ']'
+ sudo mount -o remount,rw /overlay/lower
+ mountpoint -q /boot
+ sudo mount -o remount,rw /boot
+ for DIR in boot run
+ test -d /overlay/lower/boot
+ mountpoint -q /overlay/lower/boot
+ sudo mount --rbind /boot /overlay/lower/boot
+ for DIR in boot run
+ test -d /overlay/lower/run
+ mountpoint -q /overlay/lower/run
+ sudo mount --rbind /run /overlay/lower/run
+ test -d /overlay/lower/sys
+ mountpoint -d /overlay/lower/sys
/overlay/lower/sys is not a mountpoint
+ sudo mount -t sysfs sysfs /overlay/lower/sys
+ test -d /overlay/lower/proc
+ mountpoint -d /overlay/lower/proc
/overlay/lower/proc is not a mountpoint
+ sudo mount -t proc proc /overlay/lower/proc
+ test -d /overlay/lower/dev
+ mountpoint -d /overlay/lower/dev
/overlay/lower/dev is not a mountpoint
+ sudo mount -t devfs devfs /overlay/lower/dev
mount: unknown filesystem type 'devfs'
+ sudo IMCHROOTED=/overlay/lower chroot /overlay/lower
chroot(/overlay/lower)/:# exit
exit
+ mountpoint -q /overlay/lower/sys
+ sudo umount -f /overlay/lower/sys
+ mountpoint -q /overlay/lower/proc
+ sudo umount -f /overlay/lower/proc
+ mountpoint -q /overlay/lower/dev
+ for DIR in run boot
+ mountpoint -q /overlay/lower/run
++ sudo find /run -type d
++ tac
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/initramfs
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev/tags/seat
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev/tags/master-of-seat
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev/tags/systemd
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev/tags/uaccess
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev/tags
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev/data
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fserial0'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-id\x2fmmc-LEXAR_0xb3022071'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-path\x2fplatform-20202000.mmc'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-id\x2fmmc-LEXAR_0xb3022071-part1'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-label\x2fboot'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-partuuid\x2f134d0e31-01'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-path\x2fplatform-20202000.mmc-part1'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-uuid\x2f9304-D9FD'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-id\x2fmmc-LEXAR_0xb3022071-part2'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-label\x2frootfs'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-partuuid\x2f134d0e31-02'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-path\x2fplatform-20202000.mmc-part2'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fdisk\x2fby-uuid\x2f29075e46-f0d4-44e2-a9e7-55ac02d6e6cc'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q '/run/udev/links/\x2fsnd\x2fby-path\x2fplatform-soc:audio'
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev/links
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev/static_node-tags/uaccess
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev/static_node-tags
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev/watch
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/udev
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/plymouth
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/blkid
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/lock/subsys
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/lock
+ sudo umount -f /run/lock
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/system
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/inaccessible/dir
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/inaccessible
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/transient
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/generator/multi-user.target.wants
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/generator/getty.target.wants
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/generator/local-fs.target.requires
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/generator
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/generator.late/multi-user.target.wants
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/generator.late/graphical.target.wants
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/generator.late
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/initctl
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/ask-password
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/journal/streams
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/journal
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/seats
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/sessions
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/users
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/machines
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/shutdown
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/netif/links
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/netif/leases
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd/netif
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/systemd
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs/lockd
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs/mount
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs/nfs
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs/portmap
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs/statd
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs/nfsd4_cb
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs/cache
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs/nfsd
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs/gssd/clntXX
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs/gssd
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpc_pipefs
+ sudo umount -f /run/rpc_pipefs
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/mount
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/tmpfiles.d
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/log/journal/12abad61b1dd419bbf02a48b6afdf700
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/log/journal
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/log
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/console-setup
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/network
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/sysconfig
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/sendsigs.omit.d
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/rpcbind
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/samba/msg.lock
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/samba/ncalrpc/np
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/samba/ncalrpc
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/samba
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/screen
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/sshd
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/user/1000/systemd/transient
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/user/1000/systemd
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/user/1000/gnupg
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/user/1000
+ sudo umount -f /run/user/1000
umount: /run/user/1000: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/user
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/dbus
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/cups/certs
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/cups
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/avahi-daemon
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/resolvconf/interfaces
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/resolvconf/metrics
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/resolvconf
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/dhcpcd/ntp.conf
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/dhcpcd
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/wpa_supplicant
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run/dnsmasq
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /run
+ sudo umount -f /run
umount: /run: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
+ for DIR in run boot
+ mountpoint -q /overlay/lower/boot
++ sudo find /boot -type d
++ tac
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /boot/MISC
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /boot/System
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q Volume
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q Information
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /boot/DCIM
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /boot/overlays
+ for INNER_DIR in `sudo find /"$DIR" -type d | tac`
+ mountpoint -q /boot
+ sudo umount -f /boot
+ mountpoint -q /boot
+ sudo mount -o remount,ro /overlay/lower
+ exit 0
chesty commented 5 years ago

Thanks Bruno, thanks for the report and the help. I found an unused pi so was able to test and I committed a fix (which closed this ticket). If you do a pull you'll get the fix.