I was making liveUSB iso file, doing many mounts, plus
chroot script having
mount -t proc proc /proc in the script (
chroot is a new thing for me, I noticed the issue when I was ding some "cleaning" and script run with chroot was not running any more). And now have IMO very strange situation, how is it possible for system to behave in such a way?
$ if [ -d "newdir/proc" ]; then echo 1;fi 1 $ if [ -d "newdir/pro" ]; then echo 1;fi $ sudo ls -al "newdir" total 0
The issue also is that
umount newdir outputs "target is busy".
findmnt | grep proc no longer shows "newdir/proc" line.
$ sudo ls -al "newdir/media/root/usb" # another mount total 0 $ sudo ls -al "newdir/media/root" total 0 $ sudo ls -al "newdir/media" total 0
If it could make a difference,
newdir is in
After suggestion from the answer by @Bart I ran
lsof and realised I had another terminal where I did
chroot newdir to see IIRC results of the script. Now I exited that chroot,
lsof | grep nwdir no longer outputs list if those bash commands, only warnings about
fuse /run/user/1000/doc. Still the same for:
$ sudo ls -al "newdir/media/root" total 0
However after that I was able to do w/out errors in output
umount newdir and after that
sudo ls -al "newdir/media/root"gave
no such file.
P.S. the cause of the unexpected behavior was identified with help here: not closed terminal with chroot. However, I've read how to access files using handles of open processes, but here "ghosting" evidenced itself for ordinary way to run
ls, I still hope I will see explanation why/how it worked that way.