Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd please sign up again. Thanks!

Timeshift & Similar Solutions - Safeguard & Recover Your Linux

Discussion in 'Linux Other' started by wizardfromoz, Dec 12, 2017.

  1. Condobloke

    Condobloke Active Member

    Joined:
    Apr 30, 2017
    Messages:
    100
    Likes Received:
    78
    atanere likes this.
  2. wizardfromoz

    wizardfromoz Well-Known Member

    Joined:
    Apr 30, 2017
    Messages:
    698
    Likes Received:
    729
    Afternoon all :).

    This for both @Bayou Bengal and Brian (@Condobloke ) may be of assistance.

    USB stick or DVD with a Linux Mint 18.3 series on it (could have been your install medium) desktop environment does not matter, ie could be MATE, Cinnamon, Xfce or KDE-Plasma.

    The following is based on your having used Timeshift already to take a snapshot of your Distro. You should know where you keep your snapshots in advance. For example, on my HDD for the Toshiba I keep them on /dev/sda32, and on my powered external HDD I keep them on /dev/sdb4.

    1.Boot from the stick and find Timeshift and launch it, the Wizard (not me) will likely appear.

    2.Close the wizard, and you'll be presented with a window that may have nothing on it, or may have a list of your Timeshift snapshots. If it has nothing on it, go to Settings - Location and check the radio button for the partition you store on, close out and the snapshots will appear.

    3.You may see an indication that from this mode, you can only restore a snapshot, not take one. Makes sense.

    4.Choose the snapshot you want to restore, and click Restore. Remember that if you have a full snapshot and an incremental snapshot, you can just click the recent incremental snapshot, because it is hardlinked to the full, so both will go into action.

    Once the Restore is completed, it will instruct you to reboot, and what to do if it does not work.

    For purposes of the above exercise, it does not matter if the distro you have on the stick does not match the Distro you are trying to resurrect. It could be that my Linux Lite has headed south for the winter, and I could boot from a Linux Mint 18.3 stick and restore it (this is handy if you have reused your installation stick, ie overwritten it). You could even use a Manjaro stick/DVD, Fedora, whatever I have described on page one with how to install Timeshift, and get the same result.

    In those cases, you would install Timeshift on the Live medium, but it would only be there while you have the stick in session, unless you have Persistence enabled. For Persistence, Google something like "linux howtogeek persistence" and go from there.

    Unetbootin, Linux Live, Universal USB Installer and some others have the ability to provide Persistence. Persistence only works on USB sticks, not a CD/DVD.

    For the circumstances where you cannot get in to a graphical environment, such as @Bayou Bengal has described, I will deal with that next post.

    Cheers

    Wizard
     
    atanere likes this.
  3. wizardfromoz

    wizardfromoz Well-Known Member

    Joined:
    Apr 30, 2017
    Messages:
    698
    Likes Received:
    729
    ...Actually, I have. The USB stick method will work, provided that the loss of GUI accessibility is confined to your Distro itself, and not endemic, that is, not reflecting a deeper graphics problem on the part of your computer's graphics GPU or equivalent.

    I will deal with the uses of Timeshift's Terminal capacity at a later date but soon (road trip coming up). But suffice it to say that the article Brian has linked to provides a broad picture, but the article on Tony's site dates back to January 2015 (only a few months after I started using Timeshift), and v1.7 has long since been replaced by Versions 16, 17 and 18.

    The Terminal Help likewise has changed, you can get a current idea by going to Terminal (where Timeshift is installed and entering

    Code:
    timeshift --help
    ... that's a double dash before help.

    Cheers

    Wiz
     
    atanere likes this.
  4. wizardfromoz

    wizardfromoz Well-Known Member

    Joined:
    Apr 30, 2017
    Messages:
    698
    Likes Received:
    729
    SABAYON USERS in particular, but other Users can take note.

    ...So at #18 I flagged a potential problem, which is to do with restoring from a Timeshift snapshot.

    TARGET PARTITION - Left as is or deleted?

    When you restore a snapshot, you can choose to restore it to the same partition your Distro was on, or to a different partition you have prepared in advance.

    If the former, you can make a choice of whether to :
    1. Delete the partition using eg GParted and create a new one in the same spot, or
    2. Simply restore over the top of the Distro that you had in place, working or otherwise.
    EXAMPLE 1

    My Sabayon, on my /dev/sda17, has had an adverse reaction to an update. I can leave /dev/sda17 intact, launch Timeshift, choose /dev/sda17 to restore to, and rollback to where I was before the update/s.

    EXAMPLE 2

    Same as the above, but I choose to delete /dev/sda17 using GParted (or else I deleted it accidentally whilst in GParted), which leaves me Unallocated Space, I then right-click that and choose New and duplicate the partition size for a new but empty /dev/sda17. I then run my Timeshift Restore.

    EXAMPLE 3

    Same as the above two, but this time I create a new Partition same size or not (only has to be a couple of GB larger than the snapshot), and "Restore" to that new partition, I'll call it /dev/sda20 because I have a couple more Linux at 18 and 19.

    Can we expect any problems from any of these scenario?

    No for many Distros (you might get a warning or message at bootup), but YES for some, and Sabayon is one of them.

    Example 1 works fine with Sabayon. (This was what I had done prior to writing the previous Posts).

    Example 2 - it fails to boot properly.

    The use of GParted generates a new UUID (Universal Unique IDentifier) for my /dev/sda17, and the restored snapshot, even though it "updates bootloader configuration", does not accommodate that change. The screenshot from boot shows.

    [​IMG]

    SCREENSHOT 1 - BOOT FAILURE

    In order to remedy this, I was able to do the following:

    1. At my Grub Menu, down the bottom of the screen, I chose 'e' to edit the startup commands. Screenshot 2 illustrates what that looks like, and look for the three (3) references to UUID

    [​IMG]

    SCREENSHOT 2 - Startup Edit Commands


    2. Having armed myself (from another Distro I booted, but you could use a USB stick or CD/DVD with GParted on it) with the UUID of the new partition, I replaced all three instances of the old UUID with the new, and then successfully booted.

    NOTE that this will only hold for the current session, and will not be sustained with reboots.

    3. In Sabayon, I then went to Terminal and performed the following:

    Code:
    sudo grub2-install /dev/sda
    
    #and
    
    sudo grub2-mkconfig -o /boot/grub/grub.cfg
    Note that with that second string of code - the file /etc/default/grub erroneously has

    Code:
    # To populate all changes in this file you need to regenerate your
    # grub configuration file afterwards:
    #     'grub2-mkconfig -o /boot/grub2/grub.cfg'
    That is not so, I have added

    Code:
    #CRAP - 1ST PART RIGHT, 2ND PART IS grub, not grub2, also
    #'grub2-mkconfig' is interchangeable with 'grub-mkconfig'
    ... but that's just me o_O

    4. Reboot once grub is updated, and all is good.

    I have yet to check against Example 3, but will report back here with my outcome.

    Cheers

    Wizard
     
    atanere likes this.
  5. Condobloke

    Condobloke Active Member

    Joined:
    Apr 30, 2017
    Messages:
    100
    Likes Received:
    78
    I used 'unetbootin' to write an image of LM18.3 (cinnamon) to a usb thumb drive.

    (unetbootin is already installed on lm18.3)

    I allowed 1000Mb of persistence, ....overkill I know but the thumb drive has capacity of 16Gb

    When I booted from that usb, it booted readily....however with just a plain linux desktop....no panel or taskbar etc at the bottom of the screen.

    So, I right clicked the desktop and chose desktop settings......used the back arrow to return to system settings....and then chose 'Panel'

    Clicked on 'add new panel'....and then right clicked on the panel to open edit mode....and then on 'add applets' to panel. For some reason the "menu" applet was already selected, so I deselected it and then selected it again and clicked on "add". Closed the edit mode.
    Then clicked on 'menu...typed in Timeshift....settings....Location.....selected the hard drive that my snapshots have been saved to....all there. No drama.

    Note that timeshift is in "restore only' mode

    All that would be necessary would be to select one of the snapshots and click on restore. make a cuppa and wait 5 minutes or so.

    Reboot and all will be well. catastrophe averted.
     
    atanere likes this.
  6. wizardfromoz

    wizardfromoz Well-Known Member

    Joined:
    Apr 30, 2017
    Messages:
    698
    Likes Received:
    729
    Yes, as said (but it bears repeating) in my Post at #22

    That's good news Brian, and having the Persistent USB can be a lifesaver, this will work for whatever Distro you have taken a snap of.

    Unetbootin, LinuxLive (Lili), Universal USB Installer, (French) Multisystem are just some of the burning solutions which can accommodate building in Persistence.

    Any questions on burning/persistence, please start a new thread and we will swing by :D

    Leaving on road trip imminently but will try to stay in touch if WiFi access works.

    Cheers

    Wizard
     

Share This Page