How to add storage drive on Proxmox

If you need to add a new drive to your Proxmox server, in this guide, you will learn how.

Proxmox add drive

On Proxmox, you can add one or multiple hard drives to store different types of files (such as ISO images and virtual machines), but the process requires typing different commands in the Shell console before making it available to the server, and in this guide, you will learn how.

Although you can configure different types of storage configurations on Proxmox, the most common scenario would be connecting an internal SAS or SATA drive, and this process involves using the Shell to install the “parted” tool to set up the drive, create a mount point and mount the drive to the server, and then using the web interface to storage as directory and specifying the storage usage.

This guide will teach you the steps to add and configure a new storage drive to Proxmox.

Add storage drive to Proxmox

To add and configure a new storage drive on Proxmox, use these steps:

  1. Open Proxmox server (web).

  2. Select the server from the left navigation pane.

  3. Click on Shell.

  4. Type the following command to list the available drives and press Enter:

    lsblk

    lsblk

    Quick note: You may need to restart the server if the drive you added does not appear in the operating system. Also, make sure to note the name of the drive, which in this case is “sdb,” but yours may be different.
  5. Type the following commands to install the parted tool and press Enter:

    apt policy parted 
    apt install parted

    Proxmox install parted

    Quick note: If the tool is already available, the commands won’t install anything.
  6. Type the following command to create a GPT partition table on the drive and press Enter:

    parted /dev/sdb mklabel gpt

    Proxmox create partition shell

    In the command, change “sdb” to the name that corresponds to your drive.

  7. Type the following command to create a primary partition using the entire storage available and press Enter:

    parted -a opt /dev/sdb mkpart primary ext4 0% 100%

    In the command, change “sdb” to the name that corresponds to your drive.

  8. Type the following command to confirm the partition name and press Enter:

    lsblk
  9. Type the following command to apply the ext4 filesystem to the partition and press Enter:

    mkfs.ext4 -L StorageOne /dev/sdb1

    Proxmox apply ext4 file system

    In the command, change “sdb1” for the name that corresponds to your partition.

  10. Type the following command to create a mount point on Proxmox and press Enter:

    mkdir -p /mnt/data
  11. Type the following command to open the “fstab” configuration to set the drive to mount automatically on reboot and press Enter:

    nano /etc/fstab
  12. Type the following line of code in the next available line inside the “fstab” file, press “Ctrl + O,” “Enter,” and “Ctrl + X” to save the changes and exit the text editor:

    LABEL=StorageOne /mnt/data ext4 defaults 0 2

    Proxmox edit fstab

  13. Type the following command to mount the drive and make it visible to the Proxmox server and press Enter:

    mount -a
  14. Click on Datacenter from the left navigation pane.

  15. Click on Storage from the right side.

  16. Click the Add button and select the Directory option.

    Proxmox Storage settings add drive option

  17. Confirm the ID for the drive (as previously configured). For example, StorageOne.

    Proxmox add drive to server

  18. Confirm the Directory path (as previously configured). For example, /mnt/data.

  19. Confirm the Content type you will store inside the drive. (It’s a good idea to select all the available options.)

  20. Click the Add button.

Once you complete the steps, the drive will be available under the (local) server on the left side. You can now use this storage to upload ISO files, create virtual machines, and more.