Skip to main content
add related question
Source Link
Bruno
  • 207
  • 1
  • 9

I made a script which (tries to) duplicate my live disk /dev/sdb to a second disk /dev/sda, one rsync per partition (full script).

Last step is to install grub on /dev/sda. The method I use is something like :

  1. mount /dev/sda root partition on /mnt/root1
  2. bind-mount {/dev,/sys/,/proc} on /mnt/root1 :
# mount -o bind /sys  /mnt/root1/sys
# mount -o bind /proc /mnt/root1/proc
# mount -o bind /dev  /mnt/root1/dev
  1. run chrooted update-grub and grub-install on /dev/sda :
chroot /mnt/root1 update-grub
chroot /mnt/root1 grub-install /dev/sda
  1. umount the 3 bind-mounts :
# umount /mnt/root1/sys
# umount /mnt/root1/proc
# umount /mnt/root1/dev

However, the /mnt/root1/dev umount fails :

# umount  /mnt/root1/dev 
umount: /mnt/root1/dev: target is busy.

Note: the mount command gives for /dev and /mnt/root1/dev :

udev on /dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)
udev on /mnt/root1/dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)

My questions are : How is it a bind-mount can be busy ? Is there a workaround ?

Edit: I was able to umount (in fact hiding the fact it is mounted, if I understand the man page) /mnt/root1/dev with umount --lazy, but it looks incorrect to me.

Related question : https://stackoverflow.com/questions/7878707/how-to-unmount-a-busy-device

I made a script which (tries to) duplicate my live disk /dev/sdb to a second disk /dev/sda, one rsync per partition (full script).

Last step is to install grub on /dev/sda. The method I use is something like :

  1. mount /dev/sda root partition on /mnt/root1
  2. bind-mount {/dev,/sys/,/proc} on /mnt/root1 :
# mount -o bind /sys  /mnt/root1/sys
# mount -o bind /proc /mnt/root1/proc
# mount -o bind /dev  /mnt/root1/dev
  1. run chrooted update-grub and grub-install on /dev/sda :
chroot /mnt/root1 update-grub
chroot /mnt/root1 grub-install /dev/sda
  1. umount the 3 bind-mounts :
# umount /mnt/root1/sys
# umount /mnt/root1/proc
# umount /mnt/root1/dev

However, the /mnt/root1/dev umount fails :

# umount  /mnt/root1/dev 
umount: /mnt/root1/dev: target is busy.

Note: the mount command gives for /dev and /mnt/root1/dev :

udev on /dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)
udev on /mnt/root1/dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)

My questions are : How is it a bind-mount can be busy ? Is there a workaround ?

Edit: I was able to umount (in fact hiding the fact it is mounted, if I understand the man page) /mnt/root1/dev with umount --lazy, but it looks incorrect to me.

I made a script which (tries to) duplicate my live disk /dev/sdb to a second disk /dev/sda, one rsync per partition (full script).

Last step is to install grub on /dev/sda. The method I use is something like :

  1. mount /dev/sda root partition on /mnt/root1
  2. bind-mount {/dev,/sys/,/proc} on /mnt/root1 :
# mount -o bind /sys  /mnt/root1/sys
# mount -o bind /proc /mnt/root1/proc
# mount -o bind /dev  /mnt/root1/dev
  1. run chrooted update-grub and grub-install on /dev/sda :
chroot /mnt/root1 update-grub
chroot /mnt/root1 grub-install /dev/sda
  1. umount the 3 bind-mounts :
# umount /mnt/root1/sys
# umount /mnt/root1/proc
# umount /mnt/root1/dev

However, the /mnt/root1/dev umount fails :

# umount  /mnt/root1/dev 
umount: /mnt/root1/dev: target is busy.

Note: the mount command gives for /dev and /mnt/root1/dev :

udev on /dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)
udev on /mnt/root1/dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)

My questions are : How is it a bind-mount can be busy ? Is there a workaround ?

