nicolasbs
Posts: 12
Joined: Thu Nov 14, 2019 11:56 pm

Complete backup and restore HELP !!!

Fri Nov 15, 2019 12:02 am

Hi everybody,


Please I need any suggestion to backup and restore easily my raspberry. I have been playing with it for a couple of days and dumbly delete critical resources..... sadly I have to restore entirely.

I was so trusty on Deja Dup, but it does not save my settings from samba, pivpn, rclone and others :( :( :(

I have been reading for backup-restore methods but too advanced for my rookie skills, could somebody teach me how to make an automatic complete backup and a working method to restore with my Mac.

Appreciate any help !!

have a nice one,

Nicolas

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 12:19 am

Put a new microSD card into a card reader in one of the Pi 4 USB 3 ports. make sure it is the same size as, or bigger than, the card you are booting / runnng your Pi 4 on.
Now open the Raspbian Menu, and Accessories and find SD card Copier.

Copy your MicroSD card to the new one in your card reader. The new card will be bootable and contain 'everything' that was on your original card.
To restore, just shut down the Pi, take out the old card, and put in the new card. If you want to back up the new card, obviously, just repeat the process.

Don't back up a corrupted card and expect this to work though.
Remember, nobody is listening to you
until you fart ...

nicolasbs
Posts: 12
Joined: Thu Nov 14, 2019 11:56 pm

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 12:39 am

RossDv8 wrote:
Fri Nov 15, 2019 12:19 am
Put a new microSD card into a card reader in one of the Pi 4 USB 3 ports. make sure it is the same size as, or bigger than, the card you are booting / runnng your Pi 4 on.
Now open the Raspbian Menu, and Accessories and find SD card Copier.

Copy your MicroSD card to the new one in your card reader. The new card will be bootable and contain 'everything' that was on your original card.
To restore, just shut down the Pi, take out the old card, and put in the new card. If you want to back up the new card, obviously, just repeat the process.

Don't back up a corrupted card and expect this to work though.
Thanks you much for your advice,

Is there any way to do it automatically and saved in the network share folder or gdrive ??

Nicolas

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 12:49 am

I have never needed to do this, but I answered this question for someone else a few weeks ago. I mentioned that the program that is used for SD Card Backup is called piclone, and I suggested they might be able to use it in a script. I think the OP in that case managed to do that. I will try to find the link. and add it here in a few minutes. If my memory is correct, they might be able to tell you what they did if you DM them.

OK, back again. - The OP in the other post was running a Pi 'headless' and needed to backup to an SD card remotely.
The script link I sent them just might be useful for what yoou are trying to do:
Here is a small part of my reply to another post - including the link to a script on GitHub using piclone. Hope it helps...
EDIT
I did a little digging. The program is called piclone, and running it is a terminal opens a GUI so that might not be very helpful headless. :-(
But there must surely be an underlying command. I'm guessing perhaps a script using dd or something similar...

ANOTHER EDIT

I did some searching and in ChookChookWent results, there's a link to a script for piclone that might be useful:
https://github.com/raspberrypi-ui/piclo ... src/backup
And here is a link to that post:
https://www.raspberrypi.org/forums/view ... 8&t=255276
Remember, nobody is listening to you
until you fart ...

RonR
Posts: 849
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 2:05 am

nicolasbs wrote:
Fri Nov 15, 2019 12:02 am
Please I need any suggestion to backup and restore easily my raspberry.

image-backup contained in Image File Utilities will back up your entire Raspbian system while it's running. Once you've created a full backup, image-backup can incrementally update the image file as changes occur. I have image-backup automatically run at 4 AM every day via a cron job so I always have a recent backup (it typically takes only a minute or two for an incremental backup to complete). If needed, the resulting backup image file can written to an SD card or USB device with Etcher and you're back in business.

nicolasbs
Posts: 12
Joined: Thu Nov 14, 2019 11:56 pm

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 3:04 am

RonR wrote:
Fri Nov 15, 2019 2:05 am
nicolasbs wrote:
Fri Nov 15, 2019 12:02 am
Please I need any suggestion to backup and restore easily my raspberry.

image-backup contained in Image File Utilities will back up your entire Raspbian system while it's running. Once you've created a full backup, image-backup can incrementally update the image file as changes occur. I have image-backup automatically run at 4 AM every day via a cron job so I always have a recent backup (it typically takes only a minute or two for an incremental backup to complete). If needed, the resulting backup image file can written to an SD card or USB device with Etcher and you're back in business.
thank you my friend !!

appreciate really much your support !!!

nicolasbs
Posts: 12
Joined: Thu Nov 14, 2019 11:56 pm

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 3:36 am

RonR wrote:
Fri Nov 15, 2019 2:05 am
nicolasbs wrote:
Fri Nov 15, 2019 12:02 am
Please I need any suggestion to backup and restore easily my raspberry.

image-backup contained in Image File Utilities will back up your entire Raspbian system while it's running. Once you've created a full backup, image-backup can incrementally update the image file as changes occur. I have image-backup automatically run at 4 AM every day via a cron job so I always have a recent backup (it typically takes only a minute or two for an incremental backup to complete). If needed, the resulting backup image file can written to an SD card or USB device with Etcher and you're back in business.
This question might be silly for you sorry, but could you tell me what's the image path of the entire Raspbian system.

I'm so sorry for my newness :D :D :D
Thanks,
Nicolas

RonR
Posts: 849
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 3:54 am

nicolasbs wrote:
Fri Nov 15, 2019 3:36 am
This question might be silly for you sorry, but could you tell me what's the image path of the entire Raspbian system.

image-backup will back up the entire system (minus a few directories that shouldn't be backed up) starting at '/'.

You normally mount a storage device on /media or /mnt to save the image file to. Then you specify a path/name to be used as the image file. For example, if you've mounted a USB flash drive on /mnt, you might specify an image file name of '/mnt/backup.img'. Then you specify the size of the image file to create, which defaults to the full size of the media you are backing up. It only needs to be as big as the actual space that's used. Specifying '0' will show you the minimum size possible. You want to make it larger than the minimum size if you want to be able to do incremental backups to it in the future.

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 4:54 am

image-backup contained in Image File Utilities will back up your entire Raspbian system while it's running
There are some 'Hidden Gems' in various places on this forum. Thanks RonR - I see some of them are your creations :-)
Remember, nobody is listening to you
until you fart ...

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

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 5:23 am

RossDv8 wrote:
Fri Nov 15, 2019 12:19 am
Put a new microSD card into a card reader in one of the Pi 4 USB 3 ports. make sure it is the same size as, or bigger than, the card you are booting / runnng your Pi 4 on.
Now open the Raspbian Menu, and Accessories and find SD card Copier.
The new card only needs to have sufficient capacity to hold the data currently on the old card (plus a bit more for free space). It doesn't have to be the same size or larger - that's only when you are copying raw images, which is not how the SD Card Copier works.

If you have only used 12GB on a 32GB card - even if the filesystem has been expanded to fill the card, it will quite happily copy that 12GB onto a 16GB card.

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 6:47 am

Agreed. I just tend to assume beginners might forget to check the used / free ratio before copying to another card.
And I make allowance for a beginner wanting to be able to just plug in a backup (of the entire system on a card) and go.
Also, I guess it doesn;t matter if a script is being used to copy to an external drive.
Remember, nobody is listening to you
until you fart ...

nicolasbs
Posts: 12
Joined: Thu Nov 14, 2019 11:56 pm

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 2:09 pm

RonR wrote:
Fri Nov 15, 2019 3:54 am
nicolasbs wrote:
Fri Nov 15, 2019 3:36 am
This question might be silly for you sorry, but could you tell me what's the image path of the entire Raspbian system.

image-backup will back up the entire system (minus a few directories that shouldn't be backed up) starting at '/'.

You normally mount a storage device on /media or /mnt to save the image file to. Then you specify a path/name to be used as the image file. For example, if you've mounted a USB flash drive on /mnt, you might specify an image file name of '/mnt/backup.img'. Then you specify the size of the image file to create, which defaults to the full size of the media you are backing up. It only needs to be as big as the actual space that's used. Specifying '0' will show you the minimum size possible. You want to make it larger than the minimum size if you want to be able to do incremental backups to it in the future.
Hi Ron,

Forgive me if I seem kind intense,

I have mounted a gdrive image and I could get successful access, before I crashed my raspberry I have access also through the /mnt/ folder.

Right now I only have access by the /home/pi/gdrive folder that I creat for it.

I'm telling you this issue because without accessing by /mnt/ I cannot create my desire virtual backup-image.

Do you have any idea to solve it?

thanks.
Nicolas

RonR
Posts: 849
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Complete backup and restore HELP !!!

Fri Nov 15, 2019 7:35 pm

nicolasbs wrote:
Fri Nov 15, 2019 2:09 pm
I have mounted a gdrive image and I could get successful access, before I crashed my raspberry I have access also through the /mnt/ folder.

Right now I only have access by the /home/pi/gdrive folder that I creat for it.

I'm telling you this issue because without accessing by /mnt/ I cannot create my desire virtual backup-image.

I'm assuming a 'gdrive' is a Google Drive. I'm not familiar with and don't use Google Drive. If you were successful in having image-backup create a backup image file on Google Drive, you should be able to retrieve that image file to a PC where you can run Etcher to write that image file to an SD card for use in a Raspberry Pi.

I would suggest that using a simple USB flash drive mounted on /media or /mnt would be a much better starting point for getting familiar with image-backup.

Return to “Beginners”