Find the answer to your Linux question:
Results 1 to 3 of 3
I have two identical hard drives, and have used dd to make one a duplicate of the boot drive. I have set up rsync (as root ) to run nightly ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    2

    Using rysync to mirror entire system - what to omit


    I have two identical hard drives, and have used dd to make one a duplicate of the boot drive.

    I have set up rsync (as root) to run nightly to mirror the backup drive from the boot drive. There are a bunch of directories/files that fail (mainly is /sys) due to lack of permission - some of the sys files are write-only.

    Can someone suggest what directories I can exclude from the mirroring?

    I would like to be able to either boot the backup drive in case of a boot drive failure, or reinstall Ubuntu on a new disk, then copy the files back from the backup (or use dd, or whatever)

    Any thoughts?

    Thanks

  2. #2
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    /sys and /proc are virtual filesystems that provide info on the kernel, devices, drivers, processes, etc. Both can be excluded.

    In general I would say it's easier and probably faster to reinstall that re-copy everything. I just backup configuration files and of course personal files. So my whole /home directory and then /etc and possibly /root if you've configured anything there for the root user.

    Beyond that, I backup a list of installed packages for easy reinstallation. How to do this depends on your package manager. For example in Ubuntu you can do
    Code:
    sudo dpkg --get-selections > installed-applications.txt
    and reinstall with
    Code:
    sudo dpkg --set-selections < installed-applications.txt
    sudo apt-get -y update
    sudo apt-get dselect-upgrade
    For Arch I use
    Code:
    pacman -Qqe > installed-packages.txt
    and can reinstall with
    Code:
    pacman -S $(< installed-packages.txt)
    If you have limited bandwith or a slow internet connection, you might want to backup the package cache. Again, the location varies distro to distro, but should be in /var somewhere. I think Ubuntu is /var/cache/apt/archives.

  3. #3
    Just Joined!
    Join Date
    Jan 2011
    Posts
    2
    Quote Originally Posted by reed9 View Post
    /sys and /proc are virtual filesystems that provide info on the kernel, devices, drivers, processes, etc. Both can be excluded.

    In general I would say it's easier and probably faster to reinstall that re-copy everything. I just backup configuration files and of course personal files. So my whole /home directory and then /etc and possibly /root if you've configured anything there for the root user.

    Beyond that, I backup a list of installed packages for easy reinstallation. How to do this depends on your package manager. For example in Ubuntu you can do
    Code:
    sudo dpkg --get-selections > installed-applications.txt
    and reinstall with
    Code:
    sudo dpkg --set-selections < installed-applications.txt
    sudo apt-get -y update
    sudo apt-get dselect-upgrade
    For Arch I use
    Code:
    pacman -Qqe > installed-packages.txt
    and can reinstall with
    Code:
    pacman -S $(< installed-packages.txt)
    If you have limited bandwith or a slow internet connection, you might want to backup the package cache. Again, the location varies distro to distro, but should be in /var somewhere. I think Ubuntu is /var/cache/apt/archives.
    Thanks!. I will have to test the procedure out on a spare disk drive, to be sure it works.

    Larry

  4. $spacer_open
    $spacer_close

Posting Permissions

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