This technote should be read in its entirety before installing any new
disks. Many of the steps contains notes and information that should be
read and understood BEFORE the step is taken. Again, please read this
entire technote before proceding.
Before You Begin
1. Take a look at (and print out) /etc/vfstab
note: cCtAd0sP - C=controller, A=SCSI target, P=partition
2. Type "df -k" and print out the results
Installation
1. Shutdown the machine (usually using "shutdown -i5 -g0 -y") and all
external devices.
2. Install the disk (if jumpers need to be set, do so - if the interface
automates the setting of IDs, like SCA, make sure that no drive
can conflict with your new drive by using a manual setting).
Make sure you don't exceed SCSI cable length limitations.
Usually these are VERY short. For good information, go
to www.swexpert.com, click on "Storage", and then select
May's article "Negotiating the SCSI Swamps".
Termination is also very important. You need to be sure you're
using the correct type of terminator (for each different type of
connector, there are at least four different types of terminators).
Most devices nowadays can be configured for auto-termination.
Only the last device in the chain should have auto-termination enabled.
If auto-termination is enabled, do not use an external or other add-on
terminator.
3. Turn on all external devices, then the machine - you may get a "wrong
magic number" error from the newly installed drive - this is ok.
4. Go into PROM mode (Stop A) and type "probe-scsi-all" - note all scsi
devices attached to the system on a piece of paper, especially
your new device.
Make sure you hit stop-A before the kernel begins executing. If you
hit stop-A after this you may create filesystem corruption. If you
don't hit stop-A in time, let the machine boot and then execute
"shutdown -i 0 -g 0 -y" to get back to the "ok" prompt. NOTE:
"probe-scsi-all" will sometimes hang the system if the SCSI drives
have been used since the last power-on reset, so you'll probably want
to cycle the power.
If the timing for hitting stop-A is a problem you can set the
"auto-boot?" OBT environment variable to "false", cycle the power
and you'll get the "ok" prompt without having to hit stop-A.
You'll want to be sure to set it back to "true" when you're done,
though, because otherwise if the system crashes it will not
automatically reboot (it will remain down until a human comes around
to type "boot" at the "ok" prompt).
5. Type "boot -r" to reboot your system. Upon reboot you will see a
"wrong magic number" error with regards to the newly installed drive.
Don't worry about this - it will be fixed later.
6. Once booted, enter superuser mode.
7. Type "drvconfig; disks", two commands that create drivers for the
kernal to see the disks (you may need to use the full path, /usr/sbin/).
These commands ("drvconfig; disks") are not necessary -- they are
part of what "boot -r" does. If for some reason you want to boot
WITHOUT the -r switch, and the only thing that has changed on the
system hardware-wise are the disks, then you can use these two
commands instead of using "boot -r". These commands can also be used
to force the system to recognize changes of hot-swappable drives.
Most drives are NOT hot-swappable, however, so be 100% sure before
trying to hot-swap anything!
It doesn't hurt to run these commands again after a "boot -r" though.
8. Type "format" and choose you newly installed drive (usually found by
noting the size of the drive you installed.) If you installed a drive
that is similar in size to other drives in the system, reference the
information you wrote down from the "probe-scsi-all" command. When you
determine which drive is the proper drive, write its information down
(in the format cCtAd0sP - C=controller, A=SCSI target, P=partition) for
later steps (specifically step 13).
9. At the "format>" prompt, type "label" to place a default label on
the drive - this will fix the "wrong magic number" problem.
The labeling will actually be done for you automatically when you try
to partition the drive (assuming you change the partition table).
It doesn't hurt to explicitly do it, however.
10. At the "format>" prompt, type "partition" then "print" to get a
listing of the default partition on the drive.
Almost always the default partitions are inappropriate.
At the very least, for data drives, I like to delete unused partitions
leaving only parition ("slice") 2.
Remember that slice 2 is a special partition that represents the
entire disk. Never change it -- if you do, you'll have drive
problems.
11. If you are satisfied with the partition, exit out of format, then run
the following command:
newfs -v -m x% /dev/rdsk/slice
x = the percentage of the drive you want to save for
non-usage/swap (typically 5 to 10%, lower for large drives)
slice = the full name of the slice you want to put a new
filesystem on (i.e. c0t2d0s6 - reference the info from step 8)
NOTE: you may have to include the full path for the command
(/usr/sbin)
The following can and should be done to provide a record of your
actions:
script /var/adm/newfs.cWtXdYsZ
newfs -v -m 0 /dev/rdsk/cWtXdYsZ
# often with "-f 8192 -i 16384 -c 32" too
exit
This provides you a record of all the parameters used to create the
filesystem. The most important information that newfs gives you is
the locations of the alternate copies of the superblocks. If you have
filesystem corruption and fsck will not run because it can't find the
superblock, you can then check this file and supply it with one of the
alternates via the "-b" flag. It's really usually that you'll need to
do this, but it has happened to me twice in the last five years that I
can recall.
12. Edit /etc/vfstab to reflect your new slice (or slices).
13. Create mount points for those slices (create new directories).
Make sure the mount point uses the block device (/dev/dsk) for mounting
the drive, and the the character device (/dev/rdsk) for running fsck.
The ownership and permissions of the mount point DO affect how the
drive can be accessed. For example, if the mountpoint looks like
drwx------ 2 markmont ffive 2048 Sep 1 10:23 /mountpoint
before the drive is mounted, then AFTER the drive is mounted even if
the mountpoint looks like
drwxr-xr-x 2 root root 2048 Sep 1 10:23 /mountpoint
then you'll find that only "markmont" can write (and maybe even
read) it.
I create mountpoints with the following commands:
mkdir /mountpoint
chown root:other /mountpoint
chmod 755 /mountpoint
This ensures that after the disk is mounted people can access it as
they would expect to according to the mounted filesystem's normal
permissions.
14. Reboot the machine using "shutdown -i6 -g0 -y"
Not necessary, unless you want to test things.
If you'd like to be sure your changes to vfstab are okay, type:
mount /mountpoint
ls /mountpoint
umount /mountpoint
mount /mountpoint