Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5650

Beginners • Re: Making backup of raspberry pi sd card

$
0
0
@sparrow,

I don't know if you have figured out your own solution yet, but here is mine. My approach is oriented towards Windows PC users, so more tools with a graphical interface are used than Linux command scripts.

On the RPi, I used RonR's back up tools as referred to by terribleted, RPi Disk Imager, and raspi-config. On the Windows PC side, I used Win32DiskImager and also RPi Disk Imager.

1) I used RonR's image-backup to back up my current bootfs and rootfs to my chosen location on /media, see picture below.
Back_Up_1.png

You can see that I chose the name "RPi52Backup.img" which was only about 17 GB when image-backup had done its job. The other two folders corresponded to 2 USB thumb drives with microSD cards on them. The one labeled "64 GB Volume" is the one I chose to back up "RPi52Backup.img" into (I could have used a 32 GB SD card, but I did not have one handy).

2) Next, on the RPi, I started the RPi Disk Imager tool and first ERASED that "64 GB Volume" drive (of course, please make sure to choose the right drive!)
BackUp_2.jpg

You can see that "64 GB Volume" is now changed to "C55A-CA77" (that's Linux!).

3) Then I chose to put a "CUSTOM" image (i.e. put RPi52Backup.img onto that recently erased microSD card).

4) I decided not to apply any OS customization.

5) Then just wait for this task to be done
BackUp_4.png

6) Next I removed the current OS SD card (128 GB) and inserted this "new" 64 GB microSD card into the RPi microSD port, and the system booted into the RPi without any problem ( :D ).

7) Then on the PC's side I used Win32DiskImager to copy this 64 GB drive to the PC hard disk for "safer" keeping.

8) For testing purposes, I used RPi Disk Imager on the PC to create a new 128 GB OS SD card out of that 64 GB image. That 128 GB SD booted fine on the actual RPi, but, as expected, I found out that rootfs is only about 59 GB when I used df -kh to check it out (as 64 GB remained unpartitioned on this 128 GB drive).

9) To use the full 128 GB space, I went into raspi-config, that is "sudo raspi-config", then from the main menu, choose "Advanced Options", then "Expand FileSystem" and save everything, exited and rebooted the system. From then on the new 128 GB drive is fully utilized.

My game plan is to use the "original" 128 GB OS SD card and keep it backed up regularly via image-backup (i.e. Step 1), and then as the OS Image grows in size, to back it up into an appropriate sized SD card (Steps 2-5) for "safe-keeping". When the original 128 GB OS card fails (and it will some day), then I would just use the latest "safe" image to create a new 128 GB OS SD card and put RonR's image backup tools on it as before.

Hope that you can find this procedure useful.

Happy New Year!

Statistics: Posted by Roboteer2024 — Mon Jan 01, 2024 2:44 am



Viewing all articles
Browse latest Browse all 5650

Trending Articles