4

Which file in /proc gets read by the kernel during the boot up process? This was a question on my LPIC 101 test that I think I might have answered wrong. I searched on google and some other places but wasn't able to find an answer. Hoping one of you could provide. Thanks!

0
7

My question is, which file in /proc gets read by the kernel during the boot up process? This was a question on my LPIC 101 test...

Sounds like a trick question. The files in /proc aren't real files on disk (this is why they have a size of 0) and the nodes don't exist until the kernel mounts a procfs file system there and populates it.

Procfs and sysfs files are kernel interfaces. When you read a file in /proc, you are asking the kernel for information and it will supply it. That information is not stored in that file -- nothing is. When you write to a file in /proc, you are sending the kernel information, but again, the information will not be stored in that file.

This is possible because the kernel is the gatekeeper to file access generally. All file access involves system calls, i.e., they must pass through the kernel.

So I would say the answer here is that it does not read any files in /proc at boot or at any other time. This would be like dialing your own phone number.

1
  • True, it does sound like a trick question. It may have been the way I worded it :\ because it wasn't a multiple choice question or anything. There was a text input to type in a specific filename
    – th3v0id
    Apr 27 '15 at 16:57
0

I think the answer they were looking for is /proc/cmdline

"This file shows the parameters passed to the kernel at the time it is started. A sample /proc/cmdline file looks like the following: ro root=/dev/VolGroup00/LogVol00 rhgb quiet 3 This tells us that the kernel is mounted read-only (signified by (ro)), located on the first logical volume (LogVol00) of the first volume group (/dev/VolGroup00). LogVol00 is the equivalent of a disk partition in a non-LVM system (Logical Volume Management), just as /dev/VolGroup00 is similar in concept to /dev/hda1, but much more extensible. " -redhat

1
  • 1
    But the kernel does not need to read /proc/cmdline to know the boot parameters, as the bootloader will hand those parameters to the kernel directly when turning over control to the kernel (when /proc is not even mounted yet). In fact, it is the userspace boot scripts and/or the init process which will read /proc/cmdline so that they too may know the boot parameters the kernel received. The kernel will respond to the userspace read request by giving out the parameter information; but from the kernel's viewpoint, that's outputting the information to the userspace.
    – telcoM
    Oct 27 '20 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.