Sun Logo

Adding Hardware to your Sun

Places to Find Sun Hardware

You can buy Sun hardware through a vendor such as 3comsat or you may find better deals through Ebay. On Ebay, I have found both internal and external disks, and extra processor (I now have an MP Sun), and a SCSI CD ROM. Note that the 3comsat web pages can only be accessed with Internet Explorer. Netscape produces a blank page.

Step By Step Adding a Drive

This section describes the steps in adding an internal or external hard drive to your system. Later sections provide more detail on the various steps.

  1. Install the physical drive.
    • Make sure the machine is turned off
    • For an internal drive, remove the cover by taking off the two upper cover screws on the back of the machine. Looking at the machine from the back, this is the screw in the upper right corner and the screw near the center top of the box which is in a black plastic piece through which a lock or tie down cable would be placed. The back of the case raises up releasing the lock down tabs at the front of the case.
    • For an internal drive, the drive you will be adding will be a Sun type SCSI device mounted on a Sun Sled. Raise the handle on the sled to be perpendicular to the drive and insert it in the slots above the existing drive. Rotate the handle down to push the drive into the connector. If you cannot get a sled for your internal drive, you can carefully push the drive into the connector and put about 2 pieces of corrugated cardboard under the drive to hold it at the right level. You will have to be careful not to knock the drive loose if you have to move the machine This drive will be SCSI number 1
    • For an external drive, connect the SCSI-2 cable to the back of the Sun and to one of the SCSI connectors on the back of the drive case. Attach the power cable to the drive case and plug it in. Set the SCSI number on the back of the case (this example assumes you used 4) and power up the drive.
  2. Turn on the machine and while the machine is doing it's memory test press and hold the "Stop" key and press the letter 'a' key. You will get an OK prompt. Enter the command boot -r and the machine will boot with instructions to rescan the SCSI bus and rebuild the /dev/rdsk and /dev/dsk directories.
  3. After the machine boots, log in as root.
  4. Enter the command format
    The command will list all the hard drives it can see and ask you to choose one. You choose by the number to the left of the drive, not by the SCSI number.
  5. Enter the command verify.
    This will list the existing partition table. You will see something like:
    format> verify 
      
    Primary label contents: 
      
    Volume name = <        > 
    ASCII name  = <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
    pcyl        = 3500 
    ncyl        = 2733 
    acyl        =    2 
    nhead       =   19 
    nsect       =   80 
    Part      Tag    Flag     Cylinders        Size            Blocks 
      0       root    wm       0 - 2387        1.73GB    (2388/0/0) 3629760 
      1       swap    wu    2388 - 2722      248.63MB    (335/0/0)   509200 
      2     backup    wm       0 - 2732        1.98GB    (2733/0/0) 4154160 
      3 unassigned    wm       0               0         (0/0/0)          0 
      4 unassigned    wm       0               0         (0/0/0)          0 
      5      stand    wm    2723 - 2727        3.71MB    (5/0/0)       7600 
      6      stand    wm    2728 - 2732        3.71MB    (5/0/0)       7600 
      7 unassigned    wm       0               0         (0/0/0)          0 
      
    format> 
    
       
  6. Enter the command partition
    This puts you into a mode which allows you to repartition the drive. This example assumes you want to have the entire disk be one large partition.
  7. What you do next depends upon how the drive is partitioned. What we want to do is zero out all the partitions except the root partition and the backup partition. Never change the backup partition (number 2) The following commands are used to combine the above drive into a single partition.
    1. At the partition prompt enter the partition number you want to change, type: 6
    2. You will be prompted for the tag. Type unassigned and press return.
    3. You will be prompted for the flags, press return to take the defaults.
    4. You will be prompted for the start cylinder. Type 0 as we are getting rid of this partition and press enter.
    5. You will be prompted for the size. Type 0 and press enter.
    6. Repeat steps A through E for partition number 5 and 1.
    7. To modify the root partition, type 0 at the partition prompt.
    8. You will be prompted for the tag. Press return to take the default of "root".
    9. You will be prompted for the flags. Press return to take the default.
    10. You will be prompted for the start cylinder, Type 0 as we want to use the whole drive as one partition.
    11. You will be prompted for the size. Type 2733c to show we want all the cylinders. The number is taken from the number of cylinders in the backup partition (number 2).
    12. Type print and press return to print the table as it looks. You should now see one partition (not counting the backup) covering the entire disk.
    13. Type label and press return to write the updated label out to the disk. You will be prompted to confirm.
  8. Enter the command verify. You should now see:
    format> verify 
      
    Primary label contents: 
      
    Volume name = <        > 
    ASCII name  = <SUN2.1G cyl 2733 alt 2 hd 19 sec 80> 
    pcyl        = 3500 
    ncyl        = 2733 
    acyl        =    2 
    nhead       =   19 
    nsect       =   80 
    Part      Tag    Flag     Cylinders        Size            Blocks 
      0       root    wm       0 - 2732        1.98GB    (2733/0/0) 4154160 
      1 unassigned    wu       0               0         (0/0/0)          0
      2     backup    wm       0 - 2732        1.98GB    (2733/0/0) 4154160 
      3 unassigned    wm       0               0         (0/0/0)          0 
      4 unassigned    wm       0               0         (0/0/0)          0 
      5 unassigned    wm       0               0         (0/0/0)          0 
      6 unassigned    wm       0               0         (0/0/0)          0 
      7 unassigned    wm       0               0         (0/0/0)          0 
      
    format> 
    
       
  9. Type quit to leave format
  10. If your drive is the internal drive (SCSI ID 1) enter the following command at the UNIX prompt.
    newfs /dev/rdsk/c0t1d0s0
    This will create the new file system on the partition.
  11. If your drive is the external drive (example is SCSI ID 4) enter the following command at the UNIX prompt.
    newfs /dev/rdsk/c0t4d0s0
    This will create the new file system on the partition.
  12. Execute the UNIX command: mkdir /disk2 as we plan to mount the new disk drive as /disk2.
  13. Edit /etc/vfstab and add the following line. (at the bottom is fine).

    For the internal drive:

    /dev/dsk/c0t1d0s0  /dev/rdsk/c0t1d0s0  /disk2       ufs     1       yes       -

    For the external drive:

    /dev/dsk/c0t4d0s0  /dev/rdsk/c0t4d0s0  /disk2       ufs     1       yes       -

    Save the file and exit the editor.

  14. Enter the UNIX command: mount /disk2
    You should now have access to your new drive.

