[App_rpt-users] How to clone SD card for R Pi

Pierre Martel petem001 at gmail.com
Wed Mar 13 20:41:27 UTC 2019


DD is the way to go. BUT if you expended your filesystem to the max of the
SD card you will have a large image file for nothing.

So to do a backup of only the used space you need to do a clever DD
command.

first you need to shrink the last partition on the sd card. (I wont tell
you how to do it . it is far from the scope of the this message.) but take
a look at Gparted. or just Parted if you have no GUI on the machine.

then you go into command line and do:  fdisk -l as root (or sudo)

here is the output of one of my PI

Disk /dev/mmcblk0: 29 GiB, 31117541376 bytes, 60776448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xdeb2fbcd

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192    96453    88262 43.1M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      98304 60776447 60678144   29G 83 Linux


>From there you need 2 info the block size (512 in my case) and the last
used sector number. ( 60776447 for that exemple)

you then use that command:

DD if="your source device" of =" your destination"  bs=512 count=60776448

that would extract the image file and it would stop 1 block more then the
used size of the last partition.

that way the image will be the exact maximum size it need to and if you
then use another SD card that dont have exactly the same size as the
original you wont run into problem copying it.



Le mer. 13 mars 2019 à 15:30, Bret Taylor <bmtaylor at osd.wednet.edu> a
écrit :

> You dd from one disk to another. You want to write the "image" of your
> source to the destination disk. That will give you an exact copy.
>
> On Wed, Mar 13, 2019 at 12:24 PM Lu V <luvencl8 at gmail.com> wrote:
>
>> Yea I am about to do the same (dd) but I see two partitions pop up when I
>> plug in the SD card . Which do you back up? Or is my w10 doing something
>> odd?
>>
>> Sent from my iPhone, Lu Vencl
>>
>> > On Mar 13, 2019, at 3:02 PM, Jason <cturning1 at gmail.com> wrote:
>> >
>> > I just struggled to use the win32diskimager to duplicate my Allstar
>> card. It's not intuitive, so what worked for me was you have to set the
>> destination file first, then it will let you read the SD card. Then when
>> done you can write to a new card. I almost jumped over to my Linux laptop
>> for dd.
>> >
>> > Jason - N6WBL
>> > _______________________________________________
>> > App_rpt-users mailing list
>> > App_rpt-users at lists.allstarlink.org
>> > http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users
>> >
>> > To unsubscribe from this list please visit
>> http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users and
>> scroll down to the bottom of the page. Enter your email address and press
>> the "Unsubscribe or edit options button"
>> > You do not need a password to unsubscribe, you can do it via email
>> confirmation. If you have trouble unsubscribing, please send a message to
>> the list detailing the problem.
>> _______________________________________________
>> App_rpt-users mailing list
>> App_rpt-users at lists.allstarlink.org
>> http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users
>>
>> To unsubscribe from this list please visit
>> http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users and
>> scroll down to the bottom of the page. Enter your email address and press
>> the "Unsubscribe or edit options button"
>> You do not need a password to unsubscribe, you can do it via email
>> confirmation. If you have trouble unsubscribing, please send a message to
>> the list detailing the problem.
>>
> --
> --Bret Taylor
> Olympia School District
> _______________________________________________
> App_rpt-users mailing list
> App_rpt-users at lists.allstarlink.org
> http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users
>
> To unsubscribe from this list please visit
> http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users and
> scroll down to the bottom of the page. Enter your email address and press
> the "Unsubscribe or edit options button"
> You do not need a password to unsubscribe, you can do it via email
> confirmation. If you have trouble unsubscribing, please send a message to
> the list detailing the problem.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.keekles.org/pipermail/app_rpt-users/attachments/20190313/f77f8aac/attachment.html>


More information about the App_rpt-users mailing list