Announcement

Collapse
No announcement yet.

how to restore using aptic gtk

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] how to restore using aptic gtk

    I've had to re-install Kubuntu several times because of my own errors and now I want to use Aptik just to get my home folder back. But for the life of me I can't figure it out. The problem seems to be in the backup path. My Kubuntu is a btrfs partition on sda1, while my backup is located on an external hard disk called sdb2/local disk/backups. How do I restore those files? I don't care if it's using the GTK frontend or just the terminal, I don't know what to do. Help!

    #2
    Originally posted by oldgeek View Post
    I've had to re-install Kubuntu several times because of my own errors and now I want to use Aptik just to get my home folder back. But for the life of me I can't figure it out. The problem seems to be in the backup path. My Kubuntu is a btrfs partition on sda1, while my backup is located on an external hard disk called sdb2/local disk/backups. How do I restore those files? I don't care if it's using the GTK frontend or just the terminal, I don't know what to do. Help!
    I don't know much about Aptik, but in looking over info on its home page it looks to be a file-by-file, directory-by-directory archive application. Translation: slow, just like using cp or tar, with or without compression. So, I doubt very much that it actually made copies of the snapshots of the two base subvolumes: @ and @home, or that it can even do that and not destroy the subvolumes.

    So basically, if I am right, you are out of luck.

    The next time you reinstall Kubuntu and assign Btrfs to "/" on sda1, as you should do and I hope you have done, the @ and @home subvolumes will automatically be created for you. Since you are bound and determined to use an app to "simplify" the backup process (even though it isn't simplifying things for you but making them more difficult) then choose Snapper. It is in the repository.

    OR, you could bite the bullet and just lean how to use the basic Btrfs commands manually in a root konsole. You don't have to learn every command all at once. Just learn the ones you need to know as you eventually need to know them. At almost 78 (Aug 8th) my memory is so bad that I printed them out on a sheet of paper and pasted it to the white board beside my computer chair.

    So, to restore @ and @home from an external HD, stored there as @_whatever and @home_whatever, you can do the following:

    Open a Konsole and "sudo -i" to root.
    Mount your filesystem:
    mount /dev/sda1 /mnt (better to use the UUID's instead of /dev/sdX1, but let's try this as a quickie)
    mount /dev/sdb2 /media (because I don't know what other unassigned directories you might have)

    Send the @_whatever and @home_whatever snapshots over to /mnt. Only read-only snapshots can be "send & recieve"'d.
    btrfs send -r /media/local disk/backup/@_whatever | btrfs receive /mnt (The "|" is a pipe)
    sync
    btrfs send -r /media/local disk/backup/@home_whatever | btrfs receive /mnt
    sync

    This puts @_whatever and @home_whatever along side @ and @home under /mnt

    Move @ and @home out of the way temporarily.
    mv /mnt/@ /mnt/@temp
    mv /mnt/@home /mnt/@hometmp
    sync

    Now, create read-write @ and @home snapshots out of the read-only snapshots sent over by leaving off the -r switch.
    btrfs su snapsnot /mnt/@_whatever /mnt/@
    sync
    btrfs su snapshot /mnt/@home_whatever /mnt/@home
    sync
    sync
    ... repeat until sync returns instantly.
    umount /mnt
    umount /media
    exit
    exit

    Now you can reboot and your archived system should come up.

    If it does, sudo -i to root, mount /dev/sda1 to /mnt and use
    btrfs subvol delete -C /mnt/@tmp
    sync
    btrfs subvol delete -C /mnt/@hometmp
    sync
    umount /mnt
    exit
    exit
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      I backed up the old setup, not the new one with btrfs, and finally got Aptik to work, but only on Kubuntu, not Neon. Doesn't matter, I've got all my home files and maybe a few configurations I didn't particularly want, but nothing serious. Now to experiment with btrfs!

      Comment


        #4
        Originally posted by oldgeek View Post
        I backed up the old setup, not the new one with btrfs, and finally got Aptik to work, but only on Kubuntu, not Neon. Doesn't matter, I've got all my home files and maybe a few configurations I didn't particularly want, but nothing serious. Now to experiment with btrfs!
        Kubuntu - Neon, doesn't matter, but what does matter is if the distro you have installed was installed using Btrfs as the root filesystem. With EXT4 as the root filesystem you can install btrfs-tools and play with creating subvolumes and making snapshots, but that's like kissing your girl friend through a glass window.
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          I think the problem with Aptik not working on Neon was a configuration problem. I ran it in recovery mode and it kept telling me it couldn't update certain programs to Bionic--which makes sense, since Neon was still on Xenial base and my dev-stable version had already updated some programs to the 18.04 version. I'm on Kubuntu now, and it's a straight btrfs root file system arrangement. I got the impression that Aptik was trying to do some of the things the btrfs system does but with an ext 4 file system. Whatever. I'm committed to btrfs now. By the way, I tried to install snapper, and according to Muon it's installed now, but I can't find it anywhere. Is there a GUI version that is not in the repos?
          Last edited by oldgeek; Jun 06, 2018, 06:22 PM. Reason: a grating spelling mistake!

          Comment


            #6
            Snapper's manpage gives the locations of the files:
            FILES

            /etc/sysconfig/snapper
            Global configuration file.

            /etc/snapper/configs
            Directory containing configuration files.

            /etc/snapper/config-templates
            Directory containing configuration templates.

            /etc/snapper/filters/*.txt
            Filter files.

            /var/log/snapper.log
            Logfile. Please include this file in bug reports.
            The snapper manpage is here.
            The snapper manpage for configuration is here.

            The first thing you want to do is use a configuration-template to create your own config file and edit it to set some limits to how many snapshots you want, etc. I intiially went with the default values and found that I was eating up my disk space rapidly.

            I didn't want automatic snapshots, which led to the creation of 50+ snapshots, so I set
            TIMELINE_CREATE=no
            This makes all snapshots made by snapper to be "singletons". With the TIMELINE_CREATE=yes snapper always creates a pair of snapshots, one before the action and one afterwards.

            I reduced snapper's behavior to taking singleton snapshots only when I told it to by using a script:

            snap_pre_post.sh
            Code:
            #!/bin/bash
            # created by Jerry L Kreps on July 20, 2015 and released under the GPL 2.0.
            # This script merely creates a snapshot in both root and home with the designation of PRE or POST as the type, 
            # which indicates that the user created it before an action or afterwards.
            # This script is run with PRE as the TYPE before an action which you may want to reverse
            # AND this script run again with POST as the TYPE after that action has been completed.  
            # Both snapshots are [B]singletons[/B] because [B]no timeline is used[/B].  Only the "PRE" or"POST" in the 
            # description, along with a timestamp, links the pre to the post snapshot.
            # To reverse the action run the following two snapper commands:
            #
            # [FONT=courier new][B]snapper -c home udochange n..m   [/B][/FONT]
            # where n or o is the number of the PRE and m or p is 
            # the number of the POST snapshot
            # [FONT=courier new][B]sudo snapper -c root undochange o..p[/B][/FONT]
            #
            # After running those two commands both of the empty snapshots folders can be deleted using
            #
            # [FONT=courier new][B]snapper -c home delete n-m[/B][/FONT]
            # [FONT=courier new][B]sudo snapper -c root delete o-p[/B][/FONT]
            #
            #
            #  Code starts here:
            NOW=$(date +%Y%m%d%H%M)
            echo Enter snapshot type PRE or POST:
            read TYPE
            echo Enter description
            read DESC
            STR=$TYPE" "$DESC" "$NOW
            echo $STR
            HCMD='snapper -c home create -d "'${STR}'"'
            RCMD='sudo snapper -c root create -d "'${STR}'"'
            eval "$HCMD"
            eval "$RCMD"
            Notice the the snapshot under /home (@home) is created without using sudo, but sudo is required for the root snapshot (@), so the script always asks for the account password. Also note that both a root and a home snapshot are always taken, both before an action and after it.

            IIRC, the snapshots directory for root is /.snaphsots/n and for home /home/.snapshots/m. They are hidden directories and are regular directories. The actual snapshot subvolumes are under the numbers, "m" and "m", which correspond to the numbers mentioned in the "undochange" commands mentioned above. So you have to use "btrfs subvol delete..." to delete /.snapshots/n/somesubvolume and then you can use "rmdir /.shapshot/n" and "rmdir /.snapshot" if you need to delete them manually outside snapper.
            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
            – John F. Kennedy, February 26, 1962.

            Comment

            Working...
            X