1

I have an embedded Linux (vanilla, 3.3.8, i486, Vortex86dx) system that boots from an initramfs image.

I have an IDE Flash disk with two partitions at /dev/hda1 and /dev/hda2.

It has a static /dev directory.

When I boot up, the /dev/hda1 entry is no longer present. /dev/hda1 appears to have been deleted by the kernel(?).

I do not have this same problem if I boot my target from an NFS root filing system.

I use Buildroot to create the /dev directory via the device_table_dev.txt file. e.g.

# IDE Devices
/dev/hda    b   640 0   0   3   0   0   0   -
/dev/hda    b   640 0   0   3   1   1   1   4

I inspected the rootfs.tar.gz from Buildroot output/images. The /dev directory contains /dev/hda1:

brw-r-----  1 root root  3,   0 Jul  2 13:44 hda
brw-r-----  1 root root  3,   1 Jul  2 13:44 hda1
brw-r-----  1 root root  3,   2 Jul  2 13:44 hda2
brw-r-----  1 root root  3,   3 Jul  2 13:44 hda3
brw-r-----  1 root root  3,   4 Jul  2 13:44 hda4

My post-boot directory listing (done from within rcS) on the target looks like this:

brw-r-----   1 root   root    3,   0 Jul  2 12:44 hda
brw-r-----   1 root   root    3,   2 Jul  2 12:44 hda2
brw-r-----   1 root   root    3,   3 Jul  2 12:44 hda3
brw-r-----   1 root   root    3,   4 Jul  2 12:44 hda4

/dev/hda1 is missing.

If I run the Busybox utility "mdev -s", it restores/dev/hda1 on the target and it works normally. e.g. I can mount it

Has anyone ever seen this behaviour before?

Does the kernel delete entries from /dev?

Mr Stinky
  • 881
  • 2
  • 11
  • 23

2 Answers2

0

Maybe you should check the initial scripts (/etc/init.d/, /etc/inittab), to see whether it remounts the /dev/ file system. The remount could remove your /dev/ entries.

"mdev -s" triggered a cold plug event and re-created the entry for you.

Dien Nguyen
  • 2,019
  • 6
  • 30
  • 37
  • No other scripts touch `/dev`. `inittab` calls `rcS`, and the first thing that `rcS` does is `ls -al /dev`. Even if a remount removed my `/dev` entries, why would it _selectively_ remove only one of them? – Mr Stinky Jul 13 '12 at 08:55
0

If you use static device table, you should deactivate in kernel configuration: devtmpfs, mdev and udev.

evg
  • 1