Edit: I was able to umount (in fact hiding the fact it is mounted, if I understand the man page) /mnt/root1/dev with umount --lazy, but it looks incorrect to me.

Related question : https://stackoverflow.com/questions/7878707/how-to-unmount-a-busy-device

add --lazy
Source Link
Bruno
  • 207
  • 1
  • 9

I made a script which (tries to) duplicate my live disk /dev/sdb to a second disk /dev/sda, one rsync per partition (full script).

Last step is to install grub on /dev/sda. The method I use is something like :

  1. mount /dev/sda root partition on /mnt/root1
  2. bind-mount {/dev,/sys/,/proc} on /mnt/root1 :
# mount -o bind /sys  /mnt/root1/sys
# mount -o bind /proc /mnt/root1/proc
# mount -o bind /dev  /mnt/root1/dev
  1. run chrooted update-grub and grub-install on /dev/sda :
chroot /mnt/root1 update-grub
chroot /mnt/root1 grub-install /dev/sda
  1. umount the 3 bind-mounts :
# umount /mnt/root1/sys
# umount /mnt/root1/proc
# umount /mnt/root1/dev

However, the /mnt/root1/dev umount fails :

# umount  /mnt/root1/dev 
umount: /mnt/root1/dev: target is busy.

Note: the mount command gives for /dev and /mnt/root1/dev :

udev on /dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)
udev on /mnt/root1/dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)

My questions are : How is it a bind-mount can be busy ? Is there a workaround ?

Edit: I was able to umount (in fact hiding the fact it is mounted, if I understand the man page) /mnt/root1/dev with umount --lazy, but it looks incorrect to me.

I made a script which (tries to) duplicate my live disk /dev/sdb to a second disk /dev/sda, one rsync per partition (full script).

Last step is to install grub on /dev/sda. The method I use is something like :

  1. mount /dev/sda root partition on /mnt/root1
  2. bind-mount {/dev,/sys/,/proc} on /mnt/root1 :
# mount -o bind /sys  /mnt/root1/sys
# mount -o bind /proc /mnt/root1/proc
# mount -o bind /dev  /mnt/root1/dev
  1. run chrooted update-grub and grub-install on /dev/sda :
chroot /mnt/root1 update-grub
chroot /mnt/root1 grub-install /dev/sda
  1. umount the 3 bind-mounts :
# umount /mnt/root1/sys
# umount /mnt/root1/proc
# umount /mnt/root1/dev

However, the /mnt/root1/dev umount fails :

# umount  /mnt/root1/dev 
umount: /mnt/root1/dev: target is busy.

Note: the mount command gives for /dev and /mnt/root1/dev :

udev on /dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)
udev on /mnt/root1/dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)

My questions are : How is it a bind-mount can be busy ? Is there a workaround ?

I made a script which (tries to) duplicate my live disk /dev/sdb to a second disk /dev/sda, one rsync per partition (full script).

Last step is to install grub on /dev/sda. The method I use is something like :

  1. mount /dev/sda root partition on /mnt/root1
  2. bind-mount {/dev,/sys/,/proc} on /mnt/root1 :
# mount -o bind /sys  /mnt/root1/sys
# mount -o bind /proc /mnt/root1/proc
# mount -o bind /dev  /mnt/root1/dev
  1. run chrooted update-grub and grub-install on /dev/sda :
chroot /mnt/root1 update-grub
chroot /mnt/root1 grub-install /dev/sda
  1. umount the 3 bind-mounts :
# umount /mnt/root1/sys
# umount /mnt/root1/proc
# umount /mnt/root1/dev

However, the /mnt/root1/dev umount fails :

# umount  /mnt/root1/dev 
umount: /mnt/root1/dev: target is busy.

Note: the mount command gives for /dev and /mnt/root1/dev :

udev on /dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)
udev on /mnt/root1/dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)

