[SOLVED] Restore external drive after crash

user789

New Member
Mar 1, 2020
12
1
1
34
Hi all,

My Intel NUC with Proxmox running on it crashed today, after a failed attempt to resize the main drive. However most of the VM's were on the second drive which hasn't changed. Right now I installed Proxmox again and when I run the command fdisk -l . It tells me the data is still there. I was wondering if there is a possibility to import the VM's again.

Thanks in advance!

Output of fdisk -l below:
root@proxmox:/dev# fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10SPZX-24Z
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sdb: 477 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: TOSHIBA KSG60ZMV
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 93CA2834-D9C5-40C4-BF04-3F23ADA73F3D

Device Start End Sectors Size Type
/dev/sdb1 34 2047 2014 1007K BIOS boot
/dev/sdb2 2048 1050623 1048576 512M EFI System
/dev/sdb3 1050624 1000215182 999164559 476.4G Linux LVM

Partition 1 does not start on physical sector boundary.


Disk /dev/mapper/pve-swap: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/pve-root: 96 GiB, 103079215104 bytes, 201326592 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/HDD-vm--104--disk--0: 600 GiB, 644245094400 bytes, 1258291200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: DA2E1AD3-2299-4A98-9034-A7B0FD2DBD94

Device Start End Sectors Size Type
/dev/mapper/HDD-vm--104--disk--0-part1 2048 4095 2048 1M BIOS boot
/dev/mapper/HDD-vm--104--disk--0-part2 4096 2101247 2097152 1G Linux filesystem
/dev/mapper/HDD-vm--104--disk--0-part3 2101248 1258291166 1256189919 599G Linux filesystem


Disk /dev/mapper/HDD-vm--101--disk--0: 300 GiB, 322122547200 bytes, 629145600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 91CDB41C-19F9-4A23-9C48-7D57AA4F0B19

Device Start End Sectors Size Type
/dev/mapper/HDD-vm--101--disk--0-part1 2048 4095 2048 1M BIOS boot
/dev/mapper/HDD-vm--101--disk--0-part2 4096 2101247 2097152 1G Linux filesystem
/dev/mapper/HDD-vm--101--disk--0-part3 2101248 629143551 627042304 299G Linux filesystem
root@proxmox:/dev#
 
The VMs config files are stored in /etc/pve/qemu-server directory.
If you dont have a backup of these ".cfg-files" you need to re-create the VM config.
You currently only have the disk-images left what you can see on the disk.
So just build your VMs and point them to the data-sources you have. Make sure the VM-ids match the disks you got (101, 104). Otherwise Proxmox wouldn't offer them as existing disks.
If you need to give a vm a specific ID, got to the /etc/pve/qemu-server directory and rename the configuration to the desired ID.
Has worked for me plenty of times.
 
Worked perfectly, thanks!
Could you please mark the thread as solved? Edit the first post and select the prefix next to the title. Thanks a lot :)