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, 2017 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 Well-Known Member

    Joined:
    Apr 30, 2017
    Messages:
    307
    Likes Received:
    411
    atanere likes this.
  2. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,340
    Likes Received:
    1,529
    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 Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,340
    Likes Received:
    1,529
    ...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 Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,340
    Likes Received:
    1,529
    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 Well-Known Member

    Joined:
    Apr 30, 2017
    Messages:
    307
    Likes Received:
    411
    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 Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,340
    Likes Received:
    1,529
    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
     
  7. CptCharis

    CptCharis Active Member

    Joined:
    Feb 27, 2018
    Messages:
    203
    Likes Received:
    221
    Good morning @wizardfromoz
    Just a question,
    Lets say that I made a Snapshot and I stored it in my internal HDD,
    I can find it under /timeshift/snapshots/2018-04-24 11-00/localhost.
    Can I remove (copy-paste) it in an external storage devise (USB stick, external HDD), and use it again.
    Is gone work in this way?

    Thanks and hope you are well.

    Cheers.
     
  8. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,340
    Likes Received:
    1,529
    Yes thanks, friend, and same back at you :p

    In answer to your question, yes and no. :rolleyes:

    Briefly, putting a suggestion before the details:

    Better is to take your external drive, if the speeds are quick and it is reliable, create a partition on it formatted to EXT4, using gparted, name it eg mytimeshift (either by label or naming the partition itself), and then open your Timeshift on your HDD, go to Settings, "point" to the new partition, and run a full snapshot to be stored on the external drive.

    Likewise if you used a USB stick of sufficient size, remembering to format it to EXT4 over FAT32.

    Why?


    Code:
    chown
    
    and
    
    chmod
    Permissions issues, for the most part. I am aware that you are becoming familiar with Linux commands such as the above.

    If you were to set up an EXT4 partition on a stick or an external drive, and give it a new folder "timeshift" and then, within that, a subfolder called "snapshots", and then drag and drop "2018-04-24 11-00/localhost", you would encounter problems.

    You would be OK with that part of it which comprised your Home folder or partition (provided it was 100% populated with data under your own ownership), but once you start coming to files and folders such as /etc /var/ usr /usr/bin etcetera, it will stall and say you don't have permisssion.

    If you then withdraw and repeat the process, opening your File Manager, selecting an area and right-clicking and choose "Open as Administrator or Root" (if your FM supports that function, and your Mint does) ... the process will go ahead, but at the end, the copied data on the destination end will then have all its folders and files owned by Root.

    This would make a restoration of a screenshot a nightmare.

    I can illustrate some of the hurdles with screenshots, but see if you get the picture, and ask away, as needed.

    Cheers

    Wiz
     
    atanere likes this.
  9. CptCharis

    CptCharis Active Member

    Joined:
    Feb 27, 2018
    Messages:
    203
    Likes Received:
    221
    I think that I understood @wizardfromoz
    Of course I have to study a little bit more

    Thanks for your time.
     
    wizardfromoz likes this.
  10. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,340
    Likes Received:
    1,529
    Capta, I was musing over the type of functionality you might be seeking to achieve, and knowing of your interest in SSH &c I provide the following.

    Timeshift itself is currently confined for usage with local drives only. Its author, Tony George, as recently as late 2017 was in no hurry to alter that status quo. However he only provides Timeshift as a labour of love, outside his full-time work, so I don't blame him for that.

    Timeshift, however, has as its engine the Linux command "Rsync", which is used by a lot of Linux sysadmins (system administrators). With them, it is mostly used for deploying software across a network, although rsync can have use even to the home user. Admin @Rob would likely explain it better.

    If you Google or duckduckgo the following, and look for the recent (rule of thumb circa 2016 on) articles, these keywords may assist

    "linux rsync copy partition over network" and "linux dd copy partition over network"

    The latter command

    Code:
    dd
    is one I use frequently for burning .iso's to usb sticks, but it has many talents.

    Steven Shiau's product Clonezilla can also be used, both to copy a drive or a partition to an image, or to another partition or drive.

    Clonezilla, whilst daunting on first use, is excellent (and is cross-platform ie works with Windows &c), but it performs a low-level, sector-by-sector, operation, so the destination must be at least the same size, preferably slightly larger, than the source.

    With Timeshift, however, if your Linux Mint is on a 20GB (root, ie /) partition, and only 8GB is consumed, you only need 8GB for the snapshot.

    Hope this helps rather than confuses.

    Wizard
     
    atanere likes this.
  11. CptCharis

    CptCharis Active Member

    Joined:
    Feb 27, 2018
    Messages:
    203
    Likes Received:
    221
    Good morning @wizardfromoz

    I'm sure that I confused you. SSH and Timeshift are different projects in my mint. :D
    The reason I need SSH is that I need to have access to my personal data once I am on board & I need a light program for this due to bad reception on board.

    As per timeshift now, you are used to say that is similar to "System Restore " on windows, but timeshift is working instead of System Restore that never works :mad:, or the files that restored were not that a regular user want to save :D.
    Anyway, Timeshift is a excellent tool, personally speaking, I like it more bcz is shipped as native app & I don't like to download 3rd parties programs.
     
    wizardfromoz likes this.
  12. atanere

    atanere Moderator
    Gold Supporter

    Joined:
    Apr 6, 2017
    Messages:
    1,596
    Likes Received:
    1,643
    Just a comment... "System Restore" on Windows does not restore files. That was never it's purpose. When it "goes back to an earlier time" it will go back to an earlier Windows Registry copy that was working before problems developed, and it will also uninstall programs that were installed after the Restore Point (but it does not delete files created by such programs). Here is a better explanation of System Restore.

    Just another comment... the dd command is very useful, but also very dangerous (as is anything from the command line, really). It has a pretty well-earned nickname as "data destroyer" because of its unforgiving nature. :eek:

    Cheers
     
    wizardfromoz and CptCharis like this.
  13. CptCharis

    CptCharis Active Member

    Joined:
    Feb 27, 2018
    Messages:
    203
    Likes Received:
    221
    Thank you @atanere for the brief of "System Restore".

    I'm aware about dd "nickname":D
     
    atanere and wizardfromoz like this.
  14. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,340
    Likes Received:
    1,529
    Good morning, all.

    Simplest answer, then, is ... No :D

    If however, you wish to free up space on your internal hdd, then you can establish your Timeshift snapshot storage partition on an external drive or device.

    So far as I am aware, it is native, currently, only to the Linux Mint 18.3 'Sylvia' series (Cinnamon, MATE, Xfce and KDE DEs), and to an obscure Manjaro-based Distro known as Manjaro Strit, which is developed and maintained by Danish Dan "Strit" Johansen, who is one of the maintainers of Manjaro itself.

    Poor old dd ... it gets a hard time. Most of its unexpected results can be attributed to PEBKAC - Problem Exists Between Keyboard And Chair ;)

    Cheers

    Wizard
     
    CptCharis and atanere like this.
  15. atanere

    atanere Moderator
    Gold Supporter

    Joined:
    Apr 6, 2017
    Messages:
    1,596
    Likes Received:
    1,643
    That's the source of most of my problems, to be sure! :eek::D:D

    Cheers
     
    wizardfromoz likes this.
  16. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,340
    Likes Received:
    1,529
    TIMESHIFT NEWS - BULLETIN 1

    Linux Lite has its Beta for the approaching 4.x series available now.

    For the first time, LL will be shipping with Timeshift installed. So that updates what I said to @CptCharis at #34 above :p

    The full release of Linux Lite 4.0 is scheduled for 1 June. If you wish to try the Beta, follow the DistroWatch link here and note the MD5sum available.

    The full press release for LL is here.

    Sadly, Linux Lite are joining an ever-increasing number of Linux Distros deserting support for 32-bit architecture (which is where products such as LL historically have really come into their own). With the 4 series it is discontinued.

    If you have or need 32-bit, you can still get it up to and including 3.8 from the 3.x series (which is what I am using currently). A link for that can be found here.
    Being based on Ubuntu's 16.04 'Xenial Xerus' LTS (long-term support), end of life for support is still April 2021.

    A point worth mentioning, though, is that with Ubuntu's LTS model, although nominally five (5) years, they only provide hardware support for the first half, that is 2.5 years. It is the security fixes, software maintenance and updates that applies for the full 5. So if LL follow the same model, then hardware support for the 3.x series runs out in October this year, 2018. Just be aware of that.:)

    If you install a Linux Lite from the 3.x series, or have it currently onboard, and wish to install Timeshift, then the same applies as I said at #9 on page 1, namely

    Code:
    sudo add-apt-repository -y ppa:teejee2008/ppa
    sudo apt-get update
    sudo apt-get install timeshift
    Enjoy

    Wizard
     
    atanere and CptCharis like this.
  17. atanere

    atanere Moderator
    Gold Supporter

    Joined:
    Apr 6, 2017
    Messages:
    1,596
    Likes Received:
    1,643
    Linux Lite is a very nice distro that I have used and installed for others. It is indeed sad that it is discontinuing support for 32-bit machines. But not only that, this recent post indicates that they have given up on ever providing UEFI support too. This decision, in my opinion, is even worse than abandoning 32-bit systems. We can only hope that perhaps Jerry and the LL Team will change their mind one day... on one, or both, of these decisions.
     
    wizardfromoz likes this.
  18. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,340
    Likes Received:
    1,529
    It's funny you should mention that Stan (Twilight Zone music playing in the background) ... the following screenshot is a partial view of my Timeshift snapshots, and highlighted are two (2) Distros I had to install under CSM, Compatibility Support Mode.

    [​IMG]

    SCREENSHOT - CSM - DISTROS SHIFTED

    The first one is the aforementioned Linux Lite.

    Last night I was trying to install Anarchy, to add to my stable of Arch-based Distros. I had to try the install under CSM, and appeared to be making progress, and then the install aborted, and as a "dying cockroach" act, it temporarily bricked my machine, housing (today, anyway) 35 Distros.

    A contributor to the debacle was my /dev/sda2 which is my EFI System Partition, which is a mess, containing ghostly folders from Distros gone but not forgotten - Solus, OpenMandriva and PCLinuxOS - and even ones from Distros where I did not get the install completed - Slackware, CentOS, and 4M Linux to name three. Also bootloader traces such as Goofiboot and Elilo.

    So it's no wonder the 'puter is a bit sick :rolleyes:, which I will remedy in coming weeks.

    Kudos to Timeshift was that I had a choice this morning of either
    • chrooting in to a Linux Mint MATE on /dev/sda1, reinstalling and updating GRUB or
    • using the same Live USB (which has persistence), running Timeshift and restoring same Distro, which updates Grub at the same time
    Either option would have worked, and the first would have taken a few minutes less. But I chose Timeshift.

    With a slow USB 2.0 stick drawing from a slow 3TB external hdd on which my snapshots are stored, it took 17 mins for Timeshift to copy back the files and folders, then another 23 minutes to rebuild my Grub (users would find this 2nd part to take considerably less time, maybe 3 - 4 minutes or less - my Toshiba has 40 partitions for os-prober to work through).

    So for an investment of 40 minutes (part of which I spent playing aisleriot Solitaire I have on the persistent stick :D), I now have my 35 Distros back up and running. :)

    Hard to go past that?

    Cheers

    Wizard
     
    atanere likes this.
  19. wizardfromoz

    wizardfromoz Super Moderator
    Staff Member Gold Supporter

    Joined:
    Apr 30, 2017
    Messages:
    1,340
    Likes Received:
    1,529
    TIMESHIFT NEWS - BULLETIN 2

    Two items currently:

    1. LinuxLite 4.0 released around 31 May - 1st June, 2018.
    2. Linux Mint 19 Beta released hours ago, ships with Timeshift installed.
    LINUX LITE

    I have LL 4.0 in my stables now, and it is as I said earlier:

    • :D Ships with Timeshift installed, I have tested it and it works OK
    • :( Support for 32-bit discontinued
    The current series starting with 4.0 is codenamed 'Diamond', and based on Ubuntu 18.04 'Bionic Beaver'. For those in need of 32-bit, the 3.x series, codenamed 'Citrine' is still available, and, based on Ubuntu 16.04 'Xenial Xerus', has support until 2021. For the 3.x users, you can add Timeshift via a PPA (personal package archive) as I have described earlier.

    If you have questions on the above changes that are not directly related to Timeshift, please start a new thread and title it accordingly :p.

    If you have not used LL before, be aware that it does not support UEFI, but you can install it under CSM conditions. As per above on questions.


    LINUX MINT 19 BETA

    I quite often try the Betas, but I may wait on this one until the final release.

    Timeshift works fine in the 18.3 sub series, I have no reason to believe this will change.

    I have the Cinnamon, MATE, Xfce and KDE's in my stable.

    KDE fans should note that with the 19 series, KDE has been dropped. Same as above on questions. New thread, please.

    Interesting to note is Clem's team's enthusiasm for the Timeshift product, Tony George must be pleased?

    If you didn't hear it first here, ... then you didn't o_O

    Cheers

    Wizard
     
  20. CptCharis

    CptCharis Active Member

    Joined:
    Feb 27, 2018
    Messages:
    203
    Likes Received:
    221
    Hello @wizardfromoz
    Greetings from on Zakynthos Island where we are for family holidays!
    Thanks for updates.

    Just a question, consider @JasKinasis’s post what about MATE edition of Linux Mint ?
    Is gone be supported on Mint 19?
     

Share This Page