Page 15 of 138 FirstFirst ... 513141516172565115 ... LastLast
Results 141 to 150 of 1375

Thread: Howto: Backup and restore your system!

  1. #141
    Join Date
    May 2005
    Location
    Secret Torture Camp
    Beans
    84
    Distro
    Ubuntu 10.04 Lucid Lynx

    Exclamation Re: Howto: Backup and restore your system!

    Quote Originally Posted by Heliode
    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!
    People will need to add mount points for cdrom and other partitions. My cdrom didn't work until I made the mount point.

    Code:
    mkdir /media/cdrom0
    mkdir /media/usbdisk
    mkdir /dos
    anyone have a list of things that need to be done after restore?

  2. #142
    Join Date
    Apr 2006
    Beans
    19

    Re: Howto: Backup and restore your system!

    How can I delete the backup.gtz file out of my root?

  3. #143
    Join Date
    May 2005
    Location
    Bronx, New York
    Beans
    238
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by tsharpe62
    How can I delete the backup.gtz file out of my root?
    one all done you just do an sudo rm /backup.tgz

  4. #144
    Join Date
    Aug 2005
    Location
    Århus, DenmarK
    Beans
    1,478
    Distro
    Kubuntu 8.10 Intrepid Ibex

    Re: Howto: Backup and restore your system!

    Use PartImage!?

    http://www.partimage.org/Main_Page

    ...Seems like a nice backup/restore tool!

  5. #145
    Join Date
    Apr 2006
    Beans
    29

    Re: Howto: Backup and restore your system!

    Another suggestion: DAR
    Code:
    sudo apt-get install dar
    then
    Code:
    sudo kate dar_backup.sh
    something like this
    Code:
    #!/bin/sh
    
    DIR=/backups
    FILE=${DIR}/`/bin/date -I`_data
    # Commands
    dar -m 256 -y -D -R / -c `date -I`_data -Z "*.avi" -Z "*.dar" -P media -P tmp -P mnt -P lost+found -P sys
    dar -t $FILE > /dev/null

  6. #146
    Join Date
    Apr 2006
    Beans
    29

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by likeatim
    Another suggestion: DAR
    or even better: kdar
    very convenient, does all of the above even easier....

  7. #147
    Join Date
    Jul 2005
    Location
    Yakima WA USA
    Beans
    106
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Howto: Backup and restore your system!

    Has anyone done this using RSYNC? I'd really like to know how to do this with RSYNC because it seems more useful to me. I'm a Mac guy and I'm trying to find something the recreates Carbon Copy Cloner. Haven't found anything yet. I tried to install Mondo, but it seems to have disappeared. I'm not sure where it went.
    Mac OS X...because making UNIX user friendly was easier than fixing Windows.

  8. #148
    Join Date
    Jan 2006
    Beans
    15

    Re: Howto: Backup and restore your system!

    Hello!

    Based on the suggestions in this thread, I've created a backup suite that needs as less knowledge and input from the user as you could imagine: you only have to call it, the rest will be automatically done for you by the software suite.

    This is the systembackup suite, version systembackup-suite-0.1 by
    Moritz Beller

    Usage: ./backup.sh

    In order to run the script, you need the following programs installed:
    bash, tar (gzip)

    To perform a backup, run ./backup.sh. This will generate a TAR file
    which includes everything you need to restore the saved system state
    from a Linux live or rescue system. What you do to go backup to the
    system state that was saved within the TAR file is to tar -cf FILENAME
    the generated file on the Linux rescue system. This will create a
    directory called FILENAME (without the extension). You only have to cd
    to it and call the ./restore.sh script. It is important that you know
    where you mounted your former / partition as the script will
    interactivley ask you where to put the backuped system.

    systembackup-suite-0.1 is Free Software and you may exert it under the
    terms of the GPL as distributed with your systembackup suite copy.

    Here is the link: Go, try and test it! I am open to further improvements and suggestions.

    superuser

  9. #149
    Join Date
    Mar 2006
    Location
    OHIO
    Beans
    Hidden!

    Re: Howto: Backup and restore your system! Exclude not working

    Quote Originally Posted by Heliode
    Hi, and welcome to the Heliode guide to successful backing-up and restoring of a Linux system!

    Most of you have probably used Windows before you started using Ubuntu. During that time you might have needed to backup and restore your system. For Windows you would need proprietary software for which you would have to reboot your machine and boot into a special environment in which you could perform the backing-up/restoring (programs like Norton Ghost).
    During that time you might have wondered why it wasn't possible to just add the whole c:\ to a big zip-file. This is impossible because in Windows, there are lots of files you can't copy or overwrite while they are being used, and therefore you needed specialized software to handle this.

    Well, I'm here to tell you that those things, just like rebooting, are Windows CrazyThings (tm). There's no need to use programs like Ghost to create backups of your Ubuntu system (or any Linux system, for that matter). In fact; using Ghost might be a very bad idea if you are using anything but ext2. Ext3, the default Ubuntu partition, is seen by Ghost as a damaged ext2 partition and does a very good job at screwing up your data.

    1: Backing-up

    "What should I use to backup my system then?" might you ask. Easy; the same thing you use to backup/compress everything else; TAR. Unlike Windows, Linux doesn't restrict root access to anything, so you can just throw every single file on a partition in a TAR file!

    To do this, become root with
    Code:
    sudo su
    and go to the root of your filesystem (we use this in our example, but you can go anywhere you want your backup to end up, including remote or removable drives.)
    Code:
    cd /
    Now, below is the full command I would use to make a backup of my system:

    Code:
    tar cvpzf backup.tgz / --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys
    Now, lets explain this a little bit.
    The 'tar' part is, obviously, the program we're going to use.

    'cvpfz' are the options we give to tar, like 'create archive' (obviously),
    'preserve permissions'(to keep the same permissions on everything the same), and 'gzip' to keep the size down.

    Next, the name the archive is going to get. backup.tgz in our example.

    Next comes the root of the directory we want to backup. Since we want to backup everything; /

    Now come the directories we want to exclude. We don't want to backup everything since some dirs aren't very useful to include. Also make sure you don't include the file itself, or else you'll get weird results.
    You might also not want to include the /mnt folder if you have other partitions mounted there or you'll end up backing those up too. Also make sure you don't have anything mounted in /media (i.e. don't have any cd's or removable media mounted). Either that or exclude /media.

    EDIT : kvidell suggests below we also exclude the /dev directory. I have other evidence that says it is very unwise to do so though.

    Well, if the command agrees with you, hit enter (or return, whatever) and sit back&relax. This might take a while.

    Afterwards you'll have a file called backup.tgz in the root of your filessytem, which is probably pretty large. Now you can burn it to DVD or move it to another machine, whatever you like!

    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.

    Alternatively, you can use Bzip2 to compress your backup. This means higher compression but lower speed. If compression is important to you, just substitute
    the 'z' in the command with 'j', and give the backup the right extension.
    That would make the command look like this:

    Code:
    tar cvpjf backup.tar.bz2 / --exclude=/proc --exclude=/lost+found --exclude=/backup.tar.bz2 --exclude=/mnt --exclude=/sys
    2: Restoring

    Warning: Please, for goodness sake, be careful here. If you don't understand what you are doing here you might end up overwriting stuff that is important to you, so please take care!

    Well, we'll just continue with our example from the previous chapter; the file backup.tgz in the root of the partition.

    Once again, make sure you are root and that you and the backup file are in the root of the filesystem.

    One of the beautiful things of Linux is that This'll work even on a running system; no need to screw around with boot-cd's or anything. Of course, if you've rendered your system unbootable you might have no choice but to use a live-cd, but the results are the same. You can even remove every single file of a Linux system while it is running with one command. I'm not giving you that command though!

    Well, back on-topic.
    This is the command that I would use:

    Code:
     tar xvpfz backup.tgz -C /
    Or if you used bz2;

    Code:
     tar xvpfj backup.tar.bz2 -C /
    WARNING: this will overwrite every single file on your partition with the one in the archive!

    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!

    2.1: GRUB restore
    Now, if you want to move your system to a new harddisk or if you did something nasty to your GRUB (like, say, install Windows), You'll also need to reinstall GRUB.
    There are several very good howto's on how to do that here on this forum, so i'm not going to reinvent the wheel. Instead, take a look here:

    http://www.ubuntuforums.org/showthre...t=grub+restore

    There are a couple of methods proposed. I personally recommend the second one, posted by remmelt, since that has always worked for me.


    Well that's it! I hope it was helpful!
    As always, any feedback is appreciated!

    TAR VERSION: tar (GNU tar) 1.15.1

    In this version the exclude arguments need to come before anything else.

    To backup:

    As listed (will not exclude the directories and files)
    Code:
    tar cvpzf backup.tgz / --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys

    Should be (this will exclude the directories and files):
    Code:
    tar  --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys -cvpzf backup.tgz /
    See this link for more: http://www.ubuntuforums.org/showthread.php?t=147501
    Last edited by tagra123; May 22nd, 2006 at 04:11 AM.

  10. #150
    Join Date
    May 2005
    Location
    Kansas City, Missouri, US
    Beans
    230

    Re: Howto: Backup and restore your system!

    It might be worthwhile--and save some grief later--to make a "test" directory with several subdirectories, and put any old files in those directories (and in the "test" directory itself) and experiment with using tar archiving and restoring on this material that has no value.

    As pointed out in several posts, there are different versions of tar in existence, and they do have quirky variations that can lead to bad archives or none at all, though I doubt that under any conceivable normal scenario the use of tar to CREATE an archive could hurt anything apart from using up lots of disc space unnecessarily.

    On the other hand, if a mistake is made in RESTORING from a tar archive--one of the most common and easiest errors is to be in the wrong directory when you give the command, or otherwise to fail to state exactly where to put the restored directories and/or files--then there is a possibility of serious trouble. At the least, you might end up with an enormous cleanup task. (As another poster put it, "Guess how I know this.")

    So I'd suggest experimenting with harmless material first--if possible, on a hard disk separate from the one you'll eventually be doing your "serious" work with. That way you can play around all you want, and become familiar with some of the literally hundreds of variations available with the enormously powerful and useful, but potentially dangerous, tar command. (Like learning to drive in a parking lot.)

    You can download the big tar manual in easy-to-read PDF form from the GNU/tar homepage. I doubt that anybody except maybe some tar developers know everything that is in it.

Page 15 of 138 FirstFirst ... 513141516172565115 ... 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
  •