How to Mount a Vultr File System Volume on Linux

Updated on December 12, 2024

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.

  1. Check your system's Linux Kernel version and ensure it's 5.4.x or later.

    console
    $ uname -srm
    
  2. Ensure your system is compatible with virtiofs.

    console
    $ sudo modinfo virtiofs
    
  3. Verify that the virtiofs Kernel module is loaded.

    console
    $ lsmod | grep virtiofs
    

    If the virtiofs module is not loaded, run the following command to load it manually:

    console
    $ sudo modprobe virtiofs
    
  4. Create a new directory such as /mnt/vfs to mount the Vultr File System volume.

    console
    $ sudo mkdir /mnt/vfs
    
  5. Mount the Vultr File System volume to the directory using its Mount Tag. For instance, 79287343.

    console
    $ 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.

    Find a Vultr File System Mount Tag

  6. Query the /etc/mtab file to get information about the newly mounted volume.

    console
    $ sudo cat /etc/mtab | grep virtiofs
    

    Copy the command's output to your clipboard. For instance:

    79287343 /mnt/vfs virtiofs rw,relatime 0 0
  7. Open the /etc/fstab file to automatically mount the new volume at boot.

    console
    $ sudo nano /etc/fstab
    
  8. Append the volume information you copied earlier to the end of the file.

    ini
    79287343 /mnt/vfs virtiofs rw,relatime 0 0
    

    Save and close the file.

  9. List all mounted file systems and verify that the virtiofs volume is available.

    console
    $ 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
  10. Create a new greetingsfromvultr.txt file in the /mnt/vfs directory to test write permissions on the volume.

    console
    $ echo "Greetings from Vultr" > /mnt/vfs/greetingsfromvultr.txt