Operating System - HP-UX
1834181 Members
2584 Online
110064 Solutions
New Discussion

Re: Quick, easy and safe way to remove invalid device files?

 
SOLVED
Go to solution
Dave Hutton
Honored Contributor

Quick, easy and safe way to remove invalid device files?

Hi all,

Due to a misconfiguration of my new tape library, my tape library was presented to all my hpux servers on our SAN. To compound my problem, I also had it misconfigured so it presented multiple luns of the same device. I have probably 15 unix servers that now have a bunch of invalid device files in my ioscan (which I attached from one of my systems, I'm scared to look at my other servers).

Would it be safe to do create a script that did something in this line:
ioscan -fn
grepping for NO_HW
and then rmsf -H the hardware path that was parsed out?
I'm guessing the safest would be by hand making sure I don't remove a device file that I need.
I do have XP128 disks hanging off the same chain, so I really have to be careful.

Any suggestions? What a mess. =(

Dave
9 REPLIES 9
Robert Binkhorst
Trusted Contributor

Re: Quick, easy and safe way to remove invalid device files?

Hi Dave,

What a bummer! Anyway, I assume you've tried insf -e?? Does that leave the faulty ones on the system or does it remove them as well?

Let us know,

Good luck!

Robert
linux: the choice of a GNU generation
Juan Manuel Naranjo A.
Frequent Advisor

Re: Quick, easy and safe way to remove invalid device files?

To see wich Invalid Devices you have run:
- ioscan -kf
- ioscan -u

Se the diferences

Remove invalid devices with rmsf
Kent Ostby
Honored Contributor

Re: Quick, easy and safe way to remove invalid device files?

Dave --

I would make sure that you look over the rmsf's before you kick off that part of the script to see if they "make sense".

In other words, I would expect you to see a whole line of devices that have very similar device IDs and those would be safe to remove.

If you get something that is outside that range, then you might want to consider doing more checking on that one.

Best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
RAC_1
Honored Contributor

Re: Quick, easy and safe way to remove invalid device files?

doinf ioscan -fnCtape would be better. But you are OK, even if you do not remove it. Every time you boot machine, insf is executed. If youreally want to remove them, then you can just get the list of device files you want to remove and then do rmsf on them.

Anil
There is no substitute to HARDWORK
Patrick Wallek
Honored Contributor

Re: Quick, easy and safe way to remove invalid device files?

I don't know how many devices and systems you are talking about but I would be way more comfortable doing this by hand.

rmsf is the way to go here.
Dave Hutton
Honored Contributor

Re: Quick, easy and safe way to remove invalid device files?

I'll assign points in a bit.

I think I'm talking 10-13 servers and 98 devices:
tortola:root /root # ioscan -fun | grep NO_HW | wc -l
98

I'm kind of suprised that they have the device files since I figured they would of only been created during bootup or if someone does insf -e. But thats another deal all together.

I'm 95% sure I have my tape library now so it isn't trying to discover everything on my SAN. So if I can remove these files and some day get a reboot I shouldn't have it repopulate my device files again after being rediscovered. But in case it does, I'm not sure if I want to go out to each server again after a reboot and have the same thing happen.

Dave

Dave Hutton
Honored Contributor

Re: Quick, easy and safe way to remove invalid device files?

Robert: rmsf -e I think would try to re-add all the devices that it sees. So I'm guessing it would leave the faulty ones too.

Juan: I tried those two commands, it maybe an alternative to my grepping for NO_HW.

Kent: Good idea, about checking what my NO_HW grep would look like in case something that I don't want to sneak in, sneaks in.

RAC: You confirm what I was thinking. Ctape is an idea, one server though has some legit tape drives on it. Theres also fnCctl and fnCautoch that I would have to do also. The fnCctl would be a bit scarey also to do being the controlling XP128 disks use the same type of device.

So far I'm leaning to doing them by hand. =/

Dave
Tim Sanko
Trusted Contributor
Solution

Re: Quick, easy and safe way to remove invalid device files?

Dave,

We had some issues with our install process for veritas, and had bad drives etc. It became necessary to find the /dev/rmt/* and just delete them and the indexing to keep the controller number under 256.

If you get a controller number over 255 the machine acts as though it thinks the tape is a malfunctioning tape drive.

The real key for long term success is to clean up the devices.

here is a procedure

1) Make maps of volume groups just in case. Yes, everything should be put
in / (root).
# strings /etc/lvmtab > /lvmtab.out
# vgexport -p -m /vxXX.map vgXX # For every volume group

2) Make a file with currently used instance numbers.
# ioscan -kf | grep -e ^tape -e ^lan -e ^ext_bus -e ^tty | grep CLAIMED | awk '{printf "%s %s %s\n",$3,$1,$2}' > infile

3) Edit out any lines with instance number greater than 255.

4) Test the 'infile' before rebooting. See ioinit(1M) for more details.
# ioinit -f /infile

Continue to remove entries that cause errors until the only message you get
is "line ignored." Third party drivers have not been tested, and the procedure
may not work for them.

5) Save a copy of the ioconfig file. Be sure to use cp(1) and not mv(1).
# cp /etc/ioconfig /etc/ioconfig.sav
# cp /stand/ioconfig /stand/ioconfig.sav

6) Remove the ioconfig files.
# rm /etc/ioconfig /stand/ioconfig

7) Shutdown -r but boot into LVM maintenance mode.
# shutdown -r 0
BCH> hpux -lm
Or, on a V-Class system:
Command> bo -lm

8) When the following message comes up, type the following ioinit commands
exactly as shown:
/etc/ioconfig is missing. Restore it from backup or
invoke /sbin/ioinit -c to recreate it from the kernel.
When finished enter ^D to continue boot.
(in ioinitrc)# /sbin/ioinit -c
(in ioinitrc)# /sbin/ioinit -f /infile -r

Good luck,

Tim
Dave Hutton
Honored Contributor

Re: Quick, easy and safe way to remove invalid device files?

Tim, just looking at my /dev/rmt/* files it looks like I'm clean there when it comes to controllers being below 255. It looks like the highest number that was allocated was c53/t*/d*.

I'm going to think about this for abit.