Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I mount a Xen disk image to extract files from it?

Posted on 2009-05-11
9
Medium Priority
?
5,725 Views
Last Modified: 2013-11-11
How do I mount a Xen disk image to extract files from it?

I have successfully mounted 1 Xen disk image using this command:  
mount -o loop /xen-disk /mount-point

The second Xen disk image I am trying to mount using the same command gives me the following error:  mount: you must specify the filesystem type

I  have tried Ext3 Ext 2 and auto, to no avail.

If i specify Ext3 it suggests to run dmesg | tail, the output is as below:
# dmesg | tail
hfs: unable to find HFS+ superblock
hfs: unable to find HFS+ superblock
hfs: unable to find HFS+ superblock
VFS: Can't find ext3 filesystem on dev loop0.
VFS: Can't find an ext2 filesystem on dev loop0.
hfs: unable to find HFS+ superblock
hfs: unable to find HFS+ superblock
hfs: unable to find HFS+ superblock
hfs: unable to find HFS+ superblock
VFS: Can't find ext3 filesystem on dev loop0.

]# uname -a
Linux 2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

Any ideas?


0
Comment
Question by:medfacit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 5

Expert Comment

by:0ren
ID: 24352361
did you had a clean umount on that image ?
0
 

Author Comment

by:medfacit
ID: 24352405
Possibly not, the image was running over an nfs export that was flakey and had to be shut down.  Also cant bring it back up to shut down cleanly either.  

Are there tools that can be run on the file to fix this?
0
 
LVL 5

Expert Comment

by:0ren
ID: 24352438
im not sure

you can try dd it into a file and then try to mount
if it doesnt work use the tool dd_rescue
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 5

Expert Comment

by:0ren
ID: 24352454
also try this one
mount -v -s -o ro,loop /xen-disk /mount-point
0
 
LVL 5

Accepted Solution

by:
0ren earned 2000 total points
ID: 24352464
another option:

losetup /dev/loop1 your_zen_disk
e2fsck -f /dev/loop1

and then try to mount
0
 

Author Comment

by:medfacit
ID: 24361144
Thanks will try these out.
0
 
LVL 11

Expert Comment

by:Todd Mummert
ID: 24365599

If this is a raw disk image, and not just a single partition, then you have to specify the offset of the partition as well.  Use fdisk, or sfdisk, to determine the partition offset.   For example:

root@ghostrider:~# sfdisk -d disk.raw
# partition table of disk.raw
unit: sectors

disk.raw1 : start=       63, size= 41190597, Id=83, bootable
disk.raw2 : start= 41190660, size=   738990, Id= 5
disk.raw3 : start=        0, size=        0, Id= 0
disk.raw4 : start=        0, size=        0, Id= 0
disk.raw5 : start= 41190723, size=   738927, Id=82

From sfdisk above, the linux partition can be found at the start of sector 63, sectors are 512 bytes.   For fdisk,  run 'fdisk -lu disk.raw'

  Now, run the mount command as:

root@ghostrider:~# mount -o loop,offset=$((63*512)),ro disk.raw mnt-point

0
 

Author Comment

by:medfacit
ID: 24372013
Hi All,

Thanks for all of your help.

The disk needed to be recovered.

Solution was as follows:

losetup -o 1151539200 /dev/loop2 /xen_disk
fsck /dev/loop2
mount /dev/loop2 /mnt

0
 

Author Closing Comment

by:medfacit
ID: 31580054
Thanks for your help!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question