I'm testing out different distros for the RPi and I want to look at XBian. I only have 1 SD card, so I'm using BerryBoot. I tried to convert the Xbian img to SquashFS format, but there's an issue. You can see some of it here http://forum.xbian.org/thread-280-post-2870.html

Basically, the image is screwed up. So I tried to boot XBian on a borrowed SD card, interrupt the boot w/ Control+C, then used dd bs=1M if=/dev/mmcblk0 of=/media/sda1/backup.img

Then on a separate PC, used mksquash on the backup.img, then installed the img file in BerryBoot, but now I get a problem. When booting the img it says: fsck.ext4: No such device or address while trying to open /ren/rootdev Possibly non-existent or swap device? fsck died with exit status 8

Then a maintenance shell is started which I try to fsck, but it says /dev/mmcblk0p2 is in use so it aborts. What did I do wrong or what can I do to fix the img from the Xbian site?

2 Answers 2


If you made an image of a running system (by booting it and using dd on the mounted root partition) then it will have problems, because the resulting image will be in a state as if it were running; then when you try to boot it some things will not make sense. You need to make an image of the root partition as it is when the system on it is not running.

As it says on the BerryBoot page,

Most Raspberry Pi operating system images are disk images containing two partitions. A FAT partition with the boot loader and kernel files, and a second ext4 partition with everything else. We are interested in the second partition.

I have not used Xbian but, since it is based on raspbian, this is probably how its image is too. If so, you need to write that image to an SD card (as you already have) and copy the second partition from the SD card. But do not boot the SD card to do this.

Windows doesn't even see ext partitions, last time I checked, so you will have to insert the card into a linux box, look at it with fdisk to make sure there are the two partitions there, then dd the 2nd (ext4) partition and squashFS it. It would probably be a good idea to start with the image freshly installed to the SD card, or to boot it and shut it down properly first.

If you don't have a linux install you could use a live CD from ubuntu, fedora, et. al. I believe there are ext tools for OSX -- technically, you don't need to read the partition anyway, you just need it recognized as a partition and use some block level copy tool like dd.

  • Nope, I figured it out. You can do this just fine from the RPi after booting into XBian, but before the GUI starts or any other processes start really. See my answer. This may not be the "safest" way to do what I wanted, but it worked.
    – reeeky2001
    Feb 20, 2013 at 18:07

I figured out what to do to get this how I wanted. Seeing as I don't have a PC that has an SD card reader that is supported by Linux, I had to do the following:

On the RPi, use Control-C to interrupt the boot of XBian. sda1 being my USB drive.

    $ dd bs=1M if=/dev/mmcblk0 of=/media/sda1/XBian-backup.img

Then on a separate machine

    $ sudo kpartx -av XBian-backup.img 
    add map loop2p1 (252:5): 0 117187 linear /dev/loop0 1
    add map loop2p2 (252:6): 0 3493888 linear /dev/loop0 118784
    $ sudo mount /dev/mapper/loop2p2 /mnt

Go to /mnt/etc/ and commented out all the entries in fstab

    $ sudo mksquashfs /mnt /media/sda1/xbian-bb.img -comp lzo -e lib/modules
    $ sudo umount /mnt
    $ sudo kpartx -d XBian-backup.img

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.