DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st May 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default basic rsync questions

Hi there
I want to rsync my FreeBSDs to an external usb drive that is attached to a Linux box. If i create a single, non-bootable root partition on this external drive, create an ext3 file system on this partition and do the necessary ssh public key set up would these commands back up the entire FreeBSDs, so that the entire system could be completely recovered in the event of an emergency?:
Code:
#rsync --progress -avhe ssh --delete --exclude /dev / user@Linuxbox:/usb/drive/path/dirBSD_x
Or should this be done differently from a FreeBSD system? Would just specifying / only back up the partition that / lived on? Or would it back up the whole system into /usb/drive/path/dirBSD_x ?
I'm not joking i really am a complete n00b with BSD. Any answers would be great. Thank you
regards unixjingleman
Reply With Quote
  #2   (View Single Post)  
Old 21st May 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

I've just realized that of course rsync wouldn't back-up just the / partition because it's a tool for syncing files so a recursive back-up if / would back-up the whole system. That aside any suggestions on the other question would be great. Thanks
Reply With Quote
  #3   (View Single Post)  
Old 25th May 2011
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

You're missing two *very* important options when using rsync between FreeBSD and Linux systems: --hard-links and --numeric-ids

FreeBSD uses a lot of hardlinks (/rescue/* is a single binary, for example). If you omit that option, your backup will be huge (each hard-link gets copied as a separate file). And you won't be able to restore back to the same size harddrive.

The numeric IDs option is important when transferring between OSes. Without it, rsync will send the username/groupname and the remote system will set the UID/GID to match whatever it has on the local system. These are not the same across Unix-like OSes, and bad things can happen on restores.

These are the options we are currently using for our rsync backups:
--archive --hard-links --sparse --xattrs --numeric-ids

--verbose is handy to see what it's backing up, while it's running.

If you have /home on a separate filesystem, you can add --one-file-system to only backup the / filesystem and nothing else (no /dev, no /home, no other mounted filesystems).

Or, you can use --exclude /dev --exclude /home --exclude /blahblah to skip directory trees.

However, if you want to make restoring easy, then do a complete backup of everything except virtual filesystems. So something like the following:
# rsync --archive --hard-links --sparse --xattrs --numeric-ids --exclude=/dev --exclude=/tmp --rsh="ssh -what -ever -options -needed" / username@linuxbox:/path/to/USB/drive/

That way, the restore process is just:
  1. Minimal install of FreeBSD onto new harddrive (to get partitions and filesystems right, installs boot loader correctly)
  2. Boot LiveCD
  3. Mount FreeBSD filesystems to /mnt
  4. rsync --archive --hard-links --sparse --xattrs --numeric-ids --exclude=/dev --exclude=/tmp --rsh="ssh -what -ever -options -needed" username@linuxbox:/path/to/USB/drive/ /
  5. Reboot

If you try to do a piecemeal backup, then you have to a convoluted piecemeal restore.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #4   (View Single Post)  
Old 27th May 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

Thank you to the power of a googolplex dude. Great stuff. That has saved me a lot of headache. Can't thank you enough
king regards
Reply With Quote
  #5   (View Single Post)  
Old 27th May 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

How do you officially thank people on this forum?
Reply With Quote
  #6   (View Single Post)  
Old 27th May 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Just saying thanks in the thread works, a persons receptiveness to unsolicited private messages varies.

There was once a "Thanks" button.. it's gone now, for whatever reason.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic starter questions ??? dennky OpenBSD Installation and Upgrading 10 5th December 2009 07:21 PM
rsync problem paul-lkw General software and network 6 23rd January 2009 02:39 AM
rsync freebsd server/windows client Weaseal FreeBSD General 0 27th August 2008 12:29 AM
Rsh/rsync problems ebzzry FreeBSD General 4 15th August 2008 08:09 AM
encryption during rsync gkontos General software and network 7 13th June 2008 10:08 AM


All times are GMT. The time now is 04:17 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick