“Linus put his device files in /dev, and so should you.”
—fophillips in #lugradio, from The Linux Kernel Module Programming Guide
I almost responded to that by saying “device files would be pretty useless in
anywhere but /dev on my boxen, because they’re not allowed anywhere else” but
that’s not strictly true. My rootfs, because that’s where /dev
lives, is
mounted with the ‘dev’ option (or rather ‘defaults’ which includes ‘dev’).
I then continued with “since my /dev is actually a tmpfs (udev), could / be mounted with nodev?”
The answer turns out to be “yes”, at least with some basic testing. I first
tried remounting / with the ‘nodev’ option, accessing devices, and creating
device files. Things seemed to happen normally, so I rebooted with a modified
fstab
(5), and things seem to be working fine.
Are there any pitfalls I’m missing here?