0

I have a task for university to deal with EXT2 file recovery. The problem is that the example drives (as IMG files) we got only contain one block group. I want to test if I read the drive correctly so I need more than one block group.

I tried to create an IMG file from my Kubuntu USB drive but did not manage to do it. I searched online but found not a single IMG file to download. Google only wanted to sell some ext2 drivers to me.

Where can I get an ext2 IMG file from?

1
  • This is a question you should ask your professor/TA. Most certainly all you need is contained in the given image. By thinking "outside the box" you are likely to approach the task in a way that is unnecessary cumbersome. Commented Dec 17, 2023 at 1:04

1 Answer 1

1

Not sure what you mean about block groups, but if I wanted an ext2 image I would first create an image file:

fallocate --length 1G test.img

This will create the file test.img in the current directory and uses the --length option to specify the image should be 1 gigabyte in size.

Then, create an ext2 filesystem onto the image:

mkfs.ext2 ./test.img

Now, you have an ext2 image you can mount and manipulate:

mount ./test.img /mnt/img

1
  • fallocate did not work for me, but I used this command. For some reason I was not able to create a file bigger than 128MB. dd if=/dev/urandom of=/mnt/d/image.img count=128 bs=1M Commented Dec 17, 2023 at 3:45

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.