ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Default tmpfs configuration

Default tmpfs configuration

原创 Linux操作系统 作者:amber_cop 时间:2016-12-22 12:26:50 0 删除 编辑
/boot/initramfs-$(uname -r).img

点击(此处)折叠或打开

  1. if ! ismounted /dev/shm; then
  2.     mkdir -m 0755 /dev/shm
  3.     mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime tmpfs /dev/shm >/dev/null
  4. fi

  5. if ! ismounted /run; then
  6.     mkdir -m 0755 /newrun
  7.     mount -t tmpfs -o mode=0755,nosuid,nodev,strictatime tmpfs /newrun >/dev/null
  8.     cp -a /run/* /newrun >/dev/null 2>&1
  9.     mount --move /newrun /run
  10.     rm -fr -- /newrun
  11. fi
/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.

点击(此处)折叠或打开

  1. mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime,size=20% tmpfs /dev/shm >/dev/null

  2. mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime,size=10m tmpfs /dev/shm >/dev/null

  3. mount -t tmpfs -o mode=1777,nosuid,nodev,strictatime,nr_blocks=1000 tmpfs /dev/shm >/dev/null




来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24644775/viewspace-2131195/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2013-03-18

  • 博文量
    36
  • 访问量
    71133