What is the difference between procfs and sysfs? Why are they made as file systems? As I understand it, proc is just something to store the immediate info regarding the processes running in the system.

link|improve this question

79% accept rate
feedback

2 Answers

up vote 6 down vote accepted

What is the difference between procfs and sysfs?

proc is the old one, it is more or less without rules and structure. And at some point it was decided that proc was a little to chaotic and a new way was needed.

Then sysfs was created, and the new stuff that was added was put into sysfs like device information.

So in some sense they do the same, but sysfs is a little bit more structured.

Why are they made as file systems?

Unix philosophy tells us that everything is a file, therefore it was created so it behaves as files.

As I understand it, proc is just something to store the immediate info regarding the processes running in the system.

Those parts has always been there and they will probably never move into sysfs.

But there is more old stuff that you can find in proc, that has not been moved.

link|improve this answer
Thanks for the answer.. But why are cpuinfo and meminfo like things still maintained in procfs? Why cant they be moved to sysfs? – Sen Dec 16 '10 at 10:20
2  
I guess they put new stuff in sysfs, and just leave the old as it is to keep some level of backwards compability. There is a lot of stuff that depends on those things in proc... – Johan Dec 16 '10 at 14:11
feedback

sysfs is the Virtual Filesystem created during the 2.6 Kernel release cycle to show device information as procfs did not do this type of information that well.

Memory etc has not been ported to sysfs as it was never intended to show that type of information so it is unlikely it will be ported at all.

link|improve this answer
Memory etc has not been ported to sysfs What do you mean by porting? And why was it not intended to show that type of information? Could you please explain that to me. – Sen Dec 16 '10 at 11:56
By ported i meant moved which was an answer to your question of if Memory etc will be moved to sysfs. And it was only ever intended to show device information as that was the thing that procfs did not do well, procfs is still excellent for other types of information. – kemra102 Dec 16 '10 at 13:31
feedback

Your Answer

 
or
required, but never shown

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