Page 1 of 1

dd of SD Card where Rasbpian is up and running...

Posted: Tue Apr 17, 2018 8:11 pm
by 7fh3498f
HI guys,

I use Win32 Disk Imager to backup my Pi. Works well.

I was wondering if it is possible to perform dd command of SD card where Raspbian is up and running. Any clues if that will do exact copy as Win32 does? Or some file might be missing as used by system? I am new in Linux...

Would be much easier if i could just take the .img file via Samba. Also my Pi uptime would not be disturbed. Thank you.

Re: dd of SD Card where Rasbpian is up and running...

Posted: Tue Apr 17, 2018 8:19 pm
by B.Goode
Why reinvent the wheel?

Doesn't the card copier utility installed as standard with Raspbian meet your needs?

Re: dd of SD Card where Rasbpian is up and running...

Posted: Tue Apr 17, 2018 11:07 pm
by KLL
RASPBIAN: Desktop SD card copier ( is piclone ) or CLI ( is rpi-clone )
is very good, unless you need a .img
then use @RonR
7fh3498f wrote: if i could just take the .img file via Samba. Also my Pi uptime would not be disturbed. Thank you.
read also this about the incremental backup and
SAMBA .img filetransfer ( incl. zip ) to PC for use etcher to make a new SD card.

Re: dd of SD Card where Rasbpian is up and running...

Posted: Wed Apr 18, 2018 5:48 am
by 7fh3498f
B.Goode wrote:
Tue Apr 17, 2018 8:19 pm
Why reinvent the wheel?

Doesn't the card copier utility installed as standard with Raspbian meet your needs?
Never heard about it. I use Raspbian Lite (with manually installed GUI) and there is no icon like that in menu start. Can i ask for package name so i could install it manually?

Does that program copy entire card like DD? And can i use Win32 Disk Imager to recover my Raspbian just in case something will go wrong?

Thank you guys.

Re: dd of SD Card where Rasbpian is up and running...

Posted: Wed Apr 18, 2018 6:01 am
by fanoush
7fh3498f wrote:
Wed Apr 18, 2018 5:48 am
Does that program copy entire card like DD?
Not exactly like dd but the result is very similar. I used it to copy SD card to SSD to boot over USB and it worked fine. It re-created partitions on SSD so it would fill whole space and asked me if partitions/filesystems should have same UUID as on SD card or different one. So it most probably copies data with tar, rsync or cp. The result boots fine and contains everything.

Re: dd of SD Card where Rasbpian is up and running...

Posted: Wed Apr 18, 2018 6:29 am
by jahboater
fanoush wrote:
Wed Apr 18, 2018 6:01 am
7fh3498f wrote:
Wed Apr 18, 2018 5:48 am
Does that program copy entire card like DD?
Not exactly like dd but the result is very similar. I used it to copy SD card to SSD to boot over USB and it worked fine. It re-created partitions on SSD so it would fill whole space and asked me if partitions/filesystems should have same UUID as on SD card or different one. So it most probably copies data with tar, rsync or cp. The result boots fine and contains everything.
Whereas dd copies everything including unused blocks - not sure why anyone would want that.

Re: dd of SD Card where Rasbpian is up and running...

Posted: Wed Apr 18, 2018 6:32 am
by RonR
7fh3498f wrote:
Tue Apr 17, 2018 8:11 pm
HI guys,
I was wondering if it is possible to perform dd command of SD card where Raspbian is up and running. Any clues if that will do exact copy as Win32 does? Or some file might be missing as used by system? I am new in Linux...

You cannot use dd to copy running media. Sooner or later (more sooner than later), you'll end up with a copy that has an inconsistent (corrupted) file system.

The safest way to copy a running system is to use a backup program that utilizes rsync, such as image-backup:

viewtopic.php?f=91&t=210202#p1298239

Re: dd of SD Card where Rasbpian is up and running...

Posted: Wed Apr 18, 2018 7:09 am
by RaTTuS
if you dont want to use piclone [or whatever it's called cannont check right now]
then use
rsync -ax / /other/device
followed by a
cp /boot /other/device/boot

or similar
dd is not the best tool for this

Re: dd of SD Card where Rasbpian is up and running...

Posted: Thu Apr 19, 2018 12:00 pm
by fanoush
RaTTuS wrote:
Wed Apr 18, 2018 7:09 am
rsync -ax / /other/device
Instead of -x with / one can also mount root filesystem again to different place and rsync that. AFAIK multiple mounts of same device work just fine.
The advantage is that you also copy content hidden behind mount points. I've seen systems where /dev/ contained static device nodes needed for boot and later in boot sequence such non-empty /dev/ was used for devfs mount. Your rsync example would not copy such hidden files so the system would not boot.