Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mknod(1m) [sunos man page]

mknod(1M)						  System Administration Commands						 mknod(1M)

NAME
mknod - make a special file SYNOPSIS
mknod name b major minor mknod name c major minor mknod name p DESCRIPTION
mknod makes a directory entry for a special file. OPTIONS
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). OPERANDS
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. USAGE
See largefile(5) for the description of the behavior of mknod when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). ATTRIBUTES
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 SYNOPSIS
/usr/sbin/mknod special_file [ b major_device# minor_device# | c major_device# minor_device#] /usr/sbin/mknod filename p DESCRIPTION
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. FLAGS
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) EXAMPLES
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. FILES
Specifies the command path Specifies the system device numbers specification file delim off mknod(8)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mknod

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)
Discussion started by: bemeeks
3 Replies

2. Solaris

major & minor number

Hi Can anyone tell me what is major number and minor number in the mknod command. Also what these numbers mean. I have gone through the man pages but still I couldn't understand. Regards (3 Replies)
Discussion started by: RajaRC
3 Replies

3. UNIX for Dummies Questions & Answers

How to reuse same major number

Hi, 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)
Discussion started by: Agnello
0 Replies

4. Programming

mknod system call to clone /dev/null

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)
Discussion started by: nathan
2 Replies

5. Shell Programming and Scripting

Hex Conversion

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)
Discussion started by: insania
2 Replies

6. HP-UX

recreating /dev/null

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)
Discussion started by: pblake1
4 Replies

7. HP-UX

Mknod

Hey guys i dont quite understand mknod, can anyone explain it to me and what is its purpose in LVM. (4 Replies)
Discussion started by: sbn
4 Replies

8. AIX

how do I change major-minor numbers of disk devices

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)
Discussion started by: zxmaus
2 Replies

9. AIX

vg

hi friends what is the purpose of major no while creating vg (1 Reply)
Discussion started by: senmak
1 Replies

10. AIX

major no

hi what is meant by major no in vg what is meant by concurrent vg i cant understand these two things (3 Replies)
Discussion started by: senmak
3 Replies

11. UNIX for Dummies Questions & Answers

Which kind of UNIX to major investment banks use?

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)
Discussion started by: rubrubber
5 Replies

12. AIX

VG major number in HACMP

HI All, 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)
Discussion started by: to_bsr
3 Replies

13. UNIX for Dummies Questions & Answers

Info regarding mknod -p

Hello All, 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)
Discussion started by: Bibhudatta
3 Replies

14. AIX

What is mknod file present in /etc folder in AIX server used for ?

Hi Guys, 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)
Discussion started by: DBTuner
2 Replies

15. High Performance Computing

How can an EE major looking to get into HPC bolster their CS foundation?

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)
Discussion started by: Harmonic
2 Replies