Find the answer to your Linux question:
Results 1 to 9 of 9
Hi, I've just set up my first linux box. Its running redhat 9, apache, php, mysql etc etc. It would be a real pain to have to do this all ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2004
    Posts
    30

    Backing up complete file system?


    Hi, I've just set up my first linux box. Its running redhat 9, apache, php, mysql etc etc. It would be a real pain to have to do this all over again so I was wondering how to make a complete backup of the file system so if something did happen I could restore my linux installation to its previously working state (i.e. all databases restored, all webserver config etc). I've heard that just copying every folder onto a seperate hd works well? And when you need to restore you just format your new hd and copy the files back...is this correct?

    Thanks

  2. #2
    Just Joined!
    Join Date
    Feb 2004
    Location
    Calgary Alberta
    Posts
    19
    This command will work to back things up to a second drive ...
    find / -mount -depth -print|cpio -pdmv /destnatononanotherdrive/

    I have used this quite a few times before and it works perfectly...

  3. #3
    Just Joined!
    Join Date
    Jan 2004
    Posts
    70
    There arent any "Special" files really under linux(excluding mbr perhaps).... therefore copying all files should work. I have also heard stories of using a command called dd to do the job.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    You can also use rsync (http://rsync.samba.org/) to backup the whole drive, certain folders, etc.
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  6. #5
    Just Joined!
    Join Date
    Feb 2004
    Posts
    30
    Quote Originally Posted by Buchan
    This command will work to back things up to a second drive ...
    find / -mount -depth -print|cpio -pdmv /destnatononanotherdrive/

    I have used this quite a few times before and it works perfectly...
    What exactly does this do?

  7. #6
    Just Joined!
    Join Date
    Feb 2004
    Location
    Calgary Alberta
    Posts
    19
    ok ... from the man pages of find:
    -depth Process each directory’s contents before the directory itself
    -mount Don’t descend directories on other filesystems. An alternate
    name for −xdev, for compatibility with some other versions of find.
    −print True; print the full file name on the standard output, followed
    by a newline.


    and for cpio:
    −d, −−make‐directories
    Create leading directories where needed.
    −m, −−preserve‐modification‐time
    Retain previous file modification times when creating files.
    −p, −−pass‐through
    Run in copy‐pass mode.
    −v, −−verbose
    List the files processed, or with −t, give an ‘ls −l’ style ta‐
    ble of contents listing. In a verbose table of contents of a
    ustar archive, user and group names in the archive that do not
    exist on the local system are replaced by the names that corre‐
    spond locally to the numeric UID and GID stored in the archive.

    Basicly Find looks far all of the files on the hard drve and cpio moves them to the destination of the new drive. Sorry I can't give you much more info than that, this command was given to me by a friend of mine in an email entitled "Backup instructions for the mentally impared" LOL

    I have always just used it without question because it worked well for me.

  8. #7
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Or use Mondo mindi for your system for all kinds of backups. Its a really dynamic, fast and stable product. It can make bootable isos of your system or tapes if you are using that....

    Check it out here http://www.microwerks.net/~hugo/
    Regards

    Andutt

  9. #8
    Just Joined!
    Join Date
    Feb 2004
    Posts
    30
    Andutt, does it matter if you restore to a hd with different size? What happens to the partition information?

  10. #9
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    No it doesnt matter since you get a chooise on restore if you want to nuke=restore the computer exactly as it was when the backup was taken

    interactive=interactive mode you can reformat your partitions if you like and be able to do other administrator thingies. You can also just choose specific directory structures to make restore of which makes it even better
    Regards

    Andutt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •