1847253 Members
4256 Online
110263 Solutions
New Discussion

mksf versus insf

 
Hill_1
Frequent Contributor

mksf versus insf

hi people,
i'm not sure about when to use the mksf command and when to use the insf as both are creating the device file.
Unix
8 REPLIES 8
Michael Tully
Honored Contributor

Re: mksf versus insf

Hi,

Generally 'insf' can be used to generate or
re-generate device files that may have
been accidently deleted. 'insf -e' from
/dev will create all devices that are
recognised by the system kernel.
'mksf' on the other hand can be
used mainly to create a single device file
from say a hardware address and class
e.g.
# mksf -d stape -H 0/0/1/0.3.0 will create
tape drive devices as
/dev/rmt/?m
/dev/rmt/?mn
/dev/rmt/?mb
/dev/rmt/?mnb
/dev/rmt/c0t3dBEST

One item to note is that 'insf' should not be
run in multi-user mode as stated at the end
of the man page, altough I've never had any
problem with using it whether in single or multi-user state.

HTH
-Michael
Anyone for a Mutiny ?
linuxfan
Honored Contributor

Re: mksf versus insf

Hi June,

First of all insf and mksf call mksf. When you run /usr/sbin/insf or /usr/sbin/mksf it calls /sbin/mksf.

One of the major advantages of insf is, it has an option -e which lets you reinstall the special files for psuedo-drivers and existing devices.

For more information look at man pages for insf and mksf.
Actually like Mike said, there is a WARNING for insf, that it should be run in single-user mode, but i never had a problem running in multi-user mode.

-HTH
I am RU
They think they know but don't. At least I know I don't know - Socrates
Erik Tong
Advisor

Re: mksf versus insf

Another note for insf:
When running "insf -e", all device files are recreated even if they already exist.

So, if you are running an application that requires a specific permissions/owner/group on a device file your application will break. This is because on recreation of the device file all the defaults for permissions/owner/group are applied.
Hill_1
Frequent Contributor

Re: mksf versus insf

Anyway if i configure a device for eg. tape drive without rebot the system, can i run mksf or insf to create the device file?
Unix
Bill Hassell
Honored Contributor

Re: mksf versus insf

Connecting any shared bus device (like SCSI) is a great way to watch the system crash. Unless the tape is being connected to a dedicated SCSI card, the 5 dozen or so pins will make connection randomly and usually confuses the driver bigtime.

insf is the command used at bootup to create device files for new peripherals. insf installs a standard set of device files while mksf has several options to for additional device files. insf is easier to use:

insf -H

insf figures out the driver and the associated device files.


Bill Hassell, sysadmin
linuxfan
Honored Contributor

Re: mksf versus insf

Hi June,

First of all you can try
/usr/sbin/ioscan -fnC tape

(This would return if the tape drive is already configured and the device files are existing.

If not you could create the device files using mksf
eg:
mksf -d stape -H 10/12/5.0.0
(This would create the device file for the tape drive at the hardware path 10/12/5.0.0, which happens to be the default path for K-Class system. Notice the stape here is to indicate the driver for the tape drive. To list the device drivers on your system, you can use lsdev)

If its an L/N class, the path would be 0/0/1/0.3.0 ( but check the path on your system)

-HTH
I am RU
They think they know but don't. At least I know I don't know - Socrates
Carlos Fernandez Riera
Honored Contributor

Re: mksf versus insf

The procedure to add a hot-plug tape or disk

is:

ioscan -f # scan hardware
insf -e -H harward_path # create standard special files for that hardware found.

mkfs allows you create 'special' special files as /dev/zero or /dev/async or special files for tapes


unsupported
Sundar_7
Honored Contributor

Re: mksf versus insf

Hi there,

U will use insf ..say when ur hot swap hard
disk is failed and U replaced or when U want to create more pty's or U have removed some of
the special device file and want the system to automatically build for U..

U will use mksf to ""Customize"" the device
file for U when the driver is already there in the kernel..

So U want to create a non-rewinding tape device file or U might want to enable software compression or density options..

In that case U are going to use mksf..

Hope this clears U..

Sundar
Learn What to do ,How to do and more importantly When to do ?