How to mount existing disk to Storage

twentytwo

New Member
Jan 18, 2020
28
0
1
33
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
 

t.lamprecht

Proxmox Staff Member
Staff member
Jul 28, 2015
2,885
453
103
South Tyrol/Italy
shop.maurer-it.com
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.
 

twentytwo

New Member
Jan 18, 2020
28
0
1
33
Australia
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:

t.lamprecht

Proxmox Staff Member
Staff member
Jul 28, 2015
2,885
453
103
South Tyrol/Italy
shop.maurer-it.com

t.lamprecht

Proxmox Staff Member
Staff member
Jul 28, 2015
2,885
453
103
South Tyrol/Italy
shop.maurer-it.com
To make the mount permanent for a next reboot do the following:

echo 'UUID=d8871cd7-11b1-4f75-8cb6-254a6120 /mnt/bak ext4 defaults 0 2' >> /etc/fstab

(the two >> are really important)
 

karyuu

New Member
Jun 20, 2020
2
0
1
40
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
 

t.lamprecht

Proxmox Staff Member
Staff member
Jul 28, 2015
2,885
453
103
South Tyrol/Italy
shop.maurer-it.com
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.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!