Mount You must specify the filesystem type

I encountered this error while trying to mount an image created using qemu. The command from the docs says to run the following command to mount it on the loopback device.


mount -o loop,offset=32256 debian.img ./mntpoint

This is completely wrong because the data start is not 32kb into the image file. To figure out where it starts you need to use the following commands:

]$ fdisk -ul debian.img

you must set cylinders.
You can do this from the extra functions menu.

Disk debian.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: 0x00077ccb

     Device Boot      Start         End      Blocks   Id  System
debian.img1   *        2048     5785599     2891776   83  Linux
Partition 1 does not end on cylinder boundary.
debian.img2         5787646     6141951      177153    5  Extended
Partition 2 does not end on cylinder boundary.
debian.img5         5787648     6141951      177152   82  Linux swap / Solaris

Once you have this output you can see that the data starts at sector 2048 and since sector size is 512 on my image I need to set the offset to 512*2048. So the final working command is:

mount -o loop,offset=$((512*2048)) -t ext3 ./debian.img ./mntpoint


and we now have a mounted image file.
Add to delicious Digg This Add to My Yahoo! Add to Google Add to StumbleUpon
| | Comments (0) | TrackBacks (0)

0 TrackBacks

Listed below are links to blogs that reference this entry: Mount You must specify the filesystem type.

TrackBack URL for this entry: http://www.hjackson.org/mt/mt-tb.fcgi/295

Leave a comment

About this Entry

This page contains a single entry by Harry published on March 2, 2012 11:00 PM.

Changing your keymap was the previous entry in this blog.

qemu bridged networking is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.01