Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to mount a KVM-qemu disk image with this command: sudo mount -o loop,offset=32256 centos6.img /mnt/centos6. But it shows this error: you must specify filesystem type. As I have more partitions in my disk image I tried this solution. But that too gives same error.

Here is the output of fdisk -ul centos6.img:

Disk centos6.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001da69

      Device Boot      Start         End      Blocks   Id  System
centos6.img1   *        2048     1026047      512000   83  Linux
Partition 1 does not end on cylinder boundary.
centos6.img2         1026048    20971519     9972736   8e  Linux LVM
Partition 2 has different physical/logical endings:
     phys=(1023, 254, 63) logical=(1305, 106, 17)
share|improve this question
The answer here solved my issue. serverfault.com/questions/287070/… – nixnotwin Nov 13 '11 at 6:01
As I couldn't boot my vm image I wanted to edit the inittab file. But editing it hasn't solved the issue. – nixnotwin Nov 13 '11 at 6:04
up vote 2 down vote accepted

This worked for me:

kpartex -av cento.img

And mounting the loop device created in /dev/mapper:

mount /dev/mapper/loop0p1 /mnt/destination
share|improve this answer

2048 (starting sector) times 512 (sector size) is 1048576. So you should run

sudo mount -o loop,offset=1048576 centos6.img /mnt/centos6

The reason for the error message you got is that you told the kernel to look for a filesystem at some random unoccupied point on the disk. So it told you it didn't recognize a filesystem there.

See Reading a filesystem from a whole disk image for background.

You might try libguestfs, which can mount many VM disk images automagically.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.