Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create a customized mount point system UNIX
Unlike the way OS X comes out of the box, FreeBSD usually has you do a single large partition, and then seperate the partition out into 'slices'. This gives you a simple way to overwrite the operating system, and keep installed applications or home directories, even configuration files safe.

It only makes sense then that a Unix user setting up OS X 10.2 would want to do the same thing. :) Unfortunately, up to this point, OS X hasn't made that task easy. The volinfo database and autodiskmount daemon both want to mount all slices (volumes in OS X) under /Volumes, and place them all on the desktop.

Here's what you need to do to get your swapfile off your main volumes, get your applications onto their own partition, you home directories safely off onto their own partition, and have the Apple installer love you because everything is where it expects to find them. Did I mention you'll only have to look at a single volume on your desktop too?

[Editor's note: The following article explains exactly what you need to do to accomplish the above tasks. As a result, it requires some use of the terminal, it makes some assumptions about your levels of knowledge, and finally, it's fairly involved. It may also contain advice that you may disagree with; feel free to comment on things as you see fit. Note that I have not tested this hint myself, but I thought the more advanced readers may find it of interest. If you're just starting with OS X, you may wish to save this one for much later!]

Let's begin.

I hope you're starting clean. You might want to back your home directory off onto a CD or a tape, even maybe your iDisk. Just copy it all off. If you have space, copy /Applications too. It's best if you're starting with a brand new 17" iMac out of the box like I did, but if not, backing up those two things will do. Copying /var/mail/username should back up your e-mail.

[Editor's note: Search on "back up" or "backup" here for hints on backing up; you'll want to make sure you get all the invisible files as well.]

Now we're going to wipe everything out. Pop in your OS X 10.2 installer CD, and once the installer comes up, choose the Disk Utility from the drop downs at top. Now, partition off your drive using HFS+ (Mac File System). You can do this however you like, but here's my recommendation:
  • Erwin (name it whatever you like, this is where the Operating System will live)
  • Applications
  • Users
  • Swap
  • Mail (perhaps)
I would recommend giving OS X 2-3 GB of disk space. Make Applications large enough to hold all the applications you intend to install, and leave some room to grow. For me that was 6 GB, and I have to feel that was generous. Make Swap approximately twice your physical RAM, but no more than 600MB to 1 GB. That may still be excessive for FreeBSD. Leave the rest to the Users volume. That will, in theory be where your downloaded files, music, movies, anything personal will be stored. For the Mail volume, should you choose to make it, make it only big enough to store your e-mail. If you really think you'll need more than 1 GB to store e-mail, make it so. If it's a corporate environment, I really recommend doing this, as if you need to wipe the OS, the mail stays. You'll have to chown them all, but at least it will still be there. If you'd like it on a seperate partition but don't want to give it its own volume, we can store your mail on Users. More later.

Alright, we have the drive partitioned. At least for me, OS X 10.2 would not install. It wanted a valid 10.x install to already be there. D'oh! Do what you need to do to get 10.2 installed on Erwin or whatever you named that first partition. Remember to customize and get rid of any Languages you don't need on BOTH installers! It wastes lots and lots of disk space. Alrighty, much waiting and installing later, you now have 10.2 installed. Now install the Developers Tools. You'll need them later.

You'll notice all of your volumes are on the desktop, and if you double click Erwin, Applications and Users are both right there. We need to fix that. Open up a terminal window and type:
 % sudo ditto -v -rsrcFork /Applications /Volumes/Applications
% sudo ditto -v -rsrcFork /Users /Volumes/Users
% sudo ditto -v -rsrcFork /var/mail /Volumes/Mail
[Move Mail only if you created a partition for it, obviously.]

Next, type sudo pico /etc/fstab. Right here I'm expecting to here dozens upon dozens of people yelling about autodiskmount and how Darwin doesn't use fstab right, and yadda yadda yadda...well guess what? They fixed it. Fstab is no longer slice dependant. Draw up your fstab like this:
 LABEL=Users /Users hfs rw 1 2
LABEL=Applications /Applications hfs rw 1 2
LABEL=Swap /Swap hfs rw 1 2
#Optional
LABEL=Mail /var/mail hfs rw 1 2
That label command will now pick up your partitions correctly no matter what
slice they show up as. Cool huh? Now we need to load it all into netinfo:
 % sudo niload -m fstab / < /etc/fstab
Alright, now we need to make sure that when we boot up, things are going to be handled appropriately for the swapfile, and that only our Erwin volume will show up on the desktop. Launch an editor as root on /etc/rc (i.e. sudo pico /etc/rc). Ctrl-V down to where you see this:
 ##
# Start the virtual memory system.
##
Go down four lines and change this:
 swapdir=/private/var/vm
to this:
 swapdir=/Swap/.vm
Now scroll down a few more lines until you see this:
 dynamic_pager -H 40000000 -L 160000000
-S 80000000 -F ${swapdir}/swapfile
The above appears on one line, but is shown here on two for readability. Directly after this add these lines:
 ##
# Hide unneeded volumes from the desktop.
##

/Developer/Tools/SetFile -a V /Applications
/Developer/Tools/SetFile -a V /Users
/Developer/Tools/SetFile -a V /Swap
#Uncomment this if you're putting mail onto it's own partition.
#/Developer/Tools/SetFile -a V /var/mail
That's what we needed the Developers Tools for. To make sure our swapfile will be hidden from both finder and terminal without special switches, type:
 % mkdir  /Volumes/Swap/.vm
Now, reboot into single user mode, (hold down command-s while rebooting). Follow the on-screen instructions for running fsck and mounting /. After you do that, you'll need to run a few more commands:
 % cd /
% mv Users Users-old
% mkdir Users
% chmod 755 Users
% mv Applications Applications-old
% mkdir Applications
% chmod 755 Applications
Do the following if you're making a mail partition:
 % mv /var/mail /var/mail-old
% mkdir /var/mail
% chmod 755 /var/mail
Okay, now for the moment of truth ... type reboot.

You might want to hold down command-V while rebooting to watch what happens and make sure that all goes well. When you get up to your desktop, you should see just Erwin on the desktop. If you double click Erwin, you should see your -old folders, and your new Applications, Users, and Swap, although the icons look like Aliases. You can now move the -old folders to the Trash, if you made Mail, you can do an rm -r /var/mail-old.

You should now be in a position to where if for some reason you need to
re-install the OS you won't lose any programs or user data. If you didn't
want to make a Mail partition, you could do something like this:
 % cp /var/mail /Users/mail
% rm -r /var/mail
% ln -s /Users/mail /var/mail
That puts your e-mail on the users drive. If you only have a few users and want to be really savvy, then you could do this instead:
 % cp /var/mail/username /Users/username/username
% rm /var/mail/username
% ln /Users/username/username /var/mail/username
That puts the individual's inbox in their home directory so that if they back up their e-mail, they back up their inbox as well. :)

Oh, and btw...those who wish to do something similar under previous versions of OSX, here are the changes to the /etc/rc file and the perl script mentioned in the swap section to give you the tools to accomplish it. Save fix_mounts to /usr/local/sbin and run sudo chmod +x fix_mounts on it. Be sure to back up your /etc/rc file before making these changes. Good luck!

fix_mounts:
 #!/usr/bin/perl
use File::Path;

#Fix the mounts that OS X uses by default.

print "Attempting to unmount /Volumes/Swap and mount to /Swap\n";
$slice=undef;
$mountpoint=undef;
$slice=`/bin/df | grep /Swap`;
if($slice ne undef and $slice ne ""){
@swap=split(/\s+/,$slice);
print "@swap[0] is mounted as @swap[-1].\n";
$mountpoint=@swap[0];
chomp($mountpoint);
if($mountpoint eq "/Volumes/Swap"){
if(-e "/Volumes/Swap"){
`umount -v /Volumes/Swap`;
rmtree('/Volumes/Swap');
if (! -e "/Swap") {
mkdir('/Swap');
}
`mount -w -t hfs @swap[0] /Swap`;
print "Remounted.\n";
print "$mountpoint is now mounted to /Swap\n\n";
}
}
else{
print "Action not taken, Swap appears to be mounted at
$mountpoint\n\n";
}
}
else{
print "No action taken, the specified partition does not appear to be
mounted.\n\n"
}

#Next, Applications

print "Attempting to unmount /Volumes/Applications and mount to /Applications\n";
$slice=undef;
$mountpoint=undef;
$slice=`/bin/df | grep /Applications`;
if($slice ne undef and $slice ne ""){
@swap=split(/\s+/,$slice);
print "@applications[0] is mounted as @applications[-1].\n";
$mountpoint=@applications[0];
chomp($mountpoint);
if($mountpoint eq "/Volumes/Applications"){
if(-e "/Volumes/Applications"){
`umount -v /Volumes/Applications`;
rmtree('/Volumes/Applications');
if (! -e "/Applications") {
mkdir('/Applications');
}
`mount -w -t hfs @applications[0] /Applications`;
print "Remounted.\n";
print "$mountpoint is now mounted to /Applications\n\n";
}
}
else{
print "Action not taken, Applications appears to be mounted at
$mountpoint\n\n";
}
}
else{
print "No action taken, the specified partition does not appear to be
mounted.\n\n"
}

# and Finally, Users.

print "Attempting to unmount /Volumes/Users and mount to /Users\n";
$slice=undef;
$mountpoint=undef;
$slice=`/bin/df | grep /Users`;
if($slice ne undef and $slice ne ""){
@swap=split(/\s+/,$slice);
print "@users[0] is mounted as @users[-1].\n";
$mountpoint=@users[0];
chomp($mountpoint);
if($mountpoint eq "/Volumes/Users"){
if(-e "/Volumes/Users"){
`umount -v /Volumes/Users`;
rmtree('/Volumes/Users');
if (! -e "/Users") {
mkdir('/Users');
}
`mount -w -t hfs @users[0] /Users`;
print "Remounted.\n";
print "$mountpoint is now mounted to /Users\n\n";
}
}
else{
print "Action not taken, Users appears to be mounted at
$mountpoint\n\n";
}
}
else{
print "No action taken, the specified partition does not appear to be
mounted.\n\n"
}
/etc/rc:

Make your Virtual Memory section this:
 ##
# Start the virtual memory system.
##

ConsoleMessage "Starting virtual memory"

swapdir=/private/var/vm
swapdrive=/Swap/.vm

#Netboot ONLY
if [ "${netboot}" = "1" ]; then
sh /etc/rc.netboot setup_vm ${swapdir}
fi

## Get rid of any left over, unwanted swap dirs
umount -v /Volumes/Swap*
if [ -d /Volumes/Swap ]; then
ConsoleMessage "***DELETING extant Swap directory(s)***"
mount -uw /
rm -rf /Volumes/Swap*
fi

ConsoleMessage "Checking Disks - /sbin/autodiskmount -a"
/sbin/autodiskmount -a

#Unmount and remount Volumes to the correct location.
ConsoleMessage "Umounting Volumes and Remounting Correctly"
perl /usr/local/sbin/fix_mounts

#Update the volinfo database
if [ ! -f /var/db/volinfo.database ];
then Uninitialized_VSDB=-YES-;
fi

# Make sure the swapfile exists
if [ ! -d ${swapdrive} ]; then
ConsoleMessage "Creating default swap directory"
mount -uw /
mkdir -p -m 755 ${swapdrive}
chown root:wheel ${swapdrive}
else
ConsoleMessage "Prepping swap partition"
rm -rf ${swapdrive}/swap*
fi

dynamic_pager -H 40000000 -L 160000000 -S 80000000 -F ${swapdrive}/swapfile

#Now, hide the Applications, Users, and Swap from the Finder.
ConsoleMessage "Hiding Applications from Finder"
/Developer/Tools/SetFile -a V /Applications

ConsoleMessage "Hiding Users from Finder"
/Developer/Tools/SetFile -a V /Users

ConsoleMessage "Hiding Swap from Finder"
/Developer/Tools/SetFile -a V /Swap

#For debugging, show us one last time the current mounts
Console Message "Current Mounts:"
/bin/df
I know that's long, but it's very effective!
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[68,944 views]  

Create a customized mount point system | 55 comments | Create New Account
Click here to return to the 'Create a customized mount point system' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Update
Authored by: Numbski on Oct 11, '02 10:55:26AM

Probably should change something.

Instead of this:

% cp /var/mail/username /Users/username/username
% rm /var/mail/username
% ln /Users/username/username /var/mail/username

This instead:

% cp /var/mail/username /Users/username/Inbox
% rm /var/mail/username
% ln -s /Users/username/Inbox /var/mail/username

If you're keeping you mail folders in /Users/username/mail/, then just insert the mail subdirectory into those commands.



[ Reply to This | # ]
Update
Authored by: Espique on Nov 19, '02 09:06:24PM

hi,

first: thanks for this great hint, it works like a champ here. took me a bit longer but I eventually got there. I applied the hint to a fully working system and after I restored my backup some of the apps wouldn't work anymore. I guess they had absolute paths somewhere in the configs...

anyways. one thing remains. purely cosmetic, but hey... how do I get the original icons back? the applications folder and the others that were changed now all use the same (but ugly) icon. any idea?

thanks,
sascha



[ Reply to This | # ]
Update
Authored by: cgonter on Dec 05, '02 11:36:20PM

I like the multiple mount points. Afterwards I tried to upgrade to
10.2.2 and it does not recognize any disks for installation.
craig



[ Reply to This | # ]
disk utility & netinfo manager no more working
Authored by: Safar on Mar 21, '03 10:52:42AM

hi !

i followed everything in your tip, which i loved...

But... disk utility and netinfo manager cannot launch anymore ! Error code is "-1000".

Any idea how to solve this ?

Thanks

safar



[ Reply to This | # ]
Update (Tiger Update?)
Authored by: musickhead on Aug 30, '05 05:17:43AM
Hi, I don't know if this thread is still alive, but I've got a n00b question. Has anyone tested this on 10.4 Tiger? I am a little worried that I don't have an fstab file. Instead, I have an fstab.hd file, and it has a nasty little comment in it saying
IGNORE THIS FILE. This file does nothing, contains no useful data, and might go away in future releases. Do not depend on this file or its contents.
Should I edit my blank fstab.hd file, or should i create a new fstab? This is so I can make it NOT automount my second partition, which is reserved for OS Y (the name is a joke).

Also, I want to mount a sparseimage encrypted disk image, contained on another partition, to my home folder (and mine only!). Can this be done with fstab to an image, not a partition, and an encrypted image, at that?

Thanks!
Musickhead

[ Reply to This | # ]

Does the 8GB limit still apply for G3's?
Authored by: waked1 on Oct 11, '02 12:31:43PM

Just a thought, can all your partitions add up to more than 8GB on older G3 machines? This would be great for my wallstreet PB so that only the System partition needs to be in the first part of the disk!



[ Reply to This | # ]
Does the 8GB limit still apply for G3's?
Authored by: BraindeadMac on Oct 11, '02 02:39:37PM

This should work to solve that problem



[ Reply to This | # ]
Does the 8GB limit still apply for G3's?
Authored by: eltoozero on Oct 11, '02 09:35:08PM

I really can't imagine why; as long as the boot volume ("slice") is less than 8gb everything should be aces.

- Tooz



[ Reply to This | # ]
newb questions
Authored by: vonleigh on Oct 11, '02 10:07:28PM

1. How does this work exactly? I see that you delete the folders and then make them again and change permissions. How do you actually get it to 'alias' to the new volumes?

2. What are you telling fstab? What do those "labels" mean? I checked man fstab and I got the rw, but that's about it.


thanks,
Vonleigh



[ Reply to This | # ]
newb questions
Authored by: Numbski on Oct 12, '02 10:12:15AM

I guess I need to be more clear about something.

Those bottom two scripts should ONLY be used if you are attempting this under 10.1 or before. 10.2 you use fstab.

fstab is now, instead of looking at slices (/dev/rdisk1 type stuff) it is now looking at Volume labels. You named the volume when you ran the disk tool. If you named the slice "Applications", that's its label.

You are then, effectively telling fstab where to mount the slices based on it's volume label.

Previous to 10.2 you could not do this, therefore you tell fstab nothing, and use the scripts instead.



[ Reply to This | # ]
must have done something wrong
Authored by: txiki on Oct 11, '02 10:08:03PM

hi.

i must have done something wrong. i have moved apps and users to their own partitions. i'm not so sure about swap... i can't find the swapfile0... and mail partition is empty. besides, all of the partitions still show up in my desktop.

also, what do i exactly was supposed to do when rebooting in single user mode? i did it and got a cursor waiting for me... so i typed exit.

thanx.



[ Reply to This | # ]
must have done something wrong
Authored by: Numbski on Oct 12, '02 10:14:31AM

When you reboot into single user mode, there should be instructions on-screen to type fsck -y, and then mount rw /.

If not, I wonder what you did?

Give that a whirl.

If you didn't do any of the single user mode stuff, no wonder it's not working. :)



[ Reply to This | # ]
must have done something wrong
Authored by: txiki on Oct 13, '02 08:23:33PM

i tried again. now i have apps and users each in its own partition that still mounts on the desktop, but that doesn't bother me.

when booting in single user mode the last thing was something like sh2a# (i don't remember exactly) then i typed fsck and after that all the mv users users-old etc.

i prefer to leave the virtual memory alone. i'll wait for swapcop to work in jaguar.

thanks.



[ Reply to This | # ]
rc line 96
Authored by: Tapp_Darden on Oct 14, '02 06:32:59PM

Stats
iMac 333Mhz(rev D.)
MacOSX 10.2
120 GB Hard drive

I followed the dirrections exactly. and trippled checked what I did. when I rebooted after going into single user mode(and doing what needed to be done in single user mode) I turned on verbose messageing(holding down ctr-V) at start up. I notice that it gives an error at line 96 and 97 of the rc file. It doesn't like the "mount -vat hfs" and "mount -vat ufs."

the partions seem to mount in the expected places. /Applications /Users etc... However the partions still display on the desktop.

I installed Backup and the install put it in the right place. so everything seems ok. (the installer seems to not mind that /Applications is on a different partion)



[ Reply to This | # ]
rc line 96
Authored by: Numbski on Oct 14, '02 11:27:09PM

where is it try to do a mount -vat?

That doesn't even make sense? Can you post it in context?

Are you doing the 10.2 mod, or the previous version?



[ Reply to This | # ]
rc line 96
Authored by: Tapp_Darden on Oct 15, '02 01:35:58AM

exept from my rc file.

##
# Mount essential local filesystems (according to /etc/fstab).
##

ConsoleMessage "Mounting local filesystems"

mount -vat hfs
mount -vat ufs
mount -t fdesc -o union stdin /dev
mkdir -p -m 0555 /.vol && chmod 0555 /.vol && mount_volfs /.vol


while starting up it displays the "mounting local filesystems" as you see that it should. then it gives an error on the 'mount -vat hfs' and 'mount -vat ufs lines.' it also gives the line numbers to thouse lines, 96 and 97.

I don't know what this part of the rc file is for, do you? for that reason, I find it hard to troupshoot.... also, everything mounts in the right place. my only problem is that the unneeded volumes show up on the desktop...



[ Reply to This | # ]
rc line 96
Authored by: mrlee on Nov 01, '02 04:03:54PM

I've got the same problems at startup in /etc/rc. A fix for that would be great.

Hiding Volumes:

I don't think it's neccesary to put the SetFile command in /etc/rc.
Just add a trailing slash and run from Terminal:

% sudo /Developer/Tools/SetFile -a V /Applications/
% sudo /Developer/Tools/SetFile -a V /Swap/
% sudo /Developer/Tools/SetFile -a V /Users/

This worked fine for me on OS X 10.2.1

and thx to Numbski for the great tip.



[ Reply to This | # ]
rc line 96
Authored by: pwlees on Dec 17, '02 03:07:54AM

my guess is that those of us having problems with
"bus error" at lines 96 & 97 of /etc/rc have upgraded to
10.2 rather than a fresh install, and therefore may actually
have a different /etc/rc file!

my disks are being mounted by 'autodiskmount' but i can't work
out where that's happening or why it's not picking up the data
from netinfo & mounting in the right place

irritatingly, dumping the volumes in the trash and then trying
# mount -vat ufs
works the way i want it >8(

numbski - could you post your entire /etc/rc ?



[ Reply to This | # ]
rc line 96
Authored by: jkp on Feb 18, '03 05:08:30AM

Did anyone get anywhere with this problem?

I have done a fresh 10.0 install, then uprgaded through 10.2 to 10.2.4. I have exactly the same problem. Any ideas?



[ Reply to This | # ]
rc line 96
Authored by: artgeek on Feb 19, '03 04:34:10PM

I think he meant a fresh 10.2 install. Upgrading from 10.0 (really?) is just going to give you many useless files and configs, that 10.2 isn't using anymore, or will be confused by. Just start clean with 10.2...



[ Reply to This | # ]
rc line 96
Authored by: mkhaw on Mar 04, '03 12:00:36PM

I started with a brand new (used) iBook/800 which already had 10.2.1(?) installed on it. I repartitioned the disk, reinstalled from the Apple iBook Mac OS X Install CDs, followed the recipe for customizing mount points, and I also got the bus error complaints from /etc/rc when it tries to mount -vat hfs... however, it doesn't seem to hurt being able to boot up. Installing 10.2.4 via Software Update didn't change this behavior.

By the way, I agree that it's not necessary to do SetFile in /etc/rc, except as a belt-and-suspenders measure in case you might have manually made a volume visible again and want it to revert to being invisible when you reboot.

[ Reply to This | # ]

FYI
Authored by: Tapp_Darden on Oct 15, '02 06:15:13AM

BTW I am getting bus errors on thouse two lines
I followed the first half of your instrucitons.

mount -vat hfs

mount -vat ufs

So I figure that thouse lines mount my fs that it gets from fstab..
Because of netinfo I thought that maybe it was not needed. so I commented them out which made my comp not boot :p so I put it back.

Also I followed your instructions for the lucky that have 10.2.(the first part of the instructions)



[ Reply to This | # ]
same here
Authored by: borsad on Oct 18, '02 01:14:50PM

I have the same problem. They still show in the finder, is it possibel to change the mounts? I.e. take out the 'a' (which is supposed to mount all -> mount -vt? Or would that be bad for the system? Is it possible to mount other harddisks in the file system as well with this method?

Best, Rob



[ Reply to This | # ]
possible solution
Authored by: borsad on Oct 19, '02 04:51:29PM

This seems to do the trick for me:

First, take out these lines from /etc/rc:

##
# Hide unneeded volumes from the desktop.
##

/Developer/Tools/SetFile -a V /Applications
/Developer/Tools/SetFile -a V /Users
/Developer/Tools/SetFile -a V /Swap
#Uncomment this if you're putting mail onto it's own partition.
#/Developer/Tools/SetFile -a V /var/mail

Next, give the following command in the terminal:

sudo /Developer/Tools/SetFile -a V /Users

(I only made a separate /Users partition, but I guess the same goes for the other partitions.)
And funny enough it stays the same after restarts. No need to put it in the /etc/rc file!

The only thing is that your /Users folder looks like a shortcut to a server, I see no way to change that...



[ Reply to This | # ]
yea, i get the same thing too
Authored by: jonahan on Oct 18, '02 08:45:49PM

I also get the partitions mounting on my desktop ... which is kinda bad cause i do have a second drive so right now i have 7 drives sitting on my desktop.. I also get the same bus errors on thoes lines... ill try some stuff to see if i can get it to work and let you know... Oh i have a dual 800 with 768M RAM, and 2 80 GB HD's.



[ Reply to This | # ]
what if you boot from another partition?
Authored by: garbanzito on Oct 19, '02 02:23:10AM

do the other partitions ("slices") mount if one boots from another partition? if one wants to reinstall Mac OS X, how would one restore the setup?



[ Reply to This | # ]
mount points fouls up classic?
Authored by: Craig Jones on Nov 01, '02 12:36:43PM

I succeeded in getting things looking as described on a new mirror door G4, but under Classic I find some apps (e.g., Kaleidagraph) cannot navigate to any of the mounts that were hidden (/Users, /Applications). I have tried making symbolic links to various parts of the directory tree with no success. Only thing that works is undoing the SetFile on the partition in question....



[ Reply to This | # ]
Lable=foo is no good on mutliple drives
Authored by: Hes Nikke on Dec 10, '02 01:28:18AM

after much trial and error, i figured out that Lable=foo doesn't work when you have multiple Hard Drives that you want to mount around your filesystem. instaid you have to give the BSD disk name, so in my case Users wound up on /dev/disk2s9

my fstab looks like this:
/dev/disk2s9 /Users hfs rw 1 2

FYI in theory (i havn't tried it yet) you can use fdisk from the cli and repartition the drive to have swap partitions, then you'd put a line that looks like this in:

/dev/disk2s10 swap swap defaults 0 0



[ Reply to This | # ]
Lable=foo is no good on mutliple drives
Authored by: Hes Nikke on Dec 18, '02 03:04:00PM
hmmm... my fstab still isn't quite right, i'm going to have to peek in my rc file and see what needs to be tweeked... when i gave my computer a fresh boot, automountd mounted my Users partition in /Volumes/Users i had to do a
sudo umount -f /Volumes/Users; sudo mount -a
to get my users partition were it needed to go! (the -f switch is a forced, it was complaining that the device was busy - it couldn't be, it just booted! and the -a swtich on mount makes it mount everything in fstab, the way fstab says (useful when changing your fstab)) (did i just do an embeded parensathy? i'm pathetic) i'll let you know if/when i figure out what's up...

[ Reply to This | # ]
Lable=foo is no good on mutliple drives
Authored by: Hes Nikke on Dec 30, '02 01:55:42AM

ok, i have it craked...

the OS reorders my disks each time it boots! sometimes my Users is on /dev/disk2 (and it works) some times it's on /dev/disk1 (and it doesn't work)

i've teeked my netinfo entries, and when they are both in, it doesn't work, when one of them is in, and it's the right one (flip a coin) it's right, otherwise, it still doesn't work!

anyone know the rime and reason to how it designates what disk is what?



[ Reply to This | # ]
Drive detection goo
Authored by: Lanir on Jan 12, '03 06:00:43AM

I don't think I can answer this cleanly but I can tell you a little more about it and hopefully that'll lead you in the right direction. The problem you're running into is the mach kernel is detecting your devices in different orders when it starts up. I don't know jack about your configuration but some things you might want to try if you're on a desktop machine are to move the drives to different controllers if they're on the same one or put them on the same controller (same cable) if they're not already. If they're scsi drives they should be recognized in order of scsi ID. If they're ide they should be recognized in order of primary master, primary slave, secondary master, secondary slave. If that's not true in your case, experiment until you find what works.
If you're on a laptop... Good luck. I can't imagine too many reasons why a laptop would recognize a firewire or usb drive faster than a local disk.



[ Reply to This | # ]
Drive detection goo
Authored by: Hes Nikke on Mar 05, '03 01:52:58AM
the drive has always been master on the 4th controller. however the 2nd and 3rd controller maskerade as a SCSI controler so i _think_ it is pretending to be SCSI ID 2

the good news is that uppong applying the UUID to the partition, and FSTAB, it now works perfectly! woohoo!

---
vacuums do not suck. they merely provide an absence that allows other objects to take the place of what becomes absent.


[ Reply to This | # ]

help developer tools
Authored by: cgonter on Dec 16, '02 07:23:40AM

I'm losing it. Where is are the tools that in include SetFile?
thanks
craig
cgonter@capital.net



[ Reply to This | # ]
RE: help developer tools
Authored by: BraindeadMac on Dec 16, '02 07:27:00AM

They are part of the Developer Tools package....installed into /Developer/Tools



[ Reply to This | # ]
LABEL= ==> strange NetInfo
Authored by: david_be on Dec 24, '02 10:27:23AM
For those who've done this with LABEL= in /etc/fstab look in NetInfo in mounts directory and they will have a quite bad news: each boot, the OS create a new file for each mount points created by LABEL=

I think it would be better with /dev/disk?s?

[ Reply to This | # ]
LABEL= ==> strange NetInfo
Authored by: david_be on Dec 24, '02 10:36:14AM

sorry. In my opinion (it changes a lot ;-) ) a new file is created for each modification you do in /etc/fstab and with each "LABEL=" line you have in it.



[ Reply to This | # ]
search file
Authored by: david_be on Dec 26, '02 09:02:17AM

is not good with cusomized mount points.



[ Reply to This | # ]
Does LABEL use the names from the partition table?
Authored by: bfitz on Jan 03, '03 02:14:13PM

pdisk tells me that my partitions are named "Untitled", "Untitled 2" and so forth. A bit of reading turned up the tidbit that this is a bug/misfeature of Mac OS 9's Drive Setup (which I used because the Mac OS X Disk Utility won't let you make partitions smaller than 4 GB - depends on how many partitions you split your disk into). I'm assuming that LABEL= uses the names from the partition table (less reading from disk, more stable)? Too bad that pdisk doesn't have the "n" (rename partition) feature any more, it seems to have lost it somewhere along the road from MkLinux.

Those of you that had problems using LABEL= to identify your drives, does pdisk say they have the names you think they do? Or do they have different names?



[ Reply to This | # ]
RE: Does LABEL use the names from the partition table?
Authored by: recursion on Feb 27, '03 07:45:03PM

UUID is an alternate option, universal name-independent 16-digit strings...I managed to make them work, basically am amble to use drives as I might in any other unix-based OS, though the fstab file is more robot-oriented than human. Am submitting article concurrently with this...



[ Reply to This | # ]
Panther Compatiblity
Authored by: morphis on Oct 31, '03 10:49:48AM

This Works on Panther. Have not yet tried 10.2.x -> 10.3, will probely need to unlink mount points before upgrade and replace old apple apps with the new one and relink mount points. I will be doing this one on monday fingers crossed. Will post more.



[ Reply to This | # ]
Panther Compatiblity
Authored by: jason.clark on Nov 02, '03 02:16:34AM

I got this to mostly work on Panther, with some issues.

  • in /etc/rc, the comments used to find the swap dir setting have changed to: echo "Starting virtual memory"
  • the text of the 'dynamic pager' command has also changed
  • After the reboot from single user mode, my extra partitions weren't hidden. I re-edited /etc/rc and moved the commands (SetFile) to the end of the file, just before SystemStarter.
  • Even with the extra partitions hidden on the desktop, they remain in the new sidebar in finder. To fix this, use Finder Prefs:Sidebar, uncheck Hard disks, check Computer. Close prefs. Use the Computer Icon in the sidebar to see your drives. Drag your main drive (the one seen on the desktop) into the sidebar. You can now turn off the Computer icon in the sidebar if you like.
  • I don't think the swap file change took. I saw a msg during boot abt swap file problem; not sure of the details. Didn't see any files in /swap/.vm. Another look at /etc/rc shows that if the swap dir is missing, it should get created. So I removed .vm from /swap and rebooted. .vm was not created. Not sure what to try next, suggestions welcomed


[ Reply to This | # ]
Panther Compatiblity
Authored by: jason.clark on Nov 02, '03 02:21:27AM

Forgot to mention... when viewing the contents of your main drive in finder, the relocated folders (Applications, Users, swap) have a different icon. Its the network icon, with a shortcut arrow attached. I find this annoying, but have found no workaround.



[ Reply to This | # ]
Panther Compatiblity
Authored by: Craig Jones on Dec 03, '03 12:25:54PM
At least on my system, I have figured out why I couldn't get swap to work. The mount -vat nfs command wouldn't mount the LABEL= diskname partitions, and NetInfo is apparently not up far enough for /Swap to be mounted. (I suspect this is part of the trouble when using Apple updates--they look to rely on fstab working right, so I may change the suggestion of using the Labels to using the /dev/disk0sxx format in /etc/fstab). So I adapted some of the notes posted elsewhere for Panther to get this to work. Note that I have /Swap as slice 10 on my machine (one way to see this, in the Terminal, run df -k to see the positions of your partitions), so replace disk0s10 with whatever you use locally. Go down in /etc/rc to where swapdir is set and make it

swapdir=/Swap/vm
(or /Swap/.vm if you so desire, just be sure you are consistent) After the netboot check, insert this:

#Make sure swap is put on the partition
umount -v /Swap 
#above avoids accidents
if [ -d /Swap ]; then
  rm -rf /Swap
#this flushes junk accidentally put on root drive
fi
mkdir /Swap
#now mount the Swap partition
/sbin/mount_hfs /dev/disk0s10 /Swap
sleep 1
There is now a chunk of text that tests for the swapfile existing and cleans out any left over swapfiles. After that are "dynamic_pager" and appprofile commands. Change these to:

dynamic_pager -F ${swapdir}/swapfile

appprofiledir=${swapdir}/app_profile
Make these modifications and otherwise use the instructions above in this tip and you should get swap to work.

Note that it can seem as though you are making swapfiles on Swap even when you are not: if /Swap is not mounted when /etc/rc is running, a directory you cannot see is created under your /Swap mount. This leads to really odd things: if you do a global search from the Finder for "swapfil" (visible and invisible), you will turn up the current swapdir files shown with a parent of vm (or .vm), but clicking on the file to see the full path locks up the Finder, apparently because the directory isn't accessible from the Finder (nor indeed from Unix until you unmount the Swap partition).

[ Reply to This | # ]

Panther Compatiblity
Authored by: rrrichie on Nov 19, '03 10:56:17AM

Applied this to panther, and worked well at first. I even installed panther a second time after the partitions were in place. (first I forgot to leave out all the world languages... ;-) ). With the swap, application, and user partition in place doing a clean install is a breeze.
BUT. Updating iTunes didn't work and some applications don't work. It seems some access the system folder by going "up" a folder and then into /library for example. But of course if the application is in the application partition going up a folder haves it end up in the /volumes folder. This was test by creating a folder with applications and putting symbolic links in a folder above it to /library. Then the app worked fine. Installing iTunes destroyed the symbolic link to /volumes/applications and a new applications folder was in place with only iTunes in it.
So i'm going to combine the application partition again (using fdisk) with al the system stuff creating a "system" and a "users" partition.



[ Reply to This | # ]
Panther Compatiblity
Authored by: bluehz on Nov 19, '03 07:01:05PM

When installing stuff - just point the installer to your root (System disk). If you have setup your mountpoint system properly with mountpoints for your /Applications located on the root disk - then as far as the system is concerned that /Applications dir is essentially grafted onto /root disk and appears as a normal unpartitioned OS X setup. I have never had any trouble with installers. I did used to point my installers to my /Applications partition though and then realized it wasn't even necessary.



[ Reply to This | # ]
Panther Compatiblity
Authored by: rrrichie on Nov 20, '03 10:48:43PM

Yep, I do that and for most apps it works fine. But the iTunes 4.1 update failed (it created a new applications folder, so i dittod it to the applications slice and it works now), I can't any of the pro-apps to work, but haven't dug into yet. And my keyspan digital remote doesn't work either. It install fine, but complains about not being installed properly. I still have to sort that out.
Maybe my links aren't solid enough. :-) In niutil the mountpoints are there to the slices with the labels applications and user. and i created the links on the root drive as in the instructions.
Point is, it seems that it's taking more trouble to install apps now, than having the advantage of a seperate apps partition.



[ Reply to This | # ]
Panther Compatiblity
Authored by: Craig Jones on Dec 02, '03 05:18:58PM

Made the mistake of trying to upgrade to Panther over the existing mount points. Things *seemed* to be working, but then I found that things like Terminal, Console, and X11 were not working. After some panic, I found that the upgrade did not follow the link to the Applications partition and these older versions of the applications don't run (either well or at all) under Panther. Copying over these apps from another system allows them to work, but some others are a bit more difficult to deal with. As previous upgraders from Apple have also had trouble with the Applications partition, I wonder if making a separate Applications partition is getting to be a bad idea. Does anybody have any positive results in getting the mounts to be followed by Apple's installers?



[ Reply to This | # ]
Panther Compatiblity
Authored by: vonleigh on Feb 18, '04 01:32:41PM

Craig and wizwoz,

When booting up from another partition or disk (as is the case when installing the upgrade to panther), the partitions do not get mounted, as the fstab file isn't read. This is why the applications didn't get updated in craig's case, and why you don't need to unlink anything in wizwoz' case.

Now, this is an advantage of this system. What you should be doing is the following:

Since you have your Users and Applications separate from your OS partition, essentially this means that there shouldn't be anything important left in the OS partition, especially if you've gotten into the habit of installing items in your user ~/Library for example. In any case, if there is something installed in your OS, it's a good idea to get the latest version and make sure there aren't any compatibility problems.

Anyway, since there is nothing important in the OS partition, when upgrading panther one can tell the installer to erase the whole partition (you have backups right?). Notice that since your /Users and /Applications are now unlinked (since you booted off the CD), it will only delete your base OS install.

This way you are guaranteed a fresh OS with everything working perfectly.

After that, you copy over any new/updated applications back to your /Applications partition, create your users (in the same order you created them before, so they have the same UID, or if you're advanced enough do some terminal trickery); and by relinking everything you should be good to go, with both a fresh OS and all your settings, documents, applications, etc. Best of both worlds.


v



[ Reply to This | # ]
Panther Compatiblity
Authored by: wizwoz on Jan 07, '04 10:01:38AM

I implemented this hint way back when, and loved it until I did the Panther upgrade - disaster! After restoring from backup, it's back and still works - but how would I unlink Applications and Users so they once again exist in the boot volume as real subdirectories?



[ Reply to This | # ]
Important caveats
Authored by: strebe on Feb 21, '04 01:58:18AM

After considerable experimentation I have to conclude that it's not wise to put your swap files or OS X applications on a separate volume, and even /Users might be problematic.

The reason swap files on other volumes fails sometimes is that there is no mechanism in place to guarantee that the volume has mounted at the time OS X sets up the swap directory. Volumes are mounted by a separate, parallel process from the process that initializes the virtual memory. In order for the method in this hint to function properly, code needs to be added to detect that the process for mounting volumes has terminated before proceeding with the initialization of virtual memory. I don't know how to do that.

The reason /Applications can't be on a separate volume is that some Apple applications blindly walk up the directory path looking for specific cousin directories. They fail once they rise above the /Applications directory because they end up in /Volumes instead of /.

There are probably other obscure ways that this hint causes failures. Putting /Users on another volume would seem safe enough -- heck, it's just user data -- but I discovered that using an alias (symbolic link) of /Users/.../Library to place it on another volume causes the dock to fail to save its state. That's not the same as a different mount point, but it's a similar concept and it causes failures. Therefore I'm guessing other stumbling blocks remain to be found.

Hence I've mostly given up trying to defeat Apple's manic insistence on dumping everything on one volume. I still have to do something, though, because of the 8GB limit on the boot volume in early G3 systems. I have, regrettably, set up the /Users/.../... directories such that they are all aliases onto an auxiliary volume, but leaving /Users/.../Library/ on the boot volume. Hence Music, Pictures, Documents, etc. are all on the auxiliary volume but the user directory itself along with the /Library directory within it stays on the boot volume. In this way I avoid stuffing the boot volume while minimizing the chances of bizarre failures.



[ Reply to This | # ]
Important caveats
Authored by: lerici on Jun 17, '04 12:59:29AM

You can "fix" the synchronization problems by editing the file /etc/rc.boot. Apple has fixed up their startup scripts so that there isn't any synchronization problem. IN fact they ensure they mount the disk within this script before doing anything at all. This is fairly typical in any UNIX environment. I have actually created a separate /var partition (UFS) and mounted it in this manner. THIS does work. Given the nature of HFS+ and the problems inherent with that file system a setup which includes only two partitions var and / make sense. The constantly changing files (and the swap files) would reside on a separate partition protecting the root partition and its critical databases from catastrophe.

As far as the rest of your commentary. Yes, it is true, some installations choke if /Applications is on a separate partition. Typically these are application updates rather than installs. Apple need only include an option to overwrite the app instead of just upgrade and I believe this problem would disappear. Unfortunately, you must often avail yourself of pacifist... or manually install the packages using pax etc. to resolve this. So far this has
not been a problem for me... of course the "vise" installers are a different story but over the last year or so they have improved significantly and seem to readily handle a multiple partition set up.



[ Reply to This | # ]
Simple workaround for installing iTunes upgrades
Authored by: DavidVH on Jun 22, '04 01:17:48PM
With iTunes on my Apps partition, Apple's iTunes 4.5 and 4.6 updaters (via Software Update) did not actually update the iTunes application. And after the failure of Software Update, downloading the new version of iTunes from Apple and running the installer was equally ineffective, even though it ran without giving any error message. I found a fairly easy solution, though:
  1. Delete the "iTunes4.pkg" file from /Library/Receipts

  2. Download the new version of iTunes at:
    http://www.apple.com/support/downloads/itunes.html

  3. Run the iTunes installer.

Voilà!

[ Reply to This | # ]
Clarification to workaround for installing iTunes updates across partitions
Authored by: DavidVH on Nov 10, '04 10:27:44PM
In case you're wondering about the previous comment: Yes, you have to download the entire new version of iTunes, not an updater. The download address has changed, too; use one of these instead:

[ Reply to This | # ]
Ensuring drives/partitions are mounted
Authored by: blakers on Jun 17, '04 03:06:38PM
 > there is no mechanism in place to guarantee that the volume has
 > mounted at the time OS X sets up the swap directory. Volumes are
 > mounted by a separate, parallel process from the process that
 > initializes the virtual memory. In order for the method in this hint to
 > function properly, code needs to be added to detect that the process
 > for mounting volumes has terminated before proceeding with the
 > initialization of virtual memory. I don't know how to do that.
here's how, per a comment from Apple in a 'discussion' i'd had on the darwin-kernel list ...
From: Dan Markarian 
To: Darwin Kernel List 
Subject: Re: ?? how to get SystemStarter/diskarbitrationd to wait for drives to mount ??
Date-Sent: Friday, June 11, 2004 8:17 AM -0700


> There are two ways to have it mount at boot.  The first one, also the
> ideal one, is unfortunately not working in 10.3.x due to an oversight
> on our part.  I mention it only for future reference.  It would be to
> list the volume in question by UUID in /etc/fstab along with the "auto"
> option.  This would override any default.

re: "future reference" ... i assume you mean that fstab in not currently being used/checked, not that it currently/default is simply empty.  yes?

> My alternative would be to create the preference file in
> /Library/Preferences/SystemConfiguration/com.apple.DiskArbitration.diskarbitrationd.plist with this:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
   <dict>
      <key>DAMountDeferExternal</key>
      <false/>
   </dict>
</plist>
the mod to "com.apple.DiskArbitration.diskarbitrationd.plist", i can verify on Panther 10.3.4, works perfectly.

richard

[ Reply to This | # ]
Ensuring drives/partitions are mounted
Authored by: bluehz on Jun 18, '04 07:19:00AM

I have been using the /etc/fstab method for over a year - through several OS X upgrades and I can verify that it is STILL working in the current 10.3.4. fstab - is still viable in 10.3.4.



[ Reply to This | # ]