Operating System - HP-UX
1832552 Members
5970 Online
110043 Solutions
New Discussion

Re: creat special file by using "insf"

 
SOLVED
Go to solution
emily_3
Frequent Advisor

creat special file by using "insf"

hello,

I want to creat special file for one harddisk, can anyone tell me how to use
"# insf" to creat /dev/rdsk/cxtxdx??
10 REPLIES 10
Michael Tully
Honored Contributor

Re: creat special file by using "insf"

Hi,

If the disk already is displayed in your ioscan output, the easiest way is to do this:

# cd /dev; insf -e

This will create all device files that have a hardware address and no corresponding device file.

For a particular device you can use 'mksf' -C' or 'insf -H'
See the man page for either of these, will show you the details.

HTH
Michael
Anyone for a Mutiny ?
Robert-Jan Goossens
Honored Contributor

Re: creat special file by using "insf"

Hi Emily,

Take a look at the pvcreate command.

# man pvcreate

Hope it helps,

Robert-Jan.
Leo Simon
Valued Contributor
Solution

Re: creat special file by using "insf"

The easy way to create hard disk device is using mknod command.
Example:
1.List all the hard disk device file using
ioscan -nfC disk
2.Go to /dev/rdsk/
3.list all the disk file using ll command
crw-r----- 1 bin sys 188 0x001000 Feb 18 09:14 c0t1d0
crw-r----- 1 bin sys 188 0x002000 Feb 18 09:15 c0t2d0
crw-r----- 1 bin sys 188 0x003000 Oct 25 2000 c0t3d0
crw-r----- 1 bin sys 188 0x004000 Feb 18 09:15 c0t4d0
crw-r----- 1 bin sys 188 0x005000 May 7 2001 c0t5d0
crw-r----- 1 root sys 188 0x006000 Mar 24 17:40 c0t6d0
4.If your hard disk is not listed in /dev/rdsk
the you can create using mknod command

# mknod c0t3d0 c 188 0x003000 ( This is an example ) for device address 3

Or the other way you can use insf command like below:
# cd /dev
# insf -e ( This will create all the missing device )

Hope this will help you

help each other with love
Balaji N
Honored Contributor

Re: creat special file by using "insf"

hi,

do an ioscan and find the specific hardware path.
then do an
insf -H

man insf for more info.
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
emily_3
Frequent Advisor

Re: creat special file by using "insf"


Thanks for your quickly reply, it's very helpful.

Hi Leo,

mknod c0t3d0 c 188 (major) 0x003000 (mimor)"
c0t3d0 is name,188 is major No., 0x003000 minor No.
Is there any command to find them?
Michael Tully
Honored Contributor

Re: creat special file by using "insf"

Once the device has been created, using 'insf' you can add it to an existing volume group using the 'pvcreate' command to tell the disk that it will be used as an LVM disk. From there you can add it to an existing volume group or to create a new one with it.
Anyone for a Mutiny ?
Frank Slootweg
Honored Contributor

Re: creat special file by using "insf"

Please do not use mknod(1M) to make device files. Use mksf(1M) or insf(1M) instead. That is why these commands (and rmsf(1M) and lssf(1M)) exist.

There *are* exceptions, but these are *specifically* documented in *official* HP documentation (for example vgcreate(1M), scsi_ctl(7), etc.).
Michael Craig
Advisor

Re: creat special file by using "insf"

After you see the disk in an ioscan, you should run:

#insf -h (hardware path)

This will create the device files for just that hardware path. I am a HP CE and I have run into problems when running the #insf -e as this creates special files for all devices.

Hope this helps!
emily_3
Frequent Advisor

Re: creat special file by using "insf"

Hi Craig,

Sometimes "# insf -H device-path" doesn't work. Don't know why?
Frank Slootweg
Honored Contributor

Re: creat special file by using "insf"

insf, i.e. also "insf -H ..." will not work if there are still devices known at the implied/given hardware path.

Note that the device file is *not* the only piece of information for a device. There is also the system definition of the device in ioconfig. See ioconfig(4) and ioinit(1M) for details.

If the device file is absent, but the system definition for the device still exists in ioinit, insf will not create new devices.

Therefor, if you remove a device file, you should *not* use the rm(1) command, but should use the rmsf(1M) command, *with* the "-a" option. For details, see rmsf(1M).