Page 8 of 138 FirstFirst ... 6789101858108 ... LastLast
Results 71 to 80 of 1375

Thread: Howto: Backup and restore your system!

  1. #71
    Join Date
    May 2005
    Location
    Kansas City, Missouri, US
    Beans
    230

    Re: Howto: Backup and restore your system!

    Quote Originally Posted by Heliode

    As far as I know, it is possible to restore / on a running system. I've never tried it before but since it is also possible to erase everything in / on a running system, I figure why not! I'm gonna need some confermation here though.
    Of course you could always just use a live-cd. Usually when you have to restore /, you don't have an option anyway!

    Hope this helps!
    I don't believe it's safe to restore / on a running system--it may not even be possible. I tried it once and when it came to restoring libraries, the system crashed because the libraries needed for the restore process were of course temporarily put out of operation while being restored! So I would advise against trying.

    I welcome correction by somebody that's expert, but that was my experience. I ended up having to rebuild my whole system from scratch.

    Going from a live CD should be fine, though.

  2. #72
    Join Date
    May 2005
    Location
    Sweden
    Beans
    442
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Howto: Backup and restore your system!

    Nice howto!
    But there are a coupple of issues.

    1) Restoring the system did only overwrite without removing any files. There will be a lot of unneeded files on the harddrive.

    2) I ignored the error you mentioned, removed all files from the disk and restored the backup but there are missing files like vmlinuz, initrd.img and maybe more.

    3) this does not include empty directories. what if a program is dependent of writing and deleting from a directory which might be empty at the time you do the backup?

    NOTE:

    -l will stay in the same filesystem, no mounted drives or devices, may be better then the --exclude= option

    --ignore-failed-read don’t exit with non-zero status on unreadable files. Will this remove the error during the backup?
    Last edited by Lunde; June 17th, 2005 at 12:58 PM.
    Fredrik Lunde | Vergic AB
    www.vergic.com

  3. #73
    Join Date
    May 2005
    Location
    Czestochowa, Poland
    Beans
    22

    Re: Howto: Backup and restore your system!

    Why does excluding /mnt and the rest doesn't work here? I'm using breezy and backuping the way it is described in first post?

    EDIT: There are few mistakens in the command line invoking tar to backup system, that are wrote in the first post. For some reason on certain versions of tar excluding of directories doesn't work. After my search on the google groups I found that these paths should look like that:

    tar cvpfz backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /

    The only change is that the path that shows what should be backuped is at the end.

    This change applies to bzip2 "version" respectively.

    EDIT2: There's one more thing, this time about restoring the backup. Although there is an 'p' option given for preserving files modes, there is no option given to preserve same owner as of original files. Without it all of the files unpacked from the archive will become owned by the user who made unpacking. To prevent this we should add --same-owner option to the command line when unpacking. This, in most cases, will bring out some errors - that's when we are non-root user and want to set file owner to root. To prevent this, whe should run tar with sudo tool.
    Last edited by cRoMo; June 22nd, 2005 at 07:10 AM.

  4. #74
    Join Date
    May 2005
    Beans
    24

    Re: Howto: Backup and restore your system!

    Hello,

    I'd like to make an automatic script ; could you help me ?
    I would like to say to start, for example, at 8:30pm
    How to ?


    And is it possible to say it "if the removable device where i ask you to backup is not mounted, do not do anything" ?

    Thx

  5. #75
    Join Date
    Jul 2005
    Location
    Grimstad, Norway
    Beans
    80
    Distro
    Ubuntu 6.10 Edgy

    Re: Howto: Backup and restore your system!

    The code you wrote in your first post:
    Code:
    tar cvpfz backup.tgz / --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys
    A quote from 'man tar':
    -f, --file [HOSTNAME:]F
    use archive file or device F (default "-", meaning stdin/stdout)
    As far as I am able to understand, that means that the file in your example will be named z, and not backup.tgz. I have also tried exactly this command, with both gzip and bzip2 compression (z and j falgs), and the file names are z (for gzip) and j( for bzip2), not backup.tgz/backup.tar.bz2.

    If i change the command to something like this:
    Code:
    tar cvpzf backup.tgz / --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys
    everything works fine. The error message that says 'tar: exit delayed from previous errors' also disapperars.

    By the way: Check the comand for the bzip2 compression. It excludes backup.tgz, and not backup.tar.bz2 as it should do.

  6. #76
    Join Date
    Apr 2005
    Beans
    94

    Re: Howto: Backup and restore your system!

    The way I do it (so that you don't have to remake any directories):

    Boot up off a live cd. Mount hda2 (my main partition).

    type from anywhere: sudo tar cvzf /mnt/hda2/07052005.tgz /mnt/hda2/ --exclude=/mnt/hda2/07052005.tgz

    Restore works basically the same way just now you don't have to remake the directories.
    Last edited by epb613; July 6th, 2005 at 03:31 AM.

  7. #77
    Join Date
    Apr 2005
    Location
    Rio de Janeiro, Brazil
    Beans
    12

    Re: Howto: Backup and restore your system!

    Hi there guys. Newba here.

    I´m willing to move my current Ubuntu installation to another partition. Decided on it and need more drive space. To that, I´m repartitioning the whole thing, but I just don´t want to download all the updates again.

    Based on this HOWTO I thought to do this:
    1 - Backup up the system, as taught;
    2 - Format and partition the drive accordingly;
    3 - Install a brand new Ubuntu;
    4 - Restore the backup of step 1;

    Does that sound reasonable?

    I thank you in advance for any help.
    On time: been searching like a crazy on the forums, can´t find anything related that´s answered.

  8. #78
    Join Date
    Apr 2005
    Beans
    94

    Re: Howto: Backup and restore your system!

    Well if you format the entire drive you'll have to reinstall GRUB into the MBR, but this will happen anyway when you reinstall Ubuntu. After you resintall Ubuntu, if you then restore from your backup file, I think you should be fine. The only problem I could think of is if you change partitions (ie: you go from hda2 to hda3) then you may have a problem with GRUB not looking for your drive in the right place. I think this could be fixed easily though by editing your menu.lst file in /boot/grub and changing the location to hda3.

    If it goes smooth, don't forget to write a howto when your done.

    By the way, it could a better way to acomplish this is just to boot off a live cd and resize/move around your partitions with a partition editor. If you do this, still make sure to back up first.

  9. #79
    Join Date
    Jun 2005
    Beans
    16

    Re: Howto: Backup and restore your system!

    this method doesnt work unless you run a livecd , i've tried moving from harddrive to another

  10. #80
    Join Date
    Oct 2004
    Location
    London, UK
    Beans
    49

    Re: Howto: Backup and restore your system!

    Awesome guide! I'm gonna port it to the wiki, hope that's ok? I'm just gonna take the first post, I guess that has all the updates discussed in the thread?

    If you feel like it you can subscribe to the wiki page and maintain it as you have done with the forum post

    The porting is part of an initiative we're doing to port some of the great material available on the forums to the Ubuntu wiki.

    Thanks for your great work!

    M

    EDIT: Its here by the way
    Last edited by mattheweast; July 18th, 2005 at 12:12 AM.

Page 8 of 138 FirstFirst ... 6789101858108 ... 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
  •