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 want to create an ISO image which can be mounted with an ext3 partition type. How can I do that?

I am using this command:

[root@manage upload]# dd if=testParti.txt of=./diskImage.iso
41+1 records in
41+1 records out

And then when I try to mount that using the following command:

/bin/mount -o loop -t ext3 diskImage.iso /tmp/upgrade

I get this error:

mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       or too many mounted file systems
       (aren't you trying to mount an extended partition,
       instead of some logical partition inside?)
share|improve this question
up vote 4 down vote accepted

dd only copies data, it does not make filesystems (you use mkfs for that).

Use dd to build an image of the desired size (play with bs= and count=, and use input from /dev/zero), then run mkfs.ext3 on the created file, then mount it like you're trying to do, and copy the desired files to the mounted directory, then unmount: now the image has the files you want.

Don't call it "iso image". It is a filesystem image. An ISO image is usually a filesystem image containing an ISO9660 filesystem.

share|improve this answer
Please give me whole technical process with commands. – Bhavik Ambani Feb 9 '12 at 10:44
Rather than take the time to write all zeros to the image file with dd, you can simply use truncate -s 10g foo.img to create a 10g empty sparse file. That way it starts out not using any disk space at all, and allocates space as you write to it, so you don't need 10g of disk space to hold the image when you only fill it with 2g of files. – psusi Feb 10 '12 at 15:11

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.