Page 107 of 138 FirstFirst ... 75797105106107108109117 ... LastLast
Results 1,061 to 1,070 of 1375

Thread: Howto: Backup and restore your system!

  1. #1061
    Join Date
    Dec 2009
    Beans
    20

    Re: Howto: Backup and restore your system!

    This procedure to backup my Ubuntu laptop worked great under 9.10. After upgrading to Lucid, however, I receive an error statement at the same location each and every time. The error says

    "tar: Exiting with failure status due to previous errors".

    The last file listed in all cases is /boot/grub/915resolution.mod, which is the last file in /boot/grub/ that it backs up. I excluded 915resolution.mod from the backup and the procedure erred again at the last file of the same directory.

    Does anyone know why I'm getting the tar error?
    Last edited by slalomchip; May 27th, 2010 at 03:14 AM.

  2. #1062
    Join Date
    Jan 2008
    Location
    Mumbai, India
    Beans
    128
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Howto: Backup and restore your system!

    Hello, I have recently made a fresh install of 10.04 LTS and here is how I backup.
    My main disk has 2 partitions. The / and /home are on the same partition and I have mounted /Data on other partition to put non-system data (documents etc).
    I have another HDD mounted as /Backup
    To backup the main partition I use "PartImage" program after booting from PartedMagic CD or USB and this is backed up onto the backup disk.
    I backup the /Data folder onto the backup disk using "Simple Backup" software from within Ubuntu with a daily schedule.
    Earlier, when I was using 8.04LTS, I had /home on a separate partition but I feel it is better to have this in the main partition only and make image every month. I have successfully restored 8.04LTS earlier but if the /home partition is on separate partition and some software have been installed/removed after taking image of main partition, then I think some settings are lost. Not too sure as I am not Linux expert and the PC is used only for backing up Windows Shares.
    Ubuntu 12.04LTS Desktop. C2D, 2.2GHz, 1.5 GbRAM
    250Gb HDD with partitions for /root, /home, /swap, /data. Additional 1Tb HDD also installed for backups. Mainly using to backup networked windows shares automatically.

  3. #1063
    Join Date
    Dec 2009
    Beans
    20

    Re: Howto: Backup and restore your system!

    Thanks. I'll give that a try.

  4. #1064
    Join Date
    Sep 2009
    Beans
    47

    Re: Howto: Backup and restore your system!

    Hi Slalomchip,


    I believe the guide says you can usually ignore this message.
    EDIT2:
    At the end of the process you might get a message along the lines of 'tar: Error exit delayed from previous errors' or something, but in most cases you can just ignore that.

  5. #1065
    Join Date
    Dec 2009
    Beans
    20

    Re: Howto: Backup and restore your system!

    Thanks for the info. I'm a little leery of any process that ends with an error statement, but I appreciate the response.

  6. #1066
    Join Date
    Jun 2010
    Beans
    6

    Re: Howto: Backup and restore your system!

    I am have installed lucid lynx recently, and i went to recovery mode terminal as root and run "tar xvp..." but i received the same error massage while trying to restore my system :
    "tar: Exiting with failure status due to previous errors"
    and i think howto said that if you received errors in the backup process forgot it, not in restoring. and i am sure that it's not restored!
    after all " tar xvp... " perhaps can overwrite old files but how can it remove the new files that created after backup?

    am i done something wrong or this method don't work in 10.04? is anybody restored his/her system successfully by this method while running 10.04?

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

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by Francium View Post
    I am have installed lucid lynx recently, and i went to recovery mode terminal as root and run "tar xvp..." but i received the same error massage while trying to restore my system :
    "tar: Exiting with failure status due to previous errors"
    and i think howto said that if you received errors in the backup process forgot it, not in restoring. and i am sure that it's not restored!
    after all " tar xvp... " perhaps can overwrite old files but how can it remove the new files that created after backup?

    am i done something wrong or this method don't work in 10.04? is anybody restored his/her system successfully by this method while running 10.04?
    The tar -x command does not remove any files. It merely unpacks the files in your backup, overwriting files already on your computer with the same name & location as ones in the backup.

    To ensure that files newer than the most recent backup are removed, you would basically need to erase everything prior to using tar -x. If you're using tar to backup and restore the entire system, that means you have to erase files that will render your system temporarily inoperable. So, you probably need to boot from a Live CD, erase the harddrive partition(s) in question (without erasing the backup files), and perform tar -x while still running on the Live CD. Then your system should be restored and operable again.

    Hope that helps!

    (Heliode, if you're still watching this thread, please add something to this effect to your original post.)
    Last edited by newb85; June 15th, 2010 at 04:29 AM. Reason: Added comment

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

    Re: Howto: Backup and restore your system!

    I guess I was wrong. Tar can by made to remove files that are not in the archive by including the "-G"
    argument during extraction. This should be faster and should not require booting from a LiveCD.

  9. #1069
    Join Date
    Oct 2007
    Beans
    356

    Re: Howto: Backup and restore your system!

    I wrote a very simple shell script to automatically back-up partitions with tar. It only backs up one partition at a time, and will automatically exclude files located on other partitions.

    I mostly made it for personal use, but if anybody is interested, here it is.

    Code:
    #!/bin/bash
    
    set -e
    
    # this script requires dialog
    if ! which dialog 1>/dev/null 2>&1; then
      read -p "Do you want to install dialog now? (y/n): " REPLY
      case $REPLY in
        y)
          sudo apt-get update
          sudo apt-get install dialog
        ;;
        *)
          echo "Cannot continue; this script uses dialog to generate menus" >&2
          exit 1
        ;;
      esac
    fi
    
    
    # detect mount point of a partition
    detect_mountpt() {
      mount | grep "^$1" | cut -d' ' -f3
    }
    
    # list devices mounted on folders inside a partition
    list_mounted_under() {
      mount | grep -v "^$1" | grep "$2" | cut -d' ' -f3
    }
    
    # list all mounted partitions
    list_mounted_parts() {
      CNT=0
      mount | grep '^/dev' | cut -d' ' -f1 | while read line; do
        CNT=$(( $CNT + 1 ))
        echo "$CNT $line"
      done
    }
    
    MNT_PARTS="$(list_mounted_parts)"
    ANSWER=$(dialog --stdout --menu "Select the partition to back up" 0 0 0 $MNT_PARTS)
    PART=$(echo "$MNT_PARTS" | grep "^$ANSWER" | cut -d' ' -f2)
    MNTPT=$(detect_mountpt $PART)
    
    # exclude folders with another device mounted on them
    # this includes /proc, /sys, /media/disk, etc
    for e in $(list_mounted_under $PART $MNTPT); do
      EXCLUDES="$EXCLUDES --exclude=$e/*"
    done
    
    BACK_NAME="$(basename $PART)-$(date +%F).tar.gz"
    BACK_FULL_PATH="$(dialog --stdout --inputbox "Where do you want to create the back up?" 0 0 "$(pwd)/$BACK_NAME")"
    
    # also add backup to exclude list
    EXCLUDES="$EXCLUDES --exclude=$BACK_FULL_PATH"
    
    ( cd $MNTPT
      FILES="$(ls -A | tr '\n' ' ')"
      sudo tar cvpzf $BACK_FULL_PATH $EXCLUDES $FILES 
    )
    
    echo
    echo "Backup $BACK_FULL_PATH created"
    
    exit 0

  10. #1070
    Join Date
    Jun 2010
    Beans
    6

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by newb85 View Post
    I guess I was wrong. Tar can by made to remove files that are not in the archive by including the "-G"
    argument during extraction. This should be faster and should not require booting from a LiveCD.
    thanks a lot. I will try that, but i should transfer my files somewhere safe, because if i removed all files and still couldn't restore do you know what? i am a dead man!

Page 107 of 138 FirstFirst ... 75797105106107108109117 ... 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
  •