3

I run a very small Raspbian installation off a 1GB SD card. I discovered devtmpfs uses 20% of all space.

Output of df -h:

Filesystem      Size  Used Avail Use% Mounted on
rootfs          788M  690M   97M  88% /
/dev/root       788M  690M   97M  88% /
devtmpfs        212M     0  212M   0% /dev
tmpfs            44M  184K   44M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm
/dev/mmcblk0p1   50M   19M   32M  37% /boot

What is devtmpfs and how can I reduce its size?

  • Maybe you want to take a look to your output of "top"... devtmpfs just uses the amount of mem it needs for the moment not the amount of mem shown from output of "df". So maybe most of all everything is fine with this. – user28419 Mar 27 '15 at 10:56
2

tmpfs indicates a TeMPorary FileSystem. So the devtmpfs has partitioned off 212M of your RAM and not your SD Card.

devtmpfs is the mountpoint name for the /dev directory /dev is the location of special or device files. http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/dev.html

Reducing the size may have consequences I'm not aware of so proceed with caution. To reduce it, modify /etc/mtab and adjust the size= part of the devtmpfs entry

  • 3
    No, please NEVER ever edit /etc/mtab. That is generated based on /etc/fstab and keeps track of currently mounted filesystems. See <pre>man mount</pre> – der_do Mar 9 '15 at 18:35
  • 1
    Note that for tmpfs the size is a maximum size. It is not using 212mb, it's using (next to) 0mb. Thats because device files are nothing more than a name and a reference, there's no file data. So the only memory overhead is holding the file names / permissions etc in memory. – Philip Couling Jun 22 '17 at 12:40
1

The size for tmpfs is set in

/etc/default/tmpfs
You can use percentage-of-total-ram values there.

Please note, that providing too little space for /tmp might lead to unexpected results.

Resizing devtmpfs can be done in /etc/init.d/udev (around line 116). There is a variable

$devtmpfs_size

  • 1
    I have no such thing in /etc/init.d/udev on my Raspbian 7.6. – Krzysztof Adamski Mar 9 '15 at 19:26

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.