• Compressing Ras Pi SD card image

    From Folderol@3:770/3 to All on Sun Jun 27 15:03:10 2021
    I'm find it impossible to do this at the moment, and I need to do so, because I was surprised to find that SC card I'd built on is just about the max possible for 16G, so the image won't fit on any others of that nominal size :(

    The PiShrink utility seems to do the compression, but the image doesn't work when put on another card.

    I'm wondering if it has anything to do with the fact that this is a devuan beowulf build not debian. Just to make it more 'interesting' I can no longer find the image I originally got off the 'net :(

    If I ever get to recover this, I'll find an 8G card for the reference build!

    --
    W J G
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Joerg Walther@3:770/3 to Folderol on Sun Jun 27 18:18:25 2021
    Folderol wrote:

    I'm find it impossible to do this at the moment, and I need to do so, because I
    was surprised to find that SC card I'd built on is just about the max possible >for 16G, so the image won't fit on any others of that nominal size :(

    Not all 16G SD cards are of exactly the same size, they may be a couple
    of Megs smaller or larger. You may want to try to write onto the new
    card with the "USB Image Tool" and the option "Truncate oversize
    images..." set to on. This worked for me on a couple of occastions.

    - j -

    --
    Mail address is valid for a limited time only.

    And now for something completely different...
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From druck@3:770/3 to Joerg Walther on Sun Jun 27 23:08:57 2021
    On 27/06/2021 17:18, Joerg Walther wrote:
    Folderol wrote:

    I'm find it impossible to do this at the moment, and I need to do so, because I
    was surprised to find that SC card I'd built on is just about the max possible
    for 16G, so the image won't fit on any others of that nominal size :(

    Not all 16G SD cards are of exactly the same size, they may be a couple
    of Megs smaller or larger. You may want to try to write onto the new
    card with the "USB Image Tool" and the option "Truncate oversize
    images..." set to on. This worked for me on a couple of occastions.

    I would not recommend that, although it might appear to work initially,
    you will have problems when you come to use partition or filing system
    tools on such a card.

    Far better is to use GParted on the original card to shrink it by a
    couple of MB until it small enough to fit on the card you want to copy
    it to.

    ---druck
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Computer Nerd Kev@3:770/3 to Joerg Walther on Sun Jun 27 22:59:59 2021
    Joerg Walther <usenet2@vocabsheets.de> wrote:
    Folderol wrote:

    I'm find it impossible to do this at the moment, and I need to do so, because I
    was surprised to find that SC card I'd built on is just about the max possible
    for 16G, so the image won't fit on any others of that nominal size :(

    Not all 16G SD cards are of exactly the same size, they may be a couple
    of Megs smaller or larger. You may want to try to write onto the new
    card with the "USB Image Tool" and the option "Truncate oversize
    images..." set to on. This worked for me on a couple of occastions.

    Fsarchiver can restore one of its file system archives to a
    differently sized partition, however if you have multiple
    partitions then you'll need to create an equivalent partition
    table on the new card manually.

    --
    __ __
    #_ < |\| |< _#
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Folderol@3:770/3 to Computer Nerd Kev on Mon Jun 28 07:51:31 2021
    On Sun, 27 Jun 2021 22:59:59 +0000 (UTC)
    not@telling.you.invalid (Computer Nerd Kev) wrote:

    Joerg Walther <usenet2@vocabsheets.de> wrote:
    Folderol wrote:

    I'm find it impossible to do this at the moment, and I need to do so, because I
    was surprised to find that SC card I'd built on is just about the max possible
    for 16G, so the image won't fit on any others of that nominal size :(

    Not all 16G SD cards are of exactly the same size, they may be a couple
    of Megs smaller or larger. You may want to try to write onto the new
    card with the "USB Image Tool" and the option "Truncate oversize
    images..." set to on. This worked for me on a couple of occastions.

    Fsarchiver can restore one of its file system archives to a
    differently sized partition, however if you have multiple
    partitions then you'll need to create an equivalent partition
    table on the new card manually.


    Thanks for all the suggestions. fsarchiver looks like the best bet. I've seen a crib sheet on-line specifically for the Pi using it to compress the main partition, with added instructions to get the FAT one, then how to recombine them on a new card.

    This looks promising. I'll try that, and if it works, I'll get an 8G card and flash to that as my development card, after which (hopefully) I can just use the
    dumb DD method to put copies on 16G cards.

    --
    W J G
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Nikolaj Lazic@3:770/3 to All on Mon Jun 28 08:24:34 2021
    Dana Sun, 27 Jun 2021 15:03:10 +0100, Folderol <general@musically.me.uk> napis'o:
    I'm find it impossible to do this at the moment, and I need to do so, because I
    was surprised to find that SC card I'd built on is just about the max possible
    for 16G, so the image won't fit on any others of that nominal size :(

    The PiShrink utility seems to do the compression, but the image doesn't work when put on another card.

    I'm wondering if it has anything to do with the fact that this is a devuan beowulf build not debian. Just to make it more 'interesting' I can no longer find the image I originally got off the 'net :(

    If I ever get to recover this, I'll find an 8G card for the reference build!


    This should not be done on the live system...
    use another Linux system (another card on the Pi or
    another machine with Linux).

    Use resize2fs to shrink it to minimal possible size.
    Test if it still works.
    Copy the whole card to the bigger one.
    Use partition editor to make the partition bigger.
    Use resize2fs to resize the file system in the
    bigger partition.

    And it should work.
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Folderol@3:770/3 to All on Mon Jun 28 21:42:37 2021
    Thanks everyone for the suggestions, but somehow all of them failed.

    The good news is that I was eventually able to find a compressed image of
    a recent (May 2021) build of 64 bit devuan beowulf. I've tested this on one of my 16G cards and with all the extras I needed for my project it worked perfectly, even though the image is classed as 'experimental'. Also I now know that the completed build uses less the 4G of the card in total. Therefore the idea of getting an 8G card and building on that as my reference, then flashing to 16G ones is perfectly feasible.

    The project in question is a softsynth one, that I call the YoshimiPi. Here it is working along with the Rosegarden sequencer.

    http://www.musically.me.uk/themainevent/YoshimiPi_Working.jpg

    It's pumping out 48kHz 16 bit audio without a single Xrun :)
    CPU temperature is just under 60deg C, and that's without a heatsink.

    --
    W J G
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Tauno Voipio@3:770/3 to Folderol on Tue Jun 29 14:12:37 2021
    On 28.6.21 23.42, Folderol wrote:
    Thanks everyone for the suggestions, but somehow all of them failed.

    The good news is that I was eventually able to find a compressed image of
    a recent (May 2021) build of 64 bit devuan beowulf. I've tested this on one of
    my 16G cards and with all the extras I needed for my project it worked perfectly, even though the image is classed as 'experimental'. Also I now know
    that the completed build uses less the 4G of the card in total. Therefore the idea of getting an 8G card and building on that as my reference, then flashing
    to 16G ones is perfectly feasible.

    The project in question is a softsynth one, that I call the YoshimiPi. Here it
    is working along with the Rosegarden sequencer.

    http://www.musically.me.uk/themainevent/YoshimiPi_Working.jpg

    It's pumping out 48kHz 16 bit audio without a single Xrun :)
    CPU temperature is just under 60deg C, and that's without a heatsink.


    Did you remember to expand the installed filesystem to fill up the card?

    --

    -TV
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Folderol@3:770/3 to Tauno Voipio on Tue Jun 29 20:03:37 2021
    On Tue, 29 Jun 2021 14:12:37 +0300
    Tauno Voipio <tauno.voipio@notused.fi.invalid> wrote:

    Did you remember to expand the installed filesystem to fill up the card?

    Not necessary with the original install as this automatically expands a first time startup. However, even then fsck reports a bad superblock (although the image runs perfectly well in the Pi). trying to correct this or change the size just seems to stop it working completely.

    Bearing in mind the space actually used, even with an 8G card as the reference one, that still gives over 4G of space for user data.

    A collection of over 100 combined Yoshimi + Rosegarden projects is less that 2G so I don't see the wastage as a problem - besides, should you really trust that much data to an SD card?

    --
    W J G
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Tauno Voipio@3:770/3 to Folderol on Wed Jun 30 10:18:45 2021
    On 29.6.21 22.03, Folderol wrote:
    On Tue, 29 Jun 2021 14:12:37 +0300
    Tauno Voipio <tauno.voipio@notused.fi.invalid> wrote:

    Did you remember to expand the installed filesystem to fill up the card?

    Not necessary with the original install as this automatically expands a first time startup. However, even then fsck reports a bad superblock (although the image runs perfectly well in the Pi). trying to correct this or change the size
    just seems to stop it working completely.

    Bearing in mind the space actually used, even with an 8G card as the reference
    one, that still gives over 4G of space for user data.

    A collection of over 100 combined Yoshimi + Rosegarden projects is less that 2G
    so I don't see the wastage as a problem - besides, should you really trust that
    much data to an SD card?


    This means that your way of shrinking the image is not too good.

    If you have another Linux computer with enough memory to
    store the image, the steps are:

    1. Loop mount the image:

    sudo losetup -f -P path_to_the_image

    2. Check loop setup:

    sudo losetup

    3. Run gparted on the loop device:

    gparted /dev/loopx

    where loopx is the device shown on the last losetup

    4. Select the ext4 partition and shrink it moving the
    top limit down. There must be some free space left
    on the shrunk part. gparted knows to complain if the
    suggested size is too small.

    After shrinking, select 'information' from the
    'Partition menu' and note 'Last sector' number.
    Remember to save the update partition table.

    5. Exit gparted and undo loop setup:

    sudo losetup -D

    6. The size of the new image is the 'Last sector' number
    + 1 bytes. Truncate the image:

    truncate -s the_new_size path_to_image

    That's it.

    Of course, we need all the utilities necessary for
    loop setup, GNU parted and truncate.

    The partition resize could be done with resize2fs,
    and gparted uses it. I find it easier to let gparted
    create the correct commands for the low-level utilities.

    --

    -TV
    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Folderol@3:770/3 to Tauno Voipio on Wed Jun 30 09:34:55 2021
    On Wed, 30 Jun 2021 10:18:45 +0300
    Tauno Voipio <tauno.voipio@notused.fi.invalid> wrote:

    On 29.6.21 22.03, Folderol wrote:
    On Tue, 29 Jun 2021 14:12:37 +0300
    Tauno Voipio <tauno.voipio@notused.fi.invalid> wrote:

    Did you remember to expand the installed filesystem to fill up the card? >>>
    Not necessary with the original install as this automatically expands a first
    time startup. However, even then fsck reports a bad superblock (although the >> image runs perfectly well in the Pi). trying to correct this or change the size
    just seems to stop it working completely.

    Bearing in mind the space actually used, even with an 8G card as the reference
    one, that still gives over 4G of space for user data.

    A collection of over 100 combined Yoshimi + Rosegarden projects is less that 2G
    so I don't see the wastage as a problem - besides, should you really trust that
    much data to an SD card?


    This means that your way of shrinking the image is not too good.

    If you have another Linux computer with enough memory to
    store the image, the steps are:

    1. Loop mount the image:

    sudo losetup -f -P path_to_the_image

    2. Check loop setup:

    sudo losetup

    3. Run gparted on the loop device:

    gparted /dev/loopx

    where loopx is the device shown on the last losetup

    4. Select the ext4 partition and shrink it moving the
    top limit down. There must be some free space left
    on the shrunk part. gparted knows to complain if the
    suggested size is too small.

    After shrinking, select 'information' from the
    'Partition menu' and note 'Last sector' number.
    Remember to save the update partition table.

    5. Exit gparted and undo loop setup:

    sudo losetup -D

    6. The size of the new image is the 'Last sector' number
    + 1 bytes. Truncate the image:

    truncate -s the_new_size path_to_image

    That's it.

    Of course, we need all the utilities necessary for
    loop setup, GNU parted and truncate.

    The partition resize could be done with resize2fs,
    and gparted uses it. I find it easier to let gparted
    create the correct commands for the low-level utilities.

    Thanks for the info, but it's not me doing the initial shrink. That's the devuan image. I simply used the recommended dd command to copy it across to
    the card.

    partitionmanager will then report:

    "Device found: Multi Flash Reader"
    getting smart status failed for "/dev/sdc" : Operation not supported "Partition ‘/dev/sdc2’ is not properly aligned (last sector: 3808592, modulo:
    1361)."

    However, on inserting the card in the pi, it will self expand and run quite normally.

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