Adding an existing HDD to Proxmox

Apr 30, 2021
14
0
6
57
This has probably been asked 1000 times, but can I find a simple solution? Nope.

I've had to reinstall proxmox. I have an existing drive that contains all the zipped backups of my VM's so I DO NOT want to format it!

If I go to node > Disks. I can see it there as dev/sda1

Can someone walk me through adding this back to my system please as I keep getting an error saying that the directory already exists and I'm now stuck.

Many thanks :D
 

Attachments

  • 1.png
    1.png
    43.6 KB · Views: 783
  • 2.png
    2.png
    51.9 KB · Views: 700
Edit your /etc/fstab to mount that ext4 partition of the disk. Or manually mount it with the mount command in case you need that disk only once for the restore and want to remove it afterwards.
Then go to Datacenter -> Storage -> Add -> Directory. Point it to the mountpoint of the ext4 partition and choose Vzdump backup as your content type. Then run pvesm set Id OfYourDirectoryStorage --is_mountpoint yes so new backups won't screw up your root filesystem in case mounting of the ext4 partition fails.
 
Last edited:
  • Like
Reactions: Kingneutron
Many thanks for your reply. Would something like this be ok to put in /etc/fstab ?

/dev/sda1 /mnt/test ext4
 

Attachments

  • 1669065893849.png
    1669065893849.png
    183.7 KB · Views: 817
Many thanks for your reply. Would something like this be ok to put in /etc/fstab ?

/dev/sda1 /mnt/test ext4
That is not a complete line.

I would do it this way:
1.) create that mountpoint first: mkdir /mnt/backupHDD
2.) find out the UUID or PARTUUID of the partition of your backup disk. In your case of sda1: blkid | grep sda1 | grep UUID=
3.) edit fstab: nano /etc/fstab
Add something like this there in case you found a PARTUUID:
Code:
PARTUUID=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxx   /mnt/backupHDD   ext4   defaults   0   2
Save it with CTRL + X, Y.
4.) mount it by running mount -a
5.) Check that your backups are there: ls -la /mnt/backupHDD
6.) Add a new directory storage pointing to that mountpoint using the webUI at Datacenter -> Storage -> Add -> Directory or do it using the CLI like this: pvesm add dir backups --is_mountpoint 1 --path /mnt/backupHDD --content backup --shared 0. In case you have choosen the webUI and not the CLI, enable the "is_mountpoint" with pvesm set IdOfYourDirectoryStorage --is_mountpoint yes. In case your dump directory isn't in the root of that filesystem you might need to use pvesm set IdOfYourDirectoryStorage --is_mountpoint /mnt/backupHDD and point the path to the folder that is containing the dump dir.
 
Last edited:
@Dunuin, what a l i f e s a v e r ! ! :) Why oh why isn't this in the Proxmox User Guide?! (rhetorical)
@MuttleyDoSomething, same situation as you, had all my backups, thinking I'm set ... then couldn't blinking access them on reinstall!
 
That is not a complete line.

I would do it this way:
1.) create that mountpoint first: mkdir /mnt/backupHDD
2.) find out the UUID or PARTUUID of the partition of your backup disk. In your case of sda1: blkid | grep sda1 | grep UUID=
3.) edit fstab: nano /etc/fstab
Add something like this there in case you found a PARTUUID:
Code:
PARTUUID=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxx   /mnt/backupHDD   ext4   defaults   0   2
Save it with CTRL + X, Y.
4.) mount it by running mount -a
5.) Check that your backups are there: ls -la /mnt/backupHDD
6.) Add a new directory storage pointing to that mountpoint using the webUI at Datacenter -> Storage -> Add -> Directory or do it using the CLI like this: pvesm add dir backups --is_mountpoint 1 --path /mnt/backupHDD --content backup --shared 0. In case you have choosen the webUI and not the CLI, enable the "is_mountpoint" with pvesm set IdOfYourDirectoryStorage --is_mountpoint yes. In case your dump directory isn't in the root of that filesystem you might need to use pvesm set IdOfYourDirectoryStorage --is_mountpoint /mnt/backupHDD and point the path to the folder that is containing the dump dir.
Nothing else but to say THANKS!
 
New Proxmox installation - and followed these steps -- AWESOME details.

I shut down the server, to swap out a PCI card and did not plug in the USB drive and the system would not boot fully until I plugged it in.

When I shut down again and plugged it in - and booted the server...it came up.

Why is this? Here is my /etc/fstab file below:

# <file system> <mount point> <type> <options> <dump> <pass>
/dev/pve/root / ext4 errors=remount-ro 0 1
UUID=386C-3C38 /boot/efi vfat defaults 0 1
/dev/pve/swap none swap sw 0 0
proc /proc proc defaults 0 0

