I usually remove the SD cards and use the balenaEtcher to format and rewrite my previously backed-up image from my laptop to Raspberry Pi.

Is there a way to do this job or at least restore an entire folder remotely?

By the way, I can not copy files to some folders of the Raspberry Pi due to access permissions.


2 Answers 2


If you want to keep a backup image updated rather easily, you should try image-backup - a component of image-utils. image-backup allows you to create an image file backup of your entire system using a simple one-line command:

$ sudo image-backup 

The output is an image file (.img) which can be saved to any file system you can mount on your RPi.

As an image file, you can do things with it:

  1. It can be written to an SD card using BalenaEtcher - or any of a number of other programs. In other words, you can restore your entire system to an SD card, and then boot from it.
  2. You can mount this image file from your RPi (and other systems), and access any file or folder in it (e.g. restore an entire folder remotely).

Updating this image file with image-backup is very easy: Running image-backup with a parameter of an existing image filename will incrementally update that image file; e.g.:

$ sudo image-backup /path/to/existing/backup.img 

Perhaps the best feature of image-backup is that it uses rsync, which is much more efficient than dd.

If you're interested, there's another answer here that covers the installation, and a step-by-step for creating an image.

  • This is probably the best method I've heard of for the average pi user (my own answer not withstanding). Getting an odd sense of deja vu about it >_>
    – goldilocks
    Commented Aug 15, 2021 at 20:40
  • So you "feel like you've been here before"?
    – Seamus
    Commented Aug 15, 2021 at 20:59
  • Yeah. Like I had heard of image-backup before in one of your posts and forgotten about it... pretty sure it is a real memory too :) Third time is the charm of course.
    – goldilocks
    Commented Aug 16, 2021 at 13:11

On first read I assumed you were using dd to create the images and balenaEtcher to restore -- until it was pointed out you probably used the latter for both tasks. So: Below I'm referring to two different methodologies regarding backup, one the "blob image" I've associated with dd (but also applies to what balenaEtcher does), and the other "file based", which is what I'm recommending.

It [was upon first read ;)] implicit in this you are using dd to keep a backup (but if you are using balenaEtcher, it is much the same thing in terms of the image format). While this is very easy to do, it is very inflexible (as well as being wasteful resource wise, ie., takes a long time and uses a lot of bandwidth).

Is there a way to do this job

There is not an existing one that I'm aware of using a blob image copy (as from dd), and although it would not be impossible to implement one, that is going to be a mountain more headache and effort than just using a backup methodology that is intended to be usable live remotely, such as rsync.

or at least restore an entire folder remotely?

This is a bit of a distinct issue. Using a system that copies files (such as rsync or tar) instead of raw blocks (such a dd), it is pretty simple and self-explanatory once you understand the methodology.1

It is also possible using a blob image, but not really worthwhile because you will have to use a file-based method for the restore, by mounting the image somewhere and copying them from there. Since you could count "the root filesystem" as "a folder", you could do this with /, but that is going to be the most ponderous, inefficient, and error prone choice of all.

  1. Which I won't bother with because you will find decades worth of examples, tutorials, how-tos, etc. regarding rsync or tar, online, including here.
  • It's implicit in this you are using dd to keep a backup... how did you reach that conclusion?
    – Seamus
    Commented Aug 15, 2021 at 19:38
  • Because the OP is using balenaEtcher to do the restore -- this is not a tool that speaks ext4 (or any filesystem spec, I'd guess), ie., it works on device or partition images. Whilst there are other ways, getting such in a linux context usually involves dd. I'm aware of but not familiar with the RpiOS backup tool, I'd assume it does the same -- which would count as "another way" but then I'd presume the OP would use that to restore as well. WRT my answer it actually doesn't matter how the "blob image" was created (dd does not use a unique, or for that matter any kind of, format).
    – goldilocks
    Commented Aug 15, 2021 at 19:45
  • You may be correct - I've not used BalenaEtcher in a while - I thought it could copy an SD card, but I probably just don't recall correctly.
    – Seamus
    Commented Aug 15, 2021 at 19:53
  • Hmm -- that probably is what the OP meant. I just read it as, "I have image backups and I use balenaEtcher to restore them to a card", not thinking the backup could be created with etcher too. In that case dd might as well be left out ...will edit, thanks!
    – goldilocks
    Commented Aug 15, 2021 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.