cspan
Posts: 113
Joined: Sat Jun 10, 2017 1:03 pm
Location: Chattanooga, TN, USA

SD Card Copier

Sun Feb 24, 2019 8:49 pm

Should the SD Card Copier utility in Raspberry Pi Desktop be expected to work, as a means to backing up a hard drive (250 GB) install of RPD? For me, it's not working. The / properties shows about 8 GB taken up by RPD and it's a 32 GB microSD card (class 10, not A1, but this is for backup, not regular use). When I run SD Card Copier I get an error. "Cannot create partition" or something, I forget. And then the card is no longer recognized, and has to be reformatted.

Is this expected behavior, since I'm trying to copy from an HDD that is larger than the microSD, even if the HDD is mostly empty?

I was just thinking of using some of these slower, but large-enough cards for backup of the system. I already have an *.iso file on USB flash drive, and can save any user files separately. Just thought I'd see if the SD Card Copier could be used to back up the whole thing together. Perhaps it's easier/cleaner, in the event one had to restore the whole thing, to just reinstall the OS and copy backups of user files through separate processes?

Thanks -

PhatFil
Posts: 1108
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: SD Card Copier

Sun Feb 24, 2019 10:28 pm


User avatar
HawaiianPi
Posts: 3760
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: SD Card Copier

Sun Feb 24, 2019 10:49 pm

The SD Card Copier is designed to backup Raspbian and NOOBS installs. I'm not surprised it didn't work for x86 Debian Linux with Raspberry Pi Desktop. It failed when I tried to backup a micro-SD card for another SBC (TB).

For backing up Raspbian (ARMhf) it does work. I have used to to backup a USB SSD to a smaller micro SD card (and vice-versa).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

cspan
Posts: 113
Joined: Sat Jun 10, 2017 1:03 pm
Location: Chattanooga, TN, USA

Re: SD Card Copier

Mon Feb 25, 2019 12:05 am

HawaiianPi wrote:
Sun Feb 24, 2019 10:49 pm
I have used to to backup a USB SSD to a smaller micro SD card (and vice-versa).
Thanks -

... from larger to smaller? Does it automatically shrink the partition if there's unused space or something?

User avatar
DarkPlatinum
Posts: 758
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website

Re: SD Card Copier

Mon Feb 25, 2019 9:02 am

cspan wrote:
Mon Feb 25, 2019 12:05 am
HawaiianPi wrote:
Sun Feb 24, 2019 10:49 pm
I have used to to backup a USB SSD to a smaller micro SD card (and vice-versa).
Thanks -

... from larger to smaller? Does it automatically shrink the partition if there's unused space or something?
Yes It does. That makes it much better than so many other tools out there.
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): Https://Html.dynu.net

User avatar
procount
Posts: 1595
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: SD Card Copier

Mon Feb 25, 2019 9:46 am

SD card copier will analyse your source SD card and re-create identically sized partitions on the target SD card, apart from the LAST partition which it resizes to fill the remaining space on the target SD card.
After doing that, it then copies the files from each partition on the source SD card to the corresponding partition on the target SD card.

A standard Raspbian image consists of a small FAT32 boot partition and an EXT4 rootfs partition.
Copying it with SD card copier will cause the EXT4 rootfs partition to adjust to the size of the target SD card, either up or down depending on the relative size.

A NOOBS installed Raspbian image will consist of the NOOBS recovery partition, a settings partition, followed by the Raspbian boot and rootfs partitions.
Copying it with the SD card copier will result in the last partition (again the Raspbian rootfs partition) being sized to fill the remainder of the target SD card.

You can probably gather by now, that if you have installed MULTIPLE OSes with NOOBS, that using SD card copier to downsize the source SD card to a much smaller target SD card will be less successful, because the only partition that will be adjusted in size is the last one. In this instance you may need to shrink all the partitions beforehand using something like gparted.
Copying to the same sized or larger SD card will not be a problem, except remember that only the last partition will be adjusted. Again you may need to use gparted after the copying if you want to share the extra space out amongst the other installed OS partitions.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

