all you Terminal guru's out there - ehMac.ca
Facebook
Twitter
YouTube
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
Old Apr 15th, 2012, 12:31 PM   #1
New Neighbour
 
Join Date: Mar 2011
Posts: 16
all you Terminal guru's out there

I wanted to know the best way to copy all the contents of one (1 Tb) USB external drive /dev/disk1s2 to a new (2Tb) (/dev/disk2s2) via terminal.


what's the best set of commands to "cp -rv" everything from /dev/disk1s2/ to /dev/disk2s2 ?

thx for any suggestions
highcadence is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old Apr 15th, 2012, 12:50 PM   #2
Honourable Citizen
 
macintosh doctor's Avatar
 
Join Date: Mar 2009
Location: Where royalty live and horses roam freely
Posts: 3,496
just a question here.. why do not you use drive genious or carbon copy to do a sector copy?

as for commands
How to copy a directory or folder.
__________________
Apple MacBook Pro 13" Retina 2.6GHZ i5 16GBs/512SSD/128GB Flash storage Storedge
Apple Thunderbolt display 27", K750 Solar Keyboard
Logitech Wireless Trackball M570
LaCie Stark 1TB for time machine, Apple Track Pad
Moshi Keyboard cover ( to catch the drool when surfing rumor sites )
Government jobs / work places : it smells like wet dogs, so do some people that work there. Everyone moves like they were injured!, It's like a low budget rehab centre
macintosh doctor is offline   Reply With Quote
Old Apr 15th, 2012, 12:51 PM   #3
New Neighbour
 
Join Date: Mar 2011
Posts: 16
i just think its more fun using the terminal :-)

thx
highcadence is offline   Reply With Quote
Old Apr 15th, 2012, 01:00 PM   #4
Honourable Citizen
 
macintosh doctor's Avatar
 
Join Date: Mar 2009
Location: Where royalty live and horses roam freely
Posts: 3,496
Quote:
Originally Posted by highcadence View Post
i just think its more fun using the terminal :-)

thx
well then.. hope you back up before you have your fun
__________________
Apple MacBook Pro 13" Retina 2.6GHZ i5 16GBs/512SSD/128GB Flash storage Storedge
Apple Thunderbolt display 27", K750 Solar Keyboard
Logitech Wireless Trackball M570
LaCie Stark 1TB for time machine, Apple Track Pad
Moshi Keyboard cover ( to catch the drool when surfing rumor sites )
Government jobs / work places : it smells like wet dogs, so do some people that work there. Everyone moves like they were injured!, It's like a low budget rehab centre
macintosh doctor is offline   Reply With Quote
Old Apr 15th, 2012, 04:34 PM   #5
Honourable Citizen
 
Join Date: Jun 2009
Posts: 3,214
In the time it took to make this post you could have started the clone using CCC or disk utility haha
broad is offline   Reply With Quote
Old Apr 15th, 2012, 10:19 PM   #6
Full Citizen
 
Join Date: Jul 2004
Location: Oakville, ON
Posts: 474
I think rsync is the fastest way to duplicate src to dest:

copy with progress bar - rsync | commandlinefu.com

but at least one alternative is suggested...

Craig
WCraig is offline   Reply With Quote
Old Apr 15th, 2012, 10:23 PM   #7
Full Citizen
 
Join Date: Jul 2004
Location: Oakville, ON
Posts: 474
Oh, and if you want a more up-to-date version of rsync, MacPorts is a pretty painless way to get it (and many, many other useful tools).

The MacPorts Project -- Home

Craig
WCraig is offline   Reply With Quote
Old Apr 16th, 2012, 12:19 PM   #8
mguertin
Guest
 
Posts: n/a
Beware using rsync ... unless you have a lot of rsync experience you can end up with a lot of headache for nothing (hard links, soft links, resource forks, etc). Also if you're not using the proper version(s) of rsync and you're not passing the appropriate command line options you can end up destroying your data. The MacPorts version is ok but Mike Bombich's patches (author of CCC) are probably the best ones out there for rsync and OSX. You can find them here: Bombich.com: Mac OS X and HFS+ enhancements for rsync 3

That said I'll second (third?) the suggestion for using disk image or carbon copy cloner (which is free). BTW, CCC uses rsync in the backend for many of its copying tasks.
  Reply With Quote
Old Apr 17th, 2012, 08:43 PM   #9
Full Citizen
 
Join Date: Dec 2005
Location: londonon
Posts: 376
For file level copies, I'm partial to 'ditto' myself. It isn't as fast as 'rsync' but at least in the past, was more Mac metadata-friendly.

Also note that for drives containing hard-linked directories (eg. those used with TimeMachine), it will probably be necessary to go with something like 'dd' to do block-level copies.
biovizier is offline   Reply With Quote
Old Apr 18th, 2012, 02:23 AM   #10
Honourable Citizen
 
pm-r's Avatar
 
Join Date: May 2009
Location: Brentwood Bay BC
Posts: 8,483
Quote:
Originally Posted by mguertin View Post
Beware using rsync ... unless you have a lot of rsync experience you can end up with a lot of headache for nothing (hard links, soft links, resource forks, etc). Also if you're not using the proper version(s) of rsync and you're not passing the appropriate command line options you can end up destroying your data. The MacPorts version is ok but Mike Bombich's patches (author of CCC) are probably the best ones out there for rsync and OSX. You can find them here: Bombich.com: Mac OS X and HFS+ enhancements for rsync 3

That said I'll second (third?) the suggestion for using or carbon copy cloner (which is free). BTW, CCC uses rsync in the backend for many of its copying tasks.


I'll go with the CCC (and occasionally the Disk Utility disk image) option, but I like and prefer to use Mike's CCC developer's comment:

"If you would rather avoid the following procedure, you can benefit from these enhancements to rsync by downloading Carbon Copy Cloner, which uses rsync for many of its file copying operations."

MUCH more user friendly, customizable if needed and MUCH safer IMHO.
pm-r is offline   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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Terminal Commands Question SINC Mac, iPhone, iPad and iPod Help & Troubleshooting 4 Jan 26th, 2009 12:18 PM
I need to change a pref file in the terminal jlcinc Mac, iPhone, iPad and iPod Help & Troubleshooting 0 Feb 8th, 2008 02:49 PM
Terminal Font with Leopard ifade Anything Mac 3 Dec 13th, 2007 11:42 AM
Weird Terminal Problem --help! :( wing Mac, iPhone, iPad and iPod Help & Troubleshooting 1 Jul 27th, 2007 09:44 AM
Mac Os Terminal Server? Jason H Anything Mac 0 Jun 28th, 2004 06:43 PM


All times are GMT -4. The time now is 03:04 AM.



Copyright 1999 - 2012, ehMac.ca All rights reserved. ehMac is not affiliated with Apple Inc. Mac, iPod, iTunes, iPhone, Apple TV are trademarks of Apple Inc. Content Relevant URLs by vBSEO 3.6.0 RC 2

Tribe.ca: Urban living in Toronto!