• Re: PI SDcard images

    From Nikolaj Lazic@3:770/3 to All on Fri Jun 17 20:02:10 2022
    Dana Mon, 13 Jun 2022 21:09:29 +0100, druck <news@druck.org.uk> napis'o:
    On 11/06/2022 08:04, R.Wieser wrote:
    marty,

    I have ordered a 64GB card in case I ever need to make a new card from the >>> 32GB backup image. Not sure what else to do, it is a hassle.

    As far as I know DD can be told to only copy upto a certain size.

    Though the problems are than to :

    1) find some way to shrink the (last) partition (of a new installation) so >> at the end there is some unused space (200 MB ?)

    Use the gparted tool.

    And add partition at the end of the card. And make it start from the same sector on all cards. The end sector will be different, but it does not matter. And mark it as some other FS (for example ff).
    And than automatic expand will expand it to that place.


    2) find out how to (automatically, scripted) obtain the "certain size"
    (mentioned above).

    Just knock off 0.1GB from whatever size card you are using.

    ---druck


    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From R.Wieser@3:770/3 to All on Sat Jun 18 10:01:54 2022
    Scott,

    use gparted to shrink the image size to the minimum needed
    to create the image, and to expand into the full space of a
    new SD card once the image is dd'd onto it.

    gparted knows enough of the different filesystems to be able to do that ? Hmmmm... Maybe I should take a look at it.

    Although I like the idea of shrinking the backups to whats actually used, it also means I need to keep an un-shrunken (plain DD) backup with gparted on
    it to be able to do that ...

    Thanks for the info.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Tauno Voipio@3:770/3 to scott@alfter.diespammersdie.us on Sat Jun 18 10:52:36 2022
    On 17.6.22 23.46, scott@alfter.diespammersdie.us wrote:
    R.Wieser <address@not.available> wrote:
    As far as I know DD can be told to only copy upto a certain size.

    Though the problems are than to :

    1) find some way to shrink the (last) partition (of a new installation) so >> at the end there is some unused space (200 MB ?)

    gparted will do that for you. I have a project at work where I do just that to image it across multiple Raspberry Pis: use gparted to shrink the image size to the minimum needed to create the image, and to expand into the full space of a new SD card once the image is dd'd onto it.

    2) find out how to (automatically, scripted) obtain the "certain size"
    (mentioned above).

    I've not automated this, but once I have the partition size minimized, I use fdisk to get the last block of the last partition. Multiplying that by 2048 gets the image size in MB; pass that to dd as the "count" parameter, with "bs=1048576" to set the block size.


    No need for using fdisk there, gparted shows the numbers of blocks
    in partitions. Just check the last block of the last partition, add
    one and multiply with block size (usually 512).

    --

    -TV

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From scott@alfter.diespammersdie.us@3:770/3 to R.Wieser on Tue Jun 21 06:14:12 2022
    R.Wieser <address@not.available> wrote:
    gparted knows enough of the different filesystems to be able to do that ? Hmmmm... Maybe I should take a look at it.

    The only common filesystem I can think of that gparted might not handle is ExFAT...and a quick search indicates that v1.2 and up support ExFAT. It
    even supports NTFS.

    --
    _/_
    / v \ Scott Alfter (remove the obvious to send mail)
    (IIGS( https://alfter.us/ Top-posting!
    \_^_/ >What's the most annoying thing on Usenet?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)