For a while now I've been thinking about the way Windows is often pre-installed on new PCs. Most of the time a new PC has two partitions, one with the entire Windows install and users documents, and one with a restore partition. The CD the customer is given with their new PC is a restore CD, not an install CD. This is a way of avoiding giving the customer a full install CD of Windows, which is not good, specially since they paid for a Windows licence built into the price of their PC.
It's also not a good idea to have your documents on the same partition as your system, as worms etc can jump folders easily enough in Windows, but can't jump partitions. Setting aside the idea of a single Windows partition, the idea of a rescue partition has some upsides. It allows a user to restore their PC back to factory settings with a simple wizard menu. It also made me wonder if this idea could be implemented in Linux too, in our own sane way of course.
We could have a /restore folder at the top of the file tree along with /etc /home /var etc with a pristine copy of all the config files are kept. We could have simple CLI application with an optional GUI to run from the terminal as root where it first scans for all config files, and compares them to the pristine ones on /restore. Any it finds which have been modified it then lists for the user, with some way of pointing out the system config files from userland ones in /home with a few options like restore all, or keep the ones you mark. You could set the GUI out like many applications do for editing toolbars with two columns, one restore and one keep.
When the restore / keep options have been set up, a button like "restore system" would start the process. At which point the config files it's already scanned and found would be copied to a new folder perhaps in /restore with full file paths etc before the restoration process starts. Any config files not in the default install of the distro that it finds will be deleted, meaning apps you installed after install will run fresh unless you moved their config files to the "keep" column.
An additional tab in the system-restore app could be to manually bring back individual apps from the folder it created in /restore before the restore process. That way you could recover a config file you forgot to keep, by clicking it from a menu, and it knows where to put it. An option could be to add a config file of your own for an application you've installed to the /restore partition to save time. Although as this is a "return to new" sweep, that may not be a good idea to start infecting the known good /restore with config files which may or may not be good.
The way these could be laid out is like an XML tree, with Apache2 as one clickable option, and config files for all the various parts of Apache are under the Apache2 item on the menu. Newsbeuter has two config files, one in /etc/newsbeuter and another in ~/.newsbeuter/ which would simply be listed as Newsbeuter.
Ideally this could be a standard thing included in every Linux distro, even if the command is set to pull the /restore partition information from the distros website. As most config stuff is plain text files I can't imagine it taking a lot of space. I would like to see it on every live CD too, to return the installed OS back to new, regardless of the live CD being used. You could put in a live Fedora CD and restore the installed OpenSuSE partition. That way you can fix any installed partition that won't boot with any live CD you have handy. I keep referring to it as a /restore partition, this is more to keep the continuity behind what people understand from OEM Windows installs, in reality it'd be a directory at the top of the file tree, which could be optionally mounted on it's own partition at install.
I still prefer the full install to get that "as new" experience, but I think it'd be an extra piece of mind for new users to risk buying a PC with Linux on it, knowing they can restore it back to "as new" with a command, which is easier than rebooting with the CD in the drive. I say risk, as it is a risk to switch from the devil you know to something you don't. We know the benefits of Linux, while others have yet to experience them for themselves. I also see this as an extra to all the tools we already have, not a side-step into Windows "restore only" options.
Not being a developer myself, I hope this post can spark off some ideas from developers who can find some workable solution to this. There may even be something similar already out there in Linux land and I've never seen it.
If you liked this post, buy me a coffee
Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer
Add new comment