How to mount existing disk to Storage

twentytwo

New Member
Jan 18, 2020
28
0
1
38
Australia
Hi,

My Proxmox played up and decided to do fresh clean installation, I have VM backups on dev/sdd (Spinning Disk) and want to know how can I mount the existing disk that has backups on it to Storage so that I can hopefully perform the restore method to get my VMs back. Can anyone assist me to what step I need to do to mount the drive without wipe the drive clean..

Regards

William
 
For now you mount it anywhere, e.g. as you already know which block device the data is one you just need to find out which sub-partition is required, the following command should help: lsblk -o +FSTYPE,UUID /dev/sdd*
Check out which /dev/sddX partition one is bigger and has a filesystem on it, that's the one you want to use, probably there's only one anyway.

To mount it use the following CLI commands:
Code:
mkdir /mnt/bak
mount /dev/sddX /mnt/bak

(this is only persistent until the next reboot)

You should then be able to browse the files of that storage in "/mnt/bak"

If this was a backup storage managed by PVE it should have the correct directory structure, so you could add that directory as PVE storage configuration with:

pvesm add dir bak --path /mnt/bak --content backup

To make it permanent you need to add a /etc/fstab entry too.
 
After I typed this lsblk -o +FSTYPE,UUID /dev/sdd*

The result are here
Code:
sdd    8:48   0  3.7T  0 disk
└─sdd1
       8:49   0  3.7T  0 part            ext4   d8871cd7-11b1-4f75-8cb6-254a6120                                    72f6
sdd1   8:49   0  3.7T  0 part            ext4   d8871cd7-11b1-4f75-8cb6-254a6120                                    72f6

2.
mkdir /mnt/bak
mount /dev/sdd1 /mnt/bak

3. Reboot

4. pvesm add dir bak --path /mnt/bak --content backup

5. Check Storage and can see bak mounted and doubled clicked it and nothing in the content :-(

6. I am not sure what to do next.
 
Last edited by a moderator:
My disk can not mount as dir, I used the following code:

root@pve:~# lsblk -o +FSTYPE,UUID /dev/sdb*
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT FSTYPE UUID
sdb 8:16 0 1.1T 0 disk
└─sdb1 8:17 0 1.1T 0 part ext4 b6ff3b3e-6e00-4279-8d6f-7341bbbfba88
sdb1 8:17 0 1.1T 0 part ext4 b6ff3b3e-6e00-4279-8d6f-7341bbbfba88
root@pve:~# mount /dev/sdb1 /mnt/pve/SASBK
mount: /mnt/pve/SASBK: mount(2) system call failed: Structure needs cleaning.

In the UI mode, I found my sdb shows partitions.

How can I fix this to mount this disk, all the backdata is in this disk.

Thanks
 
Code:
root@pve:~# mount /dev/sdb1 /mnt/pve/SASBK
mount: /mnt/pve/SASBK: mount(2) system call failed: Structure needs cleaning.

Your disk wasn't unmounted cleanly and/or may even be corrupted.

I'd do a plain backup first of its data with dd to some other medium, then use e2fsck to try to repair it.
 
Hi there

I am having simialr matter at hand. I however I can read my disk fine using terminal, I need to know how I add that disk as part of my storage in order to attach the VM images there and I can boot them.?
 
Hi,

this thread already explains about how to add an existing filesystem as permanent mount to a PVE host and how to add that then as directory storage for use with guests, ISO images, backups, ...

What exactly is not clear, what did you try, what did not work, ...?
 
I got the the disk mounted and I can access it via terminal, however I can add that on PVE interface so that I can access it was a directly.
 
I managed to export my qcow2 file and converted to vdi the. Accessed the file. Got what I wanted thanks.
 

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!