0

I have a very strict system with the bare minimum applications on for security reasons since I work with medical data.

Sometimes the laptops we use messup for one reason or another, won't boot, can't login, botting process gets corupt etc. When this happens the laptop gets sent to me by mail to repair. This is time consuming and expensive.

It would be better if there was a read only compressed image of Mint with the default image I have created.

Unfortunatly my users are not to be trusted with anything techinical. I can walk them through on the phone. Thats it.

Is there a way i can restore the OS from a squashfs system and then DD over the original system so it can boot like it should with the defaults?

Definity
  • 127
  • 6

1 Answers1

1

Squashfs is actually a good way to make system backups. It's like mountable tar.xz, with the nice feature that compression gets parallelized automatically. Then you can either mount and copy all the contents to the new file system, or unsquashfs it there, it doesn't matter.

Actually I am using that almost exactly as you described: there is a compressed squashfs root with read-write overlay. In my case it is even more fancy, because it also sets up bcache to speed up a hard drive and also everything is encrypted. But to achieve this I developed a complete custom initramfs init script, which is not very simple. And there's a little detail: I use that with Gentoo.

Also, this is has almost nothing to do with dd (which is used only when I update all this hamburger). I don't "reset" the system back often, but the procedure is all but hard: recreate the overlay (lvcreate + mkfs + create three directories in it, done).

I mentioned lvcreate, and this is the way I suggest you to take. Use LVM, reserve some space, and let them run from the snapshot. When anything breaks, reset the snapshot. This will work without custom init script.

Nikita Kipriyanov
  • 10,947
  • 2
  • 24
  • 45
  • And this will work with EFI, Boot and Root partition? – Definity Aug 25 '22 at 15:52
  • I doubt users will break efi and boot partition. Everything else could be snapshotted. (By the way, it is possible to have a single partition which is both /boot and ESP — again, I do have this configuration on the laptop from which I am writing this.) – Nikita Kipriyanov Aug 25 '22 at 15:55
  • Okay thanks :) I have had a copy of time when EFI broken but thats probably becuase we broke the bootloaders of Chromeboxes and installed Mint on them. – Definity Aug 26 '22 at 09:36