{"id":61,"date":"2012-03-15T16:19:09","date_gmt":"2012-03-15T15:19:09","guid":{"rendered":"http:\/\/www.mostlyharmless.nl\/?p=61"},"modified":"2012-09-22T11:04:42","modified_gmt":"2012-09-22T10:04:42","slug":"mac-recovery-partion-restoration","status":"publish","type":"post","link":"https:\/\/www.mostlyharmless.nl\/index.php\/2012\/03\/15\/mac-recovery-partion-restoration\/","title":{"rendered":"Mac recovery partion &#8211; restoration"},"content":{"rendered":"<h3>Mac recovery partion: revisited<\/h3>\n<p>&nbsp;<\/p>\n<p>as found <a href=\"http:\/\/www.dmitry-dulepov.com\/2011\/09\/mac-recovery-partion-revisited.html\" target=\"_blank\">here<\/a><\/p>\n<div><\/div>\n<div id=\"post-body-2635424587175612082\">\n<div dir=\"ltr\"><strong>Update (Oct 23, 2010): <\/strong><em>readers posted a lot of valuable comments to this article. Make sure you read them at the bottom of this page.<\/em> Some time ago I wrote an article about recreating a Lion recovery partition. The way described in hat article was very technical, complicated and risky. While any way of adjusting partitions is risky, I found a safer way to recreate recovery partition after my Mac crashed again (looks like its life time is coming to an end). Here is how I did it the second time. <a name=\"more\"><\/a><\/p>\n<h2>Install Lion<\/h2>\n<p>Install Lion on the USB drive or USB stick. If you use stick, make sure you got a good one. I got a very cheap one from Disk2Go and it took 4 hours to install Lion instead of normal 29 minutes. Reboot to your main installation after installing.<\/p>\n<p><!--more--><\/p>\n<h2>Find partition information<\/h2>\n<p>Firsts, change to the root user:<\/p>\n<pre>Applico:~$ su -\r\n Password:\r\nApplico:~#<\/pre>\n<p>List all your disks:<\/p>\n<pre>Applico:~# diskutil list\r\n \/dev\/disk0\r\n   #:                       TYPE NAME                    SIZE       IDENTIFIER\r\n   0:      GUID_partition_scheme                        *128.0 GB   disk0\r\n   1:                        EFI                         209.7 MB   disk0s1\r\n   2:                  Apple_HFS Macintosh HD            127.7 GB   disk0s2\r\n\/dev\/disk1\r\n   #:                       TYPE NAME                    SIZE       IDENTIFIER\r\n   0:      GUID_partition_scheme                        *32.3 GB    disk1\r\n   1:                        EFI                         209.7 MB   disk1s1\r\n   2:                  Apple_HFS OSX                     31.4 GB    disk1s2\r\n   3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3<\/pre>\n<p>From here we know that we have two disks: a hard disk (disk0) and a USB disk (disk1). Get the information on the Macintosh HD and Recovery HD partitions:<\/p>\n<pre> Applico~:# diskutil info \/dev\/disk0s2\r\n    Device Identifier:        disk0s2\r\n    Device Node:              \/dev\/disk0s2\r\n    Part of Whole:            disk0\r\n    Device \/ Media Name:      Macintosh HD\r\n\r\n    Volume Name:              Macintosh HD\r\n    Escaped with Unicode:     Macintosh%FF%FE%20HD\r\n\r\n    Mounted:                  Yes\r\n    Mount Point:              \/\r\n    Escaped with Unicode:     \/\r\n\r\n    File System Personality:  Journaled HFS+\r\n    Type (Bundle):            hfs\r\n    Name (User Visible):      Mac OS Extended (Journaled)\r\n    Journal:                  Journal size 16384 KB at offset 0x3ba000\r\n    Owners:                   Enabled\r\n\r\n    Partition Type:           Apple_HFS\r\n    OS Can Be Installed:      Yes\r\n    Media Type:               Generic\r\n    Protocol:                 SATA\r\n    SMART Status:             Verified\r\n    Volume UUID:              5C784582-B984-3B4A-85FE-245E9056CD5F\r\n\r\n    Total Size:               127.7 GB (<strong>127691702272<\/strong> Bytes) (exactly 249397856 512-Byte-Blocks)\r\n    Volume Free Space:        28.2 GB (28211933184 Bytes) (exactly 55101432 512-Byte-Blocks)\r\n    Device Block Size:        512 Bytes\r\n\r\n    Read-Only Media:          No\r\n    Read-Only Volume:         No\r\n    Ejectable:                No\r\n\r\n    Whole:                    No\r\n    Internal:                 Yes\r\n    Solid State:              Yes\r\n\r\n Applico:~# diskutil info \/dev\/disk1s3\r\n    Device Identifier:        disk1s3\r\n    Device Node:              \/dev\/disk1s3\r\n    Part of Whole:            disk1\r\n    Device \/ Media Name:      Recovery HD\r\n\r\n    Volume Name:              Recovery HD\r\n    Escaped with Unicode:     Recovery%FF%FE%20HD\r\n\r\n    Mounted:                  No\r\n\r\n    File System Personality:  Journaled HFS+\r\n    Type (Bundle):            hfs\r\n    Name (User Visible):      Mac OS Extended (Journaled)\r\n    Journal:                  Unknown (not mounted)\r\n    Owners:                   Disabled\r\n\r\n    Partition Type:           Apple_Boot\r\n    OS Can Be Installed:      No\r\n    Media Type:               Generic\r\n    Protocol:                 USB\r\n    SMART Status:             Not Supported\r\n    Volume UUID:              69F1FA77-EB09-3D79-BBD7-6101644A108B\r\n\r\n    Total Size:               650.0 MB (<strong>650002432<\/strong> Bytes) (exactly 1269536 512-Byte-Blocks)\r\n    Volume Free Space:        0 B (0 Bytes) (exactly 0 512-Byte-Blocks)\r\n    Device Block Size:        512 Bytes\r\n\r\n    Read-Only Media:          No\r\n    Read-Only Volume:         Not applicable (not mounted)\r\n    Ejectable:                Yes\r\n\r\n    Whole:                    No\r\n    Internal:                 No<\/pre>\n<p>You need to note total sizes of both partitions.<\/p>\n<h2>Resize your main partition<\/h2>\n<p>Now we are going to resize our main partition. For that we calculate its new total size. To be safe I decied to substract 700 megabytes instead of 650. So the desired size is calculated like 127691702272-700*1024*1024=127040651264. While we resize, we can also create a new partition:<\/p>\n<pre>Applico:~# diskutil resizeVolume \/dev\/disk0s2 127040651264B  jhfs+ \"Recovery HD\" 650002432B\r\nStarted partitioning on disk0s2 Macintosh HD\r\nVerifying the disk\r\nChecking file system\r\nPerforming live verification\r\nChecking Journaled HFS Plus volume\r\nChecking extents overflow file\r\nChecking catalog file\r\nChecking multi-linked files\r\nChecking catalog hierarchy\r\nChecking extended attributes file\r\nChecking volume bitmap\r\nChecking volume information\r\nThe volume Macintosh HD appears to be OK\r\nResizing\r\nWaiting for the disks to reappear\r\nFormatting disk0s3 as Mac OS Extended (Journaled) with name Recovery HD\r\nInitialized \/dev\/rdisk0s3 as a 621 MB HFS Plus volume with a 8192k journal\r\nMounting disk\r\nFinished partitioning on disk0s2 Macintosh HD\r\n\/dev\/disk0\r\n   #:                       TYPE NAME                    SIZE       IDENTIFIER\r\n   0:      GUID_partition_scheme                        *128.0 GB   disk0\r\n   1:                        EFI                         209.7 MB   disk0s1\r\n   2:                  Apple_HFS Macintosh HD            127.0 GB   disk0s2\r\n   3:                  Apple_HFS Recovery HD             <strong>651.1 MB<\/strong>   disk0s3<\/pre>\n<p>Note that recovery partition size is not right. When adding partitions, diskutil made it larger than we asked. Fix it:<\/p>\n<pre>Applico:~# diskutil resizeVolume disk0s3 650002432B\r\n Started partitioning on disk0s3 Recovery HD\r\n Verifying the disk\r\n Checking file system\r\n Checking Journaled HFS Plus volume\r\n Checking extents overflow file\r\n Checking catalog file\r\n Checking multi-linked files\r\n Checking catalog hierarchy\r\n Checking extended attributes file\r\n Checking volume bitmap\r\n Checking volume information\r\n The volume Recovery HD appears to be OK\r\n Resizing\r\n Finished partitioning on disk0s3 Recovery HD\r\n \/dev\/disk0\r\n    #:                       TYPE NAME                    SIZE       IDENTIFIER\r\n    0:      GUID_partition_scheme                        *128.0 GB   disk0\r\n    1:                        EFI                         209.7 MB   disk0s1\r\n    2:                  Apple_HFS Macintosh HD            127.0 GB   disk0s2\r\n    3:                  Apple_HFS Recovery HD             650.0 MB   disk0s3<\/pre>\n<p>This step is important. If you do not get the right size, you are going to screw your recovery partition.<\/p>\n<h2>Copy recovery partition content<\/h2>\n<p>Now copy recovery partition content:<\/p>\n<pre>Applico:~# dd if=\/dev\/disk1s3 of=\/dev\/disk0s3\r\n    1269536+0 records in\r\n    1269536+0 records out\r\n    650002432 bytes transferred in 185.538679 secs (3503326 bytes\/sec)<\/pre>\n<p>Make sure you use regular disks (\/dev\/diskX), not raw disks (\/dev\/rdiskX). Raw disks always results in kernel panic in my case. Be careful with <code>of<\/code>argument. If you override a wrong place, you are screwed up. Double check where you copy!<\/p>\n<h2>Adjust partition type<\/h2>\n<p>That was the most risky part in the previous article. Now I found the easier way to do it:<\/p>\n<pre>Applico:~# asr adjust --target \/dev\/disk0s3 -settype \"Apple_Boot\"\r\n    Fsck \/dev\/disk0s3 ....10....20....30....40....50....60....70....80....90....100\r\n  Adjust completed successfully<\/pre>\n<p>Check it:<\/p>\n<pre>Applico:~ root# diskutil list\r\n \/dev\/disk0\r\n    #:                       TYPE NAME                    SIZE       IDENTIFIER\r\n    0:      GUID_partition_scheme                        *128.0 GB   disk0\r\n    1:                        EFI                         209.7 MB   disk0s1\r\n    2:                  Apple_HFS Macintosh HD            127.0 GB   disk0s2\r\n    3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3\r\n \/dev\/disk1\r\n    #:                       TYPE NAME                    SIZE       IDENTIFIER\r\n    0:      GUID_partition_scheme                        *32.3 GB    disk1\r\n    1:                        EFI                         209.7 MB   disk1s1\r\n    2:                  Apple_HFS OSX                     31.4 GB    disk1s2\r\n    3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3<\/pre>\n<p>Everything seems to be in order.<\/p>\n<h2>Recheck your start up disk<\/h2>\n<p>Using diskutil may remove startup disk mark from your main disk. Go to the System Preferences (click Apple logo for that) and select \u201cStartup Disk\u201d item. Make sure that your Mac&#8217;s hard drive is listed as startup disk.<\/p>\n<h2>Test recovery partition<\/h2>\n<p>Now you can reboot and hold Alt\/Option key. The recovery partition should be appear as a boot option. You should be able to boot with it.<\/p>\n<h2>Conclusion<\/h2>\n<p>This way is much easier than the way I described before but it also took me some time to figure out all commands. The summary you see here should be error free. But if you find some errors or have anything to add, let me know and I will happily update the article. When performing these steps, you must remeber that you do it on your own risk. Neither Apple, nor I will be able to help you if you screw it up. If unsure, ask somebody more accomplished or simply reinstall Lion normally.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Mac recovery partion: revisited &nbsp; as found here Update (Oct 23, 2010): readers posted a lot of valuable comments to this article. Make sure you read them at the bottom of this page. Some time ago I wrote an article about recreating a Lion recovery partition. The way described in hat article was very technical,&hellip; <a class=\"more-link\" href=\"https:\/\/www.mostlyharmless.nl\/index.php\/2012\/03\/15\/mac-recovery-partion-restoration\/\">Lees verder <span class=\"screen-reader-text\">Mac recovery partion &#8211; restoration<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-general-theory","entry"],"_links":{"self":[{"href":"https:\/\/www.mostlyharmless.nl\/index.php\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mostlyharmless.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mostlyharmless.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mostlyharmless.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mostlyharmless.nl\/index.php\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":4,"href":"https:\/\/www.mostlyharmless.nl\/index.php\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/www.mostlyharmless.nl\/index.php\/wp-json\/wp\/v2\/posts\/61\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/www.mostlyharmless.nl\/index.php\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mostlyharmless.nl\/index.php\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mostlyharmless.nl\/index.php\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}