DSL Embedded :: QEMU virtual harddrive



I tried to replace the existing QEMU virtual harddisk file "harddisk" by using "qemu-img create harddisk 500M" (I am using a  1 GB Lexar Jumpdrive)

The command line above creates a 500M file in the default RAW format.

Two questions:
1. Is RAW the correct format?
2. Are there default files on the default 60K harddisk that need to be copied to the new 500MB harddisk (if so is there a better method to upgrade the size of the virtual drive file)?

I do not use the qemu-img program. Instead I do everything from DSL.
To make the pseudo harddrisk I used the following 2 steps from DSL.

dd of=harddisk bs=1024 seek=60000 count=0

mke2fs harddisk  ( ignore the warning and proceed )

There are files on the default 60MB harddisk. The backup.tar.gz is there.
Since qemu is a "known" virtual machine, it has a pre-made backup.tar.gz on hdb The sound blaster modprobe is in the opt/bootlocal.sh.

If you make a larger pseduo harddisk, with a different name of course, then mount both the 60MB and your new one.

Something like this:

mkdir /mnt/test2

mount harddisk /mnt/test -o loop
mount newdrive /mnt/test2 -o loop

Then copy over the backup.tar.gz.

cp /mnt/test/backup.tar.gz /mnt/test2
umount /mnt/test
umount /mnt/test2

Then you can delete the 60MB one, rename the larger one to harddisk and you should be good to go.

Do you do the dd command from DSL running under qemu?  What direcotry are you in when you do the command?
Hello pcause!

I've made a small HOWTO about the matter (for personal reference) and here it comes:


HOWTO make a new virtual HD in DSL-embedded

Boot from DSL-embedded on a usb-drive

Make the new virtual hd in “Xshells -> Root Access”

#mount -rw /dev/hda1 /mnt/hda1

#dd if=/dev/zero of=/mnt/hda1/harddisk bs=1024 count=410000
(This will create a 400 MB virtual drive; that's what I use)

#mke2fs /mnt/hda1/harddisk
(Just ignore any warning and proceed)


Copying over files to the new hd

#mount /mnt/hdb

#mount /mnt/hda1/harddisk /mnt/test -o loop

#cp /mnt/hdb/backup.tar.gz /mnt/test

#umount /mnt/hdb

#umount /mnt/test

As you can see I prefer to make the new drive on hda1 and that means I can use the actual name harddisk. So you can do it either ways.

Have fun,
meo

Thanks and that is an excellent write up.  Unfortunately, my laptop can't boot from a USB device.  Is there was way to do this from DSL running on qemu?
Next Page...
original here.