How to Add a New Disk in Proxmox VE?

In PVE, besides the drive where PVE is installed, other hard drives need to be manually mounted. This is less convenient than ESXi, but the process of mounting a hard drive is not difficult.

download-icon
Free Download
for VM, OS, DB, File, NAS, etc.
iris-lee

Updated by Iris Lee on 2024/10/18

Table of contents
  • 1.Check the device name of the hard drive to be added

  • 2.Delete old partitions

  • 3.Create a new partition

  • 4.Format the new partition

  • 5.Mount the new hard drive

  • 6.Set automatic mounting on boot

  • 7.Add the hard drive to PVE storage

  • Backup your Proxmox VMs with the safest way

  • Proxmox mount disk FAQs

  • Conclusion

In PVE, besides the drive where PVE is installed, other hard drives need to be manually mounted. This is less convenient than ESXi, but the process of mounting a hard drive is not difficult. Let’s look at how to add a new hard drive in PVE, whether it’s mechanical or solid-state, the steps are the same.

1.Check the device name of the hard drive to be added

Enter the shell window of the PVE management backend and input the command:

fdisk /dev/sdb

Supplemental information: In Linux, everything is a file, including your devices. The “/dev” directory can be understood as the device directory, similar to the Device Manager in Windows, so your hard drive is located here. For example, my 480GB SSD is “/dev/sdb”, while “/dev/sdb1, /dev/sdb2, and /dev/sdb3” are its three partitions. The hard drive exists, but it needs to be mounted before it can be used.

“fdisk” is a partitioning tool in Linux, and since PVE is a Linux system, you can use this command directly. This tool is as powerful as DiskGenius in Windows, but the difference is that it operates via the command line. After entering “fdisk”, if you don’t know what command to input, just type “m”, which serves as a help document, and it will show you what each letter represents.

2.Delete old partitions

According to the prompt, the first thing we need to do is delete the partitions. The prompt tells us to delete partitions by entering “d”. After inputting, follow the prompts to delete all the partitions.

3.Create a new partition

Next, we need to create a partition by inputting “n”. Then it asks how many partitions to create; we will create one, so input “1”. Afterward, you will be asked to enter the start and end addresses of the partition. If you don’t want to customize them, just press Enter to accept the default values. After the partition is created, press “w” and Enter to execute the operation.

Finally, under “/dev”, there will be a partition like “sdb1”, which is the newly created partition.

4.Format the new partition

To format the partition, we use another command, “mkfs”. Input:

mkfs -t ext4 /dev/sdb1

This will format the partition into the ext4 format. Common hard drive formats include ext3, reiserfs, ext2, fat32, ext4, msdos, etc. You can format it into the desired format according to your needs. If you want to check other usages of “mkfs”, input “mkfs -h” to get more information.

5.Mount the new hard drive

Create a directory named "ssd-480g":

cd /mnt
mkdir ssd-480g

Supplemental information: To mount a device to a directory, you need a directory. Create a folder under “/mnt”; you can name it anything you like. Here I name it “ssd-480g”. Why use the “/mnt” directory and not others? Because the “/mnt” directory is used for mounting devices like USB drives and hard drives. It’s a standard practice, but if you want to mount it to another directory, that’s fine too.

mkdir /mnt/ssd-480g
mount -t ext4 /dev/sdb1 /mnt/ssd-480g

6.Set automatic mounting on boot

Use the “fstab” file to set the hard drive to automatically mount at boot:

echo /dev/sdb1 /mnt/ssd-480g ext4 defaults 1 2 >> /etc/fstab

Supplemental information: The “echo” command outputs text to the console. “echo ... >>” redirects the output to a file, which in this case adds the line “/dev/sdb1 /mnt/ssd-480g ext4 defaults 1 2” to the “/etc/fstab” file. “fstab” is a configuration file that loads during boot, enabling the automatic mounting of hard drives. The format is “/partition-to-mount/directory-to-mount-to/filesystem-format/mount-options”. The last two numbers: the first one is for the “dump” tool, determining when to back up, and the second is for the “fsck” tool, setting the priority for filesystem checks.

7.Add the hard drive to PVE storage

After completing the above steps, go to the PVE > Datacenter > Storage > Add, and you can add the disk you mounted.

Name the ID as you like, enter the directory you mounted in the Directory field, and it is recommended to select all the options for Content. This ensures that you can store ISO files, containers, virtual machines, and other PVE-supported content in this directory.

Finally, you will see a new storage option under the virtual machine.

Backup your Proxmox VMs with the safest way

Vinchin Backup & Recovery is a powerful data protection solution designed for virtualized environments, including Proxmox. When backing up Proxmox virtual machines with Vinchin, users benefit from efficient backup and recovery features, utilizing incremental backups, deduplication, and compression technologies to significantly reduce storage usage while ensuring fast and stable backup processes. Its intuitive interface and automated backup tasks allow Proxmox users to easily manage large-scale VM backups and quickly restore them in case of failure, ensuring business continuity and data security.

It only takes 4 steps for you to backup Proxmox VE VMs:

1.Select the backup object.

Backup Proxmox VE VMs

2.Select backup destination.

Backup Proxmox VE VMs

3.Configure backup strategies.

Backup Proxmox VE VMs

4.Review and submit the job.

Backup Proxmox VE VMs

It offers a wide range of features, including V2V migration, allowing seamless transfers between different virtual platforms. Click the button below to download a 60-day free trial and experience it for yourself!

Proxmox mount disk FAQs

Q1: How do I mount an NFS share in Proxmox?

A: Install NFS utilities (apt install nfs-common), create a mount point (mkdir /mnt/nfs), and mount the NFS share with mount -t nfs <NFS_Server_IP>:/share /mnt/nfs. For persistence, add it to /etc/fstab.

Q2: How can I mount a ZFS dataset?

A: If you have ZFS set up, use zfs mount poolname/datasetname to mount the dataset. Normally, ZFS automatically handles mounting at boot.

Conclusion

Proxmox supports multiple storage technologies, including local storage, NFS, CIFS, iSCSI, LVM, and ZFS, making it flexible for diverse storage environments. In Proxmox VE, disk mounting is essential for making additional storage available to the system or individual virtual machines. Whether you're adding a new local hard drive, mounting a USB device, or attaching network storage like NFS or CIFS, the process requires both disk configuration and proper mounting to ensure seamless operation.

Share on:

Categories: VM Tips