[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How do I clone a Debian Distro from a 32Gb Class 10 MicroSD card to a 16Gb Class 10 A1 MicroSD card?



On Jo, 30 sep 21, 16:26:18, Myron wrote:
> 
> I know. It's not advisable to resize a live root partition.  Maybe create a
> live boot Linux CD or USB with Gparted on it and do it that way?  It would
> be a lot simpler if I can just resize the file system, which seems to be
> the simple part using resize2fs.  It's the shrinking the partition bit I'm
> not sure about.

Using *another* system running a live Linux with GParted is probably the 
easiest way, provided you have a supported SD card reader with at least 
one slot:

1.  Boot another computer with a live distro that has GParted on it.

2.  Optional: if you have enough storage I would strongly suggest you 
take an image of the bigger SD card as backup in case something goes 
wrong.

3.  Use GParted to resize the partition as needed.

3b. In case you can't connect both SD cards at the same time take 
another image of the bigger SD card.

4.  Use `dd` or similar to clone the bigger SD card or the image taken 
in step 3b. to the smaller card.

5.  Open the smaller SD card in GParted and grow the partition to the 
size available.

Disclaimer: steps above are untested.

`dd` might error out when copying the image to the smaller SD card (out 
of space), but this is expected. As long as you resized the partition 
properly all data should be there.

If in doubt just resize the partition to be definitely smaller than the 
small SD card (by a GB or so).

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser

Attachment: signature.asc
Description: PGP signature


Reply to: