On 2023-09-20, Victor Ivanov <vic.m.iva...@gmail.com> wrote: > On Wed, 20 Sept 2023 at 22:29, Grant Edwards <grant.b.edwa...@gmail.com> > wrote: >> >> That depends on how long it takes me to decide on tar vs. rsync and >> what the appropriate options are. > > I've done this a number of times for various reasons over the last 1-2 > years, most recently a few months ago due to hard drive swap, and I > find tar works just fine: > > $ tar -cpf /path/to/backup.tar --xattrs --xattrs-include='*.*' -C / . > > Likewise to extract, but make sure "--xattrs" is present
Yep, that's pretty much what I decided on based on the tar command shown at https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Stage Interestingly, the Arch Linux Wiki recommends using bsdtar because "GNU tar with --xattrs will not preserve extended attributes". > Provided backup space isn't an issue, I wouldn't bother with > compression. It could be a lot quicker too depending on the size of > your root partition. Both the drive being "fixed" and the backup drive are in a USB3 attached dual slot drive dock, so I'm thinking compression might be worthwhile. > Just make sure you update /etc/fstab and bootloader config file with > the new filesystem UUID or partition indices. I always forget one or the other until after I try to boot the first time. That's why I keep systemrescuecd and Gentoo minimal install USB drives on hand. -- Grant