#External WAVLink SSD for backups (26-Feb-2024)
PARTUUID=b3d3ac2d-e876-46b2-83fe-dad702289206 /mnt/backup ext4 defaults 0 2
 
Last edited:
Are you sure it is not booting? Removing PCIe cards usually mean your network won't work anymore because the interface enumeration will change and SSH + webUI won't work any longer until you put back that PCIe card or use keyboard+display to fix the network config file.

And when you put something in fstab the system won't boot with the disk defined there missing. In such a case you might want to use something else instead like systemd or autofs to mount your external non-permanently-attached disk.
 
Last edited:
That is not a complete line.

I would do it this way:
1.) create that mountpoint first: mkdir /mnt/backupHDD
2.) find out the UUID or PARTUUID of the partition of your backup disk. In your case of sda1: blkid | grep sda1 | grep UUID=
3.) edit fstab: nano /etc/fstab
Add something like this there in case you found a PARTUUID:
Code:
PARTUUID=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxx   /mnt/backupHDD   ext4   defaults   0   2
Save it with CTRL + X, Y.
4.) mount it by running mount -a
5.) Check that your backups are there: ls -la /mnt/backupHDD
6.) Add a new directory storage pointing to that mountpoint using the webUI at Datacenter -> Storage -> Add -> Directory or do it using the CLI like this: pvesm add dir backups --is_mountpoint 1 --path /mnt/backupHDD --content backup --shared 0. In case you have choosen the webUI and not the CLI, enable the "is_mountpoint" with pvesm set IdOfYourDirectoryStorage --is_mountpoint yes. In case your dump directory isn't in the root of that filesystem you might need to use pvesm set IdOfYourDirectoryStorage --is_mountpoint /mnt/backupHDD and point the path to the folder that is containing the dump dir.
Thank you, Dunuin. I followed this guide. But I still don't know how to access the ext4 partition. It does not show in the Create Directory menu. In the end I wanted to access the folder called H0a_Books_BD_Audiobooks. And afterwards use that in a VM running on Proxmoxx

Any suggestions on what I can do after point 6 in order to have that available? Thank you so much!
 

Attachments

  • Screenshot 2024-03-19 144043.png
    Screenshot 2024-03-19 144043.png
    19.6 KB · Views: 99
  • Screenshot 2024-03-19 144324.png
    Screenshot 2024-03-19 144324.png
    8.8 KB · Views: 98
Thank you, Dunuin. I followed this guide. But I still don't know how to access the ext4 partition. It does not show in the Create Directory menu. In the end I wanted to access the folder called H0a_Books_BD_Audiobooks. And afterwards use that in a VM running on Proxmoxx

Any suggestions on what I can do after point 6 in order to have that available? Thank you so much!
You can't use data you mounted on the PVE host in a VM. If you want to use that in a VM I would mount that disk in a NAS VM sharing it via SMB/NFS and then mount that NFS/SMB share in your VM.
 
You can't use data you mounted on the PVE host in a VM. If you want to use that in a VM I would mount that disk in a NAS VM sharing it via SMB/NFS and then mount that NFS/SMB share in your VM.
Wait! I thought I first had to mount the drive in Proxmox and than mount it in the VM running on Proxmox. In my case, OpenMediaVault

I don't understand what you are suggesting. :/
 
OMG! OMG! Thank you so much! This is what I was looking for. Thank you! Thank you! Thank you!
 
I quick question regarding this. I followed a tut and managed to make a passthrough using the following commands:
Check UUID of drives: ls -n /dev/disk/by-id/
Make a passthrough: /sbin/qm set [VM-ID] -virtio2 /dev/disk/by-id/[DISK-ID]

Everything works great!

Any idea how I can unmount / stop the passthrough? Just in case I want to move that drive again.
Thank you so much!
 
Hey @Dunuin I ran into the same problem as above, but upon mounting my partition onto a mount point, I am getting:

wrong fs type, bad option, bad superblock on /dev/sdal, missing codepage or helper program, or other error.
dmesg (1) may have more information after failed mount system call.

The hard drive in question for me is in ntfs (as it was part of a windows machine), and now want to use this drive on proxmox, from a VM.

Is there any way I can use this drive properly with the data intact, or the only way is to change the filesystem (and erasing its entirety, I'm guessing)?

Thanks!
 

Attachments

  • 1711023792324.png
    1711023792324.png
    35.3 KB · Views: 27
  • Screenshot 2024-03-21 175016.png
    Screenshot 2024-03-21 175016.png
    11.1 KB · Views: 26
  • Like
Reactions: moldytexas

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!