I want to add a new hard drive to my Ultra 20. Do I have to get the SATA drive from Sun? What do I need to do to install and use the new hard drive?
We have tested a number of non-Sun SATA hard drives in the Ultra 20 and there have been no problems adding them as long as the drive is pre-formatted. Just add the hard drive to the Ultra 20, engage a reconfiguration boot (boot -r) and run the format utility. The trick is not to execute the format option.
If you try to physically format the hard drive you will get an message saying that format does not recognize the hard drive and the format utility from the disk manufacturer should be used. In almost all cases the hard drive is pre-formatted from the manufacturer so you can just ignore this step. Continue with the normal format steps: partition, label, etc... (excluding the actual format) and most likely the drive will function perfectly.
I've installed a new hard drive in my Sun Workstation and run the format utility to partition the hard drive. How do I set up the drive to be used in Solaris?
Use the newfs command to create UFS file systems. newfs is a convenient front end to the mkfs command (make file system - the program that creates the new file system on a disk slice).
On Solaris 9 and 10 systems, disk information used to set some of the parameter defaults, such as number of tracks per cylinder and number of sectors per track, but now this information is read from the disk label. newfs determines the file system parameters to use, based on the options you specify and information provided in the disk label. Parameters are then passed to the mkfs command, which builds the file system. Although you can use the mkfs command directly, it's more difficult to use and you must supply many of the parameters manually.
The disk must be formatted and divided it into slices before you can create UFS file systems. The newfs utility removes any data on the disk slice and creates the skeleton of a directory structure, including a directory named lost+found. After you run newfs successfully, it's essential to run the fsck command to check the integrity of the file system before mounting it for the first time. After you run fsck, the slice is ready to be mounted as a file system.
To create a UFS file system on a formatted disk that has already been divided into slices, you need to know the raw device filename of the slice that will contain the file system.
Below is an example of how to create a UFS File System:
Note: If you are re-creating or modifying an existing UFS file system, back up and unmount the file system before performing these steps.
1. Become superuser.
2. Type newfs /dev/rdsk/<device-name> and press Enter. You are asked if you want to proceed. The newfs command requires the use of the raw device name, not the buffered device name. Be sure you have specified the correct device name for the slice before performing the next step. You will erase the contents of the slice when the new file system is created, and you don't want to erase the wrong slice.
3. Type y to confirm.
The following example creates a file system on /dev/rdsk/c0t3d0s7:
1. To become superuser type, su, and enter the root password.
The system responds with this:
newfs: construct a new file system /dev/rdsk/c0t3d0s7 (y/n)? y
/dev/rdsk/c0t3d0s7: 163944 sectors in 506 cylinders of 9 tracks, 36 sectors
83.9MB in 32 cyl groups (16 c/g, 2.65MB/g, 1216 i/g)
super-block backups (for fsck -b #) at:
32, 5264, 10496, 15728, 20960, 26192, 31424, 36656, 41888,
47120, 52352, 57584, 62816, 68048, 73280, 78512, 82976, 88208,
93440, 98672, 103904, 109136, 114368, 119600, 124832, 130064, 135296,
140528, 145760, 150992, 156224, 161456,
The newfs command uses conservative and safe default values to create the file system. Below are a list the default parameters used by the newfs command:
. File system block size is 8192.
. File system fragment size (the smallest allocable unit of disk space) is 1024 bytes.
. Percentage of free space is now calculated as follows: (64MB/partition size) 100, rounded down to the nearest integer and limited to between 1 percent and 10 percent, inclusive.
. Number of I-nodes or bytes per I-node is 2048. This controls how many I-nodes are created for the file system (one I-node for each 2KB of disk space).
After the new file system has been created it must be mounted in order for it to be accessible to the users. Modify the vfstab file to automatically mount the file system during the boot process. Follow the procedure below to automatically mount the partition.
The /etc/vfstab (virtual file system table) file contains a list of file systems to be automatically mounted when the system is booted to the multiuser state. The system administrator places entries in the file, specifying what file systems are to be mounted at bootup. The following is an example of the /etc/vfstab file:
device device mount FS fsck mount mount
to mount to fsck point type pass at boot options
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
/proc - /proc proc no - -
/dev/dsk/c0t0d0s1 - - swap no - -
swap - /tmp tmpfs - yes -
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 2 no -
/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /data ufs 2 no -
Each column of information follows this format:
. device to mount: Buffered device that corresponds to the file system being mounted.
. device to fsck: Raw (character) special device that corresponds to the file system being mounted. This determines the raw interface used by fsck. Use a dash (-) when there is no applicable device, such as for swap, /proc, tmp, or a network-based file system.
. mount point: Default mount point directory.
. FS type: Type of file system.
. fsck pass: Pass number used by fsck to decide whether to check a file. When the field contains a dash (-), the file system is not checked. When the field contains a value of 1 or greater, the file system is checked sequentially. File systems are checked sequentially in the order that they appear in the /etc/vfstab file. The value of the pass number has no effect on the sequence of file system checking.
A common misconception is that the fsck pass field specifies the order in which file systems are to be checked. In SunOS system software, the fsck pass field does not specify the order in which file systems are to be checked. During bootup, a preliminary check is run on each file system to be mounted from a hard disk, using the boot script /sbin/rcS, which checks the / and /usr file systems. The other rc shell scripts then use the fsck command to check each additional file system sequentially. They do not check file systems in parallel. File systems are checked sequentially during booting even if the fsck pass numbers are greater than 1. The values can be any number greater than 1.
. mount at boot: Specifies whether the file system should be automatically mounted when the system is booted. The rc scripts located in the /etc directory specify which file system gets mounted at each run level.
. mount options: List of comma-separated options (with no spaces) used when mounting the file system. Use a dash (-) to show no options.
Type the mount command with the -p option to display a list of mounted file systems in /etc/vfstab format:
The system responds with this:
/dev/dsk/c0t3d0s0 - / ufs - no rw,suid,largefiles
/dev/dsk/c0t3d0s6 - /usr ufs - no rw,suid,largefiles
/proc - /proc proc - no rw,suid
fd - /dev/fd fd - no rw,suid
/dev/dsk/c0t3d0s1 - /var ufs - no rw,suid,largefiles
/dev/dsk/c0t3d0s3 - /export ufs - no suid,rw,largefiles
/dev/dsk/c0t3d0s5 - /opt ufs - no suid,rw,largefiles
swap - /tmp tmpfs - no
sparc4:/usr - /net/sparc4/usr nfs - no nosuid
/dev/dsk/c0t0d0s0 - /home2 ufs - no suid,rw,largefiles
The -p option is useful for obtaining the correct settings if you're making an entry in the /etc/vfstab file.
Do you have a question you'd like to see answered in a future issue of eKnowledge? Email Allen at: email@example.com