My questions are : How is it a bind-mount can be busy ? Is there a workaround ?

Edit: I was able to umount (in fact hiding the fact it is mounted, if I understand the man page) /mnt/root1/dev with umount --lazy, but it looks incorrect to me.

added ubuntu tag
Source Link
Bruno
  • 207
  • 1
  • 9

I havemade a script which (tries to) duplicate my live disk /dev/sdb to a second disk /dev/sda, one rsync per partition (full script).

Last step is to install grub on /dev/sda. The method I use is something like :

  1. mount /dev/sda root partition on /mnt/root1
  2. bind-mount {/dev,/sys/,/proc} on /mnt/root1 :
# mount -o bind /sys  /mnt/root1/sys
# mount -o bind /proc /mnt/root1/proc
# mount -o bind /dev  /mnt/root1/dev
  1. run chrooted update-grub and grub-install on /dev/sda :
chroot /mnt/root1 update-grub
chroot /mnt/root1 grub-install /dev/sda
  1. umount the 3 bind-mounts :
# umount /mnt/root1/sys
# umount /mnt/root1/proc
# umount /mnt/root1/dev

However, the /mnt/root1/dev umount fails :

# umount  /mnt/root1/dev 
umount: /mnt/root1/dev: target is busy.

Note: the mount command gives for /dev and /mnt/root1/dev :

udev on /dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)
udev on /mnt/root1/dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)

My questions are : How is it a bind-mount can be busy ? Is there a workaround ?

I have a script which (tries to) duplicate my live disk /dev/sdb to a second disk /dev/sda, one rsync per partition (full script).

Last step is to install grub on /dev/sda. The method I use is something like :

  1. mount /dev/sda root partition on /mnt/root1
  2. bind-mount {/dev,/sys/,/proc} on /mnt/root1 :
# mount -o bind /sys  /mnt/root1/sys
# mount -o bind /proc /mnt/root1/proc
# mount -o bind /dev  /mnt/root1/dev
  1. run chrooted update-grub and grub-install on /dev/sda :
chroot /mnt/root1 update-grub
chroot /mnt/root1 grub-install /dev/sda
  1. umount the 3 bind-mounts :
# umount /mnt/root1/sys
# umount /mnt/root1/proc
# umount /mnt/root1/dev

However, the /mnt/root1/dev umount fails :

# umount  /mnt/root1/dev 
umount: /mnt/root1/dev: target is busy.

Note: the mount command gives for /dev and /mnt/root1/dev :

udev on /dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)
udev on /mnt/root1/dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)

My questions are : How is it a bind-mount can be busy ? Is there a workaround ?

I made a script which (tries to) duplicate my live disk /dev/sdb to a second disk /dev/sda, one rsync per partition (full script).

Last step is to install grub on /dev/sda. The method I use is something like :

  1. mount /dev/sda root partition on /mnt/root1
  2. bind-mount {/dev,/sys/,/proc} on /mnt/root1 :
# mount -o bind /sys  /mnt/root1/sys
# mount -o bind /proc /mnt/root1/proc
# mount -o bind /dev  /mnt/root1/dev
  1. run chrooted update-grub and grub-install on /dev/sda :
chroot /mnt/root1 update-grub
chroot /mnt/root1 grub-install /dev/sda
  1. umount the 3 bind-mounts :
# umount /mnt/root1/sys
# umount /mnt/root1/proc
# umount /mnt/root1/dev

However, the /mnt/root1/dev umount fails :

# umount  /mnt/root1/dev 
umount: /mnt/root1/dev: target is busy.

Note: the mount command gives for /dev and /mnt/root1/dev :

udev on /dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)
udev on /mnt/root1/dev type devtmpfs (rw,nosuid,relatime,size=8131896k,nr_inodes=2032974,mode=755,inode64)

My questions are : How is it a bind-mount can be busy ? Is there a workaround ?

Source Link
Bruno
  • 207
  • 1
  • 9
Loading