How to Ball Your Disk Up Real Good Using the Format Command

Using DD and or the format command, you can damage the volume label of a hard drive. This makes the drive think it is some other kind of drive. It may also make the drive unusable. In general you should not use DD from one raw drive to another unless the drives are the same kind. It is possible to get it to work anyway although you could end up rebuilding a drive now and then.

Options For Adding a CDROM

The Sun Sparc 20 takes a special 1/2 height SCSI CD ROM drive. The internal Sun CD Roms on Ebay seem to go for a premium price. The internal connection in the Sun for the CD ROM is a standard 50 pin SCSI connector and a standard 4 pin power connection. Thus you can plug in any SCSI CD ROM and it will work. If you do manage to get a 1/2 height SCSI CD ROM for the Sun, you will need a special Sun sled which is similar to but not exactly like the sleds used to mount internal drives.

Note that the recommended SCSI ID for the CDROM is 6.

Special note: To be able to boot from a CDROM, via "boot cdrom"
you need to have the SCSI jumpers set to the CDROM is at SCSI address 6.
Otherwise the cdrom will not be bootable.

The problem with using a normal SCSI CD ROM is that after you plug it in, you cannot put the cover back on. (Anyone need a SCSI CD :-)). However, if you only use the SCSI for installing software and don't mind pulling the cover off when you want to use the CD ROM this should not be too much a problem.

Note that any 50 pin SCSI device can be connected at this point. If you put a disk drive in this location, you will want to secure it in some way so it does not bounce around. Make sure there is space for ventilation around the drive.

Another option is to get an external Sun SCSI CD ROM. These can be had on Ebay for under $40 with shipping. They usually come in a Sun type 411 external case. You will need a SCSI-2 to SCSI-2 connector and a power cord for them. The SCSI-2 connector plugs into the back of the sun and the back of the drive. The CDROM's you get in the Model 411 case tend to be the old ones which use carriers and are slow. Inside the case is a standard 50 pin SCSI connector, so you can swap the drive for a more modern SCSI drive.

