Linux 2.6.26.5 embedded. I need manually mount the root file system from busybox shell (initramfs). Because this Linux kernel not use devtmpfs, I have to create the basic device nodes manually, use mknod (/dev/null
, /dev/zero
, dev/mtdblock
{0-10}, ttys
). I'm not sure about correct format for /dev/mtdblock
and ttys
. Should I create nodes for both /dev/mtdblock and /dev/mtd? The device creates 11 MTD partitions on nand0.
Where to find the major and minor numbers assigned for a devices?
The same question for ttys: what is correct mknod command for 5 /dev/tty
and 4 tty
- are they in different places?
mknod -m 666 tty c 4 0
mknod -m 666 /dev/tty c 5 0
Edit: partitions, devices and filesystems
# cat /proc/partitions
major minor #blocks name
31 0 384 mtdblock0
31 1 128 mtdblock1
31 2 20352 mtdblock2
31 3 7168 mtdblock3
31 4 18816 mtdblock4
31 5 2048 mtdblock5
31 6 1024 mtdblock6
31 7 512 mtdblock7
31 8 128 mtdblock8
31 9 512 mtdblock9
31 10 512 mtdblock10
# cat /proc/devices
Character devices:
1 mem
2 pty
3 ttyp
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
89 i2c
90 mtd
108 ppp
128 ptm
136 pts
153 spi
204 ttyJ
254 cordless
Block devices:
1 ramdisk
31 mtdblock
93 nftl
mknod /dev/mtdblock0 b 31 0
will create the mtdblock0 for you. Tricky question: what do you think, what could mean the "major" and "minor" columns in/proc/partitions
? :-)