--- title: How to Mount and Unmount Volumes description: Manually mount, persistently mount, and unmount volumes on Droplets. product: Volumes url: https://docs.digitalocean.com/products/volumes/how-to/mount-unmount/ last_updated: "2026-02-05" --- > **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document). # How to Mount and Unmount Volumes Volumes are network-attached block storage. You can use them with Droplets or Kubernetes clusters, move or resize them, and create snapshots at any time. Every time you attach a volume to a Droplet, you need to mount it. [Mounting a formatted volume](#mount) adds the volume’s filesystem to the Droplet’s existing file hierarchy. You need to mount a volume every time you attach it to a Droplet to make it accessible to that Droplet’s operating system. To move a volume between Droplets in the same region, first [unmount and detach it from the current Droplet](#unmount), and then [attach and mount it on the new Droplet](#mount). Alternatively, you can choose to [automatically format and mount it](https://docs.digitalocean.com/products/volumes/how-to/create/index.html.md#format-mount) to a Droplet with a [supported operating system](https://docs.digitalocean.com/products/droplets/details/images/index.html.md). **Note**: We cannot automatically mount volumes for you at any time other than when you first create the volume. To automatically format and mount newly-created volumes, we need to write some metadata to the volume for the Droplet to read and perform the setup. Once the volume is mounted, this metadata is deleted. For privacy and security reasons, we can’t write to a volume after it’s fully created, so we can’t automatically mount volumes after their initial creation. You can also [set up persistent mounting](#persistent) to tell the operating system to mount certain filesystems on boot, which lets volumes remain accessible after reboots. Before you mount your volume, you need to [format it once](https://docs.digitalocean.com/products/volumes/how-to/create/index.html.md#format-mount). Formatting a volume creates a filesystem on the volume, erasing any existing data. ## Mount a Volume To mount a volume, choose a mount point, which is the directory where the volume’s filesystem should be attached. This is where you access the volume’s files after it’s mounted. We recommend creating a new directory in `/mnt` to use as a mount point: ```shell sudo mkdir /mnt/example_mount_point ``` Next, use `mount` to mount the volume’s filesystem to the mount point. We recommend using the same options as automatic mounting, which are `defaults,nofail,discard,noatime`: ```shell sudo mount -o defaults,nofail,discard,noatime /dev/disk/by-id/scsi-example /mnt/example_mount_point ``` These options include read/write access, executing programs, error suppression for nonexistent devices, and continuous TRIM, which improves performance and reduces unnecessary disk writes. Use `mount`’s man page (`man mount`) for more details about these options and all other mount options. You can check that the mount itself was successful by passing the mount point to `findmnt`: ```shell findmnt /mnt/use_your_mount_point ``` A successful output shows that the volume is currently mounted like this: ``` TARGET SOURCE FSTYPE OPTIONS /mnt/example_mount_point /dev/sda1 ext4 rw,noatime,discard,data=ordered ``` ## Set Up Persistent Mounting The `/etc/fstab` file contains static information about filesystems that the operating system can mount, including which ones to mount automatically at boot. You can add a line to this file for the volume’s filesystem to make it mount automatically when the Droplet boots. This keeps the volume’s filesystem persistent through reboots. Each line in `/etc/fstab` represents one filesystem and consists of six fields: - `fs_spec`, the block device to mount. Use the `/dev/disk/by-id` identifier for the volume or partition. - `fs_file`, the mount point for the filesystem. - `fs_vfstype`, the type of filesystem in lowercase, like `ext4` or `xfs`. - `fs_mntops`, the mount options. We recommend the same options as automatic mounting, `defaults,nofail,discard,noatime`. `nofail` in particular lets the operating system continue its boot sequence if the filesystem can’t be found, which is helpful if you detach the volume in the future without removing its `fstab` entry. - `fs_freq`, whether `dump` should operate on the filesystem. Use `0` to disable this functionality unless you know you need it. - `fs_passno`, the order that `fsck` should check filesystems in. Use `2` to enable checking. The root filesystem should be `1`, and `0` disables checking. The line you add to `/etc/fstab` should look like this, with your volume’s identifier and mount point: Example `/etc/fstab` entry ```text /dev/disk/by-id/scsi-example /mnt/example-mount-point ext4 defaults,nofail,discard,noatime 0 2 ``` After you edit the file, check that `/etc/fstab` is parsable and usable: ```shell findmnt --verify --verbose ``` This lists any parsing errors, execution errors, and warnings. Once you resolve all errors, you can use `mount -a` to mount the volume. ## Unmount a Volume If needed, you can unmount a volume to make its filesystem inaccessible to its Droplet’s operating system. This means the operating system can’t write to or read from the volume. You should unmount volumes before [resizing](https://docs.digitalocean.com/products/volumes/how-to/increase-size/index.html.md) or [detaching](https://docs.digitalocean.com/products/volumes/how-to/delete-detach/index.html.md#detach) them to protect data integrity. To unmount a volume, get the volume’s mount point with `df`: ```shell sudo df --human-readable --print-type ``` The mount point looks like `/mnt/volume-sfo2-01`, for example: `df` output ```text Filesystem Type Size Used Avail Use% Mounted on ... /dev/sda ext4 99G 60M 94G 1% /mnt/volume-sfo2-01 ... ``` Then, ensure the volume isn’t in use. If you try to unmount a volume while it’s in use, you get a `target is busy` error, so check if any processes are using the volume with `lsof`: ```shell sudo lsof +f -- /mnt/use_your_mount_point ``` If there are any processes using the volume, stop any listed processes by stopping the services or processes that are accessing the mount point. For example, stop the service using `systemctl stop ` or terminate the process with `kill`. Unmount the volume with `umount`: ```shell 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. A successful unmount looks like this: ``` /mnt/use_your_mount_point unmounted ``` If you plan not to reattach the volume, you can also edit the `/etc/fstab` to remove any entries referencing the volume, and also delete the mount point. To edit `/etc/fstab` to remove any entries referencing the volume, open the file using a text editor of your choice, such as `nano` or `vi`, and delete the line that references the volume’s `/dev/disk/by-id` identifier. This is successful if the file saves without errors and `findmnt --verify` reports no issues. To delete the mount point, run the following command to remove the directory: ```shell sudo rmdir /mnt/use_your_mount_point ``` Verify the mount point is deleted by running `ls /mnt` and confirming the directory no longer appears in the output.