Mount raw file in another vm

cuteboyucsc

New Member
Mar 26, 2014
2
0
1
Hello!

To start with, I have a freenas drive and brought the space to proxmox server as iscsci lvm and attached to a vm. The vm was actually running resara(samba). Once the disk space added to the resara it has the added the followin entry /dev/sdb/ /volumes/harddisk ext3 rw,acl,user_xattrr 0 0
Because i have lost this vm now i want to attach this file system to a ubuntu desktop and recover data.
This vm--106--disk--3 is in RAW data format. I have also tried to mount the disk proxmox itself using http://centos.org/docs/5/html/Virtualization-en-US/ch-virt-accessing-data.html
But it says, mount: you must specify the filesystem type
Should i specify ext3 rw,acl,user_xattrr 0 0 ?
Please some one help!
 
you could try to mount it with nbd:

#modprobe nbd max_part=63
#man qemu-nbd
#qemu-nbd -c /dev/ nbd0p1 /dev/vgXX/vm-XXX-disk-1
(eg)

I did it once... since I had orphan LVs (vm disks)

from within pve itself it should work (be VERY careful!)

Marco
 
Last edited:
you could try to mount it with nbd:

#modprobe nbd max_part=63
#man qemu-nbd
#qemu-nbd -c /dev/nbd0 /dev/vgXX/vm-XXX-disk-1

I did it once... since I had orphan LVs (vm disks)

from within pve itself it should work (be VERY careful!)

Marco

Thanks! i did up to the level you mentioned, but just following what you said.
Didn't really try to understand what it does. As this is just a testing vmdisk i don't mind. So what i should do next ?
last one was, qemu-nbd -c /dev/nbd0 /dev/lvm/vm-106-disk-3
 
when you mount the LV with mbd, you have "mapped partitions" like /dev/nbdXXX
you can than mount those as usual partitions, with the mount command.
eg:
#mount /mnt/test /dev/nbdXXX

once it is mounted, you can move its content elsewhere easily.

BUT
if the LV is partitioned, you should have /dev/nbd0p1, /dev/nbd0p2, one for each partition.

[edit] you could need
#partprobe /dev/nbd0
[/edit]


if you have only /dev/nbd0, either you used
#modprobe nbd
and not
#modprobe nbd max_part=63 (I used this one)
(without max_part parameter nbd could not find partitions, and mount could fail)

or your LV has no partitions, but I'm not an expert.

If there are partitions, you will not be able to mount /dev/nbd0: you have to mount a mapped partition like /dev/nbd0p1, or so.
that was for me at least...

[edit]
see also posts on the web like
http://systemdilettante.blogspot.it/2013/04/mounting-qemu-disk-images.html
[/edit]

Marco
 
Last edited:

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!