Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8013

Advanced users • Re: Best practice to set up armhf container image

$
0
0
If diskspace is a problem, for example small but expensive/good onboard soldered eMMC, you should not work with images, but use file- and roottrees. And don't use Ext4 but a modern filesystem that can do reflink copies, snapshots, on-the-fly compression. FreeBSD has ZFS included, Linux has Btrfs build-in in kernel. On hosts with Btrfs rootfs, /var/lib/machines is automatically made a subvolume, so it can be handled separately from the host OS. And container tools can make clones/copies in a blink of an eye of a whole roottree for another container machine/name.
In my example above, if I would not go back to SD-card in the real pi, I make the folder oldslowpi a Btrfs subvolume, so then you can make a temp save copy with:

Code:

btrfs subvolume snapshot oldslowpi oldslowpi.backup
The oldslowpi.backup folder does not occupy new space until you start changing files in there.
Then suppose you messed up oldslowpi in an upgrade or so, you do:

Code:

btrfs subvolume delete oldslowpibtrfs subvolume snapshot oldslowpi.backup oldslowpi
Then you copied the backup ('rollback'), still no extra space needed

Statistics: Posted by redvli — Wed Sep 04, 2024 6:45 pm



Viewing all articles
Browse latest Browse all 8013

Trending Articles