Click to See Complete Forum and Search --> : ext2 file -> partition help ...


cjanscen
11-20-2003, 04:26 PM
I have an ext2 filsystem image in a file, that I can mount and play around with and all that...but I also have an extra partition/blank space on my hard drive that I want to put it on...how do I do this?

Something with dd perhaps? It kinda boggles the mind because I can't figure out what exactly I need to do:

I was thinking try:

1) make a 'linux' partition in the empty space

2) dd the file to the partition (dd if=./file of=/dev/hda2 ...)

3) resize it to fill the ntire partiton

Does this sound right?

Thanks in Advance!

bigrigdriver
11-20-2003, 07:14 PM
I'm not certain, but it seems to me that, if dd can be used to make boot disks, why not a bootable partition?
The part I take issue with is resizing the partition so that the image takes up the entire partition. You may find
the partition un-bootable, or, at best, bootable to runlevel 3 only (text mode). I did a recursive copy
incorrectly once, and filled my partition. All went well, until I shut down and later tried to re-boot. Couldn't
get a graphical interface; not enough memory (hard disk). Luckily, I was sufficiently familiar with the directory
structure that I was able to manually search out the directories I needed to delete to make room on disk
for the tmp files that are loaded for the graphical interface. So, I'd guess that if you resize the partition so
that the iso image fills it, you may not be able to boot at all, or you may be limited to command line.
Just a guess. Hope this info is correct, and is helpful.

swiftnet
11-20-2003, 07:53 PM
If the partiton is not a bootable partition, why don't you mkfs.ext2 (or3) on the empty partition and then mount your ext2 image and do a cp -Rf - or am I missing something?

cjanscen
11-21-2003, 02:57 AM
Thanks for the replys, but I actually just mesed around and figured it out like this:

1) make an empty parttion, of type linux

2) do:

dd if=/fs_image of=/dev/hdx

3) now just resize the filesystem to fill up the rest of the partition:

resize2fs /dev/hdx

You might have to 'fsck -f' the file/filesystem before you resize it. Now it just mounts like any old parttion!

mount /dev/hdx /mnt/point -t ext2

PS: