DSL Embedded :: How do I change size of virtual hd?
Hello everybody!
Just a quick question: How do I change the size of the virtual hd in dsl embedded (either making it bigger or smaller)? I would be grateful for any help.
Have fun,
meo
My guess is that it can be done directly in DSL by using the "dd" command to create a new blank hd image file. Then you can either format the image file directly in linux with mkfs or you can boot into DSL embedded and run cfdisk and mk2fs to partition and format it just like a real hard drive.
Something like this (totally untested):
dd if=/dev/zero of=/mnt/sda1/newfile.img bs=1M count=30
(for a 30MB file)
and
mkfs -t ext2 /mnt/sda1/newfile.img
and then rename your old harddisk file and change newfile.img filename to the harddisk file name.
That's the general idea, anyways.
But the way that I used many moons ago was to install QEMU for windows from the QEMU windows download page. They include a virtual hard drive setup batch file that you can run and create your new virtual hard drive.
I did this, then mounted the new file in loopback (sudo mount -o loop new_harddisk /mnt/test), then copied my files over from the current harddisk in /mnt/hdb. I had been making files with dd forever and not getting them to mount until I discovered that I was missing the 'mke2fs new_harddisk' part.
Another thing to remember is that there is a certain amount of overhead involved when you format the file; my 160 MB harddisk file really has more like 154 MB usable because some gets eaten by the formatting. I used a 1K block size. Is that why?
Instead of dd, qemu-img.exe will create a new harddisk file for you in windows (look at the qemu docs to see how) but it won't format it. I needed linux for that.
I guess we can put this one into the "it works" column, then
I answered this back in Janunary, You would think it would have found its way into the docs by now.
You need to copy over some default files or you will break things.
Next Page...
original here.