Rsync for back up, external HD | Unix Linux Forums | OS X (Apple)

  Go Back    


OS X (Apple) OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple.

Rsync for back up, external HD

OS X (Apple)


Tags
backups, options, rsync

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-20-2013
marek marek is offline
Registered User
 
Join Date: Jun 2013
Last Activity: 25 July 2013, 11:21 AM EDT
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Rsync for back up, external HD

Hello all!


I am quite unsure with all options of rsync. Here my backup configuration: I am on Mac X (10.8) and want an exact copy of my HD to an external HD. I formatted the new USB drive with Mac OS extended (Journaled, Encrypted) and made in my shell the following command and got the following errors:

Code:
sudo rsync -a / /Volumes/backup_2013/
Password:
rsync: opendir "/dev/fd/3" failed: Bad file descriptor (9)
file has vanished: "/Users/mstep/Library/Saved Application State/com.apple.DiskUtility.savedState/data.data"
file has vanished: "/Users/mstep/Library/Saved Application State/com.apple.DiskUtility.savedState/window_1.data"
file has vanished: "/Users/mstep/Library/Saved Application State/com.apple.DiskUtility.savedState/window_2.data"
file has vanished: "/Users/mstep/Library/Saved Application State/com.apple.DiskUtility.savedState/windows.plist"
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(992) [sender=2.6.9]

I think, this is due to the fact, that I was working while this very long backup was running. And probably there were some temporary files of the format just before I run the backup ...

My questions:

1. Is this the good option (rsync -a) for the first backup?
2. Is for the following backups `rsync -a --delete HD/ backup` right?
3. Is it possible to make the backup bootable (it is password protected)?

Thank you for your hints!


marek - greetings from very hot Munich

Last edited by vbe; 06-20-2013 at 11:07 AM.. Reason: code tags...
Sponsored Links
    #2  
Old 06-21-2013
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 1 October 2014, 12:42 PM EDT
Location: Switzerland - GE
Posts: 5,778
Thanks: 160
Thanked 406 Times in 381 Posts
Well Marek I suppose the lack of response comes from the usage you make of rsync... designed for remote copy...
And so most of us to do what you do would use cpio (or even tar...) or dd for exact copies
As to your Q3, with rsync like that you can forget about it... but I would give a try with dd ( your external disk must be same size or bigger, only if bigger, the difference will be lost...) I cant promise anything since I only did this on scsi devices almost identical or same standards... but it be worth trying ( but will it damage your external disk??). For if it works you would have an exact copyand then you could try to boot from it, if this works, you can return to your rsync for following backups I suppose

My 2 cents...
Sponsored Links
    #3  
Old 06-21-2013
drl's Avatar
drl drl is offline Forum Advisor  
Registered Voter
 
Join Date: Apr 2007
Last Activity: 1 October 2014, 11:50 AM EDT
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 1,678
Thanks: 40
Thanked 194 Times in 177 Posts
Hi.

For backup of files, I use rsnapshot, possibly in your repositories, more information at rsnapshot . It uses rsync as part of a larger organization process. I have used it for more than a year, it allows recovery of individual files, and uses hard-links to create a very compact backup, yet still "addressable" by date-time of collection. You can set up cron jobs to do hourly, daily, weekly, monthly backups from the remote gathering computer. I backup at 4-hour intervals.

For a very quick backup of everything, I often used a tar.gz file -- it quickly restores my files to updated, and newly installed systems with no trouble (although you may not want every old file).

For cloning to create a bootable image, I suggest you look at Clonezilla - About -- it will use dd as a last resort, but will first check to see if it can copy by omitting unused sectors. (I use software RAID, which causes a dd copy.)

Always experiment before you commit important data.

Best wishes ... cheers, drl
    #4  
Old 06-23-2013
marek marek is offline
Registered User
 
Join Date: Jun 2013
Last Activity: 25 July 2013, 11:21 AM EDT
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Thank you vbe and del for your hints!


Sorry for answering so late. I have had to read tons of manual pages of rsync, cp, dd, cpio, tar, rsnapshot.

My question was concerning an exact backup of my HD on a USB-HD and how to do it incrementally.

