Restore root from SquashFS or TAR
I'm running a dual-boot Ubuntu & Windows 10 Pro configuration. Before re-installing Windows I made 2 full backups with TAR and SquashFS of / with the following commands:
SquashFs:
sudo mksquashfs / /media/dennis/Backup_SSD/Ubuntu_N580VD_Backup.sqsh -e media dev run mnt proc sys tmpTAR:
sudo tar czf /media/dennis/Backup_SSD/Ubuntu_N580VD_Backup.tar.gz --exclude=/backup.tar.gz --exclude=/dev --exclude=/mnt --exclude=/media --exclude=/proc --exclude=/sys --exclude=/tmp --exclude=/lost+found /After re-installing Windows Ubuntu failed to boot:
tpm_crb MSFT0101:00: [Firmware Bug]: ACPI region does not cover the entire command/response buffer. [mem 0xfed40000-0xfed4087f flags 0x201] vs fed40080 f80
Couldn't get size: 0x800000000000000e
PKCS#7 signature not signed with a trusted keySo I re-installed Ubuntu on sda6 and now it's booting again. But how do I replace the content of the fresh install on partition sda6 with the content of my .tar.gz or .squashfs backup files?
sda 238.5G
├─sda1 ntfs 499M | Recovery
├─sda2 vfat 100M | Boot (EFI)
├─sda3 16M | Microsoft reserved
├─sda4 ntfs 137.4G | Windows
├─sda5 swap 4G | SWAP
└─sda6 ext4 96.5G | Ubuntu 3 1 Answer
Looking at your logs, you made a hot system backup instead of a cold system backup, which means that files were being modified while you were making your backup. On top of this, your OS (/) and data (/home) are not separated, so under these, far from ideal circumstances, I would:
- log into the console as root, not the GUI nor your admin user
Mount the squash file system:
mkdir /media/restore mount /media/dennis/Backup_SSD/Ubuntu_N580VD_Backup.sqsh /media/restore -t squashfs -o loopCopy your data:
cp --recursive --preserve=all /media/restore/home/* /home/- Shut down the machine in its working state
- Take a CloneZilla live cold backup of your system in its current state.
For the following steps, it'll depend on your luck and the kind of applications you were running at the time you made the hot backup.
Copy everything from your hot backup except
/runwhich is a virtual file system set up in memory by the kernel:rsync --archive --verbose --progress /media/restore/* / --exclude /media/restore/runReboot and pray to the gods of Torvalds and Stallman that this'll work. ¯\_(ツ)_/¯
- If it doesn't work:
- Restore your CloneZilla Live cold backup
- Reinstall all your applications. (Individual configurations of these applications are still available in your
/homefrom the data restore.) - For heaven's sake: don't take hot system backups and put the CloneZilla Live ISO file in your grub menu and take cold backups from now on.
- If it does work: Remove root login please. Congratulations! I never thought you would reach this step as hot backups are notoriously unreliable.