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.
You can just use `# cat /dev/your-disk > /dev/your-stick, no need for a (dd) scalpel there.
If your system uses UUID’s in
/etc/fstab
, you have to change them to match the current partitions to have it bootable.lsblk -o+UUID
is nice for that.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
?
fill up the remaining space on the drive completely with 0s with a dummy file you delete then, before gzipping
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.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?
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.
Wait what? You can use cat like that?! That’s dope
Everything is a file. ☺
… not if you took a blue pill overdose …
@MonkderZweite @Secret300
?