FAQs and How To's Handy FAQs/How To Guides for installing/configuring Mac OS X.

 
 
Thread Tools Display Modes
  (#1) Old
CodF4ther CodF4ther is offline
Member
 
Posts: 93
Join Date: Apr 2009
Default How-To: Mounting a SDHC card to /Users via fstab - 05-14-2009, 04:20 PM

This borrows heavily from the following sites:OS X Firewire Mount Point

I have an 8Gb Mini which I was finding very tight on space. Having some experience with fstab on linux, I decided to try and mount a SDHC card that I had lying around as part of the file system. This worked out very well for me, and can easily be adapted to mount other parts of the filesystem from SDHC (ie /Applications). I have successfully used this method on Leopard 10.5.6 and Snow Leopard 10.6.2.

Notes:
#1) After completing these changes you won't be able to swap your SDHC card in and out. It basically becomes a permanent part of your machine. If swapping SDHC cards is important to you, you'll need a external card reader.
#2) You need to have basic vi skills to use vifs. There should be lots of guides available if you do a bit of searching with Google.
#3) I've also been warned by meklort that the SDHC drivers are buggy. It has worked for me without issue for over 7 months, but your mileage may vary.
#4) This guide assumes that you have a HFS (journaled) formatted SDHC card with permissions enabled. The journaling probably isn't necessary (and may even be a bad idea, most similar guides on Linux recommend ext2 over ext3). You can partition and format the SDHC card using diskutil.
#5) SDHC cards aren't loaded by default in safe boot, meaning if you follow this guide you won't have access to your profile directory. I was able to login, but couldn't access my downloads directory etc. I have added a new optional step to the guide to make the SDHC required by the OS on safe boot, but I'm leaving this as optional for now. You make the call if you want/need it.

Part 1: Enable OSX to Mount your SDHC on Boot (normally OSX only mounts SDHC cards at login)

1. Open the Terminal app and enter the following command:

Code:
sudo nano /Library/Preferences/SystemConfiguration/autodiskmount.plist
2. Paste in the following into the nano editor (the file should be blank). If you get a file with some existing settings, make sure the value that follows the "AutomountDisksWithoutUserLogin" key is <true/>.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>AutomountDisksWithoutUserLogin</key>
    <true/>
</dict>
</plist>
3. Quit the editor (ctrl-X) and save the file (Y)

Part 2: Modify your mount points

1. Insert your SDHC card and then log in to your favorite account to mount the card.
2. Get the UUID of the drive in Terminal ("<MySDHCDrive>" is the name of your SDHC card):

Code:
diskutil info /Volumes/MySDHCDrive|grep UUID
The diskutil command is going to spew out a lot of info, using grep narrows it down a bit. The stuff you want is on the line that starts: "Volume UUID:". You want the long identifier afterwords. E.g.: A740D396-D42D-3348-BD87-709342F87840

3. Edit your /etc/fstab file the OS X approved way with vifs (in Terminal):

Code:
sudo vifs
And add the equivalent to this line:

Code:
UUID=A740D396-D42D-3348-BD87-709342F87840 /Users hfs rw 1 1
4. Save the file and quit the editor

Part 3: Copy the contents from the original /Users folder to the SDHC card

1. Open terminal again and enter the following command:

Code:
sudo ditto -rsrcFork -V /Users /Volumes/MySDHCDrive
2. Rename the original /Users folder

Code:
sudo mv /Users /Users.orig
3. Recreate the /Users folder for a mount point

Code:
sudo mkdir -P /Users
4. Now, reboot your mac verify that it still boots properly

Code:
sudo shutdown -r now
5. At this your SHDC card should be mounted to /Users. Any reads and writes to that folder will actually happen to your SDHC card. You can verify the mounting with the following:

Code:
cd /
sudo df -k
6. Remove the /Users.orig folder that we are no longer using:

Code:
sudo rm -dr /Users.orig
Part 4: (Optional but recommended) Modify the SDHC driver so that it gets loaded in safe boot

1. Edit the Info.plist for the SDHC driver:
Code:
sudo nano /Extra/Mini9Ext/IOSDHCIBlockDevice.kext/Contents/Info.plist
2. modify the first part of the file from:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
to:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>OSBundleRequired</key>
        <string>Safe Boot</string>
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
3. Manually regenerate the extension cache by running:

Code:
sudo kextcache -a i386 -m /Extra/Extensions.mkext /Extra/Mini9Ext/
  (#2) Old
Dr_Death Dr_Death is offline
Junior Member
 
Dr_Death's Avatar
 
Posts: 26
Join Date: Apr 2009
Location: Newcastle, UK
Default 05-15-2009, 12:21 AM

Would this achieve the same thing a little more easily (for the less geeky amongst us)???


TUAW Tip: Moving your home folder to another disk (or moving it back)

You'd still be better getting the disk to mount at boot to make life easier


Steven

Trust me, I'm a Doctor!

Alpine White Mini 9 | OS X 10.5.7 | 16Gb Stock SSD | 2Gb RAM | BT | 1.3 Mp Webcam

Will install OS X for beers!

Dropbox Invite
  (#3) Old
CodF4ther CodF4ther is offline
Member
 
Posts: 93
Join Date: Apr 2009
Default 05-15-2009, 12:54 AM

Quote:
Originally Posted by Dr_Death View Post
Would this achieve the same thing a little more easily (for the less geeky amongst us)???
I think so yes, but you would still need to do Part 1.
  (#4) Old
Dr_Death Dr_Death is offline
Junior Member
 
Dr_Death's Avatar
 
Posts: 26
Join Date: Apr 2009
Location: Newcastle, UK
Default 05-15-2009, 09:23 AM

That's what I thought... Might do this as I have very little space left on the SSD and a newly installed 32GB SDHC with nowt on it. + having it mount at boot would be more sensible anyway.


Steven

Trust me, I'm a Doctor!

Alpine White Mini 9 | OS X 10.5.7 | 16Gb Stock SSD | 2Gb RAM | BT | 1.3 Mp Webcam

Will install OS X for beers!

Dropbox Invite
  (#5) Old
CodF4ther CodF4ther is offline
Member
 
Posts: 93
Join Date: Apr 2009
Default 05-15-2009, 01:07 PM

I have a 16Gb. What I did with mine was partition it into 3 areas:

Partition 1: 8Gb Fat32 - Storage I may eventually mount this to Downloads or music under my user profile
Partition 2: 4Gb HFS mounted to /Users
Partition 3: 3Gb HFS mounted to /Applications
  (#6) Old
rshuck rshuck is offline
Junior Member
 
Posts: 10
Join Date: Jul 2009
Default 08-17-2009, 07:09 PM

Thanks for this, worked like a charm.
  (#7) Old
CodF4ther CodF4ther is offline
Member
 
Posts: 93
Join Date: Apr 2009
Default 08-19-2009, 02:08 PM

Quote:
Originally Posted by rshuck View Post
Thanks for this, worked like a charm.
No prob, did you just do it for /Users? I've been running with /Users and /Applications off my SDHC for 4 mths now, haven't had a hiccup.
 

« Previous Thread | Next Thread »
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

Forum Jump

Copyright © 2008-2016 MyDellMini.com.