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 have created an 200MB ext3 using the following commands.

dd if=/dev/zero of=./system.img bs=1000000 count=200
mkfs.ext2 ./system.img
tune2fs -j ./system.img

How can I resize it to 50MB and 300MB? The problem is I have only some binaries in my system. They are : badblocks,e2fsck, mke2fs, mke2fs.bin, parted, resize2fs, tune2fs

share|improve this question
up vote 8 down vote accepted

First, run a filesystem check, e2fsck -f ./system.img. Without this, it may proceed to enlarge the raw file, but fail to make any meaningful changes to the filesystem.

To reduce the size of the file system:

resize2fs ./system.img 50M

To enlarge:

resize2fs ./system.img 300M

resize2fs automatically adjusts the file size for you.

share|improve this answer
I just edited this answer to suggest running e2fsck first. I had problems where resize2fs would merely increase the size of the image file, without making any meaningful changes to the filesystem. – Aaron McDaid Dec 9 '14 at 15:29

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.