Solved

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

Posted on 2009-05-11
9
5,640 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
000webhost.com default error log 1 40
awk to variable in bash 2 70
CLI command keep running after close 7 36
When trying to install php-fpm on CentOS 7 - GPG error 2 43
#Citrix #XenApp #Citrix Scout #Citrix Insight Services #Microsoft VMMAP #Microsoft ADEXPLORE #Microsoft RAMMAP #Microsoft TCPVIEW #Microsoft AUTORUNS #Microsoft PROCESS EXPLORER #Microsoft PROCESS MONITOR
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

860 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