
How to add storage to Proxmox
5th March 2019 37 By George WouUsing an HDD for the proxmox host, the VMs and the containers was causing delays and long iowait.After upgrading to an SSD there was a spare 1TB hard drive that could be used for storing containers that write constantly big chunks of data to the hdd,something that can cause increased wear to the ssd.
Since the needs are not complicated the setup is simple and does not use raid,zfs etc.
After the hdd setup, an elasticsearch stack container with netflow analysis was moved to the hdd,and although the read speeds do not match the performance of the containers running from the ssd, the hdd not having anything else running has an amazing increase in data read compared to the previous setup where the proxmox host and the VMs were based on the same hdd.
This tutorial covers the following subjects:
- How to partition and format a hard disk added to our baremetal host
- possible use cases for the new partition
Identify the new disk
Check the layout of the disks attached to the server to find the device names assigned to the disks by the proxmox host OS (Debian 9):
lsblk
In the example we have disks sda and sdb.
sda has the current debian os with Proxmox VE installed and some vms.The new disk is sdb which retains the old setup.We’ll clear all contents from sdb since we have already moved the vms to the new sda disk and verified they are working.
Format and partition
We’ll use parted instead of fdisk although they have equal capabilities.Parted can be used in scripting and supports disks bigger than 2TB.
check existence in the system and install parted:
apt policy parted
apt install parted
Create a new partition table of type GPT,a newer and better standard than the older MBR:
parted /dev/sdb mklabel gpt

lsblk : result of parted /dev/sdb mklabel gpt
Make a primary partition for filesystem ext4 utilizing 100% of the disk:
parted -a opt /dev/sdb mkpart primary ext4 0% 100%

lsblk
Create the ext4 filesystem on the newly created partition sdb1 with a volume label we want.Giving a label to a partition is the recommended method since when adding or removing drives the device name sdb1 could change.
mkfs.ext4 -L storageprox /dev/sdb1
lsblk -fs
Now we can mount the drive in a folder we like.For a more unified appearence and ease of use we choose mnt/.
Create a folder inside mnt/ that will host the data of the new disk:
mkdir -p /mnt/data
Edit fstab file and enter a line with the mount options:
nano /etc/fstab
LABEL=storageprox /mnt/data ext4 defaults 0 2
mount the new drive:
mount -a

lsblk final
The HDD drive is now ready for use.Below we see common usage cases in Proxmox VE.
Use the new disk as backup
Backup our VMs and LXC containers in the new HDD drive.
Create a directory to store the backups:
mkdir -p /mnt/data/backup/
Now in the Proxmox GUI go to Datacenter -> Storage -> Add -> Directory.
In the directory option input the directory we created and select VZDump backup file:
Finally schedule backups by going to Datacenter – > Backups.The new directory will be available in the backup options.
Use the new disk to run VMs
As mentioned in the beginning of the article we can select specific VMs or containers that do heavy writing on the SSD to run from the HDD.
Create a directory for the VMs:
mkdir -p /mnt/data/hdd-img/
In the Proxmox GUI go to Datacenter -> Storage -> Add -> Directory .
In the directory option input the directory we created and select Disk image,container :
Now when restoring a backup image or creating a new VM or container, in the storage selection we have the option of hdd-img, the ID of the new storage we added.

