{"id":419,"date":"2009-08-31T12:53:01","date_gmt":"2009-08-31T16:53:01","guid":{"rendered":"http:\/\/www.pressleypress.com\/blog\/?p=419"},"modified":"2009-08-31T12:53:01","modified_gmt":"2009-08-31T16:53:01","slug":"merging-2-hfs-partitions-using-diskutil","status":"publish","type":"post","link":"https:\/\/www.pressleypress.com\/blog\/?p=419","title":{"rendered":"Merging 2 HFS Partitions using DiskUtil"},"content":{"rendered":"<p>As a Mac user, you&#8217;re probably aware of Mac OS X&#8217;s &#8220;Disk Utility&#8221; program for mounting volumes, repairing permissions, creating disk images, etc. However, the command line version of the tool, &#8220;diskutil&#8221; is also very handy and has functions that aren&#8217;t available in the GUI application. <\/p>\n<p>Let&#8217;s say you have 2 HFS+ partitions; 1 called &#8220;Music&#8221; on disk0s1 and the other called &#8220;Photos&#8221; on disk0s2. Then, at some point decide that you don&#8217;t want those 2 partitions separated anymore and want to combine them into one partition called &#8220;Music_and_Photos.&#8221; It&#8217;s easy with the &#8220;diskutil&#8221; tool.<\/p>\n<p>Open a command line and type :<\/p>\n<p>&#8220;diskutil mergePartitions hfs+ Music_and_Photos disk0s1 disk0s2&#8221;<\/p>\n<p>The partition disk0s1 (Music) and the partition disk0s2 (Photos) would at this point now be merged as disk0s1 (Music_and_Photos)<\/p>\n<p>Keep in mind that only HFS partitions can be merged without data loss, and that the partitions being merged must be &#8220;next to each other&#8221; in the partition map. (Meaning that if you tried to merge disk0s1 and disk0s3 that s2 which is in the middle would also be merged.) If you don&#8217;t know where each partition&#8217;s place is in the partition map, simply type &#8220;diskutil list&#8221; on the command line to find out.<\/p>\n<p>More info on DiskUtil can be found <a href=\"http:\/\/developer.apple.com\/mac\/library\/documentation\/Darwin\/Reference\/ManPages\/man8\/diskutil.8.html\">HERE<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a Mac user, you&#8217;re probably aware of Mac OS X&#8217;s &#8220;Disk Utility&#8221; program for mounting volumes, repairing permissions, creating disk images, etc. However, the command line version of the tool, &#8220;diskutil&#8221; is also very &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3],"tags":[],"class_list":["post-419","post","type-post","status-publish","format-standard","hentry","category-computers"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p32FB4-6L","jetpack-related-posts":[{"id":1333,"url":"https:\/\/www.pressleypress.com\/blog\/?p=1333","url_meta":{"origin":419,"position":0},"title":"Linking a Local Folder with Microsoft&#8217;s One Drive","author":"Matt","date":"October 21, 2018","format":false,"excerpt":"You may want to sync a folder on your computer with OneDrive that isn't one of the Windows standard C: drive folders like \"Documents\", \"Pictures\" etc. If that's the case, here's the command line for you to use to link any folder with OneDrive. mklink \/j \"<path to configured OneDrive\u2026","rel":"","context":"In &quot;Computers&quot;","block_context":{"text":"Computers","link":"https:\/\/www.pressleypress.com\/blog\/?cat=3"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1147,"url":"https:\/\/www.pressleypress.com\/blog\/?p=1147","url_meta":{"origin":419,"position":1},"title":"XCode File Comparison Tool (FileMerge.app)","author":"Matt","date":"October 2, 2014","format":false,"excerpt":"XCode comes with a file comparison tool. It's pretty basic, but gets the job done. Run the following from a command line to run it : open \/Applications\/Xcode.app\/Contents\/Applications\/FileMerge.app","rel":"","context":"In &quot;Computers&quot;","block_context":{"text":"Computers","link":"https:\/\/www.pressleypress.com\/blog\/?cat=3"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":552,"url":"https:\/\/www.pressleypress.com\/blog\/?p=552","url_meta":{"origin":419,"position":2},"title":"Make a VM of a Real Machine Using Disk2vhd","author":"Matt","date":"March 4, 2010","format":false,"excerpt":"Ever wanted to clone a windows machine, and run it as a VM? Well, Disk2vhd is the answer. \"Disk2vhd is a utility that creates VHD (Virtual Hard Disk - Microsoft's Virtual Machine disk format) versions of physical disks for use in Microsoft Virtual PC or Microsoft Hyper-V virtual machines (VMs).\"\u2026","rel":"","context":"In &quot;Computers&quot;","block_context":{"text":"Computers","link":"https:\/\/www.pressleypress.com\/blog\/?cat=3"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1149,"url":"https:\/\/www.pressleypress.com\/blog\/?p=1149","url_meta":{"origin":419,"position":3},"title":"Stop your Macbook from sleeping when lid closed (CLI)","author":"Matt","date":"October 7, 2014","format":false,"excerpt":"The\u00a0caffeinate\u00a0command is used to prevent a Mac from going to sleep. The simplest way to use this command is to run the following command in the terminal. Full Article","rel":"","context":"In &quot;Computers&quot;","block_context":{"text":"Computers","link":"https:\/\/www.pressleypress.com\/blog\/?cat=3"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":23,"url":"https:\/\/www.pressleypress.com\/blog\/?p=23","url_meta":{"origin":419,"position":4},"title":"Star Wars ASCII &#8211; Hillarious and Somewhat Impressive","author":"Matt","date":"April 12, 2006","format":false,"excerpt":"The entire Star Wars movie in ASCII characters. Open a Terminal\/Shell and type the following command : telnet towel.blinkenlights.nl Then sit back and watch the hillarity. (I know this will work for Mac OS X and Unix\/Linux. It SHOULD work for Windows too but I'm not sure.)","rel":"","context":"In &quot;Miscellaneous&quot;","block_context":{"text":"Miscellaneous","link":"https:\/\/www.pressleypress.com\/blog\/?cat=4"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1105,"url":"https:\/\/www.pressleypress.com\/blog\/?p=1105","url_meta":{"origin":419,"position":5},"title":"XCode Command Line Tools","author":"Matt","date":"April 10, 2014","format":false,"excerpt":"Need to install the XCode Command Line Tools? This is how you do it... $ xcode-select --install Then, follow the screen prompts. I came across this need when attempting to compile pyOpenSSL. It needed FFI.h can I couldn't get that without installing the command line tools.","rel":"","context":"In &quot;Computers&quot;","block_context":{"text":"Computers","link":"https:\/\/www.pressleypress.com\/blog\/?cat=3"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.pressleypress.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pressleypress.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pressleypress.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pressleypress.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pressleypress.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=419"}],"version-history":[{"count":1,"href":"https:\/\/www.pressleypress.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/419\/revisions"}],"predecessor-version":[{"id":420,"href":"https:\/\/www.pressleypress.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/419\/revisions\/420"}],"wp:attachment":[{"href":"https:\/\/www.pressleypress.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pressleypress.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pressleypress.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}