{"id":280,"date":"2005-05-24T05:38:00","date_gmt":"2005-05-24T05:38:00","guid":{"rendered":"http:\/\/jclark.org\/weblog\/Miscellany\/ubuntumount.html"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-30T04:00:00","slug":"ubuntumount","status":"publish","type":"post","link":"https:\/\/jclark.org\/weblog\/2005\/05\/24\/ubuntumount\/","title":{"rendered":"HOWTO: Mount an OS X Hard Drive from a Ubuntu LiveCD"},"content":{"rendered":"<p>One of the selling points of &#8216;LiveCD&#8217; Linux distributions is that they allow you to try out Linux on your computer with out touching anything on your hard drive.  Sometimes, however, you you want to do exactly that.  While <a href=\"http:\/\/jclark.org\/weblog\/Miscellany\/ubuntu.html\">playing with<\/a> a <a href=\"http:\/\/ubuntulinux.org\/\">Ubuntu<\/a> LiveCD on my Powerbook, I decided that I wanted to do exactly that.  These are the steps that I followed, after some Googling led me to <a href=\"http:\/\/ubuntuforums.org\/showthread.php?t=24218\">this thread<\/a> on the Ubuntu forums.<\/p>\n<p><strong>Please Note:<\/strong> By default, the Ubuntu LiveCD will not touch your hard drive.  This is for your safety.  The steps below allow you read <em>and write<\/em> to your hard drive&#8217;s OS X partition while running Ubuntu from the Live CD.  If this makes you in any way nervous, don&#8217;t do it.  If you don&#8217;t know why it should make you nervous, don&#8217;t do it.  I make no warranties.  You could lose all your data, your job, or your hair.  In fact, you should just stop reading now, and go watch television.<\/p>\n<p>Still with me?  Okay.  You were warned.  From the Ubuntu Applications menu, choose Utilities, and therein choose Terminal (aside from the use of a menu instead of Finder, it&#8217;s just like OS X).  Once in terminal, you need to create a &#8216;mount point&#8217;, which is just an empty directory where you want to be able to access your OS X partition.  The traditional place for this is in <code>\/mnt<\/code>:<\/p>\n<pre><code>sudo mkdir \/mnt\/macosx<\/code><\/pre>\n<p>Just as in OS X, <code>sudo<\/code> will make your command run as root.  When running from the LiveCD, you will not be prompted for a password, so make sure you&#8217;re sure about your commands before pressing Return.<\/p>\n<p>Next, we need to find out what hard drive partition your OS X data is on.  OS X normally creates a number of small partitions for its own use.  To check your drive, you can use <code>parted<\/code>.  <strong>Another Dire Warning:<\/strong> <code>parted<\/code>&#8216;s <em>raison-d&#8217;etre<\/em> is viewing <em>and changing<\/em> disk partitions.  It <strong>can and will<\/strong> destroy your harddrive.  If you&#8217;re nervous, don&#8217;t do it.  Here&#8217;s my entire <code>parted<\/code> session:<\/p>\n<pre><code>ubuntu@ubuntu:\/usr$ sudo \/sbin\/parted\nGNU Parted 1.6.20 with HFS shrink patch 16\nCopyright (C) 1998 - 2004 Free Software Foundation, Inc.\nThis program is free software, covered by the GNU General Public License.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT\nANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\nFOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\ndetails.\n\nUsing \/dev\/hda\n(parted) print\nDisk geometry for \/dev\/hda: 0.000-38154.375 megabytes\nDisk label type: mac\nMinor    Start       End     Filesystem  Name                  Flags\n1          0.000      0.031              Apple\n2          0.031      0.058              Macintosh\n3          0.059      0.085              Macintosh\n4          0.086      0.113              Macintosh\n5          0.113      0.140              Macintosh\n6          0.141      0.390              Macintosh\n7          0.391      0.640              Macintosh\n8          0.641      0.890              Patch Partition\n10       128.891  33050.109  hfs+        Apple_HFS_Untitled_2\n(parted) quit\nInformation: Don&#039;t forget to update \/etc\/fstab, if necessary.<\/code><\/pre>\n<p>First, I invoked it with <code>sudo \/sbin\/parted<\/code>.  Under Ubuntu Live, only root can access \/dev\/hda, which is your harddrive.  Note the line <code>Using \/dev\/hda<\/code>.  If you see something else, you can try <code>select \/dev\/hda<\/code>, but you probably forgot the sudo, or else you have a system which is different enough from mine that you should just type <code>quit<\/code> now and seek another source of information.<\/p>\n<p>At the first prompt (<code>(parted)<\/code>), I typed <code>print<\/code> which printed the partition table below.  As you can see, my OS X partion is number 10.  So I type <code>quit<\/code> and return to the bash prompt.<\/p>\n<p>Now it&#8217;s time to mount the drive.  Here&#8217;s the command I used, using the mount point I created earlier and the partition number I learned from <code>parted<\/code>:<\/p>\n<pre><code>sudo mount -t hfsplus \/dev\/hda10 \/mnt\/macosx<\/code><\/pre>\n<p>If you get no ouput, success.  Otherwise, something went wrong, and you should quit now or seek other counsel.  Assuming it worked, you should be able to access your OS X partition thusly:<\/p>\n<pre><code>cd \/mnt\/macosx<\/code><\/pre>\n<p>Your OS X partition is now mounted under <code>\/mnt\/macosx<\/code>.  So for example, my OS X home directory, which is normally <code>\/Users\/jclark<\/code>, is now <code>\/mnt\/macosx\/Users\/jclark<\/code>.  Should you want to write any of the directories in the mounted partition (don&#8217;t do it!), you&#8217;ll need to run your commands with <code>sudo<\/code>.<\/p>\n<p><strong>Final word:<\/strong> I don&#8217;t know for sure how Ubuntu will unmount the partition when I shut it down.  It <em>should<\/em> be fine, but an ounce of prevention is worth a pound of reformatting.  To unmount your partition, use <code>umount<\/code> (cd out of the \/mnt\/macosx directory tree first):<\/p>\n<pre><code>cd\nsudo umount \/dev\/hda10<\/code><\/pre>\n<p>You can double check your work by running <code>mount<\/code> with no arguments to see a list of all mounted partitions.  After the umount, <code>\/dev\/hda10<\/code> (or your equivalent) should not be listed.<\/p>","protected":false},"excerpt":{"rendered":"<p>One of the selling points of &#8216;LiveCD&#8217; Linux distributions is that they allow you to try out Linux on your computer with out touching anything on your hard drive. Sometimes, however, you you want to do exactly that. While playing with a Ubuntu LiveCD on my Powerbook, I decided that I wanted to do exactly [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-280","post","type-post","status-publish","format-standard","hentry","category-miscellany"],"_links":{"self":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/comments?post=280"}],"version-history":[{"count":0,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/280\/revisions"}],"wp:attachment":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/media?parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/categories?post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/tags?post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}