Platform Notes: Using luxadm Software

Replacing a Disk Drive

This section describes how on configuring your system to replace a disk drive while the power is on and the operating system is running.

You must stop any activity on the disk; physically remove the old drive and install the new one; and configure the Solaris environment to recognize the drive. You must then configure your application to accept the new disk drive.


Caution - Caution -

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 and/or data corruption.


Different applications provide various levels of error logging. In general, you can find messages about failing or failed disks in your system console window. The information is also logged in the /usr/adm/messages file(s). See the documentation that came with your application for more information.

Preparing to Replace the Disk Drive

The following procedure describes how to unconfigure a disk being used by one or more UFS file systems.

  1. Stop any application processes on the file systems to be unconfigured.

  2. Back up your system.

  3. Determine what file system(s) are on the disk:


    # mount | grep cwtxdysz
    

    For example, if the device to be removed is c2t1d0, enter the following:


    # mount | grep c2t3d0
    /export/home   (/dev/dsk/c2t1d0s7 ):   98892 blocks   142713 files
    /export/home2  (/dev/dsk/c2t1d0s5 ):  153424 blocks   112107 files

  4. 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 enables you to configure the replacement disk so that its layout matches the current disk.

    Refer to the format(1M) man page for more information.

  5. Unmount any file systems on the disk.


    Note -

    If the file system(s) is 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 reboot the system.


    For each file system from Step 3 returned, type:


    # umount filesystem
    

    where filesystem is the first field for each line returned in Step 3.

    For example:


    # umount /export/home
    # umount /export/home2
    

  6. Using the df command, verify that the file system has been unmounted.

Removing the Disk Drive

  1. Use the luxadm remove_device command to remove the disk.

    The luxadm remove_device command is interactive. You will be guided through the procedure for removing a device or chain of devices.


    # luxadm remove_device /dev/rdsk/c2t1d0s5
    
    
      WARNING!!! Please ensure that no filesystems are mounted
    on these device(s).
      All data on these devices should have been backed up.
    
    
    
    The list of devices which will be removed is:
      1: Box Name "macs1" front slot 1
    
    Please enter 'q' to Quit or <Return> to Continue: 
    
    stopping:  Drive in "macs1" front slot 1....Done
    offlining: Drive in "macs1" front slot 1....Done
    
    Hit <Return> after removing the device(s).
    #

  2. Remove the disk drive and then hit any key.


    Note -

    The yellow LED on the designated disk drive(s) should be flashing.


    The following is displayed:


     Drive in Box Name
    "macs1" front slot 1
    
        Removing Logical Nodes: 
    	Removing c2t1d0s0
    	Removing c2t1d0s1
    	Removing c2t1d0s2
    	Removing c2t1d0s3
    	Removing c2t1d0s4
    	Removing c2t1d0s5
    	Removing c2t1d0s6
    	Removing c2t1d0s7
    #
    

Installing the New Disk Drive

  1. Use the luxadm insert_device command to add the new device.

    This command is interactive. You will be guided through the procedure for inserting a new device or chain of devices.


    # luxadm insert_device, macs1,f1
    
    The list of devices which will be inserted is:
      1: Box Name "macs1" front slot 1
    
    Please enter 'q' to Quit or <Return> to Continue: 
    
    
    Hit <Return> after inserting the device(s).
    

  2. Insert the disk drive and hit Return.

    The following is displayed:


      Drive in Box Name "macs1" front slot 1
      Logical Nodes under /dev/dsk and /dev/rdsk :
    	c2t1d0s0
    	c2t1d0s1
    	c2t1d0s2
    	c2t1d0s3
    	c2t1d0s4
    	c2t1d0s5
    	c2t1d0s6
    	c2t1d0s7
    #
    

    The new disk drive is now available for use as a block or character device. Refer to the sd(7) man page for further details.

  3. Verify that the device label meets your requirements.

    You can use the prtvtoc command to inspect the label for your disk. To modify the label, use the format command. See the prtvtoc(1M) and format(1M) man pages for more information.

  4. 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.

  5. Once you have selected a disk slice for your UFS file system, create a file system on the slice:


    # newfs /dev/rdsk/cwtxdysz
    

  6. 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.