I know about Clonezilla and copy pasting partitions with gparted, but can I just use dd to copy a partition with batocera to a USB stick and will it then boot from the stick? Do I have to set the boot flag or take any other steps?

Thank you for any tips.

  • bartolomeo@suppo.fi
    hexagon
    ·
    10 months ago

    Ok, thanks. That sounds pretty good.

    If i want to compress it and save it as a backup can I do

    cat /dev/sda3 | gzip -9 > drive.img.gz

    ?

    • MonkderZweite@feddit.ch
      ·
      edit-2
      10 months ago

      Yes, but like @kuneho said, since "deleted" stuff only is marked as deleted (not wiped), there's always a bunch of random on the "empty" space part of a disk, which compresses badly.

      Do cat /dev/zero > /path/to/mounted/partition/zeroes and delete it after cat errored out because no space, to fill the "empty" space with zeroes.

      • bartolomeo@suppo.fi
        hexagon
        ·
        10 months ago

        That worked really well! I got a 50gb partition with about 30gb free space into a 10gb zipped image. Is there any way to show progress during the operation like with dd's status=progress?

        • MonkderZweite@feddit.ch
          ·
          edit-2
          10 months ago

          I often use pv instead of cat for this. And there's some 'hack' where some tool looks at some kernel feature to guess progress of cp & co. But i forgot it's name.