Solved

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

Posted on 2009-05-11
9
5,622 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
  • 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
 
LVL 5

Expert Comment

by:0ren
ID: 24352454
also try this one
mount -v -s -o ro,loop /xen-disk /mount-point
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 5

Accepted Solution

by:
0ren earned 500 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:climbgunks
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

930 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now