Page 101 of 138 FirstFirst ... 519199100101102103111 ... LastLast
Results 1,001 to 1,010 of 1375

Thread: Howto: Backup and restore your system!

  1. #1001
    Join Date
    Feb 2009
    Beans
    5

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by Marius Cloete View Post
    Hi all,

    Here is a shell I have put together from this post. I am not a guru on shell scripts this was put together with the help of google search .
    Feel free to comment and/or change it.
    I saved it as backupAndRestore.sh and you can run it as follows
    sudo ./backupAndRestore.sh
    enjoy

    Code:
    #!/bin/bash
    S1='b'
    S2='y'
    echo "Please enter b for backup or r for restore:"
    read action
    
    if [ $action = $S1 ]; then 
        
        echo "These Directories will be excluded:"
        echo -e "\033[1m\033[32m /proc /lost+found */backup.tgz /mnt /sys /dev"
        echo -e "\033[0m"
        echo "To chance these values edit this shell"
        echo "continue (y/n):"
            
        read action
        if [ $action = $S2 ]; then 
            echo "Backing up PC ~ timestamp " ;date
            tar cpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=*/backup.tgz --exclude=/mnt --exclude=/sys  /
        fi
    else
        echo -e "\033[1m\033[31mWARNING: this will overwrite every single file on your partition with the one in the archive!"    
        echo -e "\033[0m"    
        echo "Please enter name and location of the archive to restore:"        
        read fileName
        echo "You are about to restore $fileName do you want to continue?(y/n)"
        read action
        echo -e "\033[1m\033[47mJust sit back and watch the fireworks.This might take a while. When it is done, you have a fully restored Ubuntu system!"
        sleep 5
        echo "start"
        if [ $action = $S2 ]; then 
            tar xvpfz $fileName -C /
            echo "Creating excluded directories"    
            #Just to make sure that all excluded directories are re-created
            mkdir /proc
            mkdir /lost+found
            mkdir /mnt
            mkdir /sys
            
        fi    
    fi
    echo -e "\033[0m"
    Thanks it worked great for me! One thing that you'll have to do is to modify your grub or grub2 after you restore. Fast and easy way to back up or migrate to another machine.

    Cheers!

  2. #1002
    Join Date
    Dec 2009
    Beans
    24

    Re: Howto: Backup and restore your system!

    Is there a way for me to back it up on this hard drive and then install it on another hard drive. My HD is taking a crap so that's why i'm asking.

  3. #1003
    Join Date
    Jan 2010
    Beans
    2

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by nick_geetar View Post
    Is there a way for me to back it up on this hard drive and then install it on another hard drive. My HD is taking a crap so that's why i'm asking.
    best way I can think of would be to backup your drive using the script then copy it on a flash stick or network drive. Then install ubuntu on your new HDD then locate you backup file (flash or network) and then run the restore.

  4. #1004
    Join Date
    May 2009
    Location
    Indiana
    Beans
    1,971
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Howto: Backup and restore your system!

    If you're dealing with a tower with an extra bay, you might consider putting the new HDD in that bay, installing Ubuntu on it. If you create the backup on your old drive before making the new one the master, you should be able to run Ubuntu on your new drive with your old drive mounted. It should be straight-forward from there.

  5. #1005
    Join Date
    Nov 2009
    Location
    South east, UK
    Beans
    55
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto: Backup and restore your system!

    Great thread, Heliode. Thanks for writing out your guide.

  6. #1006
    Join Date
    Dec 2009
    Location
    Surat
    Beans
    16
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto: Backup and restore your system!

    Why don't you use Sbackup? It is awesome and easy to use...
    I am a banana feak.

  7. #1007
    Join Date
    Jul 2008
    Beans
    3

    Re: Howto: Backup and restore your system!

    this is gr8.

    As due to large number of power cuts in my area, many times due to improper shut down my system fails to restart and i have to re-install the whole operating system again and again.

  8. #1008
    Join Date
    Jul 2006
    Beans
    29

    Re: Howto: Backup and restore your system!

    Hi,

    I have been using the tar utility like described in the first post of this post to backup my Ubuntu system - with success.

    But now I have moved to a new harddrive with a new partition order and I installed Ubuntu 9.10 which uses grub2, but apperently my backup Ubuntu version used "grub1" (although the system itself is also Ubunut 9.10).

    Grub2' boot menu shows up fine, but when I try to start Ubuntu, it shows the starting screen, and then hangs.

    My new partition layout looks like this:
    /sda1 (NTFS): Windows 7 boot loader
    /sda2 (NTFS)
    /sda5 (ext3): Ubuntu
    /sda6 (swap)

    Do you have any hints how to fix this?

  9. #1009
    Join Date
    Jan 2010
    Location
    Brno, Czech Republic
    Beans
    6

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by Heliode View Post
    Just hit enter/return/your brother/whatever and watch the fireworks. Again, this might take a while. When it is done, you have a fully restored Ubuntu system! Just make sure that, before you do anything else, you re-create the directories you excluded:
    Code:
    mkdir proc
    mkdir lost+found
    mkdir mnt
    mkdir sys
    etc...
    And when you reboot, everything should be the way it was when you made the backup!!
    Great, but do I need to re-create those directories? Files will be overwritten, but the excluded directories won't be removed, will they?

    Thanks
    Last edited by danerben; February 18th, 2010 at 05:12 PM. Reason: no icon

  10. #1010
    Join Date
    May 2009
    Location
    Indiana
    Beans
    1,971
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Howto: Backup and restore your system!

    I could be wrong, but I don't believe the tar file contains information about what directories were excluded. I also don't think it's accurate to say every file is overwritten. In my experience, using tar extract only overwrites files in the tar file already reflected in the destination directory, and creates the files in the tar file not yet destination directory.

    That would mean the excluded directories you've listed would still exist.

    If you don't do a clean install before restoring, though, you might still have old files not in your backup hanging around.

Page 101 of 138 FirstFirst ... 519199100101102103111 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •