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

Re: SD card backup / copy: how to ?

Sun Dec 27, 2015 6:30 pm

is that true that for the RPi there is no single backup-program or script or what ever which works out of the box?
e.g., choose target backup drive by commandline parameter or by menu (listing all available drives / just all USB drives)?

like e.g., most simple:

Code: Select all

sudo ./backup  /media/pi/usb120drv   # usb120drv == drive name 
In case something like that doesn't exist yet, then that would be really rediculous...
#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(;;);}

SonOfAMotherlessGoat
Posts: 690
Joined: Tue Jun 16, 2015 6:01 am

Re: SD card backup / copy: how to ?

Sun Dec 27, 2015 11:20 pm

davenull wrote:is that true that for the RPi there is no single backup-program or script or what ever which works out of the box?
Not one that fits the extremely narrow range of constraints that has been put on the problem...
Account Inactive

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

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 8:57 pm

that cannot - that MUST not be true!
How long does Linux and Unix already exist?
And NO BACKUP PROGRAM to a plugged-in USB drive available ?!?
#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(;;);}

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 10:12 pm

davenull wrote:that cannot - that MUST not be true!
How long does Linux and Unix already exist?
And NO BACKUP PROGRAM to a plugged-in USB drive available ?!?
Of course there are, from free to $$$$. rsync has already been mentioned as has dd'ing the partions.

If you really want a one liner:

Code: Select all

sudo tar --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run cvzf /media/pi/usb120drv/pibackup.tar.gz /
The position of the excludes depends on the version of tar. I've not tested the above as I use rsync...

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

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 10:17 pm

thank you!
neverless there is this error:

pi@raspberrypi:~ $ sudo tar --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run cvzf /media/pi/usb120drv/pibackup.tar.gz /
tar: Eine der Optionen „-Acdtrux“, „--delete“ oder „--test-label“ ist notwendig.
„tar --help“ oder „tar --usage“ gibt weitere Informationen.

...?

