/boot/initramfs-$(uname -r).img
/usr/lib/dracut/modules.d/99base/init.sh
The size of a tmpfs filesystem is actually the maximum amount of space that it could use. When the filesystem is empty, it is no using any memory. It won't allow the filesystem to contain more than that size of data, which defaults to 50 of RAM.
点击(此处)折叠或打开
-
if ! ismounted /dev/shm; then
-
mkdir -m 0755 /dev/shm
-
mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime tmpfs /dev/shm >/dev/null
-
fi
-
-
if ! ismounted /run; then
-
mkdir -m 0755 /newrun
-
mount -t tmpfs -o mode=0755,nosuid,nodev,strictatime tmpfs /newrun >/dev/null
-
cp -a /run/* /newrun >/dev/null 2>&1
-
mount --move /newrun /run
-
rm -fr -- /newrun
- fi
The size of a tmpfs filesystem is actually the maximum amount of space that it could use. When the filesystem is empty, it is no using any memory. It won't allow the filesystem to contain more than that size of data, which defaults to 50 of RAM.
点击(此处)折叠或打开
-
mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime,size=20% tmpfs /dev/shm >/dev/null
-
-
mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime,size=10m tmpfs /dev/shm >/dev/null
-
- mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime,nr_blocks=1000 tmpfs /dev/shm >/dev/null
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24644775/viewspace-2131195/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24644775/viewspace-2131195/
本文介绍如何在Linux系统中初始化RAM磁盘并挂载tmpfs文件系统,包括为/dev/shm和/run目录设置合适的参数。此外,还讨论了如何限制tmpfs文件系统的大小,以避免占用过多内存。
1145

被折叠的 条评论
为什么被折叠?



