Resizing Raspbian image for QEmu

June 2nd, 2013 by Xerxes Leave a reply »

I’m running Raspbian (Wheesy 2013-05-29) under QEmu just to make dev a bit quicker. The problem goes that the Raspbian image is 2GB which leaves only 200Mb free for apps/data.

To resize the image, start by resizing the image and giving it an extra 2GB (this is run on the host):

> qemu-img resize 2013-05-29-wheezy-armel.img +2G

Now boot into Raspbian and issue the following to resize the partition (from within linux):

1. > sudo fdisk /dev/sda
2. Print the partition table ("p"). Take note of the starting block of the main partition
3. Delete the main partition ("d"). Should be partition 2.
4. Create (n)ew partition. (P)rimary. Position (2)
5. Start block should be the same as start block from the original partition
6. Size should be the full size of the image file (just press "enter")
7. Now write the partition table (w)
8. Reboot (shutdown -r now). After reboot,
9. > sudo resize2fs /dev/sda2


When that’s all done, run “df -h” and you should have plenty of space.

Be Sociable, Share!

Related posts:

  1. CSS Rollovers without Image Flipping this technique changes the background-image offset, and the background...
  2. For everything else, there’s … Dual booting Linux and Windows – Free Resizing Windows partition...
  3. Turning your Asus eeeBox B202 into a XBMC I recently became owner and custodian of one of these...
  4. Run a command as Administrator under Windows To run any command under the credentials of a different...
  5. Relocating Your Windows Profile To A Different Location In the last few OS rebuilds of my machine, i’ve...

1 comment

  1. electronic says:

    I used to be suggested this web site by means of my cousin. I’m no longer certain whether or not this publish is written through him as no one else understand such unique about my problem. You are incredible! Thanks!