psgarcha92
Posts: 16
Joined: Fri Oct 12, 2012 5:19 am

How do i perform live backup of Raspi SD card?

Sun Oct 28, 2012 10:50 pm

Hey guys...
in the last 24 hours i have had to rewrite the Raspi Image onto the SD card 5-6 times. Everytime, with the system updated and upgraded, i managed to do something or the other that would give me a kernel panic at boot. I am sick of getting the SD Card out of my self made Raspi Casing, which is a cumbersome job to do. All i want to know is, how do i copy the raspi SD Card contents onto a file on a USB pendrive while the system is operating. I want to do it on the Raspi itself, coz as i said before, getting the SD card out everytime is cumbersome....


Please help guys. I really dont wanna update and upgrade and then lose it all again.

User avatar
Vindicator
Posts: 314
Joined: Sat Sep 17, 2011 11:10 pm
Location: Susanville Ca USA
Contact: Website

Re: How do i perform live backup of Raspi SD card?

Mon Oct 29, 2012 12:36 am

If you are losing your SD that often perhaps we should find out why this is happening to your cards first question I would ask is are you overclocking then I would ask are you performing a clean halt or shutdown each time to keep the corruption of your card to a minimum.

The first question on overclocking is because when you are overclocking the card corruption happens more often in my opinion.
the second is if you do not give a halt/shutdown command to write back any info and un-mount the card before disconnecting power you will also get corruption.

Code: Select all

sudo shutdown -h now
is one of the suggested commands to use before removing power form your Raspi.

As I said I would find out the cause of the corruption and then work on a backup of the card.
If you are more worried about ,spelling, punctuation or grammar you have probably already missed the point so please just move on.

psgarcha92
Posts: 16
Joined: Fri Oct 12, 2012 5:19 am

Re: How do i perform live backup of Raspi SD card?

Mon Oct 29, 2012 1:59 am

@Vindicator,
It happened again. I am hating every minute of it.
Okk, i do not overclock it in forced mode, but in the turbo_mode preset in the raspi_config menu.

It almost always happens at unclean shutdowns. I get Panic : VFS unable to mount root fs at (179,2)
pid 1) due to keyboard entry
>kdb

(roughly the error, unreadable because of low res screen)

When putting the SD Card into my computer, it does not show the second partition at all. Using fsck in linux, getting the name of the block from Gparted, nothing happens. It is really troubling me now. I cannot format the card this often. And the bad thing is, i try to always do safe shutdowns, but if it hangs in between and i have to do unclean shutdowns, it gets corrupted for sure. And yes, my power supply is totally fine. Even under load it provides 4.97 V to the Raspi.

What do i do??

Regards

psgarcha92
Posts: 16
Joined: Fri Oct 12, 2012 5:19 am

Re: How do i perform live backup of Raspi SD card?

Mon Oct 29, 2012 1:52 pm

I am here to update the thread on the issue i had just posted.

After what was happening over and over again with my element14 (preloaded) purchased SD Card, i decided to try a 4GB Micro SD i had lying around collecting dust. First i formatted it with SD Formatter properly, as the SD and SDHC cards are supposed to be formatted.
Then i wrote the image on it using W32DiskImager program, please note this is the image available in the downloads section, namely 2012-09-18 wheezy Raspibian.

Once written, i put it into my Raspi and booted. All booted up fine.
Then it was time to treat my Pi rough. I rebooted it, set the Overscan values in the tool, enabled ssh, all to keep the variables of the cases where the Pi misbehaved the same.

Now i rebooted it, and let it boot fully, to the desktop. Everything working fine.
Then rebooted it, and while it was preloading files (first terminal before raspi-config tool appears), i shut off the supply completely. Booted again, and it started normal and came to the desktop.
I rebooted the Pi, and this time i shut off the supply when the OS Desktop was loading.
Booted up fine again.
Now i added my un-powered hub with a mouse, USB pendrive and keyboard attached. Booted just fine. Misbehaved a little bit more at first terminal and loading desktop. Still worked fine.

Then i remembered that adding the Wlan USB adapter i had made it reboot. So i connected the adapter to RasPi at boot time, it rebooted (involuntary). But the device booted fine again to dektop. I have since done a lot of clean shutdowns, and all i have lost is the taskbar due to some error in openbox config xml file.

All in all, i am very very happy that the pi is working fine, and over that i have a working Wlan adapter on the port.

P.S. i had read at alot of places that overclocking also caused absurd behaviour. So i overclocked as i have done with my element14 card,
CPU Freq 1000
GPU 500
MEM 500
current_limit_override=1

But but but, i am here loading updating the system to the latest packages using sudo apt-get update && sudo apt-get upgrade. after it finishes i would perform sudo apt-get update and upgrade again just to be sure. after that when it reboots, in raspi-config i would select update, where it updates the firmware and config.txt

if it starts misbehaving, then we would surely know that the problems are with the software updates or the Firmware update.

I hope all would end well here. At last i would be able to sleep properly.

Regards

User avatar
RaTTuS
Posts: 10558
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: How do i perform live backup of Raspi SD card?

Mon Oct 29, 2012 1:55 pm

psgarcha92 wrote:...
Now i added my un-powered hub with a mouse, USB pendrive and keyboard attached. Booted just fine. Misbehaved a little bit more at first terminal and loading desktop. Still worked fine.
...
it's going to be a POwer issue
use a powered USB hub

edit....
mount your USB drive somewhere under /mnt
rsync -axvS / /mnt/USB
and that will copy everything .....
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

psgarcha92
Posts: 16
Joined: Fri Oct 12, 2012 5:19 am

Re: How do i perform live backup of Raspi SD card?

Mon Oct 29, 2012 2:32 pm

EDIT to the above post:

Now i added my un-powered hub with a mouse, USB pendrive and keyboard attached. Booted just fine.I Misbehaved/roughed up/dirty shutdown the RasPi a few more times at the first terminal and loading desktop. Still worked fine. No lost files, no corrupt SD partitions.

The unpowered USB has not caused any problems yet. Still looking for more though. thinking of adding a big capacitor to the Raspi Usb port so it does not reboot when a high current drain device is connected. Happy to see that my DIY Power supply is providing the WLAN USB adapter enough juice. Plus, i still get 4.90 volts at the board :)

Return to “Beginners”