Internal Sun drives

Sun Internal Drives are SCSI. They have a special 80 pin connector which includes the power supply and sets the SCSI ID automatically. To be fitted properly, they have to be attached to a Sun sled. It appears that Sparc 5 and Sparc 20 take the same drives. Sparc 10's take a different type. The machine you have has one sled with it. If you want to add a second internal drive, you will have to get one with a sled or obtain the sled separately from the drive. The sled attaches to the drive with 4 phillips head screws. The Sun you bought has 1.05 GB drive with a sled. All sorts of internal drives, with and without the sleds can be found on Ebay. The sleds seem to command a premium price. If you want to add a second internal drive, you will need to get a second sled.

The internal drives sit one on top of the other in the front left corner of the computer case. The SCSI ID on the drive is automatically configured. The bottom drive is SCSI ID 3 (/dev/rdsk/c0t3d0s[0-7]) and the top drive is SCSI ID 1 (/dev/rdsk/c0t1d0s[0-7]). The machine boots from /dev/rdsk/c0t3d0s0 (partition number zero on SCSI device 3) by default.

External Sun drives

External drives for the Sun are readily available. They connect to the Sun with a SCSI-2 to SCSI-2 cable. The Model 411 is not very expensive and often comes with a one or two GB drive. You can also find the 411 case very cheap ($10.00) with a small drives of about 200 MB. One option is to buy the case with the small drive and replace it with a standard SCSI drive. The 411 Case has a standard 50 pin SCSI connector inside and a standard 4 pin power connector.

The Model 411 case has a SCSI ID selector switch on the back which lets you select the SCSI device number. In general don't pick values 1 or 3 which are what the internal drives want to be.

Also available are the Sun Model 611 external cases. As with the Model 411 they can contain a disk drive, a CD, a tape drive, or something else. The Model 611 has a SCSI-3 connector on it. You would therefore need a SCSI-2 to SCSI-3 cable to connect it to the SCSI-2 connector on your Sparc 20. Also, Model 611, takes a Sun 80 pin drive on the inside. This is known to be true for the cases which contain hard drives. The Model 611 drives are generally newer and have bigger 4 - 9 Gig drives already in them.

If you swap out the drive inside the case with a standard SCSI 50 pin drive you will notice a difference between the drive in the case and the one you have. The SCSI selector switch goes to a 4 pin connector which attaches to the bottom of the hard drive. The 4 pins are the 3 SCSI address bits and ground. This will not fit over the normal jumpers on a SCSI drive. You have two choices. The simplest is to pick the SCSI number you want to use for the drive, set the jumpers and forget about the switch on the back of the case. Normally SCSI numbers are not changed. The alternative is to cut apart the connector and attach it to the appropriate pins on the new drive. You might have to build an extender for the cable if the pins are on the back of the drive.

One more thing. The Sun drives seem to deal with SCSI termination quite well. Some drives have a jumper which specifies that they will be the terminator drive. Some do not. You may have to set a jumper, add a SCSI terminator, or make sure the drive is not the last in the chain. You can get manuals and configuration specs for most drives from the manufactures web site.

Booting After Adding Drives

After you add or remove hard drives or CD ROM drives, you need to tell the Sun to rebuild the device directory. After you power on the Sun, while the memory test is going on, press and hold the key marked "Stop" and then press the 'a' key. This will result in an OK prompt being displayed. At the OK prompt, type:
boot -r

Backup Boot Drives

If you get an second 1 GB hard drive and want to create a backup boot drive, you can mount it and DD the boot drive over to it. For the sake of example, we will assume you have a 1.05 GB internal Sun drive to use as the backup. Mount it into the top drive bay this will give it SCSI ID 1. Power up and then use "Stop-a" and "boot -r" to boot the machine. Once the machine is up, log in as root. Run the command:
dd if=/dev/rdsk/c0t3d0s2 of=/dev/rdsk/c0t1d0s2 bs=1024k
Double check the command before you run it. This command uses 'dd' to copy partition 2 (the backup partition) from SCSI device 3 to SCSI device 1. The backup partition is a special partition which covers the entire drive.

If you were to 'dd' a 1.05 GB drive to a larger drive, the label gets overwritten and the drive then things it is a 1.05GB drive. Fixing the label is quite a trick but can be done. If the geometry of the two drives is radically different, the drive may begin reporting errors when you are trying to access non-existent tracks.

