mknod(1M) System Administration Commands mknod(1M)NAME
mknod - make a special file
mknod name b major minor
mknod name c major minor
mknod name p
mknod makes a directory entry for a special file.
The following options are supported:
b Create a block-type special file.
c Create a character-type special file.
p Create a FIFO (named pipe).
The following operands are supported:
major The major device number.
minor The minor device number; can be either decimal or octal. The assignment of major device numbers is specific to each system. You
must be the super-user to use this form of the command.
name A special file to be created.
See largefile(5) for the description of the behavior of mknod when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes).
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWcsu |
SEE ALSO ftp(1), in.ftpd(1M), mknod(2), symlink(2), attributes(5), largefile(5)NOTES
If mknod(2) is used to create a device, the major and minor device numbers are always interpreted by the kernel running on that machine.
With the advent of physical device naming, it would be preferable to create a symbolic link to the physical name of the device (in the
/devices subtree) rather than using mknod.
SunOS 5.10 16 Sep 1996 mknod(1M)
Check Out this Related Man Page
mknod(8) System Manager's Manual mknod(8)NAME
mknod - Creates a special file
/usr/sbin/mknod special_file [ b major_device# minor_device# | c major_device# minor_device#]
/usr/sbin/mknod filename p
The mknod command makes a directory entry. The first argument is the name of the special device file. Select a name that is descriptive
of the device.
The mknod command has two forms. In the first form, the second argument is the b or c flag. The last two arguments are numbers specifying
the major_device, which helps the operating system find the device driver code, and the minor_device, the unit drive, or line number, which
may be either decimal or octal.
The assignment of major device numbers is specific to each system. You can determine the device numbers by examining the conf.c system
source file. If you change the contents of the conf.c file to add a device driver, you must rebuild the kernel.
In the second form of mknod, you use the p flag to create named pipes (FIFOs).
Only the superuser can create a character or device special file.
Indicates that the special file corresponds to a block-oriented device (disk or tape) Indicates that the special file corresponds to a
character-oriented device Creates named pipes (FIFOs)
To create the special file for a new drive, /dev/disk/dsk20, with a major device number of 1 and a minor device number of 2, enter: mknod
/dev/disk/dsk20 b 1 2 This command creates the special file, /dev/disk/dsk20, which is a block special file with major device number 1
and minor device number 2. To create a pipe named fifo, enter: mknod fifo p This command creates the pipe fifo, which is not necessarily
in the current directory.
Specifies the command path Specifies the system device numbers specification file delim off
Can someone please tell me what the command mknod does and what it's syntax is? I can't find it in my "Unix for dummies" book or "Unix in s nutshell". I found it in an existing script that I want to copy, but I want to understand what I am doing. The script is going to do a full export of an... (3 Replies)
I am working on device drivers.Once If register a device i'll get one major no. If i unregister and register again i'll get a different major no.What i have to do to get same major no. each time :( (0 Replies)
I'm trying to use the "mknod" call in C to create a clone of /dev/null. I am stumped as to the final parameter I should provide to "mknod()". I am supposed to give it a type dev_t, which specifies a major & minor number. I want to specify major 3, minor 1, but how can I do this?
dev_t seems to... (2 Replies)
I need to have my scripts import volume groups and mknod devices files. I have most of the script working but the device file needs to be in the format 0x??0000 (where the question marks are my HEX representations of the volume group number. I have the code below and the output it produces which... (2 Replies)
Something (I'm still trying to find out what) has clobbered our /dev/null and made it into an ordinary file. I know I need to recreate it with mknod, but I'm unsure what the major and minor device numbers should be - I know enough to know that they vary on different systems and I've seen 1 3, 2 2,... (4 Replies)
Good evening ...
does anyone of you know how to change major/minor numbers of disk devices ?
I had to migrate from raid1 to raid5 and this messed up my ASM cluster - I know which devices should have which IDs to match the content - but I have no idea how to change it.
Any help would be... (2 Replies)
Hi, I would like to know what kind of UNIX major investment banks tend to use? I want to try to get a job with one of these places. By major, I mean big companies like Citigroup, JP Morgan Chase, Morgan Stanley, etc. Thanks. (5 Replies)
I would like to know is it compulsory to keep major number of shared VG's on cluster nodes to be same..?
I have come across a situation where on one node major number of shared vg is the major number of altinst_rootvg on other node..how to overcome this situation..?
shan (3 Replies)
Friends i know mknod with -p option is used to create FIFO special file.:p
But i want to know some circumstance/scenario where these are used.:wall:
Actually i want to know where i can use it in real time.
Please advise.:) (3 Replies)
On my AIX server , I have this file "mknod" present in the /etc/ directory. When i try opening it , I dont find
any ascii characters. It shows some encryption/binary format which is not readable. Is it any executable ? what is the
purpose of having this file in etc folder? what if... (2 Replies)
Im a soph. EE major with an interest in applied mathematics looking to get into HPC and am looking for suggestions on where to start in terms of reading up on some CS subjects in order to get relatively rigorous understanding of whats really going on. For example im interested in parallel... (2 Replies)