On May 11, 2005, at 6:57 PM, Robert Citek wrote:
I created a knoppix.img file by choosing "Create a persistent KNOPPIX home directory" and placing it on /dev/hda1 which has 1.1 GB of free space. Unfortunately, I created it with only 10 MB thinking that's a good size to transfer to a USB stick if needed. I now realize that I need at least 100 MB for a project I'm working on. I don't want to redo the image file, especially since I've put in a fair amount of time customizing it. What to do?
The answer is to resize the image.
The reverse can also be done with a knoppix.img file. For example, I instead of 100 MB actually only need a 50 MB image, which I can later copy to a 64 MB USB stick. To adjust the size down, the steps are:
1) boot into Knoppix 2) mount the drive with the image 3) check the image 4) shrink the filesystem on the image to as small as possible 5) create a smaller copy of the image file 6) resize up to fill the image file
For example:
boot: knoppix 2 mount /dev/hda1 /mnt/hda1 cd /mnt/hda1 e2fsck -pf knoppix.img resize2fs knoppix.img 49M dd if=knoppix.img of=knoppix.50.img bs=1M count=50 resize2fs knoppix.50.img e2fsck -pf knoppix.50.img mv knoppix.50.img knoppix.img
When resizing the first time there's no reason not to guess a number less than what you think is possible. If you pick a size that is too small, resize2fs will tell you and not adjust the filesystem. Just be sure that your image is larger than your filesystem size within the image.
Regards, - Robert http://www.cwelug.org/downloads Help others get OpenSource software. Distribute FLOSS for Windows, Linux, *BSD, and MacOS X with BitTorrent
_______________________________________________ CWE-LUG mailing list [email protected] http://www.cwelug.org/ http://www.cwelug.org/archives/ http://www.cwelug.org/mailinglist/
