Score:1

bind mount /dev/pts twice - umount fails with "target is busy."

ca flag

I'm trying to understand problems that I get when I run my debootstrap procedure more than once in parallel. It seems to come down to this piece of bash script:

DIR1=/mnt/foo$RANDOM
DIR2=/mnt/foo$RANDOM
mkdir -p "$DIR1" "$DIR2"
mount -o bind /dev "$DIR1"
mount -o bind /dev/pts "$DIR1/pts"
mount -o bind /dev "$DIR2"
mount -o bind /dev/pts "$DIR2/pts"
umount "$DIR1/pts"
umount "$DIR1"

Do you have an idea why the last line fails (at least on my Debian bullseye system) with "target is busy."?

When I add -l to the umount for lazy unmounting, it gets even worse: My system ends up with /dev/pts not mounted anymore. I have to mount it again manually or reboot then.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.