Clifton Brosius asked 1 year ago
Title : How to mount a xenimg file in linux?

Question :

How to mount a xenimg file in linux?

1 Answers
Ruchin SinhaRuchin Sinha Staff answered 1 year ago

To mount the xen image of the whole drive, you need to know the partition layout and the offsets of each partition in the image file. parted command can be used to check the partition layout and the offsets. For eg.

ruchins@TestServer:/data$ parted system.img
WARNING: You are not superuser. Watch out for permissions.
GNU Parted 2.3
Using /data/system.img
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) unit B
(parted) print
Model: (file)
Disk /data/system.img: 42949672960B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32256B 42935961599B 42935929344B primary ntfs boot
(parted)

The above table shows that the image has one partition and has the offset at 32256. Below command can be used to mount this partition:
mount -o loop,ro,offset=32256 system.img /mnt/image/
Make sure that /mnt/image already exist.
 
Thanks,
Ruchin

Cubastion is among a very small number of specialized Siebel CRM Oracle Gold Partners in SME.