Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: How do I change size of virtual hd?, Smaller or bigger< Next Oldest | Next Newest >
meo Offline





Group: Members
Posts: 552
Joined: April 2004
Posted: April 26 2005,16:39 QUOTE

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


--------------
"Live and let live"   Treat others the way you want to be treated because that's what you should expect from them.

"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire
Back to top
Profile PM 
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: April 26 2005,17:05 QUOTE

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.
Back to top
Profile PM 
muellerr1 Offline





Group: Members
Posts: 18
Joined: April 2005
Posted: April 26 2005,18:33 QUOTE

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.
Back to top
Profile PM 
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: April 26 2005,22:38 QUOTE

I guess we can put this one into the "it works" column, then :)
Back to top
Profile PM 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: April 27 2005,00:05 QUOTE

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.
Back to top
Profile PM WEB 
7 replies since April 26 2005,16:39 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: How do I change size of virtual hd?

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code