Rebuild the /dev/sg/* and /dev/rmt/* devices on a Solaris server without rebooting

On Solaris Server sometimes the fault is happened and the driver could not be recognized by the OS. Unfortunately the server is production and could not be rebooted. Here are the basic steps to rebuild the /dev/sg/* and /dev/rmt/* devices on a Solaris server without rebooting.

1. Create a backup copy of the current st.conf file:
# cp /kernel/drv/st.conf /kernel/drv/st.conf.`date +%m%d%y_%H%M%S`

2. Move the existing sg.conf to a backup (this must be a move, otherwise a later step will fail):
# mv /kernel/drv/sg.conf /kernel/drv/sg.conf.`date +%m%d%y_%H%M%S`

3. Create a backup copy of the current devlink.tab file:
# cp /etc/devlink.tab /etc/devlink.tab.`date +%m%d%y_%H%M%S`

4. Delete SCSI targets/LUNs from the /kernel/drv/st.conf file:
name="st" class="scsi"
target=0 lun=0;

All of these entries should be removed, otherwise duplicates will be added later.

5. Delete SCSI targets/LUNs from /etc/devlink.tab. This is typically the section near the end of the file and the entries are typically of the form:

# begin SCSA Generic devlinks file - creates nodes in /dev/sg
type=ddi_pseudo;name=sg;addr=0,0; sg/c\N0t0l0
type=ddi_pseudo;name=sg;addr=1,0; sg/c\N0t1l0
type=ddi_pseudo;name=sg;addr=2,0; sg/c\N0t2l0
type=ddi_pseudo;name=sg;addr=3,0; sg/c\N0t3l0
type=ddi_pseudo;name=sg;addr=4,0; sg/c\N0t4l0
type=ddi_pseudo;name=sg;addr=5,0; sg/c\N0t5l0
type=ddi_pseudo;name=sg;addr=6,0; sg/c\N0t6l0
type=ddi_pseudo;name=sg;addr=0,1; sg/c\N0t0l1
type=ddi_pseudo;name=sg;addr=1,1; sg/c\N0t1l1
type=ddi_pseudo;name=sg;addr=2,1; sg/c\N0t2l1
type=ddi_pseudo;name=sg;addr=3,1; sg/c\N0t3l1
type=ddi_pseudo;name=sg;addr=4,1; sg/c\N0t4l1
type=ddi_pseudo;name=sg;addr=5,1; sg/c\N0t5l1
type=ddi_pseudo;name=sg;addr=6,1; sg/c\N0t6l1
# end SCSA devlinks

Everything in this section should be removed, inclusive of the beginning and ending lines.

6. Change to the appropriate directory to run commands:
# cd /usr/openv/volmgr/bin/driver

7. Generate the configuration files (st.conf, sg.conf and sg.links):
../sg.build all -mt -ml

Note: You will need to know what the max_target and max_lun values will need to be (this is the maximum SCSI Target and LUN value).

8. Append the generated st.conf entries to the OS configuration file:
# cat st.conf >> /kernel/drv/st.conf

9. Unload the sg driver:
# rem_drv sg

10. Use the provided script to re-create the /kernel/drv/sg.conf file, append the SCSA entries to /etc/devlink.tab and reload the sg driver:
# ./sg.install

11. Now sgscan should see the appropriate devices:
# /usr/openv/volmgr/bin/sgscan all conf -v
*these information is taken from http://seer.support.veritas.com/docs/266501.htm

Please Select Embedded Mode To Show The Comment System.*

Previous Post Next Post