Announcement

Collapse
No announcement yet.

HowTo: Backup & Restore your system my way ~[:^D

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

    HowTo: Backup & Restore your system my way ~[:^D

    As a result of many reinstallations, I've begun developing a method that quickly allows me to restore my new installation to the setup of my old one. As such, I decided to share my knowledge:

    -> MAKE A LIST

    - To create an easily restoreable list of all installed software on your system (from the repos), open Konsole and enter the following command:
    Code:
    dpkg --get-selections | grep [^de]install$ > installed-software.txt

    - That will create an entry in your "/home/[username]/" directory entitled "installed-software.txt" ([username] is your username).


    -> BACKUP

    - Backup all your important files to an external storage device (hard drive / flash disk); you may wish to backup your "/etc/X11/xorg.conf" and "/etc/apt/sources.list" configs. If you have the Medibuntu/Wine repo(s), you'll need to additionally backup your "/etc/apt/sources.list.d" directory. For an excellent guide on backing up using the "dd" command, see Qqmike's dd Command.

    - I generally format my external hard drive as XFS because it allows me to quickly transfer/move large files. You can format your hard drive using any number of formatting utilities; I prefer using the GParted LiveCD.

    - It's a very good idea to backup periodically, because you'll be out of luck if you don't have a copy and you frag your system beyond repair. Also, keep a list of any software you installed outside of the repositories (such as those downloaded/installed from 3rd party websites).


    -> FRY YOUR SYSTEM ( )

    - Configure your BIOS to boot from CD first. Then, insert the Kubuntu installation CD (I used the Alternate CD for this example, but it doesn't matter which you use), and reboot. When the CD loads, choose the "Install a Command-Line System" option, fill out all the requested information, and choose the "Manual" option to partition your hard drive.

    - I would suggest creating 3 basic partitions: SWAP, "/" , and "/home". For SWAP, create a partition roughly 1.5 - 2 times the amount of RAM you have installed (SWAP is similar to "Virtual Memory" in Windows). Then, create your "/" (or "/root") partition. You shouldn't need more than 8 GB for your "/root" partition; if you ever use more than 10 GB, my hat's off to you You can make it any format you wish (check the list of File Systems (FS) to see which you prefer; just look for the “Linux” entries in the far-right column). Finally, create a "/home" partition; choose whichever FS type you would like to use, and create it as large as you want (this is the partition you'll be storing your personal data in). If you already have a separate “/home” partition, keep it the way it is (don't format it), and select it again as your “/home” partition. This way you can keep your application settings/customizations and personal data intact. Then, use the same username you had before so the installer will associate your previous “/home/[username]/” directory with your new “/home/[username]/” directory.

    - I create an additional 200MB “/boot” partition for the GRUB bootloader, and format as ext3; I do this because my FS of choice is XFS, which currently is incompatible with GRUB. I also create an extended partition where I create logical “/root” partitions; this way, I can install as many operating systems I want, and use the same “/home” directory (BIOS currently only allows 4 primary partitions on your hard drive, including 1 extended partition; an extended partition is a primary partition within which you can create as many "logical" partitions you want).


    -> RESTORE YOUR STUFF

    Once Kubuntu is installed, remove the installation CD from your computer and reboot. Login, restore your repositories, and update your system with the command
    Code:
    sudo aptitude update; sudo aptitude safe-upgrade
    - You're now ready to restore all your previously installed software. To do so, you'll need the dselect package manager:
    Code:
    sudo aptitude install dselect

    - Restore the “installed-software.txt” file you created, and reinstall your software with the following commands:
    Code:
    sudo dpkg --set-selections < installed-software.txt
    Code:
    sudo dselect
    - Choose option "3. [ I ]nststall Install and upgrade wanted packages." That should install everything you had before!

    - You'll have to manually install anything you installed outside the repos, sorry :P

    - Most of your application settings will already be in your “/home/[username]/” directory, for those that aren't (such as your “xorg.conf”), simply replace the existing ones with those you backed up. Once everything has reinstalled, start KDM with
    Code:
    sudo /etc/init.d/kdm start
    Everything should now be as it was before




    Edit: Using the many suggestions of those who contributed to this thread, I've re-written it in attempt to make it simpler, easier, quicker, and more effective. Thank you all who helped
    Asus G1S-X3:
    Intel Core2 Duo T7500, Nvidia GeForce 8600M GT, 4Gb PC2-5300, 320Gb Hitachi 7k320, Linux ( )

    #2
    Re: HowTo: Backup &amp; Restore your system my way ~[:^D

    -> MAKE A LIST

    - to create an easy to restore list of all installed/uninstalled software on your system (from the repos), open Konsole and enter the following command:want
    Code:

    dpkg --get-selections > installed-software


    - That will create an entry in your /home/[username]/ directory entitled "installed-software" that includes a list of all installed/uninstalled software on your system ([username] is your username).
    Thanks for this one. I've been wondering how I could do that.

    Comment


      #3
      Re: HowTo: Backup &amp; Restore your system my way ~[:^D

      @integr8e
      Hey, pretty cool.

      Did some testing and found that the file created by dpkg --get-selections includes packages that were deinstalled. I verified this by checking Adept Manager on those so marked. They are listed as not installed (they obviously had been at one time). So I played around with grep and came up with the following modification:

      To generate a listing of only installed packages:
      dpkg --get-selections | grep [^de]install$ > installed-software.txt
      And:

      To generate a listing of only deinstalled packages:
      dpkg --get-selections | grep deinstall$ > deinstalled-software.txt
      Man, you just have to love the power of Linux! 8)
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        Re: HowTo: Backup &amp; Restore your system my way ~[:^D

        Noticed that myself. I was just going through Adept when I noticed this response. Cool!!!!!

        Comment


          #5
          Re: HowTo: Backup &amp; Restore your system my way ~[:^D

          The Snowhog: Burn'n for Linux Learn'n!
          Windows no longer obstructs my view.
          Using Kubuntu Linux since March 23, 2007.
          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

          Comment


            #6
            Re: HowTo: Backup &amp; Restore your system my way ~[:^D

            As I've noticed from your picture there!!

            Comment


              #7
              Re: HowTo: Backup &amp; Restore your system my way ~[:^D

              Nice how-to
              -> MAKE A LIST

              - to create an easy to restore list of all installed/uninstalled software on your system (from the repos)
              You can conversely use aptoncd:
              http://aptoncd.sourceforge.net/

              This is especially useful for people with slow internet conections and installing on a number of machines

              Just a thought
              HP Pavilion dv6 core i7 (Main)
              4 GB Ram
              Kubuntu 18.10

              Comment


                #8
                Re: HowTo: Backup &amp; Restore your system my way ~[:^D

                Cool!! Thanks Fintan for that one as well. I'll take that for a "spin"!!!

                Comment


                  #9
                  Re: HowTo: Backup &amp; Restore your system my way ~[:^D

                  Installed AptOnCD. Question. Noticed it installed Synaptic Pkg Mangr. Will I need to remove Adept Manager? Believe it or not, I prefer Adept Manager. Can I still use Adept Manager along with AptOnCD? Evidently AptOnCD relies on Synaptic Pkg Mangr and I don't want to mess anything up .

                  Good Point there lingenfr. Wish I had done that originally.
                  |
                  |
                  |
                  \/

                  Comment


                    #10
                    Re: HowTo: Backup &amp; Restore your system my way ~[:^D

                    Also, as to partitioning suggestions, I suggest that you create a separate /home partition. This allows you to reinstall/upgrade without blowing away all your settings and data.

                    Comment


                      #11
                      Re: HowTo: Backup &amp; Restore your system my way ~[:^D

                      Integr8e, Good stuff, interesting. Thanks.
                      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                      Comment


                        #12
                        Re: HowTo: Backup &amp; Restore your system my way ~[:^D

                        You can conversely use aptoncd
                        @Fintan, I tried to use AptOnCD, but it seems to allow me to only backup what's located in my /var/cache/apt/archives/ directory, and I clean that each time I update/install software. I would have to re-download everything again if this is the case; do you know a way I can use AptOnCD without having to do that (thus the reason I learned how to MAKE A LIST )?

                        . . . I suggest that you create a separate /home partition
                        @lingenfr, I did that before, but when I reinstalled the software, some of the apps threw a fit because their .hidden files were already in my /home directory. That was a while back - though - and I don't even remember what applications were throwing fits, or if I still use them, so I'll give it another try. I'll even experiment a little (); I've wanted to create a separate partition - for my /home directory - after having installed Kubuntu, just to see how smoothly the transition can be. I'll let y'all know how it goes.
                        Asus G1S-X3:
                        Intel Core2 Duo T7500, Nvidia GeForce 8600M GT, 4Gb PC2-5300, 320Gb Hitachi 7k320, Linux ( )

                        Comment


                          #13
                          Re: HowTo: Backup &amp; Restore your system my way ~[:^D

                          Originally posted by MoonRise
                          Will I need to remove Adept Manager?
                          Don't remove Adept Manager.
                          Windows no longer obstructs my view.
                          Using Kubuntu Linux since March 23, 2007.
                          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                          Comment


                            #14
                            Re: HowTo: Backup &amp; Restore your system my way ~[:^D

                            Thanks for the heads up!

                            Comment


                              #15
                              Re: HowTo: Backup &amp; Restore your system my way ~[:^D

                              OK, my fingers are crossed; I've created a new logical partition and set it up as my /home directory. Good thing I backed up all my data, because everything in my old /home directory got fried So far, so good; I'll let y'all know if anything goes wrong.
                              Asus G1S-X3:
                              Intel Core2 Duo T7500, Nvidia GeForce 8600M GT, 4Gb PC2-5300, 320Gb Hitachi 7k320, Linux ( )

                              Comment

                              Working...
                              X