Posted on Leave a comment

Emergency recovery shell in berryboot

Every now and again you would experiment with things in raspberry pi, in this instance I am playing around with the wall display called Dakboard, so I modify the config.txt file /boot, and because I had berryboot, it freak out and drops to “emergency recovery shell”.

In order to restore the config.txt file do the following in the command line, because berry boot doesn’t haveĀ  /boot partition by design we will have to create one:

cd /
mkdir boot
mount /dev/mmcblk0p1 /boot
vi /boot/config.txt

At this point you can edit the config back to the original or restore it from the backup (what? you didn’t make a back up?)

Once you restore it to the original, you will have to unmount the boot partition back using

umount /boot

Then reboot by using the Ctrl + Alt + Del key or power cycle the pi. This should then boot back to berryboot gui for you to perform any changes.

Posted on Leave a comment

Backup Raspberry Pi remotely

To back up your raspberry pi remotely, you will need to know the ip address, then using the following command

ssh pi@xx.x.x.xx “sudo dd if=/dev/mmcblk0 bs=1M | gzip -” | dd of=~/Desktop/pibackup.gz

Replace the xx.x.x.xx with the ip address of your pi, and the final image will be copied to your desktop.

To check from time to time the progress, press “Ctrl + T”, and you will see something like the following:

load: 0.98 cmd: dd 8967 running 0.17u 1.94s
317344+0 records in
317344+0 records out
162480128 bytes transferred in 167.835383 secs (968092 bytes/sec)

To restore the image back you need to restore to SD card

diskutil unmountDisk /dev/disk#
gzip -dc ~/Desktop/pibackup.gz | sudo dd of=/dev/rdisk# bs=1m conv=noerror,sync