Volumes are network-based block devices that provide additional data storage for Droplets. You can move them between Droplets and resize them at any time. Learn more about volumes.
DigitalOcean volumes have some platform-specific naming conventions for volume device files, automatic mount points, and systemd unit files:
||Automatic Mount Point||Mount Unit File in
Each section below goes into more detail about these naming conventions.
In Linux, hardware devices are typically represented by special device files within the
/dev directory with names like
sdb. Subdirectories in
/dev/disk contain symbolic links with more descriptive names to make it easier to identify devices.
/dev/sd* names can change between boots, so we recommend using the links in
/dev/disk/by-id for DigitalOcean volumes (and any partitions on them) because they are predictable and reliable across reboots.
Links in the
/dev/disk/by-id subdirectory are conventionally associated with hardware serial numbers, but the
/dev/disk/by-id identifiers for DigitalOcean volumes are composed of these parts in order:
-part1, if the volume is partitioned
The full identifier for a volume named
volume-nyc1-01 would be
/dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01. The first partition on that volume would be
-Loption to label a filesystem. These labels are persistent names that can be easier to remember as an alternative to the
/dev/disk/by-id link for a volume is visible in its config instructions in the control panel (click on the volume’s More menu, then Config instructions).
Most tools can take
/dev/disk/by-id identifiers as input, but will use the traditional
/dev/sd* names in their output.
To see the mapping between
/dev/disk/by-id links and
/dev/sd* names, read the link targets with
/dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01: symbolic link to ../../sda /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01-part1: symbolic link to ../../sda1
|Volume Name||Automatic Mount Point||Mount Unit File|
When you create a new volume, you can automatically format and mount it to Droplets with supported operating systems. Automatic mounting uses systemd on distributions that support it.
The systemd mount unit files are named
/etc/systemd/system/path-to-mount-point.mount. The path to the mount point uses hyphens as separators instead of forward slashes.
We automatically mount volumes to
/mnt in a directory with the same name as the volume, so a volume named
example would have the mount point
However, because of the systemd mount unit file naming, we cannot automatically mount a volume at a path that includes hyphens. If there are hyphens in the volume name, we replace the hyphens with underscores, so a volume named
volume-nyc-01 would have the mount point
For consistency, we match this behavior even on distributions without systemd.