davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

issue update: full image of the current SD card

Fri Apr 15, 2016 8:17 pm

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?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

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

Sat Apr 16, 2016 11:32 am

no suggestions?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

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

Sat Apr 16, 2016 4:15 pm

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

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

Sat Apr 16, 2016 6:23 pm

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.
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

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

Sun Apr 17, 2016 12:44 am

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

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

Sun Apr 17, 2016 8:40 am

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.
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

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

Sun Apr 17, 2016 2:05 pm

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).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

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

Sun Apr 17, 2016 2:25 pm

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?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

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

Sun Apr 17, 2016 2:29 pm

Boot into a busybox image. That runs in RAM, so the card isn't in use at the time.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

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

Sun Apr 17, 2016 2:34 pm

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 ?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

User avatar
scruss
Posts: 3212
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

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

Sun Apr 17, 2016 2:37 pm

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.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

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

Sun Apr 17, 2016 2:59 pm

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:
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

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

Sun Apr 17, 2016 3:09 pm

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
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

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

Sun Apr 17, 2016 3:29 pm

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?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

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

Sun Apr 17, 2016 3:38 pm

Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

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

Sun Apr 17, 2016 3:53 pm

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!
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

Return to “Beginners”