On 28/02/2019 08:34, David Taylor wrote:
> I want to copy an existing working SD card to a newer, larger one.
>
> Background: Following the recent discussions on SD card reliability, and
> having had a couple of card failures on other Raspberry Pi systems, I
> have now purchased a 32 GB card for my Raspberry Shake:
>
> https://www.amazon.co.uk/gp/product/B01BDKTQY6/
>
> Currently the 'Shake has an 8 GB card so how would I go about
> transferring the existing 8 GB card to the new 32 GB one?
>
> I don't have access to a Linux systems with multiple SD card slots.
>
> On Windows I would use Paragon's Hard Disk manager to transfer from one
> HD to another and it would keep all the partitions intact but rescaled
> to fit the new HD capacity. I had considered using a Windows disk
> imager program to copy the 8 GB card to a .IMG file and then writing
> that image to the 32 GB card, but I don't know whether Linux would even
> recognise the card, or be able to use its greater capacity.
>
> If I could add a couple of SD card readers to a (different) Raspberry
> Pi, is there a Linux command or program which do the equivalent of
> Paragon's "copy disk and expand partitions"? I'm not familiar enough
> with Linux to know how to do this.
>
Easiest way I've found is - get a USB/microSD card adapter.
All done directly on the Pi.
Put new card in adapter and plug in to USB. Note the /dev/sd?
Unmount newly mounted partition(s)!
Using fdisk, make new partitions - 1 = type c ~ 100M; 2 = type 83 = rest.
Make filesystems: mkfs.vfat /dev/sd?1; mkfs.ext4 /dev/sd?2
Mount the new partitions - unplug and replug USB adapter.
Use: rsync -avx /boot/ /media/{newpartition1}
rsync -avx / /media/{newpartition2}
sync; sync and check there is nothing in {newpartition2}/boot
Check the file cmdline.txt in the {newpartition1}. If there is a
ROOT=PARTUUID= or ROOT=UUID= make sure to change the {longhexnumber} to
the UUID or PARTUUID of {newpartition2}. (blkid is your friend). Or
change to ROOT=/dev/mmcblk0p2. If ROOT=/dev/mmcblk0p2, leave it alone.
Make sure there is no mount line for / in {newpartition2}/etc/fstab.
Then unmount {newpartition1} and {newpartition2}
Power down, swap the SD cards and boot.
Always worked for me (but YMMV). HIH.
--
Chris Elvidge, England
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|