MacNN Forums (http://forums.macnn.com/)
-   Mac OS X (http://forums.macnn.com/mac-os-x/)
-   -   Cloning Partitions via Terminal (http://forums.macnn.com/90/mac-os-x/503315/cloning-partitions-via-terminal/)

 
Dex13 Aug 22, 2013 07:00 PM
Cloning Partitions via Terminal
Hello All!

I've been mucking about with asr, diskutil, and dd but I haven't been able to solve this question that I have.

Lets say we have this:
//
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0:GUID_partition_scheme *751.3 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 750.4 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
//

I figured out how to clone the normal boot volume (via .dmg), but how could I directly clone disk0s3 onto disk1s3? Is this even possible?

Note: I understand I can do this all with dd, BUT it takes forever and ever.
 
besson3c Aug 22, 2013 07:39 PM
If you do it with dd you'll also have problems if the partitions are a different size. You should be able to grow the partition later, but shrinking it is a no-go.

It doesn't look like the CLI diskutil supports the restore command found in the Disk Utility GUI. Does this need to be a command line solution?
 
mduell Aug 22, 2013 08:52 PM
Try adding a reasonable blocksize to your dd:

dd if=/dev/disk0s3 of=/dev/disk1s3 bs=1M
 
Dex13 Aug 22, 2013 11:10 PM
thanks besson and mduell

I used $ asr restore -source /dev/disk0s2 -target /dev/disk1s2 -erase -verbose

and for some reason it added the recovery hd as well (if its obvious to someone else why this happened, you clearly understand how much of a novice I am)

However, if you have lets say (bootcamp):
Type: Microsoft Basic Data
Name: Name of Bootcamp Partition
Size: GBs on GBs
IDENT: disk0s4

How could I:
find the exact size of disk0s4 and could i then use asr to restore it on disk1s4 if its the same size partition?

Also, even if I could speed up dd, is there a way for it to ignore writing blank/unused space onto the target drive?

I'm just trying to learn unix.
 
All times are GMT -4. The time now is 04:13 PM.

Copyright © 2005-2007 MacNN. All rights reserved.
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2014, vBulletin Solutions, Inc.


Content Relevant URLs by vBSEO 3.3.2