Add more storage to Proxmox VM

Adding extra storage to a VM can be needed for a range of reasons. One reason is to save on SSD space and use cheaper hard drives for file storage. Adding storage comes in two parts. Part one is configuring a virtual disk and connect it to the VM in Proxmox. The second part is configuring the storage within Windows since it is not picked up automatically,

Video

Configuring storage in Proxmox

  1. In the Server View menu, Click the desired VM.
  2. Click Hardware, in the menu to the right.
  3. Click Add
  4. In the dropdown menu click Hard disk.
  5. Configure the hard drive.
    • Bus/Device: This is the type of device you wish the hard drive to be. SCSI works great for Windows and Linux.
    • Storage: Here you select which physical drive you wish the virtual one to be located on.
    • Disk size (GiB): The size you wish the hard drive to be in gigabytes.
    • Cache: This has to do with the performance and how data is handled by Proxmox. No cache and writeback can cause data loss if the server loses power. Write through and direct sync will make sure that you don't lose data, but it will strain more on your hard drives.
    • Discard: If Thin provision is used on the drives, this can be checked to make the hard drive files of virtual machines smaller.
  6. Click Add when you are happy with your configuration.

It should not be needed but you might have to reboot the VM for it to see the drive.

Configuring storage in Windows

  1. In Windows, Right click the start menu button.
  2. Click Disk management.
  3. Right click the new drive that should be shown in black.
  4. Click New Simple Volume to start configuring the hard drive.

  1. click next in the first window.
  2. Specify Volume Size. If you wish to split up the hard drive, this can be done here by changing the volume size. or do nothing to use the entire drive for one partition.
  3. Assign Drive Letter or Path: Select the Drive letter you wish. If you have ISO files mounted, they will take up the first available drive letters. and give you a gap later.
  4. Format Partition: If this is a drive you move between virtual machines, remember to change to "Do not format this volume". Otherwise, Change the details to what you wish and click next
  5. Completing the New Simple Volume Wizard: The final window gives you a summary you can look over. Click finish to complete the setup.

The hard drive will now be ready for use in Windows.

Configuring storage in Linux with fdisk

If you are using a Linux version with a GUI, the hard drive setup will most likely be similar to Windows. This depends on the Linux version. In the terminal it is a bit different.

Format The disk

  1. First you will have to find the drive in the system. This is done with the command below.
1sudo fdisk -l

This will output a fair amount of data. For me I can see the new drive at the bottom here with the name /dev/sdb.

  1. Next is to configure the drive with the fdisk tool.
1sudo fdisk /dev/sdb

  1. Inside here press n to make a new partition.
  2. In the coming steps you can just press enter unless you wish to configure the drive in a specific way.
  3. When the configuration is done, press w to save the partition and exit the program.
  4. The drive now needs to be configured with a file system. Windows use NTFS but for Linux it is preferred to use ext4.
1sudo mkfs -t ext4 /dev/sdb1

Mount drive

The drive has been formatted but you have to mount it in the system to access it.

  1. First is to create a mount point. This is done by simply making a folder where you want to mount it. With the command below I am making a folder named diskname in the mnt directory.
1sudo mkdir /mnt/diskname
  1. Now to edit the fstab file to make sure the drive is mounted every time the system is rebooted.
1sudo nano /etc/fstab
  1. Here I add the line below to the end of the file then press CTRL + S to save and CTRL + X to exit.
1/dev/sdb1       /mnt/diskname   ext4    defaults 0 1
  1. Finally I mount the hard drive.
1sudo mount -a

Ready for use,

The drive should now be ready for use by your VM whether you use Windows or Linux. There is a lot more in the Linux version I did not take up but hopefully it helps a bit.

Translations: