Cloning Booted RPi’s microSD card on Windows PC through Network

ab cd

Senior Member

Cloning Booted RPi’s microSD card on Windows PC through Network​

This method creates a backup copy of microSD card of a booted RPi on Windows Computer through Network (LAN or Internet).

This method is good for backing up microSD card of RPi for which physical access is difficult, such as those installed at remote locations or at a hard to access location.

There are two options to use it

OPTION-1
Without installing the software raspiBackup on your RPi.
Just download and run run the script. This is good if you want to create backup only once or occasionally.

OPTION-2
Install the software raspiBackup on RPi.
This software can be configured to perform regular backups automatically at specified intervals.


۔
 
Last edited:
OPTION-1
Without installing the software raspiBackup on your RPi.

(1) On Windows computer do following:
  • Create a folder rpi-clone to hold the cloned img files
  • Enable Network Sharing
  • Grant sharing permission to folder rpi-clone
For items (1) above, please see detailed instructions here:
Option One: Create a Share on Windows and Access It From Linux


(2) On RPi, create a folder /home/pi/windows and mounted on it Windows shared folder rpi-clone.
Code:
## IP address of Windows PC = 192.168.0.10
## User name of Windows PC = abcd
## Shared folder on Windows PC = rpi-clone
## Mount-point folder on RPi = /home/pi/windows

sudo mkdir /home/pi/windows

sudo apt-get install cifs-utils

## In command below, replace:
## 192.168.0.10 by IP of your Windows computer
## abcd by your user name on Windows computer

sudo mount.cifs //192.168.0.10/rpi-clone /home/pi/windows -o user=abcd

Password for abcd@//192.168.0.10/rpi-clone: ********


(3) Download and Run Script raspiBackup.sh
Downloaded and run the raspiBackup script by following commands

Code:
curl -sSLO https://www.linux-tips-and-tricks.de/raspiBackup.sh

sudo bash ./raspiBackup.sh -a : -o : -m detailed /home/pi/windows.

The details of options (-a : -o : -m detailed ) in the 2nd command above are as below:
(a) Save cloned image in folder /home/pi/windows
(b) Use dd
(c) Use compression
(d) Output in terminal, the progress status during execution


(4) Following is the output of running the script raspiBackup.sh
Code:
--- RBK0009I: raspberrypi: raspiBackup.sh V0.6.6 (7989828) started at Sat 26 Dec 2020 06:36:40 PM EST.
--- RBK0031I: Checking whether a new version of raspiBackup.sh is available.
--- RBK0151I: Using backuppath /home/pi/windows with partition type cifs.
!!! RBK0157W: No services to stop.
--- RBK0085I: Backup of type dd started. Please be patient.
7948+1 records in
7948+1 records out
7948206080 bytes (7.9 GB, 7.4 GiB) copied, 733.158 s, 10.8 MB/s
--- RBK0078I: Backup time: 00:12:14.
--- RBK0159I: 3 backups kept for dd backup type. Please be patient.
--- RBK0033I: Please wait until cleanup has finished.
--- RBK0049I: Messages saved in /home/pi/windows/raspberrypi/raspberrypi-dd-backup-20201226-183640/raspiBackup.msg.
--- RBK0026I: Debug logfile saved in /home/pi/windows/raspberrypi/raspberrypi-dd-backup-20201226-183640/raspiBackup.log.
--- RBK0010I: raspberrypi: raspiBackup.sh V0.6.6 (7989828) stopped at Sat 26 Dec 2020 06:49:03 PM EST with rc 0.
--- RBK0017I: Backup finished successfully.


(5) Check folder rpi-clone on Windows computer


raspiBackup-1.png



(6) Verify that backup is OK
- Write the backup image on Windows computer on a SPARE microSD card.
- Shutdown RPi and slip-out its microSD card.
- Slip-in the spare microSD card (on which you have written tthe backup image.
- Power up and verify that the backup image is OK.


.
 
Last edited:
Back
Top