Am 18.10.2015 um 15:50 schrieb Josh Grosse: > On Sun, Oct 18, 2015 at 01:08:48PM +0200, Paolo Aglialoro wrote: > >> ...Still cannot understand why some of you have adviced to put /dev on >> ramdisk: isn't MAKEDEV just run at install time and then only manually? >> From what emerged in the discussion it looks that, besides /home, /var is >> the only place where system makes its usual writes. > > The "some of you" was me, if I recall the complete discussion thread. :) > > While it's true MAKEDEV needs to create the device special files, the > device special files that are stored there need to be writeable. > > Here's one key example: > > You mount(8) a device special file when you mount a filesystem. > All write operations to that mounted filesystem are directed through > the device special file. >
No. As far as I understand it: The type (char or block), the major and minor number of the device special file and its name are means to activate the corresponding device handler ("driver") in the kernel and the bytes are sent to the device specified by the file. A simple test: If your /dev filesystem resides on wd0a and you write from the network to a mounted filesystem on a second disc, e.g. /dev/wd1a on /mnt and you watch this with iostat you will see almost no activity on wd0. To quote from "D.M. Ritchie and K. Thompson: ``The UNIX Time-Sharing System'' Communications of the ACM, Vol. 17, No. 7, July 1974.": "Special files constitute the most unusual feature of the UNIX filesystem. Each supported I/O device is associated with at least one such file. Special files are read and written just like ordinary disk files, but requests to read or write result in activation of the associated device. An entry for each special file resides in directory /dev, although a link may be made to one of these files just as it may to an ordinary file. Thus, for example, to write on a magnetic tape one may write on the file /dev/mt. Special files exist for each communication line, each disk, each tape drive, and for physical main memory. Of course, the active disks and the memory special files are protected from indiscriminate access. There is a threefold advantage in treating I/O devices this way: file and device I/O are as similar as possible; file and device names have the same syntax and meaning, so that a program expecting a file name as a parameter can be passed a device name; finally, special files are subject to the same protection mechanism as regular files." So I see no harm in /dev residing on the flash device. > ---- > > While you won't run MAKEDEV while the system is up and running, > take a look at the MAKEDEV(8) man page. You'll see a lot of device > special files that will need to be writeable. > Yes, but this is an _attribute_ of the device file that is used by the kernel and the device handler. Nothing gets written to a device file in the sense bytes are written to an ordinary file in a fileystem (e.g., /tmp/test). HTH rru