Use tar to package system files into compressed files. Simply reinstall the system, decompress and overwrite it, and restore the system.
Backup: (the entire file system is backed up from the root directory except the home and media directories. The files are stored in sys_bak/clean. tgz in the current user directory)
Sudo tar cvpzf sys_bak/clean. tgz -- exclude =/home -- exclude =/Media/
Restore:
Restore to the root directory to exclude the fstab file
Sudo tar xvpzf sys_bak/clean. tgz -- exclude =/etc/fstab-C/
Update grub. cfg (I forgot to update it once. I had to reload it again because I couldn't find the uuid of the new partition)
Sudo/usr/sbin/grub-mkconfig-O/boot/GRUB/grub. cfg
Supplement:
To facilitate restoration, it is best to use the device name instead of UUID to load partitions in fstab.
Ls-L/dev/Disk/by-UUID can show all partitions by using UUID