Skip to content

Commit

Permalink
force unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Oct 7, 2023
1 parent e0530a1 commit 0a82773
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ pub fn unmount_chroot(root: &Path) -> Result<()> {
// umount $root/proc;
// sh -c "mv $root/etc/resolv.conf.bak $root/etc/resolv.conf || true";
// )?;
nix::mount::umount(&root.join("dev").join("pts"))?;
nix::mount::umount(&root.join("dev"))?;
nix::mount::umount(&root.join("sys"))?;
nix::mount::umount(&root.join("proc"))?;
nix::mount::umount2(&root.join("dev/pts"), nix::mount::MntFlags::MNT_FORCE)?;
nix::mount::umount2(&root.join("dev"), nix::mount::MntFlags::MNT_FORCE)?;
nix::mount::umount2(&root.join("sys"), nix::mount::MntFlags::MNT_FORCE)?;
nix::mount::umount2(&root.join("proc"), nix::mount::MntFlags::MNT_FORCE)?;
Ok(())
}
/// Mount chroot devices, then run function
Expand Down

0 comments on commit 0a82773

Please sign in to comment.