Page 1 of 1

issue update: full image of the current SD card

Posted: Fri Apr 15, 2016 8:17 pm
by davenull
hey'all,
until now I used a SD copy tool to make image backups of my SD card ( http://www.roadkil.net/program.php/P12/Disk%20Image )
Small intermediate backups of some proprietary folders (programs, scripts) of course can be copied to a USB drive or to a workgroup folder.

But now my Pi is built into the deep innermost of my robot and its not possible any more to easily touch or even remove the SD for this image copy purpose without almost completely disassembling the robot.

How it is possble to make complete SD copies by the running Pi itself during runtime, and, in case of need, restore this image during runtime?

Re: issue update: full image of the current SD card

Posted: Sat Apr 16, 2016 11:32 am
by davenull
no suggestions?

Re: issue update: full image of the current SD card

Posted: Sat Apr 16, 2016 4:15 pm
by DougieLawson
You can do a copy of a running system to a mounted USB or NFS filesystem (my backups go to NFS).

You can't do a restore without shutting down the borked RPi and pulling its SDCard.

Re: issue update: full image of the current SD card

Posted: Sat Apr 16, 2016 6:23 pm
by davenull
thank you, but the restore is a must, too.
On my PC I also don't remove the HDs for backup and restore reasons, I am using Norton Ghost (for XP) and Acronis TrueImage (for Win Server 2003/2008 and Win7).
I can boot Acronis or Ghost and build the image on an extra drive or restore it from there.

Such a thing I would need on my Pi.

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 12:44 am
by DougieLawson
You can't do the restore on a running system.

Your only option is a file by file backup using rsync and a restore using rsync with source and target reversed.

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 8:40 am
by davenull
a boot manager could do it:
1.) boot Raspbian by default
2.) boot Ghost optional

in case of 2.):
a) backup image to target drive (select menu)
b) restore image from target drive (select menu)

the backup/restore functions can also be started by an agent program from the running system.
This is like Norton Ghost works on Win XP and MSDOS.

There are also Windows image programs which are able to make an image even from a running system, e.g. Windows Server 2008 .

Either functionality would be important to have for the Raspi as well!

-----

But instead, how can I write a complete SD image from a running Raspbian, like performed by SD image file programs (Win32DiskImager, RoadkilDiskImage)?
For that purpose I would need a 2nd SD slot on the Pi.
Could that be a way?

Anyway, I need a complete image (not single files) which can be created without ejecting the SD out of the Pi and which can be used to quickly create a backup SD card when my system once is broken.

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 2:05 pm
by DougieLawson
You can't restore to a running root filesystem. It will crash before your copy is complete. So you need a way to boot to an alternative rootfs in another partition. You may be able to do that with uBoot or Berryboot (or NOOBS).

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 2:25 pm
by davenull
yes, intermediately booting from another partition was also my ides, but then also some OS is running, so how to restore a backup SD image then?

The problems simply are the following, as I cannot remove the SD card and/or insert another SD:
1.) how can I buil a complete SD image from my PI with the SD to be backup-ed when inserted?

2.) Given I have a backup SD image,
and given my SD in my Pi has crashed / is broken
and given I cannot remove it and/or insert another SD:
How can I restore the backup image then to my inserted SD card, unable to touch it ?

A program like Norton Ghost or Acronis TrueImage is able to do it on Windows.
Which program can do it on the Pi?

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 2:29 pm
by rpdom
Boot into a busybox image. That runs in RAM, so the card isn't in use at the time.

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 2:34 pm
by davenull
thank you, for that I would need some more details then.

1st, how can I boot into busybox,
2nd, once having bootet into busybox, how can I
a) create an image of my SD and save to an USB drive (?? FAT wont work, NTFS perhaps? or copy directly to a second SD ? )
b) restore the backup image to my SD ?

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 2:37 pm
by scruss
davenull wrote:Which program can do it on the Pi?
PCs have the advantage of having the BIOS in flash on the motherboard. The Raspberry Pi loads it from SD, so if it gets corrupted it will need physical replacement.

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 2:59 pm
by davenull
scruss wrote:
davenull wrote:Which program can do it on the Pi?
PCs have the advantage of having the BIOS in flash on the motherboard. The Raspberry Pi loads it from SD, so if it gets corrupted it will need physical replacement.
that's a pity :(

is there something like an extension cable to put in between the microSD slot and the SD card itself? :geek:

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 3:09 pm
by fruitoftheloom
davenull wrote:
scruss wrote:
davenull wrote:Which program can do it on the Pi?
PCs have the advantage of having the BIOS in flash on the motherboard. The Raspberry Pi loads it from SD, so if it gets corrupted it will need physical replacement.
that's a pity :(

is there something like an extension cable to put in between the microSD slot and the SD card itself? :geek:
If this Feature is important then you will need a different product, which has the guts of an x86 PC :?


http://www.jaguarboard.org/index.php/pr ... based.http

http://www.up-board.org

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 3:29 pm
by davenull
so is there not even a way just to write a SD backup image (like created by Win32DiskImager and others) by the running Raspi itself, storing it elsewhere?

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 3:38 pm
by fruitoftheloom

Re: issue update: full image of the current SD card

Posted: Sun Apr 17, 2016 3:53 pm
by davenull
is this true...?
Note: Only suitable for use with plain non-NOOBS installed Raspbian
viewtopic.php?f=29&t=137693&p=914109#p914109

edit:
perhaps not true, or is it?
just for an add-on script or generally?

well, I have no USB-SD-adapter, but I will purchase one.

There are some issues about my understanding of some statements though, but I will ask then later.
I think I'll give it a try.

Thank you very much!