FreeBSD: Forcefully unmount a disk partition to get rid of device busy error

Under FreeBSD if you get error device busy while unmounting file system then you can forcefully unmount a disk partition or mount point. You can pass -f option to mount command. It forces the read/write mount of an unclean file system. Suppose you would like to unmount /cdrom forcefully then type command (login as a root user use su or sudo command):

ADVERTISEMENTS

# umount -f /cdrom

Where,

  • -f : Forces umount to unmount a disk partition or mounted system
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
1 comment… add one
  • Rick Nov 14, 2009 @ 9:26

    Before you do this you should always check what process is keeping your device busy:

    Install “lsof” from ports and run:

    #> lsof /dev/

    This will output a list of users and processes using this device. Then kill one by one and try to unmount again. If no process is using it but you still get the error use the command in this hint above.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.