Backup solutions for Linux

Discussion in 'all things UNIX' started by tlu, Nov 18, 2009.

Thread Status:
Not open for further replies.
  1. tlu

    tlu Guest

    Yes, that's basically what Mrk described here. It's the chroot alternative to my approach already discussed with Mrk. I don't know if it's really easier. And it's certainly not enough if new driver modules are required.
     
  2. wat0114

    wat0114 Guest

    Okay, I have an older super grub 2 disk but it doesn't have an option that I can see to restore the grub (**EDIT** oh wait, I just saw it is necessary to run a terminal command after booting to live environment). I'll give the new one a try. Thanks! Still, I'm not cloning to new hardware, only to another drive to be used in the same pc as the source disk, so I'm not convinced the Clonezilla clone procedure works properly with grub 2. There should be no need to change id's or run the procedure I ran. At least there are workarounds, though :)

    **EDIT**

    Finally, just to add that I've figured something else out which applies to my situation where I want grub 2 installed to the linux root part (sda6 my case) and use EasyBCD in Win 7 to control where I boot from, I had to change entries sda to sda6 in these steps:

    otherwise grub 2 woild install to the mbr. Now I feel I understand all this perfectly - at last! :)
     
    Last edited by a moderator: Mar 2, 2010
  3. RonCam

    RonCam Registered Member

    Joined:
    Aug 28, 2009
    Posts:
    12
    Sorry, wasn't watching the tread for a while.:oops: But ... it's possible that none of the other variables mentioned above are the real cause/cure for the problem.

    According to Clonezilla's author, who was kind enough to reply to my question, the answer is that the -g parameter in Advanced Mode should be UN-checked prior to the restoration, if you don't want grub overwritten.

    If this is the reason, you had very good fortune to finally recover the back-up, just by trying so many different combinations. You may want to look at the -g parameter in the "different version of Clonezilla" that finally worked, and see what it's status is. Wonder if the default for this parameter could be set differently, on different versions of Clonezilla??
     
    Last edited: Mar 8, 2010
  4. apathy

    apathy Registered Member

    Joined:
    Dec 10, 2004
    Posts:
    461
    Location:
    9th Circle of Hell(Florida)
    I've used Back in Time/Image for Linux for years. I can't wait for the new stable for Back in Time and maybe Tbiview/IFL will start working again as well.
     
  5. tlu

    tlu Guest

    Below is an updated and improved version (here for backing up /home) for a Debian-based system like Ubuntu:

    Code:
    #!/bin/bash
    # Simple backup with rsync
    
    # SOURCES and TARGET must end with slash
    
    SOURCES="/home/"
    TARGET="/media/backup/"
    
    # mountpoint must end WITHOUT slash
    #MOUNTPOINT="/media/server"
    
    LOGFILE="~backup.log"
    EXPIREDAYS=0
    RSYNC="--delete"
    
    PACKAGES="/tmp/packages.list"
    #MAILREC="root@localhost"
    
    #SSHUSER=""
    #SSHHOST=""
    #SSHPORT=22 
    
    ### do not edit ###
    
    /bin/date > $LOGFILE
    
    MOUNTED=$(/bin/mount | /bin/fgrep "$MOUNTPOINT");
    if [ -z "$MOUNTPOINT" ] || [ -n "$MOUNTED" ]; then
    
      if [ -e $TARGET ]; then
        LASTBACKUP=$(/bin/ls -d $TARGET[[:digit:]]* 2>> $LOGFILE | /usr/bin/sort -r | /usr/bin/head -1)
      fi
    
      TODAY=$(/bin/date +%y%m%d)
    
      if [ $EXPIREDAYS -gt 0  ]; then
        EXPIRED=$(/usr/bin/find $TARGET[[:digit:]]* -maxdepth 0 -ctime +$EXPIREDAYS  2>> $LOGFILE)
        for EX in $(/bin/echo $EXPIRED)
        do
          /bin/echo  "rm -rf $EX " >> $LOGFILE
          /bin/rm -rf $EX
        done
      fi
    
      for SOURCE in $(/bin/echo $SOURCES)
      do
        if [ "$LASTBACKUP" ]; then
          INC="--link-dest=$LASTBACKUP$SOURCE"
        fi
    
        if [ "$SSHUSER" ] && [ "$SSHHOST" ] && [ "$SSHPORT" ]; then
          SSH="ssh -p $SSHPORT -l $SSHUSER";
          SOURCEDIR="$SSHHOST:$SOURCE";
        else
          SOURCEDIR=$SOURCE;
        fi
        /bin/mkdir -p $TARGET$TODAY$SOURCE >> $LOGFILE 2>> $LOGFILE;
        echo "/usr/bin/rsync -e \"$SSH\" -av $SOURCEDIR $RSYNC $INC $TARGET$TODAY$SOURCE "  >> $LOGFILE 2>> $LOGFILE;
        /usr/bin/rsync -e "$SSH" -av $SOURCEDIR $RSYNC $INC $TARGET$TODAY$SOURCE  >> $LOGFILE 2>> $LOGFILE;
      done
    
      if [ -n "$PACKAGES" ]; then
        echo "dpkg --get-selections | awk '!/deinstall|purge|hold/ {print $1}' > $PACKAGES " >> $LOGFILE 2>> $LOGFILE
        dpkg --get-selections | awk '!/deinstall|purge|hold/ {print $1}' > $PACKAGES 2>> $LOGFILE
        echo -e "/bin/mv $PACKAGES $TARGET$TODAY \n" >> $LOGFILE 2>> $LOGFILE
        /bin/mv $PACKAGES $TARGET$TODAY 2>> $LOGFILE
      fi
    
      /bin/date >> $LOGFILE
      /bin/cp $LOGFILE $TARGET$TODAY/backup-$(/bin/date +%T).log 2>> $LOGFILE
    
    else
      /bin/echo "$MOUNTPOINT not mounted" >> $LOGFILE
    fi
    
    if [ -n "$MAILREC" ];then
      /bin/echo -e 'Backup is finished!\n'$(/bin/date)  | /usr/bin/mutt -s "Backup" -a $LOGFILE -- $MAILREC
      /bin/rm $LOGFILE
    fi
    It also creates a packages.list file with all your installed packages. In order to restore them you just would execute:

    Code:
    sudo dpkg --set-selections < packages.list
    sudo apt-get -u dselect-upgrade
    or alternatively by:

    Code:
    sudo apt-get install $(<packages.list)
    Please note that the script above makes incremental backups by creating a new subfolder with the backup date under the target folder and uses hardlinks giving the impression that all backup files are contained in every daily subfolder. This saves a lot of space on the target drive, yet it is possible to copy any daily backup to another medium.
     
    Last edited by a moderator: Jul 17, 2010
  6. tlu

    tlu Guest

    Mrk, I've just remembered this topic, and I would like to ask you if a solution has come into your view?
     
  7. tlu

    tlu Guest

    Since Clonezilla was mentioned in this thread, I'd like to add the well-known Terabyte for Linux as an alternative. I had bought the program some years ago but hadn't used it for quite a while as ext4 had nor been officially supported. Now that it does (plus ReiserFS) I've tried the new version 2.58, and it looks really good.

    It offers some advantages over Clonezilla:
    1. Terabyte has the option to validate your images (even byte-for-byte, if required). That's something I've always missed in Clonezilla.
    2. It offers differential backups.
    3. It offers to save the image as a "Single File Set" or, alternatively, as a "Multiple File Set" which is comprised of one image for every individual partition. This makes it easier to restore single partitions rather than the whole drive. (Clonezilla offers the choice to save the image as one file or as, by default, 2 GB files if I remember correctly.)
    4. It contains the tbiview program that lets you see the files/folders in an image.
    5. It offers several restore options (like geometry settings) that go beyond the ones offered by Clonezilla. They might be useful in specific cases.
    I can't say anything about the reliability yet, but the Terabyte products have gained great renown in the past.The price of 29.95 $ is okay for what it offers IMHO.
     
  8. wat0114

    wat0114 Guest

    Actually I've had repeat disappointments with Clonezilla; Try restoring backed up partitions to targets that are re-sized even slightly larger than the originals they were created form, and you get a "unable to restore, image may be corrupt..." or to that effect, when in fact there's nothing wrong with the images. I understand target parts can't be smaller than the original source, but no way in the world should it be impossible to restore to larger targets, but Clonezilla fails miserably here :mad:
     
  9. tlu

    tlu Guest

    Hm, I'm not quite sure but I think that I successfully restored partitions to larger targets in the past. You have to resize them with Parted Magic after that, of course.

    Have you tried a newer version of Clonezilla? Perhaps this was a bug in an older one ...
     
  10. wat0114

    wat0114 Guest

    I've always used GParted to resize the parts and several recent versions, including latest 1.2.5-35, of Clonezilla have failed to clone to resized-to-larger-than-original parts.
     
  11. wearetheborg

    wearetheborg Registered Member

    Joined:
    Nov 14, 2009
    Posts:
    667
    I tried aptoncd. Is the apt cache cleared at periodic intervals? I had installed Debian a year back, and I have downloaded and installed many many deb packages. But I only see a few recent ones in AptonCD.
     
  12. wearetheborg

    wearetheborg Registered Member

    Joined:
    Nov 14, 2009
    Posts:
    667
    Pity that clonezilla is buggy.

    So is the current leade fsarchiver?

    I have a dual boot system (XP+Linux) and I want to make a backup of the two systems. Will fsarchiver also backup grub? Or does it need to be manually installed and configured?

    The scenario I am considering is that I have to change hard disk, with a different sized one, with different partitions; and I want to clone XP&Linux back to the new hard disk.
     
  13. wat0114

    wat0114 Guest

    It seems to be near-flawless as long as one leaves the source partitions that the images were created from alone, to make for dependable restoring of images back to them.
     
  14. wearetheborg

    wearetheborg Registered Member

    Joined:
    Nov 14, 2009
    Posts:
    667
    Unfortunately my main use is to make backups in case of HDD crash/change; so source partitions would be different....

    Does clonezilla work with dual boot systems? Can it restore XP?

    What about tools like DriveXML or Macrium Reflect or Paragon? Will they work on dual boot systems?
     
    Last edited: Aug 2, 2010
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.