ps,
I'm a complete beginner and my English is very poor, especially I don't understand sort of slang like dd'ing :-/
rsync appears extremely complicated, except there is 1 single install programm for the whole installation (like setup.exe for windows programs)
and just 1 command to start (like double-click on sort of "rsync.exe"
and adjust the settings (like target drive) interactively.
#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: SD card backup / copy: how to ?

Sat Jan 02, 2016 10:26 pm

ps,
all directories of /pi/ also should be backup-ed
and why exclude proc and dev?
Last edited by davenull on Sat Jan 02, 2016 10:29 pm, edited 2 times in total.
#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(;;);}

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 10:27 pm

davenull wrote:thank you!
neverless there is this error:

pi@raspberrypi:~ $ sudo tar --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run cvzf /media/pi/usb120drv/pibackup.tar.gz /
tar: Eine der Optionen „-Acdtrux“, „--delete“ oder „--test-label“ ist notwendig.
„tar --help“ oder „tar --usage“ gibt weitere Informationen.

...?

ps,
I'm a complete beginner and my English is very poor, especially I don't understand sort of slang like dd'ing :-/
rsync appears extremely complicated, except there is 1 single install programm for the whole installation (like setup.exe for windows programs)
and just 1 command to start (like double-click on sort of "rsync.exe"
and adjust the settings (like target drive) interactively.
Well, I did say that may have the alter the position of the excludes, try:

Code: Select all

tar  cvzf /media/pi/usb120drv/pibackup.tar.gz / --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run
Seems to do something...I'll let you know when it finishes

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

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 10:30 pm

pi@raspberrypi:~ $ tar cvzf /media/pi/usb120drv/pibackup.tar.gz / --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run
tar: Entferne führende „/“ von Elementnamen
tar (child): /media/pi/usb120drv/pibackup.tar.gz: Funktion open fehlgeschlagen: Datei oder Verzeichnis nicht gefunden
tar (child): Error is not recoverable: exiting now
/
/srv/
/etc/
/etc/gai.conf
/etc/polkit-1/
/etc/polkit-1/nullbackend.conf.d/
/etc/polkit-1/nullbackend.conf.d/50-nullbackend.conf
tar: /etc/polkit-1/localauthority: Funktion open fehlgeschlagen: Keine Berechtigung
/etc/polkit-1/localauthority.conf.d/
/etc/polkit-1/localauthority.conf.d/50-localauthority.conf
/etc/polkit-1/localauthority.conf.d/60-desktop-policy.conf
/etc/dhcpcd.duid


that looks better...

ps,
all directories of /pi/ also should be backup-ed
and why exclude proc and dev?
#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: SD card backup / copy: how to ?

Sat Jan 02, 2016 10:32 pm

no,...
tar (child): /media/pi/usb120drv/pibackup.tar.gz: Funktion open fehlgeschlagen: Datei oder Verzeichnis nicht gefunden
tar (child): Error is not recoverable: exiting now

did not find the USB target drive
nevertheless, the USB drive is plugged in and can be accessed via the file explorer
#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(;;);}

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 10:50 pm

davenull wrote: and why exclude proc and dev?
They are psuedo-filesystems populated by the OS at runtime, they probably are empty on the SDcard (if they exist at all).
You exclude /media as you don't want it archiving the archive file...
davenull wrote:no,...
tar (child): /media/pi/usb120drv/pibackup.tar.gz: Funktion open fehlgeschlagen: Datei oder Verzeichnis nicht gefunden
tar (child): Error is not recoverable: exiting now

did not find the USB target drive
nevertheless, the USB drive is plugged in and can be accessed via the file explorer
Try putting sudo in front of the tar command (as in my first example), or:

Code: Select all

cd /media/pi/usb120drv/
sudo tar cvzf ./pibackup.tar.gz / --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run

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

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 10:52 pm

pi@raspberrypi:~ $ sudo tar cvzf /media/pi/usb120drv/pibackup.tar.gz / --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run
tar: Entferne führende „/“ von Elementnamen
/
/srv/
/etc/
/etc/gai.conf
/etc/polkit-1/
/etc/polkit-1/nullbackend.conf.d/
/etc/polkit-1/nullbackend.conf.d/50-nullbackend.conf
/etc/polkit-1/localauthority/
/etc/polkit-1/localauthority/10-vendor.d/
/etc/polkit-1/localauthority/20-org.d/
/etc/polkit-1/localauthority/30-site.d/
/etc/polkit-1/localauthority/90-mandatory.d/
/etc/polkit-1/localauthority/50-local.d/
/etc/polkit-1/localauthority/50-local.d/55-storage.pkla
/etc/polkit-1/localauthority.conf.d/
/etc/polkit-1/localauthority.conf.d/50-localauthority.conf
/etc/polkit-1/localauthority.conf.d/60-desktop-policy.conf
tar (child): /media/pi/usb120drv/pibackup.tar.gz: Funktion open fehlgeschlagen/etc/dhcpcd.duid
/etc/rpi-issue
: Datei oder Verzeichnis nicht gefunden
tar (child): Error is not recoverable: exiting now
/etc/protocols
/etc/udev/
/etc/udev/rules.d/
#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: SD card backup / copy: how to ?

Sat Jan 02, 2016 10:53 pm

but I don't find a tar file on my usb drv after that... :(
Google translate of error msgs:

tar (child): /media/pi/usb120drv/pibackup.tar.gz: fuction open failed
/etc/dhcpcd.duid/etc/rpi-issue no such file or directory
tar (child): Error is not recoverable: exiting now
#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(;;);}

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:13 pm

davenull wrote:but I don't find a tar file on my usb drv after that... :(
Google translate of error msgs:

tar (child): /media/pi/usb120drv/pibackup.tar.gz: fuction open failed
/etc/dhcpcd.duid/etc/rpi-issue no such file or directory
tar (child): Error is not recoverable: exiting now
Mine's just failed with

Code: Select all

tar: Exiting with failure status due to previous errors
But there are no errors...
However, it did create a file:

Code: Select all

-rw-r--r-- 1 root root 1473845343 Jan  2 22:52 pibackup.tar.gz
I'm running wheezy from a hdd with 135GB free, so it's not a space issue.

Best try rsync

Code: Select all

sudo apt-get install rsync -y
mkdir -p /media/pi/usb120drv/pibackup
cd /media/pi/usb120drv/pibackup/
sudo rsync -avz --delete --exclude /sys --exclude /tmp --exclude /proc --exclude /run  --exclude /media/* / .
The excludes can be written to a file if required.

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

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:18 pm

it does not find the target USB drv

pi@raspberrypi: $ cd /media
pi@raspberrypi:/media $ cd usb120drv
bash: cd: usb120drv: no such file or directory
pi@raspberrypi:/media $
#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(;;);}

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:26 pm

davenull wrote:it does not find the target USB drv

pi@raspberrypi: $ cd /media
pi@raspberrypi:/media $ cd usb120drv
bash: cd: usb120drv: no such file or directory
pi@raspberrypi:/media $
I was using you previous example:

Code: Select all

sudo ./backup  /media/pi/usb120drv   # usb120drv == d
If your drive is mounted to somewhere else, then use that (use df -h to find the mountpoint).

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

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:26 pm

pi@raspberrypi:~ $ sudo apt-get install rsync -y
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
rsync ist schon die neueste Version.
rsync wurde als manuell installiert festgelegt.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
pi@raspberrypi:~ $ mkdir -p /media/pi/usb120drv/pibackup
mkdir: das Verzeichnis „/media/pi/usb120drv“ kann nicht angelegt werden: Keine Berechtigung
pi@raspberrypi:~ $ cd /media/pi/usb120drv/pibackup/
bash: cd: /media/pi/usb120drv/pibackup/: Datei oder Verzeichnis nicht gefunden
pi@raspberrypi:~ $ sudo rsync -avz --delete --exclude /sys --exclude /tmp --exclude /proc --exclude /run --exclude /media/* / .


(hangs up)
Last edited by davenull on Sat Jan 02, 2016 11:28 pm, edited 1 time in total.
#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: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:28 pm

pi@raspberrypi:~ $ cd /media
pi@raspberrypi:/media $ cd pi
pi@raspberrypi:/media/pi $ cd usb120drv
bash: cd: usb120drv: Datei oder Verzeichnis nicht gefunden
pi@raspberrypi:/media/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(;;);}

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

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:29 pm

what is "mounted" ?
I plug it in and it is opened in the file manager.. :?:
I can see the file tree
\media\pi\usb120drv
#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(;;);}

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:32 pm

davenull wrote:what is "mounted" ?
I plug it in and it is opened in the file manager.. :?:
I can see the file tree
\media\pi\usb120drv
What does this command produce?

Code: Select all

df -h

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

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:33 pm

pi@raspberrypi:/media/pi $ df -h
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root 28G 3,5G 24G 14% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 463M 0 463M 0% /dev/shm
tmpfs 463M 6,4M 457M 2% /run
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 463M 0 463M 0% /sys/fs/cgroup
/dev/mmcblk0p6 63M 20M 44M 31% /boot
tmpfs 93M 4,0K 93M 1% /run/user/1000
/dev/mmcblk0p5 30M 417K 28M 2% /media/pi/SETTINGS
/dev/sda1 112G 39G 74G 35% /media/pi/USB120DRV
pi@raspberrypi:/media/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(;;);}

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:44 pm

davenull wrote:pi@raspberrypi:/media/pi $ df -h
/dev/sda1 112G 39G 74G 35% /media/pi/USB120DRV
pi@raspberrypi:/media/pi $
Unix systems are case sensitive (unlike windows), so /media/pi/USB120DRV is not the same as /media/pi/usb120drv
So, try

Code: Select all

mkdir -p /media/pi/USB120DRV/pibackup
cd /media/pi/USB120DRV/pibackup/
sudo rsync -avz --delete --exclude /sys --exclude /tmp --exclude /proc --exclude /run  --exclude /media/* / .

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

Re: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:49 pm

OMG ...
Image
cd USB120DRV is fine
#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: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:52 pm

pi@raspberrypi:/media/pi/USB120DRV $ sudo tar --exclude=/media/* --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/run cvzf /media/pi/USB120DRV/pibackup.tar.gz /
tar: Eine der Optionen „-Acdtrux“, „--delete“ oder „--test-label“ ist notwendig.
„tar --help“ oder „tar --usage“ gibt weitere Informationen.
pi@raspberrypi:/media/pi/USB120DRV $

Image
Last edited by davenull on Sat Jan 02, 2016 11:57 pm, edited 1 time in total.
#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: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:53 pm

how I LOVE Linux :evil:
#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: SD card backup / copy: how to ?

Sat Jan 02, 2016 11:56 pm

http://www.gnu.org/fun/jokes/unix-hoax.html
We actually thought of selling this to the Soviets to set their computer science
progress back 20 or more years.
yes.
definitely: yes.
#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 “Raspberry Pi OS”