Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-05-11
9
Medium Priority
?
5,763 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
Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

 
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

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.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses
Course of the Month12 days, 6 hours left to enroll

972 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