I recently upgraded to debian [/raspbian] buster. Ever since then, cron jobs creating directories using
mkdir -p <directory name> will create the directory on the root file system
/ device instead of the mounted device
/backup/. This seems to only apply to manually mounted file systems, not drives listed in
I'm absolutely certain that /backup on
/) is empty. I'm pretty certain that I'm mounting my USB drive correctly (
mount /dev/disk/by-label/BACKUP1 /backup)
For completeness I only access the r-pi via SSH. I haven't been able to get back to it to see if a direct terminal can see the mounts created over SSH.
Does anyone have any idea what is going on here?
Steps to Reproduce
# mkdir /backup # mount /dev/sdb1 /backup # mkdir -p /backup/mars/foo # batch << EOF # mkdir -p /backup/mars/bar > ls /backup/mars > /tmp/mount.test.log > EOF
Wait for the script to end.
# ls /backup/mars foo bar # cat /tmp/mount.test.log foo bar # umount /backup # ls /backup/mars ls: cannot access '/backup/mars': No such file or directory
# ls /backup/mars foo # cat /tmp/mount.test.log bar # umount /backup # ls /backup/mars bar
I've compared the between
batch << EOF mount > /tmp/mount.test.log EOF
The output from the batch version is missing the following two lines. The are otherwise identical:
/dev/sdb1 on /backup type ext4 (rw,relatime,data=ordered) tmpfs on /run/sshd type tmpfs (rw,nosuid,nodev,mode=755)