Mounting a Vultr File System volume on Linux allows you to expand storage and share files across multiple Vultr Cloud Compute instances. This process involves creating a mount point, mounting the Vultr File System volume, and configuring it for automatic mounting at boot.
Follow this guide to mount a Vultr File System volume on Linux.
Check your system's Linux Kernel version and ensure it's 5.4.x
or later.
$ uname -srm
Ensure your system is compatible with virtiofs
.
$ sudo modinfo virtiofs
Verify that the virtiofs
Kernel module is loaded.
$ lsmod | grep virtiofs
If the virtiofs
module is not loaded, run the following command to load it manually:
$ sudo modprobe virtiofs
Create a new directory such as /mnt/vfs
to mount the Vultr File System volume.
$ sudo mkdir /mnt/vfs
Mount the Vultr File System volume to the directory using its Mount Tag. For instance, 79287343
.
$ sudo mount -t virtiofs 79287343 /mnt/vfs
Open the Vultr File System volume's management page to find the Mount Tag to use in the above command.
Query the /etc/mtab
file to get information about the newly mounted volume.
$ sudo cat /etc/mtab | grep virtiofs
Copy the command's output to your clipboard. For instance:
79287343 /mnt/vfs virtiofs rw,relatime 0 0
Open the /etc/fstab
file to automatically mount the new volume at boot.
$ sudo nano /etc/fstab
Append the volume information you copied earlier to the end of the file.
79287343 /mnt/vfs virtiofs rw,relatime 0 0
Save and close the file.
List all mounted file systems and verify that the virtiofs
volume is available.
$ df -hT
Output:
tmpfs tmpfs 96M 1.2M 94M 2% /run
/dev/vda2 ext4 23G 6.6G 16G 30% /
tmpfs tmpfs 476M 0 476M 0% /dev/shm
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/vda1 vfat 511M 6.1M 505M 2% /boot/efi
tmpfs tmpfs 96M 4.0K 96M 1% /run/user/1002
79287343 virtiofs 80G 0 80G 0% /mnt/vfs
Create a new greetingsfromvultr.txt
file in the /mnt/vfs
directory to test write permissions on the volume.
$ echo "Greetings from Vultr" > /mnt/vfs/greetingsfromvultr.txt