How do I change size of virtual hd?
Forum: DSL Embedded
Topic: How do I change size of virtual hd?
started by: meo
Posted by meo on April 26 2005,16:39Hello 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.
Posted by cbagger01 on April 26 2005,17:05My 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)
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.
Posted by muellerr1 on April 26 2005,18:33I 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.
Posted by cbagger01 on April 26 2005,22:38I guess we can put this one into the "it works" column, then
Posted by roberts on April 27 2005,00:05I 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.
Posted by SaidinUnleashed on April 27 2005,15:50Hey, I'm not omnicient.
If you want/need/desire something to be added to the docs, send me a PM, or email me.
I'll add this later today.
Posted by SaidinUnleashed on April 27 2005,21:11< Docified. >
Posted by meo on April 29 2005,08:35Hi guys!
Thanks for all help. Now I can get wat I want.
Have fun out there,