What are /dev, /run and /run/shm and can I resize them?

20,081

Solution 1

/run and /run/shm are temporary filesystems residing in RAM. See What is this new filesystem /run?

/dev is where udev manages the device nodes for the kernel.

Essentially, you can change the size of your tmpfs (it is set by default to use half your total RAM) but, looking at your overall disk usage, you have a more pressing space issue than resizing your temporary filesystem.

The Arch Wiki fstab entry on tmpfs has details on how to resize it by, for example, including a line in your /etc/fstab:

tmpfs   /tmp    tmpfs   nodev,nosuid,size=2G     0  0

Solution 2

Temporary increase tmpfs filesystem

1) Open /etc/fstab with vi or any text editor of your choice,

2) Locate the line of /dev/shm and use the tmpfs size option to specify your expected size,

e.g. 512MB: tmpfs /dev/shm tmpfs defaults,size=512m 0 0

e.g. 2GB: tmpfs /dev/shm tmpfs defaults,size=2g 0 0

mount -o remount /dev/shm

Share:
20,081

Related videos on Youtube

justindao
Author by

justindao

Updated on September 18, 2022

Comments

  • justindao
    justindao over 1 year

    So, I recently created a 15GB partition for Linux Mint 14. I've been working on it for a while, and I got a Low Disk Space notification. I ran df -h and this is what I'm getting:

    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda5        11G   11G  2.3M 100% /
    udev            1.9G  4.0K  1.9G   1% /dev
    tmpfs           751M  1.1M  750M   1% /run
    none            5.0M     0  5.0M   0% /run/lock
    none            1.9G  4.0M  1.9G   1% /run/shm
    none            100M   16K  100M   1% /run/user
    

    What are /dev, /run, and /run/shm, and can I resize them to be smaller and extend /dev/sda5 to use that space instead?

    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' about 11 years
      I suspect you have a <~15,000,000,000B partition with a >~11*1024*1024*1024B filesystem. Post the output of fdisk -l and df / (without -h, to have precise numbers). Anyway, unless you've resized the partition or something, the filesystem uses all the space in the partition. /run and the others are not the same filesystem, they don't take up any space in the partition (nor in RAM for that matter — only the ~5MB that's in use).
    • pabouk - Ukraine stay strong
      pabouk - Ukraine stay strong almost 8 years
      As Gilles wrote, only the "Filesystem" /dev/sda5 directly occupies space on the harddrive. The other volumes are in the RAM disk (but they occupy only the used space). More details are also in my reply here: Shrink or delete udev partition in Ubuntu?
  • justindao
    justindao about 11 years
    So if the /run folders are coming from my RAM, does that mean / and /dev come from the allocated space? If so, that still only adds up to 13GB - any idea where the other 2GB go?
  • jasonwryan
    jasonwryan about 11 years
    The tmpfs is the maximum size that may be used. Your filesystem may also be using space for fsck to track files...