Page 38 of 138 FirstFirst ... 2836373839404888 ... LastLast
Results 371 to 380 of 1375

Thread: Howto: Backup and restore your system!

  1. #371
    Join Date
    Oct 2006
    Location
    SLC, UofU
    Beans
    684
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: Howto: Backup and restore your system!

    bullgr, et al.

    Partimage works much like ghost, but is designed for linux. It works for a large number of filesystems/drive types.
    --Superb--

  2. #372
    Join Date
    Sep 2007
    Location
    010101010101001101000001
    Beans
    858
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto: Backup and restore your system!

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


    1: Backing-up

    This was exactly what I was looking for... Many Thanks!
    I tested, and it worked!

    Cheers!

    "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!
    This is exactly what I was looking for... Many Thanks!
    I tested this, and it works!

  3. #373
    Join Date
    Jul 2007
    Beans
    230

    Re: Howto: Backup and restore your system!

    Just wondering, after two tries, the original method posted worked to back up and restore but with a slight problem.... Libs and other synaptic or otherwise software. All my software installed did not get written to my restore disk, nothing I put in on my own like Lexmark drivers, some libs, or anything of that sort. It did restore most everything else though. It did leave out the newer thunderbird install and things like that.

    So is this just a back up of "approved" Ubuntu installs on the system? This is how it seems to me but thought i'd ask.

    TX

  4. #374
    Join Date
    Dec 2006
    Beans
    47

    Re: Howto: Backup and restore your system!

    Can i use this method to backup and reload my windows windows partition too? er.... how?
    thanks!

  5. #375
    Join Date
    Aug 2007
    Beans
    5

    Lightbulb Re: Howto: Backup and restore your system!

    i use debian etch.
    zurk@DarkSMP:/$ cat backup
    tar cvpjf - --one-file-system --exclude=/proc --exclude=/media --exclude=/var/lock --exclude=/var/run --exclude=/tmp --exclude=/var/tmp --exclude=/dev --exclude=/lost+found --exclude=/backup.tbz2.* --exclude=/mnt --exclude=/sys / | split -b 1024m - backup.tbz.


    zurk@DarkSMP:/$ cat restore
    cat backup.tbz.* | tar xvpfj - -C /
    mkdir /proc
    mkdir /lost+found
    mkdir /mnt
    mkdir /sys
    mkdir /dev
    mkdir /media
    mkdir /var/lock
    mkdir /var/run
    mkdir /tmp
    mkdir /var/tmp
    chmod 777 /tmp
    Last edited by zurk; September 16th, 2007 at 03:04 AM.

  6. #376
    Join Date
    May 2007
    Location
    Canada
    Beans
    304
    Distro
    Kubuntu 11.10 Oneiric Ocelot

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by mahasmb View Post
    Question, would the steps in this how to in any cause the following?


    http://ubuntuforums.org/showthread.p...85#post3350485

    I only did the backup part and not restore part.
    I ask again.

    It seems I have lost my whole Ubuntu partition on my laptop with no means of recovering all my hard work AND also without a reason as to why it all happened.

    I followed this HOW TO and did nothing else to my system that could possibly mess it up.

    Yet, I can't access my Ubuntu partition in any way nor even the files within it. Everything is telling me one thing, my Ubuntu partition is an "unknown" partition.

    COULD THIS BACKUP PROCEDURE HAVE POSSIBLY CAUSED MY PROBLEMS?

    I need to know.

    Please.

  7. #377
    Join Date
    Sep 2007
    Location
    010101010101001101000001
    Beans
    858
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by tech9 View Post
    This is exactly what I was looking for... Many Thanks!
    I tested this, and it works!

    I take this back...

    See link....
    http://ubuntuforums.org/showthread.php?t=553115

  8. #378
    Join Date
    May 2006
    Location
    Manhattan
    Beans
    40
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Howto: Backup and restore your system!

    I've read over the thread and I am a bit confused why I cannot get this method to work. We had to send a laptop back to the manufacturer and they told us we would be charged is anything other than windows was on it. BS
    Any way, when it came back, I tried to installed Ubuntu, then un tar my backup as root from the root directory, but when I restart, I get the following error
    /bin/sh: can't access tty
    Anyone know what I've done wrong?

  9. #379
    Join Date
    Nov 2005
    Beans
    3

    Re: Howto: Backup and restore your system!

    Hey!

    I used your wonderful guide to backup AND restore my drive. Lovely stuff, I have Ubuntu up and running again, yet I have errors.



    Now, I should probably tell you HOW I broke my system.

    Imagine, if one were to run VMware sessions straight from drive in non-snapshot mode. Then imagine one was curious as to what'd happen if from INSIDE Ubuntu you load up Ubuntu again. In essence, the same file system, kernel, loggers, etc were all being used at the same time. Obviously it was going to break


    Well, after reboot, it was all read-only. I opted to restore my backup (which I had luckily just made five hours ago! ) so it'd all be well and dandy.


    However, now when I boot I get a series of messages telling me this:
    ld_static: cannot open output file /lib/modules/2.6.20-16-generic/volatile/nvidia_new.ko : Readonly file system.

    I get these with all modules in the volatile folder.

    This means, I have NO NET on my laptop. Not even cable.


    I could use a bit of help on fixing this one, the irc channel doesn't seem to know what is wrong

    Cheers!

  10. #380
    Join Date
    Oct 2005
    Location
    Peru, South America
    Beans
    1,486
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Howto: Backup and restore your system!

    Well after running many backups and even writing a script to backup my system on a monthly basis, this system is for the birds! It has left me hanging so many times it is not even funny. I think my restore ratio is about 20% of the time that it has actually worked over a 2 year period! That is sorry. I have a separate partition for Home and only backup my / with this system. I tried a complete backup, including my home directory and went to restore after making some changes that messed up my system, and it was unbootable! Re-installed and then restored an earlier backup of just the filesystem and still unbootable!!! ARGHHH, why do I bother with this system of backing up!!! I'm off to find a new backup method that is more secure, more stable, and more reliable!

    Shane

    EDIT: Ok, I determined that the restore problem stems from the fact that I restore my Grub menu list, and that list is now run with the UUID method which changes if you have to do a re-install. This is unacceptable for a backup procedure and restore procedure. If you use this method, you cannot re-install and then restore without editing your Grub Menu list to be correct. I'm going to the partimage method described here. And plan on installing a second Linux installation on my hdd to use instead of a live CD as it boots much faster, and will run much faster. Looking at PuppyLinux or Xubuntu, so it doesn't require much space. I have used partimage before and find it to be a very good way of backing up and restoring.
    Last edited by shane2peru; September 24th, 2007 at 09:36 PM.

Page 38 of 138 FirstFirst ... 2836373839404888 ... 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
  •