B.Goode
Posts: 7582
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: SD Card Copier

Mon Feb 25, 2019 10:56 am

procount wrote:
Mon Feb 25, 2019 9:46 am


A standard Raspbian image consists of a small FAT32 boot partition and an EXT4 rootfs partition.
Copying it with SD card copier will cause the EXT4 rootfs partition to adjust to the size of the target SD card, either up or down depending on the relative size.

A NOOBS installed Raspbian image will consist of the NOOBS recovery partition, a settings partition, followed by the Raspbian boot and rootfs partitions.
Copying it with the SD card copier will result in the last partition (again the Raspbian rootfs partition) being sized to fill the remainder of the target SD card.

Probably there is no-one better placed to make those clear statements than the author of this reply.


However, this thread has been posted in the Raspberry Pi Desktop for PC and Mac sub-forum.

I suspect that the descriptions provided may not be directly applicable to that distribution?

User avatar
procount
Posts: 1595
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: SD Card Copier

Mon Feb 25, 2019 11:26 am

@B.Goode - I just wanted to explain in the wider sense how SD card copier works to help people better understand what it is doing. Then they can see whether it is appropriate themselves. I've never used it in the X86 RPD version, but I assume it works the same. If so, the same caveats apply related to the number of partitions that are to be copied and which one gets shrunk/expanded. Bearing in mind that the type of SD cards that can be copied are independent of where SD card copier is hosted.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

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

Re: SD Card Copier

Mon Feb 25, 2019 11:35 am

B.Goode wrote:
Mon Feb 25, 2019 10:56 am
However, this thread has been posted in the Raspberry Pi Desktop for PC and Mac sub-forum.

I suspect that the descriptions provided may not be directly applicable to that distribution?
The standard layout for the RPD for PC (at least, I suspect Mac is the same), is for a single partition. I doubt the SD Card Copier is set up to handle that case.
It would also have to handle the bootloader, with the stub being in the MBR (which must be bootable), and the rest being in the unused space between the MBR and the first partition.
Actually, that is not too hard to do. Just copy the block from sector 0 to the sector before the first partition to the new card/disk/stick, then edit the partition table to create the new / partition, format it and copy the data over. Fiddle around with UUIDs to make sure it is mounted at boot time and it's ready to go.
Signature is on holiday.

User avatar
HawaiianPi
Posts: 3760
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: SD Card Copier

Mon Feb 25, 2019 12:15 pm

procount wrote:
Mon Feb 25, 2019 11:26 am
@B.Goode - I just wanted to explain in the wider sense how SD card copier works to help people better understand what it is doing. Then they can see whether it is appropriate themselves. I've never used it in the X86 RPD version, but I assume it works the same.
Not really. SD card copier couldn't even clone an SD card from another SBC. It really is just for the ARM/Pi version of Rapsbian and NOOBS. It creates the destination card in an expected layout and copies files. It does not copy any non-filesystem space, so it will miss boot code stored before the partition(s), which many other computers use.

It isn't a general backup utility. It's just for the Pi (Raspbian/NOOBS). It may work on other Pi distros, but it's doubtful it will work on much else.

However, the x86 Debian RPiD version does work well to backup Pi micro SD cards at USB 3.0 speeds (zoom!).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
procount
Posts: 1595
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: SD Card Copier

Mon Feb 25, 2019 1:49 pm

I think what you mean is that it does behave exactly as it does in Raspbian (like I explained), but that this behaviour is not appropriate for copying the x86 RPiD partitions, or any other dissimilar partition layouts/formats for the reasons you stated.
One cannot assume that just because it is included in the x86 RpiD version that it can copy the RPiD disk, but it can copy Raspbian/NOOBS and some other SD cards that are formatted for the RPi, as it was originally designed to do.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Return to “Raspberry Pi Desktop for PC and Mac”