Saturday, 2 July 2016

Rename device file for a tape drive

After the reboot or if the ioscan –fnC tape shows the below output:- 

[server1:/opt/atdd/bin]# ioscan -fnC tape
Class     I  H/W Path        Driver   S/W State   H/W Type     Description
===============================================================
tape      0  0/5/1/0.9.12.0.0.0.1  atdd     CLAIMED     DEVICE       IBM     ULTRIUM-TD2
                            /dev/rmt/0m             /dev/rmt/0mnr           /dev/rmt/c22t0d1BESTnb  /dev/rmt/s0mnb
                            /dev/rmt/0mb            /dev/rmt/c22t0d1BEST    /dev/rmt/s0m
                            /dev/rmt/0mn            /dev/rmt/c22t0d1BESTb   /dev/rmt/s0mb
                            /dev/rmt/0mnb           /dev/rmt/c22t0d1BESTn   /dev/rmt/s0mn
------------------------------------------------------------------------------------------------------------
So to change from 0mn to 1mn check with below commands:-

[server1:/opt/atdd/bin]# /opt/atdd/bin/atdd_mksf –h ---à For Help

[server1:/opt/atdd/bin]# /opt/atdd/bin/atdd_mksf –c -à The command for listing the commands for               creating the special files as shown below.

mknod /dev/rmt/atdd.dbg c 118 0xFFFFFd

mknod /dev/rmt/atdd.cfg c 118 0xFFFFFc

rm -f /dev/rmt/atdd.ctrl
mknod /dev/rmt/atdd.ctrl c 118 0xFFFFFa

mknod /dev/rmt/0m c 118 0x160100

mknod /dev/rmt/0mb c 118 0x160180

mknod /dev/rmt/0mn c 118 0x160140

mknod /dev/rmt/0mnb c 118 0x1601c0

mknod /dev/rmt/0mnr c 118 0x16014b

rm -f /dev/rmt/c22t0d1BEST
mknod /dev/rmt/c22t0d1BEST c 118 0x160100

rm -f /dev/rmt/c22t0d1BESTb
mknod /dev/rmt/c22t0d1BESTb c 118 0x160180

rm -f /dev/rmt/c22t0d1BESTn
mknod /dev/rmt/c22t0d1BESTn c 118 0x160140

rm -f /dev/rmt/c22t0d1BESTnb
mknod /dev/rmt/c22t0d1BESTnb c 118 0x1601c0


chmod 666   /dev/rmt/atdd.dbg /dev/rmt/atdd.cfg /dev/rmt/atdd.ctrl /dev/rmt/0m /dev/rmt/0mb /dev/rmt/0mn /dev/rmt/0mnb /dev/rmt/0mnr /dev/rmt/c22t0d1BEST /dev/rmt/c22t0d1BESTb /dev/rmt/c22t0d1BESTn /dev/rmt/c22t0d1BESTnb

chown bin:bin   /dev/rmt/atdd.dbg /dev/rmt/atdd.cfg /dev/rmt/atdd.ctrl /dev/rmt/0m /dev/rmt/0mb /dev/rmt/0mn /dev/rmt/0mnb /dev/rmt/0mnr /dev/rmt/c22t0d1BEST /dev/rmt/c22t0d1BESTb /dev/rmt/c22t0d1BESTn /dev/rmt/c22t0d1BESTnb

So to change from 0mn to 1mn manually create the device file for the tape drive:-

[server1]#mknod /dev/rmt/atdd.dbg c 118 0xFFFFFd

[server1]#mknod /dev/rmt/atdd.cfg c 118 0xFFFFFc

[server1]#rm -f /dev/rmt/atdd.ctrl

[server1]#mknod /dev/rmt/atdd.ctrl c 118 0xFFFFFa

[server1]#mknod /dev/rmt/1m c 118 0x160100

[server1]#mknod /dev/rmt/1mb c 118 0x160180

[server1]#mknod /dev/rmt/1mn c 118 0x160140

[server1]#mknod /dev/rmt/1mnb c 118 0x1601c0

[server1]#mknod /dev/rmt/1mnr c 118 0x16014b

[server1]#rm -f /dev/rmt/c22t0d1BEST

[server1]#mknod /dev/rmt/c22t0d1BEST c 118 0x160100

[server1]#rm -f /dev/rmt/c22t0d1BESTb

[server1]#mknod /dev/rmt/c22t0d1BESTb c 118 0x160180

[server1]#rm -f /dev/rmt/c22t0d1BESTn

[server1]#mknod /dev/rmt/c22t0d1BESTn c 118 0x160140

[server1]#rm -f /dev/rmt/c22t0d1BESTnb

[server1]#mknod /dev/rmt/c22t0d1BESTnb c 118 0x1601c0

Then Change the permission and owership of the newly created device files as mentioned below.

[server1]#chmod 666   /dev/rmt/atdd.dbg /dev/rmt/atdd.cfg /dev/rmt/atdd.ctrl /dev/rmt/1m /dev/rmt/1mb /dev/rmt/1mn /dev/rmt/1mnb /dev/rmt/1mnr /dev/rmt/c22t0d1BEST /dev/rmt/c22t0d1BESTb /dev/rmt/c22t0d1BESTn /dev/rmt/c22t0d1BESTnb

[server1]#chown bin:bin   /dev/rmt/atdd.dbg /dev/rmt/atdd.cfg /dev/rmt/atdd.ctrl /dev/rmt/1m /dev/rmt/1mb /dev/rmt/1mn /dev/rmt/1mnb /dev/rmt/1mnr /dev/rmt/c22t0d1BEST /dev/rmt/c22t0d1BESTb /dev/rmt/c22t0d1BESTn /dev/rmt/c22t0d1BESTnb

Then Check with ioscan as shown below after the changes:-

[server1:/opt/atdd/bin]# ioscan -fnC tape

Class     I  H/W Path        Driver   S/W State   H/W Type     Description
===========================================================================
tape      0  0/5/1/0.9.12.0.0.0.1  atdd     CLAIMED     DEVICE       IBM     ULTRIUM-TD2
                            /dev/rmt/1m             /dev/rmt/1mnr           /dev/rmt/c22t0d1BESTnb  /dev/rmt/s0mnb
                            /dev/rmt/1mb            /dev/rmt/c22t0d1BEST    /dev/rmt/s0m
                            /dev/rmt/1mn            /dev/rmt/c22t0d1BESTb   /dev/rmt/s0mb
                            /dev/rmt/1mnb           /dev/rmt/c22t0d1BESTn   /dev/rmt/s0mn

[server1:/root]#

No comments:

Post a Comment

Using capture groups in grep in Linux

Introduction Let me start by saying that this article isn't about capture groups in grep per se. What we are going to do here with gr...