tmpfs, /dev and swap question

Submitted by Anonymous
on January 2, 2009 - 9:06am

Hi,

I have a question concerning /dev, tmpfs and swap.
In several modern linux distributions I've seen so far - there is /dev directory mounted on tmpfs pseudofilesystem:

# cat /proc/mounts |grep tmpfs
/dev /dev tmpfs rw,mode=755 0 0

As I know the tmpfs is pseudo-filesystem basing on swappable cache so it resides either in memory or in swap area.
As the contents of "/dev" directory is mounted on tmpfs and tmpfs is in swappable cache it may be swapped out to the storage.
I'm wondering what will happen if the "/dev" contents will be swapped out and the storage with swap area suddenly will start with reporting bad-sectors? Probably we will lost our swapped out "/dev" directory contents.
Why the most of linux distribution developers uses tmpfs instead of ramfs for /dev?
Is it possible to turn off swapping of tmpfs contents?

This is carefully explained

Anonymous (not verified)
on
January 2, 2009 - 2:29pm

This is carefully explained in the documentation in /usr/src//docs/fs
(or it may be Documentation). Basically tmpfs is a safer version of ramfs.

Will

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.