Solved

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

Posted on 2009-05-11
9
5,617 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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
Will try to explain how to use the VMware feature TAGs in the VMs and create Veeam Backup Jobs using TAGs. Since this article is too long, I will create second article for the Veeam tasks.
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…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…

743 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

13 Experts available now in Live!

Get 1:1 Help Now