2

My new kernel has CONFIG_DEVTMPFS enabled, and thus my /dev is mounted as devtmpfs. My old kernel was not using CONFIG_DEVTMPFS, and /dev used to be mounted as plain tmpfs.

Now I have noticed, the size of /dev/ is ridiculously large: 8GB, which is half of my RAM:

df | grep devtmpfs
devtmpfs         devtmpfs  7.8G     0  7.8G   0% /dev

In the past, when my /dev was mounted as tmpfs, the size used to be 10MB

df | grep tmpfs
tmpfs                 tmpfs        10M     0   10M   0% /dev

Seems to me, 10MB is more than enough for /dev. Why does /dev/ allocate 50% of my RAM by default? Where can I change this ?

3

No, the size of /dev is not 8GB. That's the maximum size. The size that it actually uses in memory is proportional to the used size; memory is allocated as needed.

Linux doesn't have man pages for all filesystems, in which case you should look in the mount man page. But tmpfs does have a man page and it does mention this.

  • yes I know, but it could "potentially" grow to up to 8GB. Using 50% of RAM as default size for '/dev' makes absolutely no sense whatsoever. I see no legitimate reason to allow /dev/ bigger than 10MB. So why should I use default value of 8GB ? – Martin Vegter Dec 25 '15 at 18:09
  • @MartinVegter Well it will only use as much as it needs... That default is there because there needs to be one. – Paul Stelian Aug 13 at 21:49

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.