linux - Ubuntu 12.04: user configuration sudden rollback

07
2014-07
  • Sergey

    I am a newbie to Linux and after half of year working in Ubuntu (12.04 LTS) had encountered the following strange thing: one day I am doing manual restart of Linux PC and at next boot observing absence of some installed programs or configuration changes which I made in last X months. It looks like Linux did rollback to some old saved point:

    1. profile file has a content without my changes done in this X months
    2. installed programs (in this X months) are marked in Synaptic application as not installed
    3. configuration settings, made in some programs (in this X months), vanished

    Firstly I connected this phenomenon to Linux auto-update, and asked never to do any updates. But now this option is also turned back to be executed daily. What is it??? Does Linux have something like restore feature in Windows (I want to backup my software configuration at some point and then to have possibility restore it!) ?

    EDIT: SOLVED

    At some point I have cleared that ALL my files modification dates are about 3 months ago!.. and suddenly I remembered that in that period did snapshot of my primary Linux HDD partition to another partition (on the same HDD). It seems after one of the soft reboots by some reason (why?) the Linux failed to mount its primary partition and found instead the second one - this snapshot - and booted from it. But how is it possible that Linux doesn't inform a user about such thing? Or at least may be it logged in some GRUB log-files? If yes - where can I find it?
    After I did actual shutdown (not reboot) and then switched PC on – it booted normally!

  • Answers
  • darker.ego

    That's not supposed to happen. It would be one thing if apt automatically uninstalled software because of your /etc/apt/sources.list got corrupt or something, but for settings and files to "roll back" like that is very strange. There is no direct equivalent to Windows "system restore" that I know of, however package lists and profile settings can be backed up and then easily restored using package and profile lists.

    But again, for a machine to 'go back in time' like that is odd indeed. However, I did recently have exactly what you described happen to my Verizon Fios router, which is a Linux powered device. One day my entire router configuration 'rolled back' to the way I had it set it up a couple months before-- effectively destroying many hours of configuration time I had put into my network. The culprit? Probably verizon, as they like to log into their customers routers via telnet periodically and change security settings with no explanation or consent, and they did do just that according to the security logs.

    So when I read this, I figured I'd tell you that it makes little sense, and that perhaps you should back up all of data, download (and VERIFY with GPG) another copy of Ubuntu and then reinstall it on your computer, from the ground up. At least that is what I would do, just to be safe. Although I suppose it is theoretically not so far fetched for a hard drive to time-capsule corrupt in this manner, it's very unlikely and makes me think that there is something fishy going on with your software. And if it is a mechanical error, than chances are it could happen again. Check the SMART status of your hard disc for errors as well, because if your disc somehow is responsible than it could very well happen again.


  • Related Question

    ubuntu - Is this a complete way to back up a Linux installation?
  • DWilliams

    Back when I first made the switch to Linux, I didn't know nearly as much about it as I do now. As a result, there are several fundamental things about how my partitions and operating systems are set up (not using 64bit, only have one root partition, etc). I want to wipe the drive completely and start over.

    Now, I don't want to lose my configurations or installed packages. My plan is as follows:

    1. Copy the entire contents of my home directory off to an external drive
    2. Generate a list of all installed packages using this guide.
    3. Copy contents of external drive back into home folder (which will be on it's own partition now to avoid issues like this in the future
    4. Re-download/install packages following the method in the aforementioned guide.

    Is this a complete way to back up/restore my configurations or will it miss a few things? The only thing I can see it missing are themes and such (which are in /usr and not /home), but I can live with that.


  • Related Answers
  • bandi

    Do not forget to save /etc. You can't copy it over the new installation however, because it might cause problems for your system. Some people even put it even under local version control (e.g. using git or mercurial), which provides even more control.

    Even if you don't use version control, just keep a safe copy of your precious configuration, you can always look up the last known good configuration and compare it to the current one, if something doesn't work as expected.

  • nagul

    If you want to keep your configurations, it's not enough to just copy the home directory. Any modification that required you to enter the admin password was probably stored in /etc. In my experience, it is unfortunately not enough to backup /etc if you're looking to do a full restore. In fact, you can only safely leave off backing up a few directories (/proc, /lost+found, /tmp, /media, /mnt, /sys etc) in this scenario.

    The reason I mention this is because you mention a "complete way to back up" and you cannot have a complete backup without a whole lot of directories.

    If you haven't done a large number of tweaks to the system, I'd recommend going with the steps you have, and configure the packages again manually. There'll be a lot less cruft in the system this way. You can always keep a copy of /etc to help you perform the tweaks again, but I'd advice against blindly copying the /etc files over in the new install.

    Also, when you copy the files over, use cp -a to preserve file ownership and to disable following of symlinks.

    Once you have a new installation, you can use something like debfoster or deborphan to keep down the bloat to a minimum.

  • theotherreceive

    Generally when backing up anything I take a "back up everything unless you know you don't need it" approach. After /home the rest of the file system shouldn't be more than 5-8gb on an average desktop system. Unless you're really stuck for space don't take any chances and just copy everything.

    If you can't afford the space of copying everything then do copy /etc/, and take a look around /var to see if there's anything important to you in there.

    Taking a list of packages is a good idea, will make it much easier to re-install.

  • Igoru

    I think you should backup your home folder, of course, plus those data (like icons and themes) inside /usr. Take a look at /var and /etc as people said before, too...

    Sometime ago i accidentally reinstalled my Ubuntu 9.04. I already had a standalone home partition. I thought it was magic when I saw my desktop there, and all the settings... I just needed to reinstall all my packages - since my theme comes from one too, the gnome-colors package.

    Oh! Don't forget to look at /opt and see if there is any application installed. Take note of it for reinstallation too.

    I think it's all you need. Your config files, extra files, programs. Good luck! =D