Renumbering logical tape drive devices

On one of our Solaris 8 systems, tape drives were numbered beginning with /dev/rmt/3 instead of /dev/rmt/0. The physical devices pointed to by the logical /dev/rmt/[012] devices no longer existed, and we wanted to renumber the valid devices beginning at /dev/rmt/0.

On versions of Solaris that do not include devfsadm (Solaris 7 and earlier), you should be able to substitute drvconfig;devlinks;tapes for devfsadm.

# inquire | grep Tape
scsidev@3.0.0:QUANTUM DLT7000         276A|Tape, /dev/rmt/3cbn
scsidev@4.1.0:QUANTUM DLT7000         276A|Tape, /dev/rmt/4cbn
scsidev@4.2.0:QUANTUM DLT7000         296B|Tape, /dev/rmt/5cbn

1. Cleanup non-existent tape drive devices with devfsadm.

# devfsadm -C -c tape -v
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:
devfsadm[2635]: verbose: removing file: /dev/rmt/0
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:n
devfsadm[2635]: verbose: removing file: /dev/rmt/0n
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:b
devfsadm[2635]: verbose: removing file: /dev/rmt/0b
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:bn
devfsadm[2635]: verbose: removing file: /dev/rmt/0bn
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:l
devfsadm[2635]: verbose: removing file: /dev/rmt/0l
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:m
devfsadm[2635]: verbose: removing file: /dev/rmt/0m
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:h
devfsadm[2635]: verbose: removing file: /dev/rmt/0h
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:c
devfsadm[2635]: verbose: removing file: /dev/rmt/0c
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:u
devfsadm[2635]: verbose: removing file: /dev/rmt/0u
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:ln
devfsadm[2635]: verbose: removing file: /dev/rmt/0ln
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:mn
devfsadm[2635]: verbose: removing file: /dev/rmt/0mn
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:hn
devfsadm[2635]: verbose: removing file: /dev/rmt/0hn
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:cn
devfsadm[2635]: verbose: removing file: /dev/rmt/0cn
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:un
devfsadm[2635]: verbose: removing file: /dev/rmt/0un
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:lb
devfsadm[2635]: verbose: removing file: /dev/rmt/0lb
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:mb
devfsadm[2635]: verbose: removing file: /dev/rmt/0mb
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:hb
devfsadm[2635]: verbose: removing file: /dev/rmt/0hb
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:cb
devfsadm[2635]: verbose: removing file: /dev/rmt/0cb
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:ub
devfsadm[2635]: verbose: removing file: /dev/rmt/0ub
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:lbn
devfsadm[2635]: verbose: removing file: /dev/rmt/0lbn
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:mbn
devfsadm[2635]: verbose: removing file: /dev/rmt/0mbn
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:hbn
devfsadm[2635]: verbose: removing file: /dev/rmt/0hbn
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:cbn
devfsadm[2635]: verbose: removing file: /dev/rmt/0cbn
devfsadm[2635]: verbose: removing file: /devices/pci@4,2000/scsi@1,1/st@0,0:ubn
devfsadm[2635]: verbose: removing file: /dev/rmt/0ubn

...

2. Remove all /dev/rmt logical links.

rm -f /dev/rmt/*

3.
Recreate all /dev/rmt logical links with devfsadm.

devfsadm -c tape -v
devfsadm[2653]: verbose: symlink /dev/rmt/0 -> ../../devices/pci@4,2000/scsi@1/st@0,0:
devfsadm[2653]: verbose: symlink /dev/rmt/0n -> ../../devices/pci@4,2000/scsi@1/st@0,0:n
devfsadm[2653]: verbose: symlink /dev/rmt/0b -> ../../devices/pci@4,2000/scsi@1/st@0,0:b
devfsadm[2653]: verbose: symlink /dev/rmt/0bn -> ../../devices/pci@4,2000/scsi@1/st@0,0:bn
devfsadm[2653]: verbose: symlink /dev/rmt/0l -> ../../devices/pci@4,2000/scsi@1/st@0,0:l
devfsadm[2653]: verbose: symlink /dev/rmt/0m -> ../../devices/pci@4,2000/scsi@1/st@0,0:m
devfsadm[2653]: verbose: symlink /dev/rmt/0h -> ../../devices/pci@4,2000/scsi@1/st@0,0:h
devfsadm[2653]: verbose: symlink /dev/rmt/0c -> ../../devices/pci@4,2000/scsi@1/st@0,0:c
devfsadm[2653]: verbose: symlink /dev/rmt/0u -> ../../devices/pci@4,2000/scsi@1/st@0,0:u
devfsadm[2653]: verbose: symlink /dev/rmt/0ln -> ../../devices/pci@4,2000/scsi@1/st@0,0:ln
devfsadm[2653]: verbose: symlink /dev/rmt/0mn -> ../../devices/pci@4,2000/scsi@1/st@0,0:mn
devfsadm[2653]: verbose: symlink /dev/rmt/0hn -> ../../devices/pci@4,2000/scsi@1/st@0,0:hn
devfsadm[2653]: verbose: symlink /dev/rmt/0cn -> ../../devices/pci@4,2000/scsi@1/st@0,0:cn
devfsadm[2653]: verbose: symlink /dev/rmt/0un -> ../../devices/pci@4,2000/scsi@1/st@0,0:un
devfsadm[2653]: verbose: symlink /dev/rmt/0lb -> ../../devices/pci@4,2000/scsi@1/st@0,0:lb
devfsadm[2653]: verbose: symlink /dev/rmt/0mb -> ../../devices/pci@4,2000/scsi@1/st@0,0:mb
devfsadm[2653]: verbose: symlink /dev/rmt/0hb -> ../../devices/pci@4,2000/scsi@1/st@0,0:hb
devfsadm[2653]: verbose: symlink /dev/rmt/0cb -> ../../devices/pci@4,2000/scsi@1/st@0,0:cb
devfsadm[2653]: verbose: symlink /dev/rmt/0ub -> ../../devices/pci@4,2000/scsi@1/st@0,0:ub
devfsadm[2653]: verbose: symlink /dev/rmt/0lbn -> ../../devices/pci@4,2000/scsi@1/st@0,0:lbn
devfsadm[2653]: verbose: symlink /dev/rmt/0mbn -> ../../devices/pci@4,2000/scsi@1/st@0,0:mbn
devfsadm[2653]: verbose: symlink /dev/rmt/0hbn -> ../../devices/pci@4,2000/scsi@1/st@0,0:hbn
devfsadm[2653]: verbose: symlink /dev/rmt/0cbn -> ../../devices/pci@4,2000/scsi@1/st@0,0:cbn
devfsadm[2653]: verbose: symlink /dev/rmt/0ubn -> ../../devices/pci@4,2000/scsi@1/st@0,0:ubn
...

# inquire | grep Tape

scsidev@3.0.0:QUANTUM DLT7000         276A|Tape, /dev/rmt/0cbn
scsidev@4.1.0:QUANTUM DLT7000         276A|Tape, /dev/rmt/1cbn
scsidev@4.2.0:QUANTUM DLT7000         296B|Tape, /dev/rmt/2cbn

Back to brandonhutchinson.com.
Last modified: 11/15/2004