All of lore.kernel.org
 help / color / mirror / Atom feed
* Can't umount /mnt/dev after calling dd(1) and with /mnt/dev is a bind mount
@ 2014-03-22 16:52 Francis Moreau
  2014-03-22 19:24 ` Al Viro
  2014-03-30  7:54 ` Francis Moreau
  0 siblings, 2 replies; 4+ messages in thread
From: Francis Moreau @ 2014-03-22 16:52 UTC (permalink / raw)
  To: LKML

Hello,

I'm posting here because it might be a behaviour related to the kernel
internals that I can't explain from my user point of view :)

Basically I'm doing this:

  mount -o bind /dev/ /mnt/dev &&
  chroot /mnt dd bs=440 conv=notrunc count=1 if=gptmbr.bin of=/dev/loop0
  umount /mnt/dev

but umount gives the following error: "umount: /mnt/dev: target is busy"

I tried to see if any processes were still using a file in dev with
fuser(1) but there weren't. Futhermore inserting a call to fuser(1)
right before umount fixed the issue, so it really seems a timing issue.

stracing umount showed that umount failed here:
umount("/mnt/dev", 0)                   = -1 EBUSY (Device or resource busy)

I replaced the bind mount of /dev by:
    mount -t devtmpfs none /mnt/dev
and it worked.

Could anybody tell me what I'm doing wrong ?

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-30  7:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-22 16:52 Can't umount /mnt/dev after calling dd(1) and with /mnt/dev is a bind mount Francis Moreau
2014-03-22 19:24 ` Al Viro
2014-03-22 20:30   ` Francis Moreau
2014-03-30  7:54 ` Francis Moreau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.