@drl

Off course rsync is also a tool for external HDs not only over network.

If I am right the command I will use in future is the following to make a incremental backup - you may still prevent a catastrophe with some helpful hints:


Code:
sudo rsync -tavu --delete / /Volumes/backup_2013/

The option -t preserves modification times. -a archive mode. -v verbose. -u update (only newer files are transferred - this switch I was looking for). --delete means all files which are deleted on the source HD are deleted on the destination too. Because I asked for an exact copy of my actual HD, this is the option I was looking for.

To make the external HD bootable (MacOS Lion) I have to make some researches again ... It is for a later post. (I am not sure, whether it will possible with an encrypted HD).


marek

---------- Post updated at 03:52 PM ---------- Previous update was at 02:23 PM ----------

To make the external HD bootable (only to make this thread complete for some MacOS X users):

First try: I opened the HD Utility in the Utilities folder. I was hoping to find something like "Make Disk Bootable", but no help. I will not claim, that there is no such "button". I simply did not find it.

I have no Install MacOS X Disk Image in my Applications Folder. My idea was, to run the installer over the external HD to make it bootable. But to download this large installer file over the App Store, just to make an external HD bootable, I thought that this is overkill. So I decided to try the following and it worked:

The old version of CCC (Carbon Copy Cloner), which is now payable, is working! I just have had to run a copy of the HD over the external HD ...

I expected from this forum, to help me to find the right switches for rsync, and perhaps tell me, how to make an external HD bootable over the Shell. Disappointed!


Hope this helps somebody out there


marek
Sponsored Links
    #5  
Old 06-25-2013
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 1 October 2014, 12:42 PM EDT
Location: Switzerland - GE
Posts: 5,778
Thanks: 160
Thanked 406 Times in 381 Posts
Wanted to thank you for your contribution!
As I already said rsync wasnt what it was supposed to be for that is why you have so little feed back, as for rsync making something bootable, that certainly cant be done the only standard unix tool to my knowlege able to do so is dd for you will have to create a bootstrap and that no ordinary copy command can do..that is why backup utilities that are able to create bootable tapes use dd to write at the beginning of tape then pass to tar... I might give a try when I have time and a bit $$ to spend on an extra external usb disk and see what happens with dd from a MacOS at home (my laptop in my bedroom...)
Sponsored Links
    #6  
Old 06-25-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 1 October 2014, 1:35 PM EDT
Location: Saskatchewan
Posts: 19,480
Thanks: 796
Thanked 3,288 Times in 3,083 Posts
Quote:
Originally Posted by vbe View Post
Well Marek I suppose the lack of response comes from the usage you make of rsync... designed for remote copy...
It can just as easily do local copy. More easily, since daemons and authentication aren't involved.


Code:
rsync dir1 dir2

Sponsored Links
    #7  
Old 06-25-2013
xbin xbin is offline
Registered User
 
Join Date: Feb 2007
Last Activity: 14 September 2014, 9:02 AM EDT
Posts: 105
Thanks: 5
Thanked 20 Times in 20 Posts
You could use Apple's proprietary tool asr which can clone your operating system using block copy. The version of rsync Apple supplies is horribly hack. I'm not going to get into the details. If you want to use rsync to create a clone then roll your own by downloading the latest version of rsync (3.0.9) and applying the patches fileflags, crtimes, and hfs-compression. You'll find a list of files that should be excluded from the clone at the following link- Some files and folders are automatically excluded from a backup task / Backup and archiving settings / Knowledge Base - Bombich Software Support

Finally, you need to "bless" the clone (see man bless) so it can boot.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Bash script to back up with rsync ajmoreti Shell Programming and Scripting 3 11-16-2009 05:36 AM
Back-to-Back Connection using HBAs aldowsary IP Networking 3 11-28-2008 09:21 PM
Rsync to an external list of URLs ibsen Shell Programming and Scripting 8 10-06-2008 07:33 PM
rsync back? redlotus72 UNIX for Dummies Questions & Answers 1 09-22-2005 03:43 PM



All times are GMT -4. The time now is 10:22 PM.