The following procedure describes how to deconfigure a disk being used by one or more UFS file systems.
These procedures should be performed only by a qualified system administrator. Performing hot-plug operations on an active disk drive can result in data loss if performed incorrectly.
Type su and your superuser password.
Identify activities or applications attached to the device you plan to remove.
Commands to use are mount, showmount -a, and ps -ef. See the mount(1M), showmount(1M), and ps(1) man pages for more details.
For example, where the controller number is 0 and the target ID is 11:
# mount | grep c0t11 /export/home1 on /dev/dsk/c0t11d0s2 setuid/read/write on # showmount -a | grep /export/home1 cinnamon:/export/home1/archive austin:/export/home1 swlab1:/export/home1/doc # ps -f | grep c0t11 root 1225 450 4 13:09:58 pts/2 0:00 grep c0t11
In this example, the file system /export/home1 on the faulty disk is being remotely mounted by three different systems--cinnamon, austin, and swlab1. The only process running is grep, which has finished.
Stop any activity or application processes on the file systems to be deconfigured.
Back up your system.
Determine what file system(s) are on the disk:
# mount | grep cwtx
For example, if the device to be removed is c0t11d0, enter the following:
# mount | grep c0t11 /export/home (/dev/dsk/c0t11d0s7 ): 98892 blocks 142713 files /export/home1 (/dev/dsk/c0t11d0s5 ): 153424 blocks 112107 files
Determine and save the partition table for the disk.
If the replacement disk is the same type as the faulty disk, you can use the format command to save the partition table of the disk. Use the save command in format to save a copy of the partition table to the /etc/format.dat file. This will allow you to configure the replacement disk so that its layout matches the current disk.
Refer to the format(1M) man page for more information.
Unmount any file systems on the disk.
For each file system returned, type:
# umount file_system
where file_system is the first field for each line returned in Step 5.
# umount /export/home # umount /export/home1
If the file system(s) are on a disk that is failing or has failed, the umount operation may not complete. A large number of error messages may be displayed in the system console and in the /var directory during the umount operation. If the umount operation does not complete, you may have to restart the system.
Use the ssaadm replace_device command to take the device offline:
# ssaadm replace_device logical_device_name ssaadm: warning: can't quiesce "/dev/rdsk/c0t11d0s2": I/O error Bus is ready for the replacement of device Replace device and reconfigure bus as needed Press RETURN when ready to continue
Here, logical_device_name is the full logical device name of the drive to be removed (/dev/rdsk/c0t11d0s2). You must specify slice 2, which represents the entire disk. Note that this command also accepts a physical device name as an alternative.
You can safely ignore the warning message since the Enterprise 250 SCSI bus does not require quiescing.
Remove the faulty disk drive and insert the replacement drive in its place.
Refer to the Sun Enterprise 250 Server Owner's Guide for drive removal and replacement instructions.
Press Return to complete the hot-plug operation.
The ssaadm command brings the replacement drive back online.
Verify that the device's partition table satisfies the requirements of the file system(s) you intend to re-create.
You can use the prtvtoc command to inspect the label for your device. If you need to modify the label, use the format command. Refer to the prtvtoc(1M) and format(1M) man pages for more information. For example:
# prtvtoc /dev/rdsk/cwtxdysz
If you have saved a disk partition table using the format utility and the replacement disk type matches the old disk type, then you can use the format utility's partition section to configure the partition table of the replacement disk. See the select and label commands in the partition section.
If the replacement disk is of a different type than the disk it replaced, you can use the partition size information from the previous disk to set the partition table for the replacement disk. Refer to the prtvtoc(1M) and format(1M) man pages for more information.
You have defined your disk's partition table and have identified the disk slice on which to build your UFS file system.
Once you have selected a disk slice for your UFS file system, check and/or create a file system on the slice:
# fsck /dev/rdsk/cwtxdysz # newfs /dev/rdsk/cwtxdysz
Mount the new file system using the mount command:
# mount mount_point
where mount_point is the directory on which the faulty disk was mounted.
The new disk is ready to be used. You can now restore data from your backups.