Local folder or IDE drive pass through

reetp

Renowned Member
Aug 19, 2013
67
11
73
Hi,

I want to install a server on a KVM but need to recover data from a backup drive which somehow needs to be mountable by the new OS.

The drive is one part of the original RAID 1 mirror from the original server. I can mount it OK locally with mdadm and vgchange.

Any suggestions ?

B. Rgds
John
 
I'm a little confused. This is how I read this:

- You have a server with Proxmox installed already
- You have a kvm guest on the proxmox host
- You have a drive installed in the Proxmox host, and you can mount it with mdadm and vgchange.
- You're asking how to transfer all data on this drive to the kvm guest?

If everything I said above is true, mount it locally (i.e. on the proxmox host). Setup a nfs share on this local folder, then mount that nfs share on your kvm guest.
 
You just want to make the old RAID 1 disk you have accessible inside of a VM so you can copy data from it into the VMs disk?

If so, you can manually edit the VM config file to do this.
1. Stop the VM
2. Do your mdadm/vgchange magic to make the device accessible
3. backup your vm config file
4. Manually edit the VM config file, add something like this:
Code:
ide4: /dev/path/to/block/device/you/want/accessible/in/your/vm
5. start the VM
 
You just want to make the old RAID 1 disk you have accessible inside of a VM so you can copy data from it into the VMs disk?

Yup, that's the size of it. I use SME server. I want to effectively restore the data & settings directly from the disk. I could mount it via NFS as per the suggestion above but I'd rather use the tools to hand rather than installing more stuff.

If so, you can manually edit the VM config file to do this.
1. Stop the VM
2. Do your mdadm/vgchange magic to make the device accessible
3. backup your vm config file
4. Manually edit the VM config file, add something like this:
Code:
ide4: /dev/path/to/block/device/you/want/accessible/in/your/vm
5. start the VM

Thanks I'll give that a whirl. I presume that is a straight forward passthrough and I should be able to mount it as a RAID/LVM item in the Guest ?

Thanks for the suggestions

B. Rgds
John
 
Thanks I'll give that a whirl. I presume that is a straight forward passthrough and I should be able to mount it as a RAID/LVM item in the Guest ?

Thanks for the suggestions

B. Rgds
John

You can pass in the whole disk and do the RAID/LVM in the guest, eg:
Code:
ide4: /dev/sdb

Of you can do the RAID/LVM in the host and pass in just the logical volume you need, eg:
Code:
ide4: /dev/volgroup/volume

If you pass in the whole disk might also be best to edit the filter setting in /etc/lvm/lvm.conf to exclude that disk from the host.
Honestly I have no idea if that would be necessary just a thought that crossed my mind.
You can find an example of how to do this in the DRBD section of the wiki.
 
Excellent and thanks again - I'll try both methods and report back.

B. Rgds
John
 
Ok, I tried both methods but the guest fails to see the drive.

I tried both :

ide4: /dev/sda

ide4: /dev/main/root

Log reports :

vm 100 - unable to parse value of 'ide4' - unknown setting 'ide4'

So Proxmox doesn't like the line and doesn't pass it to the guest.

When I have the LVM active Proxmox can see it - I tried to add it as a storage option and it can see the LVM.

Clearly the command line is not right. If I try to refresh the Virtual machine management page it does lot list the ide4 option which I would have expected it to do.

Absolutely no idea what to do now so any help or advice appreciated !

B. Rgds
John
 
you cannot use ide4. there are only 4 ide devices allowed - ide0, ide1, ide2 and ide3.
 
Doh! Looks like my geek card needs revoked.
I knew there were 4, just forgot they started with 0 not 1.

Hahahahahahahaha. Glad I'm not the only one who makes mistakes like that :)

Will go back and try again !

B. Rgds
John
 
OK, I can mount the drive if I pass through the whole drive, but not if it is already activated as a LVM on the host.


ide0: /dev/main/root

kvm: -drive file=/dev/main/root/,if=none,id=drive-ide0,aio=native,cache=none: could not open disk image /dev/main/root/: Not a directory

Failed exit code 1



ide0: /dev/sda

this worked. The guest OS picked up and activated the RAID and I then activated the LVM and could then mount the drive.


Make sure you have mdadm installed on the guest. If it doesn't automatically start the RAID then use the following line and replace it with your drive and partition number.

In the guest :

mdadm -A --verbose /dev/md5 /dev/sdxy

Then start the LVM :

vgchange -a y

Have a look to see it is there

pvscan

Mount the LVM :

mkdir /mnt/temp

mount /dev/main/root /mnt/temp

You should now be able to see the files in the guest.

I would still be interested in how to get the volume passed through if anyone has any other suggestions ?

B. Rgds
John
 

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!