Final result for both types of content
37 Comments
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
this really helped me !!!!
Thanks
Amazing, been scratching my head for days, how to mount hard drives in Proxmox, waching you tube videos, but still nothing clear, and I come here, and its so easy to understand.
Thankyou!
Glad to help!
tnx
this was the best guide for how to store the VM File ( vmdk equivalent? ) on a storage drive and not the local install OS.
Thank you very much.
The Best
Simple and easy 😉
Thx
Saying this article is awesome is an understatement.
Thanks a lot.
Sen adamın dibisin. Thank u bro.
This helped me tremendously, thank you. I do have a question though. I’m quite a beginner, and cant find any information on this. Do you think you could do a tutorial or recommend one for mounting storage from within the VM? Like say I have a directory at /dev/sdd/storage that I want to be able to access within a ubuntu-server VM. I’m not sure if it needs to be mounted as a CIFs or what. Thanks if you or anyone else might have a suggestion to me.
You will mount it as CIFS or NFS or whatever suits you,it has nothing to do with adding a real drive to a proxmox installation.For the case you mention you can follow this one https://nubcakes.net/index.php/2019/03/22/how-to-install-sonarr-radarr-and-jacket-with-docker/#step1 , it is for Alpine but besides installing cifs for Ubuntu with
apt install cifs-utils
the rest of the step applies to Ubuntu too.This is my first time here. I was able to add a second physical drive to proxmox, but I don’t know how to get it to appear in windows server 2016 list of drives. is there a clear direction on how to do that?
This is overly complicated. To provision a disk, Proxmox requires it to be blank. Therefore, all that needs to happen:
1) Inside Proxmox, open a Shell on the Node with the disk to provision; Identify its name: ls /dev/disk/by-id
2) Clear the disk: gdisk /dev/disk/by-id/ | enter ‘d’ to delete and ‘w’ to commit
3) Back in Proxmox, on the Node->Disks>LVM-> Create Volume Group -> Select disk -> Name It -> OK
4) Node -> Disks -> LVM-Thin -> Create Thinpool -> Select Disk -> Name It -> OK
Done.
I get what’s happening at the low level, the idea is to stay inside the tool as much as possible, let it work for you. A common ‘complaint’ I have about Linux admins is the tendency to over-engineer solutions that take much longer to execute, are prone to error, and whose results are less predictable than utilizing built-in functionality of Apps/Management Interfaces.
Hey Travis,thanks for your comment.
It all depends on the use case.First of all i think the guide is detailed so one knows why he’s doing everything.My goal is not just copy paste the commands but document everything in-between.
Now on the use case,if i have a large spare hard drive that i can use as multipurpose i’ll just mount the disk as a directory and make backups or/and run write intensive beasts like Zabbix,instead of having everything in a good commercial SSD drive.The life cycle of the SSD will be gone very fast if you keep VMs or containers that write a lot.The use case described above is about a spare HDD.
On the other hand when i get a NVME disk i should add it the way you describe,as LVM-thin so i can squeeze everything in it (thin provisioning is about overallocating disk space) without caring about the life span of the disk,since NVME’s reach 10x the life span of a regular SSD,and this value will keep rising with each new model.
Thanks for adding your insight to the guide!
Thank you so much for this! I added a 2nd drive on the weekend and used the GUI and got tied in knots. The use case you address was a near perfect fit for me. Tonight I redid it using this approach and it is exactly what I wanted to achieve. Thanks again.
Hello,
I’ll have a Raid 0 drives for my actives VMs.
Do you think it’s possible and did you know where i can find help fot that?
Thanks.
Excellent overview of exactly what I was trying to do!
Thank you VERY much.
Travis, will this work for creating storage for a Prox backup?
No,you can’t choose LVM-thin as a backup destination
Hello,
I followed this guide to set up an external hdd for saving backups of my VMs & LXCs. Everything looked good but then the reported size of the backup storage changed. On the summary page of the storage it now says the backup storage is the exact same size as the local storage – Usage 4.59% (4.31 GiB of 93.99 GiB). Is this normal?
Is it a usb external disk?the only thing i can think of is that the hdd is not mounted and somehow it gives you the same info.I would suggest a NAS for this purpose,usb drives sometimes get dismounted.
Thank you. Saved my day. Worked perfectly to mount my drives and use them for anything.
AMAZING
Thank you for posting this article!
Thanks, very well explained. Saved my day.
I’m just starting out with this guide, but when I try to install parted I get a message back that says ” Package parted is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source” So my question to you is this, how to I install “parted”. I’m new to all of this and still trying to learn.
Do:
apt-get update
apt-cache policy parted.
If there is no result you dont have the required repositories in you OS,so you’ll need to find a suitable repo for parted and paste it in /etc/apt/sources.list
Thanks a lot guy, you really helped me too !!!
As a noob on Linux and Proxmox I was informed on another forum to use this method after various attempts over the last few months , Thank you it worked a treat !!!!
You say that you can run VMs from this secondary drive in Proxmox . Can you help by advise how you can achieve this as i am unable to see how As the two nodes HHD-img/ Storage do not appear when you want create new vm/ct.
Am i missing something ?
Any way at least i have a backup disk if i am?
Have you followed the last part of the guide called “Use the new disk to run VMs”.
If yes the new mount should appear as a selection.
You must choose disk image,container.Check again.
my concern is that
i have an internal 4T HDD and 256SSD Disk
the proxmox was installed on the 256ssd, with installed windows10Pro
what i want is to access the 4T Hdd under windows.
i hope you can help me out
Hello
Proxmox VE 7.1 on this release fails to partition the disk according to your instructions, as it does not support Parted. !!!
What do you advise ???
hi, sorry my inglish
if i mount zfs how is? i have a mount two disk zfs_members, but i don’t erase data
how is process
Thanks, very well explained. Saved my day.
You are Amazing!
Thank you so very much. I was stuck with my storage not showing up when I wanted to deploy VMs
It’s really one of the best and most concise tutorials on adding new storage on proxmox. Thank you 1000 times!
I’m quite a noob in proxmox, have some basic experiance in linux and my proxmox VE was falling apart due to bad and old SSD drive. Thanks to you I swaped drives and followed your tutorial…and I worked in 5 min!!!!
Thanks and keep up the good work!
Kind regards,
Andrej
Thank you for the kind words!I wish i had more time to keep writing 🙁