Operating System - HP-UX
1834586 Members
3571 Online
110069 Solutions
New Discussion

wrong "ioscan" file in "/" directory

 
SOLVED
Go to solution
Vipin Singhal
Super Advisor

wrong "ioscan" file in "/" directory

Hi,
These are the details of commands:
# cd /
# ls -l ios*
-rw-rw-rw- 1 root sys 0 May 12 2005 iosca
# ls -l ioscan.*
-rw-rw-rw- 1 root sys 0 May 12 2005 iosca

I think -the file "ioscan." has invisible characters at the end of the name.

Please suggest what to do?
Thanks
Vipin

11 REPLIES 11
Patrick Wallek
Honored Contributor

Re: wrong "ioscan" file in "/" directory

# rm -i /iosc*

Answer yes to whatever file is appropriate. There are NO files in the / directory that ioscan uses. It looks like that was a mistake made by someone on May 12, 2005.

A. Clay Stephenson
Acclaimed Contributor

Re: wrong "ioscan" file in "/" directory

Use the -b option of ls to print the octal equivalent of any non-printable characters.

ls -b i*

You can use the interactive version of rm to remove any files.

e.g.
rm -r i*
answer 'y' for each matching filename you wish to delete and 'n' for those you do not want to delete.

Man ls, rm for details.

If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: wrong "ioscan" file in "/" directory

Hi Vipin:

One way to expose unprintable characters is to use the '-b' switch of 'ls':

# ls -lb los*

The unprintable characters will now be written in \ddd octal notation.

To insure that you remove the correct file, you can get it's inode with :

# ls -li los*
# cd
# find . -xdev -inum -exec rm -i {} \;

Note the '-xdev' so as not to cross mountpoints. Inode numbers are only unique within a filesystem. Note too the '-i' with the remove command to make sure you get one last chance to verify what was found.

Regards!

...JRF...
Vipin Singhal
Super Advisor

Re: wrong "ioscan" file in "/" directory

This is the output:
# ls -b io*
ioscan.\177\177\003\030\003


But on the another server:
# ls -l io*
-rw-rw-rw- 1 root sys 2032 May 12 2005 ioscan.out
# ls -b io*
ioscan.out

can I make it visible this file of 1st server , I am not prefering to delete this file because the same file also exists on another server.
Please suggest how to make it visible or what to do?
Thanks
Vipin
Patrick Wallek
Honored Contributor

Re: wrong "ioscan" file in "/" directory

I'm not sure what you hope to accomplish by renaming the file.

The file is empty (0 bytes) and is NOT used by ioscan for anything.

The easiest thing may be to look at the file on the 2nd machine, see what information is there and then run 'ioscan > /ioscan.out' on the first machine to recreate the file.

If there is full device file information, you may need to use 'ioscan -kfn > /ioscan.out'.

There really isn't going to be an easy way to rename that file.
A. Clay Stephenson
Acclaimed Contributor

Re: wrong "ioscan" file in "/" directory

Because all of your control characters are at the end and only 1 file matches the pattern, it makes it rather easy:

mv ioscan.* ioscan.out
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: wrong "ioscan" file in "/" directory

Hi (again) Vipin:

I'm not sure what your second question is asking.

The real 'ioscan' command lives in /sbin as /sbin/ioscan. There is a symbolic link to it in /usr as /usr/sbin/ioscan.

You seem to have a file named "ioscan.out". Where or not that exists on different servers is immaterial. You can do anything you want with it.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: wrong "ioscan" file in "/" directory

Hello again Vipin,

Thoug some linux admins flagrantly violate this rule, I agree with Bill Hassell's take on the root fs.

No real files belong there at all.

I have root home equal to /root/ and keep a few tools I need there in case I'm booting to single user mode, but nothing else.

root fs is for other filesystems to be mounted in subfolders and for system configuration like /etc

In my opinion, borrowed though it is, nothing else belongs there.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vipin Singhal
Super Advisor

Re: wrong "ioscan" file in "/" directory

I have done :
# mv ios* ioscan.out
# ls -l | grep io*
-rw-rw-rw- 1 root sys 0 May 12 2005 ioscan.out

this is an empty file.

But on the another server--
# ls -l io*
-rw-rw-rw- 1 root sys 2032 May 12 2005 ioscan.out

# more ioscan.out
Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
disk 0 0/0/0/3/0.6.0 sdisk CLAIMED DEVICE HP 73.4GST373453LC
/dev/dsk/c0t6d0 /dev/rdsk/c0t6d0
/dev/dsk/c0t6d0s1 /dev/rdsk/c0t6d0s1
/dev/dsk/c0t6d0s2 /dev/rdsk/c0t6d0s2
/dev/dsk/c0t6d0s3 /dev/rdsk/c0t6d0s3
disk 7 0/0/10/1/0.1.0.0.0.0.0 sdisk CLAIMED DEVICE DGC CX500WDR5
/dev/dsk/c12t0d0 /dev/rdsk/c12t0d0
disk 6 0/0/10/1/0.1.0.0.0.0.1 sdisk CLAIMED DEVICE DGC CX500WDR5
/dev/dsk/c12t0d1 /dev/rdsk/c12t0d1
disk 3 0/0/10/1/0.1.31.0.0.0.0 sdisk CLAIMED DEVICE DGC CX500WDR5
/dev/dsk/c13t0d0 /dev/rdsk/c13t0d0
disk 8 0/0/10/1/0.1.31.0.0.0.1 sdisk CLAIMED DEVICE DGC CX500WDR5
/dev/dsk/c13t0d1 /dev/rdsk/c13t0d1
disk 2 1/0/0/3/0.6.0 sdisk CLAIMED DEVICE HP 73.4GST373453LC
/dev/dsk/c4t6d0 /dev/rdsk/c4t6d0
disk 1 1/0/0/3/1.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 305
/dev/dsk/c5t2d0 /dev/rdsk/c5t2d0
disk 4 1/0/8/1/0.1.0.0.0.0.0 sdisk CLAIMED DEVICE DGC CX500WDR5
/dev/dsk/c14t0d0 /dev/rdsk/c14t0d0
disk 9 1/0/8/1/0.1.0.0.0.0.1 sdisk CLAIMED DEVICE DGC CX500WDR5
/dev/dsk/c14t0d1 /dev/rdsk/c14t0d1
disk 5 1/0/8/1/0.1.31.0.0.0.0 sdisk CLAIMED DEVICE DGC CX500WDR5
/dev/dsk/c15t0d0 /dev/rdsk/c15t0d0
disk 10 1/0/8/1/0.1.31.0.0.0.1 sdisk CLAIMED DEVICE DGC CX500WDR5
/dev/dsk/c15t0d1 /dev/rdsk/c15t0d1

This file contains the details of the disk from 0 to 10.

I was trying to see the output of #ioscan -fnC disk, but its not showing the same details which exists in ioscan.out file.
this command shows the details of every HDD but not of HDD (0 to 10)


so on the first server , from where i will get the details of HDD (0 to 10) to ioscan.out file?

Thanks
Vipin
Patrick Wallek
Honored Contributor
Solution

Re: wrong "ioscan" file in "/" directory

If 'ioscan -fnC disk' does not show those drives, then there is a good chance that they are no longer attached to the server.

Are you sure those disks are still connected to the sever? Maybe they were disconnected at some point and are no longer in use.

Vipin Singhal
Super Advisor

Re: wrong "ioscan" file in "/" directory

Thanks everybody
Vipin