系统相关
首页 > 系统相关> > linux – / run和/ var / run之间的区别

linux – / run和/ var / run之间的区别

作者:互联网

/ run目录和var / run目录之间是否有任何区别.似乎后者是前者的链接.如果内容是同一个,那么两个目录的需求是什么?

解决方法:

来自Filesystem Hierarchy Standard的维基百科页面:

Modern Linux distributions include a /run directory as a temporary filesystem (tmpfs) which stores volatile runtime data, following the FHS version 3.0. According to the FHS version 2.3, this data should be stored in /var/run but this was a problem in some cases because this directory isn’t always available at early boot. As a result, these programs have had to resort to trickery, such as using /dev/.udev, /dev/.mdadm, /dev/.systemd or /dev/.mount directories, even though the device directory isn’t intended for such data. Among other advantages, this makes the system easier to use normally with the root filesystem mounted read-only.

因此,如果您已经为/ run创建了一个临时文件系统,那么将/ var / run链接到它将是下一个逻辑步骤(而不是将文件保留在磁盘上或创建单独的tmpfs).

标签:directory-structure,linux,ubuntu,tmpfs
来源: https://codeday.me/bug/20190808/1624126.html