How to Unmount Volumes

Get the volume’s mount point with df if you don’t already know it:

sudo df --human-readable --print-type

The mount point will look like /mnt/volume-sfo2-01:

Filesystem     Type      Size  Used Avail Use% Mounted on
. . .
/dev/sda       ext4       99G   60M   94G   1% /mnt/volume-sfo2-01
. . .

Make sure the volume isn’t in use. If you try to unmount a volume while it’s in use, you’ll get a target is busy error, so check if any processes are using the mounted filesystem with lsof:

sudo lsof +f -- /mnt/use_your_mount_point
  1. Stop any listed processes.

Unmount the volume with umount.

sudo umount --verbose /mnt/use_your_mount_point

Including the --verbose flag makes the command output /mnt/your_mount_point unmounted when it executes successfully. Otherwise, umount is silent on successful execution.

If you won’t reattach the volume in the future, you can do some additional cleanup:

  1. Edit /etc/fstab to remove any entries referencing the volume.
  2. Delete the mount point:
sudo rmdir /mnt/use_your_mount_point


Leave a Reply