Mounting New Drives

/etc/vfstab

The mounting of hard drive partitions is controlled by the file /etc/vfstab. Here is an example:

#device             device             mount       FS      fsck    mount     mount
#to mount           to fsck            point       type    pass    at boot   options
#
fd                  -                  /dev/fd     fd      -       no        -
/proc               -                  /proc       proc    -       no        -
/dev/dsk/c0t3d0s1   -                  -           swap    -       no        -
/dev/dsk/c0t3d0s0  /dev/rdsk/c0t3d0s0  /           ufs     1       no        -
swap                -                  /tmp        tmpfs   -       yes       -

The above table describes how to mount file systems on the Sun. Only some of these refer to actual disks. The line starting fd describes the floppy drive which most machines don't have unless you add one. The /proc file system allows access to process memory and should not be disturbed.

The /dev/dsk/c0t3d0s1 is the swap space. Partition number 1 (s1) on the boot disk is normally the swap partition. It is not actually mounted and should also be left alone. It is treated as raw disk which is why there is no device to fsck. The last line in the file which mounts at /tmp is the file system which makes /tmp an in memory file system. If you changed this to point to a real disk partition, /tmp would be real disk and not go away when the machine is turned off.

The interesting line is the one colored in red. The entries in /dev/dsk and /dev/rdsk are both pointers to the devices with additional information in the link. The entries in these directories are created when you boot with boot -r. The c0t3d0s0 identifies the partition within the disk. The example is:

c0t3d0s0
Controller 0
Target     3 (This is the SCSI device number)
Drive      0
Slice      0 (This is the partition number)
The only two numbers you will probably ever see change are the t number and the s number. That is, the SCSI number and the partition.

The third parameter says where the device is mounted. In the case of the root partition this is device /. On the machines we were delivered, /usr was on a separate partition (#6) resulting in the line /etc/vfstab line:
/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 1 no -
Note that in the root partition, there is an empty directory called /usr which is what the file system is mounted over.

The forth parameter tells file system type and it is always ufs for hard drives. The fifth controls whether fsck should check the disk automatically. fsck is to UNIX as chkdsk is to DOS. It is normally 1. The 5th parameter specifies whether to mount the file system at boot. / and /usr are automatically mounted (to be able to boot) and thus you specify no to avoid an error message saying they are already booted.

The last parameter allows you to control the order partitions get mounted. (More Later)

Mounting New Drives

The mounting of hard drive partitions is controlled by the file /etc/vfstab as described above. For this example assume that a second internal drive (SCSI number 1) has been installed and formatted as a single partition which is partition 0. We plan to mount this as /home. We have run the command mkdir /home to create the mount directory in the root directory. The /etc/vfstab line will read:

/dev/dsk/c0t1d0s0  /dev/rdsk/c0t1d0s0  /home        ufs     1       yes       -

Once the /home mount point directory is created and the /etc/vfstab line is edited in, you can either reboot or type mount /home to mount the partition.

Sometimes You Don't Want to Mount a Drive at Boot Time

If you have installed an external drive you may want to not mount it at boot time. Unless you have the machine and external drive attached to the same power strip and use the power strip switch to power up the system, it is easy to forget to turn on the external drive. If the "mount at boot" field in the /etc/vfstab line is set to yes and you forget to turn on the external drive, the machine will not boot properly. If the external drive is used for backup or some other purpose, you may want to leave it set to not mount automatically and mount it manually when you need it using
mount /disk2
or
mountall
If you had set the SCSI number to 4 and formatted as a single large partition which you wanted to mount as /disk2, the /etc/vfstab line would then read:
/dev/dsk/c0t4d0s0  /dev/rdsk/c0t4d0s0  /disk2        ufs     1       no       -

mount and mountall are described in the manual pages

Sharing New Drives via NFS

If you want to share the drive so that other machines can access it via NFS, you use the share command. The manual page has all the options, but the default:
 
share /disk2
 
will allow it to be mounted read/write by anybody.
 
share -o ro /disk2
 
will allow it to be mounted read only by anybody.



Back to Sun At Home Home Page
Last Maintained, 05/25/2005 by R. E. Styma (x7323)