How to Mount Vultr Block Storage Volume on Linux
-
by Blog Admin
- 20
How to Mount Vultr Block Storage Volume on Linux
A family of open-source operating systems based on the Linux kernel, offering stability, security, and flexibility for various server environments.
Mounting Vultr Block Storage volume on Linux provides flexible and scalable file storage for Vultr Cloud Compute instances. Linux distributions including Debian, Ubuntu, CentOS, Rocky Linux, Alma Linux, Arch Linux, and Alpine Linux support NVMe and HDD-based Vultr Block Storage volumes.
Follow this guide to mount a Vultr Block Storage volume on Linux.
The following commands may destroy data on existing volumes. Use a new Vultr Block Storage volume to avoid data loss due to file system changes and partitioning.
- Attach a Vultr Block Storage volume to the Linux instance.
- Use the
lsblkutility to list all storage disks attached to the Vultr Cloud Compute instance and verify the Vultr Block Storage volume disk name.console$ lsblkOutput:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sr0 11:0 1 1024M 0 rom vda 254:0 0 25G 0 disk ├─vda1 254:1 0 512M 0 part /boot/efi └─vda2 254:2 0 24.5G 0 part / vdb 254:16 0 40G 0 diskThe Vultr Block Storage volume is attached to the instance as
/vdbbased on the above output. The first Vultr Block storage volume attaches to Linux as/dev/vdband additional volume disk names increment in alphabetical order such as/dev/vdcand/dev/vdd. - Create a new disk label using the
partedutility.console$ sudo parted -s /dev/vdb mklabel gpt - Create a primary partition to fill the entire disk space.
console
$ sudo parted -s /dev/vdb unit mib mkpart primary 0% 100%
- Create an EXT4 file system on the primary partition and format it.
console
$ sudo mkfs.ext4 /dev/vdb1Output:
mke2fs 1.47.0 (5-Feb-2023) Discarding disk blocks: done Creating filesystem with 10485248 4k blocks and 2621440 inodes Filesystem UUID: 95b1f596-e044-4dcd-beb3-a94877960e4d Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624 Allocating group tables: done Writing inode tables: done Creating journal (65536 blocks): done Writing superblocks and filesystem accounting information: done - Create a new mount point directory for the Vultr Block Storage volume partition.
console
$ sudo mkdir /mnt/blockstorage - View detailed information about the Vultr Block Storage volume partition and note its UUID value.
console
$ sudo blkid /dev/vdb1Output:
/dev/vdb1: UUID="95b1f596-e044-4dcd-beb3-a94877960e4d" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="primary" PARTUUID="a7eb098c-288d-4040-9aac-38b36d4e63e7" - Add a new entry to the
/etc/fstabfile to automatically mount the Vultr Block Storage volume at boot. ReplaceUUID-VALUEwith the actual Vultr Block Storage volume partition UUID.console$ echo "UUID=<UUID-VALUE> /mnt/blockstorage ext4 defaults,noatime,nofail 0 0" | sudo tee -a /etc/fstab
- Reload systemd to apply the
/etc/fstabchanges.console$ sudo systemctl daemon-reload - Mount the Vultr Block Storage volume partition.
console
$ sudo mount /mnt/blockstorage - View all active storage volumes on the Vultr Cloud Compute instance and verify that the new Vultr Block Storage volume is available.
console
$ lsblkOutput:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sr0 11:0 1 1024M 0 rom vda 254:0 0 25G 0 disk ├─vda1 254:1 0 512M 0 part /boot/efi └─vda2 254:2 0 24.5G 0 part / vdb 254:16 0 40G 0 disk └─vdb1 254:17 0 40G 0 part /mnt/blockstorage
How to Mount Vultr Block Storage Volume on Linux A family of open-source operating systems based on the Linux kernel, offering stability, security, and flexibility for various server environments. Mounting Vultr Block Storage volume on Linux provides flexible and scalable file storage for Vultr Cloud Compute instances. Linux distributions including…
How to Mount Vultr Block Storage Volume on Linux A family of open-source operating systems based on the Linux kernel, offering stability, security, and flexibility for various server environments. Mounting Vultr Block Storage volume on Linux provides flexible and scalable file storage for Vultr Cloud Compute instances. Linux distributions including…