-   Linux - Software (
-   -   qemu raw file formatting and partitioning. (

JonathanWilson 08-09-2009 01:21 PM

qemu raw file formatting and partitioning.

I currenty have a number of WD Mybook worlds which run an embeded linux system on Arm926ej as NAT devices.

Now I have come up against some "limitations" on the new versions, namely that the WD supplied software doesnt support pluging in usb file systems other than fat32, dos, ntfs. Now quite why they don't by default is beyond me... but I'm guessing that as its a "consumer" device its really intended for a windows home environment.

Now while I have been playing with 1 stripped down box, so i can remove/re-create the original file system every time I break it I have come up against a few problems, the main one is that the busybox (shell) has a lot of the options turned off so I had an idea to use qemu to run the WD and linux software on my pentium linux system so I could change things to my hearts content and every time I broke it I'd just have to re-create the raw disk instead of moving hardware around.


Having studied qemu it seems that the raw format is basicaly a file mimicking a disk, in much the same way a CD image can be copied to a hd as a file using DD; infact as far as I can see it should be possible to DD my WD disk to a file, and then use qemu to boot it.

Where this all goes horibly wrong is the WD disk is huge (1TB) and all I really need is the first 3 partitions, and blank space prior to partition 1 (approx 8GB), and manually create partition 4 to a size more sutible, say 20G.


Now if i'm correct about linuxes everything is a file, it should be possible to somehow make the os see the file as a disk (loop device?, or some other method) and then partition/format/DD into the file.

My question is how?

I did try using "mount, -o loop..."(as described on a web page I found) but that doesnt work because obviously the file is empty to start with and mount requires a partition type, so some how I need to fool linux into seeing "myfile.dta" as "/dev/hdx" so I can use the standard partitioning tools.

Any help much appreciated.

linus72 08-09-2009 02:43 PM

I brlieve in mounting a partition img, you need to mount it as "hda", not hda1, etc

some distro's can mount the img's better than others
in that some have more stuff associated with img's
like tinycore

All times are GMT -5. The time now is 10:17 PM.