Last year (2002), I got a PowerBook G4 which came factory installed. But didn’t like the installation, as everything was installed on one big partition. I wanted to do a custom installation my way. I dug up at the various places on the web for information and finally did my installation. I was happy with it for almost a year, till I found out that my system partition is getting smaller and smaller after I updated for a year. Again in the partitions where I installed Developer tools and Fink packages, there were unnecessary spaces. The following was the result of “df -h
” [I installed fileutils from fink] command.
Filesystem Size Used Avail Use% Mounted on /dev/disk0s10 3.5G 3.0G 564M 85% / devfs 1.0k 1.0k 0 100% /dev fdesc 1.0k 1.0k 0 100% /dev <volfs> 512k 512k 0 100% /.vol /dev/disk0s11 512M 161M 351M 32% /.swap /dev/disk0s9 9.9G 6.2G 3.6G 63% /Volumes/Free /dev/disk0s12 3.5G 1.6G 1.9G 44% /Applications /dev/disk0s13 1.0G 557M 467M 55% /Developer /dev/disk0s14 2.0G 958M 1.0G 47% /sw /dev/disk0s15 17G 3.2G 13G 19% /Users
Finally, I dicided to reinstalled the system again. I have another machine with a big hard disk, where I backed up my home directory. But I had forgotten what I did last summer. I had to go through the web again. So this time I thought I will keep a note (last time also I thought the same, but this time I did), while installing the system, in case I have to do it again in future.
Step by Step Installation Instructions
1. Installing OS X
Put the installation CD came with the powerbook and restart. Hold down the C key as the computer starts up. When installer starts, open the “Disk Utility” for partitioning the disk. The following is my new partition scheme:
Name | Size |
---|---|
OS | 6.0GB |
.swap | 512MB |
Applications | 3.5GB |
Users | 27.0GB |
After partitioning install the system. I choosed the volume “OS” as the destination disk.
2. Moving Applications and Users
When system comes up, open Terminal application:
$ sudo ditto -v -rsrcFork /Applications /Volumes/Applications $ sudo ditto -v -rsrcFork /Users /Volumes/Users
In the file /etc/fstab, put the followinf line:
LABEL=Users /Users hfs rw 1 2 LABEL=Applications /Applications hfs rw 1 2
Load fstab to netinfo:
$ sudo niload -m fstab / < /etc/fstab
Restart the computer into single user mode (Press Command-S key during startup):
# /sbin/fsck -y # /sbin/mount -uw / # mv Users Users-old # mkdir Users # chmod 755 Users # mv Applications Applications-old # mkdir Applications # chmod 755 Applications # reboot
Hold down Command-V (for the verbose mode) during startup to see if there is anything wrong.
I like my computer to startup always in the verbose mode, so in Terminal:
$ sudo nvram boot-args="-v"
If Applications and Users partitions are successfully mounted (use “df” to see), then remove the backup.
$ sudo rm -rf /Applications-old $ sudo rm -rf /Users-old
3. Moving the swapfile to a different partition
(This step is optional. Given that physical RAM is cheap, if there is frequent problem with the memory, one can as well increase the RAM size.)
Find out the location of the swap partition.
$ df -k
In the output there will be a line something like:
/dev/disk0s3 524196 0 524196 100% /Volumes/.swap
So, “/dev/disk0s3” is the location, where I want to put my swap. Now open the file /etc/rc and replace the contents
## # Start the virtual memory system. ## . . . ## # Start daemon to fix incorrectly-prebound binaries ##
with the following content (Note: put the correct disk for your computer):
## # Start the virtual memory system. ## ConsoleMessage "Starting virtual memory" #OLD# swapdir=/private/var/vm swapdir=/.swap/vm if [ "${netboot}" = "1" ]; then sh /etc/rc.netboot setup_vm ${swapdir} fi # Make sure that no swapdir before mounting if [ -d ${swapdir} ]; then ConsoleMessage "**** Removing old swapdir *******" rm -rf ${swapdir} fi # Make sure the swapfile exists, # first ckeck existence # if not first make sure that the disk is mounted if [ ! -d ${swapdir} ]; then ConsoleMessage "************* Mounting swap disk ****************" mount -vt hfs /dev/disk0s3 /.swap mount -uw / fi # Make sure the swapfile exists, # if not create directory since disk should be mounted if [ ! -d ${swapdir} ]; then ConsoleMessage "Creating default swap directory" mount -uw / mkdir -p -m 755 ${swapdir} chown root:wheel ${swapdir} else rm -rf ${swapdir}/swap* fi dynamic_pager -H 40000000 -L 160000000 -S 80000000 -F ${swapdir}/swapfile ## # Start daemon to fix incorrectly-prebound binaries ##
I have also moved “appprofiledir” to the swap partition: in /etc/rc file replace the line
appprofiledir=/private/var/vm/app_profile
with the line
appprofiledir=${swapdir}/app_profile
Restart the computer. If the computer is using the new swap partition (use “df” to check whether the disk “/dev/disk0s3” is mounted on /.swap and the file “/.swap/vm/swapfile0” and directory “/.swap/vm/app_profile/” exist), remove the old swap directory:
$ sudo rm -rf /private/var/vm
4. Installing other softwares
Install Developer tools from Apple Developer Connetion.
Install X11 and SDK from Apple.
Install Fink for installing OpenSource software. To hide the directory /sw from the Finder:
$ sudo /Developer/Tools/SetFile -a V /sw
Once Fink installation is over, fink packages can be installed either from the precompiled binary (Debian way)
$ sudo dselect
or by building everything from the source
$ sudo fink install packagename
For help, consult The Fink FAQ.