Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A way of reading I think a vhd file? (SOLVED)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1079

PostPosted: Sun Mar 10, 2019 10:15 am    Post subject: A way of reading I think a vhd file? (SOLVED) Reply with quote

Hi to all gentoo up late at night, or morning depending on the location of the place you are. I actually wondered if there is a utility either in the linux kernel or userspace that is able to do something with a file that I have 150GB which I believe is an old virtual hard disk (.vhd format). Alternatively I guess that I could attempt from windows to mount it, because I know that possibly could be done. I just thought I would ask since the file is already on Gentoo box right now. Thanks much it will help my efforts to locate some missing virtual machines I can't seem to locate on the ever increasing number of disks for several boxes and even more disk drives.

Last edited by LIsLinuxIsSogood on Mon Mar 11, 2019 2:55 am; edited 1 time in total
Back to top
View user's profile Send private message
Leio
Developer
Developer


Joined: 27 Feb 2003
Posts: 487
Location: Estonia

PostPosted: Sun Mar 10, 2019 10:30 am    Post subject: Reply with quote

You could try mounting it; as root:
Code:
kpartx -av /path/to/vhd

If it works, it should report you a device mapper map which you can mount, e.g.:
Code:
mount /dev/mapper/loop0p1 /mnt/vhd_image

if loop0p1 was one of the maps reported and /mnt/vhd_image is a (empty) directory under which to mount that partition inside the image.

After you are done, you can unmount with umount /mnt/vhd_image and kpartx -dv /path/to/vhd

If that simple way doesn't work, it'll be a bit more complicated, maybe with qemu-nbd or some such.
_________________
GNOME team lead; GStreamer; MIPS/ARM64
Back to top
View user's profile Send private message
Goverp
l33t
l33t


Joined: 07 Mar 2007
Posts: 705

PostPosted: Sun Mar 10, 2019 12:23 pm    Post subject: Reply with quote

If it's not a disk image, good ole "file" might give you a hint.
_________________
Greybeard
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5917

PostPosted: Sun Mar 10, 2019 11:15 pm    Post subject: Reply with quote

qemu-nbd might help here, you'll need network blockdev support in the kernel for it.
Back to top
View user's profile Send private message
LIsLinuxIsSogood
Veteran
Veteran


Joined: 13 Feb 2016
Posts: 1079

PostPosted: Mon Mar 11, 2019 2:54 am    Post subject: Reply with quote

All good suggestions. They worked, more or less with a combination of qemu-nbd and mount commands. I had several other file formats so qemu-nbd was especially helpful with some of the proprietary virtual disk image formats. Thanks! marking as solved for now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum