lef*_*out 5 linux grub boot ubuntu tmp
假设我正在运行一些冗长的过程,包括两个步骤:a生成一个大的中间文件,例如/tmp/aoutput,然后b读取该文件并对其执行进一步的操作。
现在系统在执行该b步骤时崩溃了。是否可以以一种不会像启动时通常发生的那样删除 的内容的方式重新启动系统/tmp,以便我们可以立即重新启动b而无需先a完全运行?
这当然假设/tmp没有安装在tmpfs.
我想排除涉及物理取出 HDD/SSD 或使用实时 USB 介质启动的解决方案。在我现在的具体情况中,它实际上是一个具有全盘加密的 SSD,但我也对仅适用于非加密驱动器的解决方案感兴趣。
编辑现在仍然保留这个问题,因为这两个答案都没有提供一个无需实时媒体或事先调整配置即可工作的解决方案。也许确实不可能有其他方式,但看起来很奇怪:GRUB 不是已经挂载分区来引导 Linux 了吗?如果是这样,是否有办法在启动之前手动移动文件systemd?也许我错了,我对引导加载程序知之甚少;但我想听听为什么这是不可能的。
systemd配置信息:
$ grep -s . /*/tmpfiles.d/*.conf /*/*/tmpfiles.d/*.conf
/run/tmpfiles.d/kmod.conf:c! /dev/fuse 0600 - - - 10:229
/run/tmpfiles.d/kmod.conf:c! /dev/cuse 0600 - - - 10:203
/run/tmpfiles.d/kmod.conf:c! /dev/btrfs-control 0600 - - - 10:234
/run/tmpfiles.d/kmod.conf:d /dev/net 0755 - - -
/run/tmpfiles.d/kmod.conf:c! /dev/net/tun 0600 - - - 10:200
/run/tmpfiles.d/kmod.conf:c! /dev/ppp 0600 - - - 108:0
/run/tmpfiles.d/kmod.conf:c! /dev/uinput 0600 - - - 10:223
/run/tmpfiles.d/kmod.conf:d /dev/mapper 0755 - - -
/run/tmpfiles.d/kmod.conf:c! /dev/mapper/control 0600 - - - 10:236
/run/tmpfiles.d/kmod.conf:c! /dev/uhid 0600 - - - 10:239
/run/tmpfiles.d/kmod.conf:c! /dev/vhci 0600 - - - 10:137
/run/tmpfiles.d/kmod.conf:d /dev/snd 0755 - - -
/run/tmpfiles.d/kmod.conf:c! /dev/snd/timer 0600 - - - 116:33
/run/tmpfiles.d/kmod.conf:d /dev/snd 0755 - - -
/run/tmpfiles.d/kmod.conf:c! /dev/snd/seq 0600 - - - 116:1
/usr/lib/tmpfiles.d/00rsyslog.conf:# Override systemd's default tmpfiles.d/var.conf to make /var/log writable by
/usr/lib/tmpfiles.d/00rsyslog.conf:# the syslog group, so that rsyslog can run as user.
/usr/lib/tmpfiles.d/00rsyslog.conf:# See tmpfiles.d(5) for details.
/usr/lib/tmpfiles.d/00rsyslog.conf:# Type Path Mode UID GID Age Argument
/usr/lib/tmpfiles.d/00rsyslog.conf:d /var/log 0775 root syslog -
/usr/lib/tmpfiles.d/dbus.conf:# Type Path Mode UID GID Age Argument
/usr/lib/tmpfiles.d/dbus.conf:L /var/lib/dbus/machine-id - - - - /etc/machine-id
/usr/lib/tmpfiles.d/debian.conf:# This file is part of the debianisation of systemd.
/usr/lib/tmpfiles.d/debian.conf:#
/usr/lib/tmpfiles.d/debian.conf:# systemd is free software; you can redistribute it and/or modify it
/usr/lib/tmpfiles.d/debian.conf:# under the terms of the GNU General Public License as published by
/usr/lib/tmpfiles.d/debian.conf:# the Free Software Foundation; either version 2 of the License, or
/usr/lib/tmpfiles.d/debian.conf:# (at your option) any later version.
/usr/lib/tmpfiles.d/debian.conf:# See tmpfiles.d(5) for details
/usr/lib/tmpfiles.d/debian.conf:# Type Path Mode UID GID Age Argument
/usr/lib/tmpfiles.d/debian.conf:L /run/initctl - - - - /run/systemd/initctl/fifo
/usr/lib/tmpfiles.d/debian.conf:L /run/shm - - - - /dev/shm
/usr/lib/tmpfiles.d/debian.conf:d /run/sendsigs.omit.d 0755 root root -
/usr/lib/tmpfiles.d/debian.conf:L+ /etc/mtab - - - - ../proc/self/mounts
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:# This is a systemd tmpfiles.d configuration file
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:#
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:# tmpfiles.d defaults are set to clean /run/user every now and then
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:# which includes our gvfs-fuse mount being mounted in /run/user/<id>/gvfs
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:#
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:# This file adds an exclusion rule so that user data don't get automatically
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:# cleaned up (i.e. destroyed).
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:#
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:# Due to our fuse mount restrictions root can't access nor stat the mountpoint
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:# resulting in warning spitted out by the systemd-tmpfiles process. Please
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:# ignore it for the time being until proper solution is found:
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:# https://bugzilla.gnome.org/show_bug.cgi?id=560658
/usr/lib/tmpfiles.d/gvfsd-fuse-tmpfiles.conf:x /run/user/*/gvfs
/usr/lib/tmpfiles.d/home.conf:# This file is part of systemd.
/usr/lib/tmpfiles.d/home.conf:#
/usr/lib/tmpfiles.d/home.conf:# systemd is free software; you can redistribute it and/or modify it
/usr/lib/tmpfiles.d/home.conf:# under the terms of the GNU Lesser General Public License as published by
/usr/lib/tmpfiles.d/home.conf:# the Free Software Foundation; either version 2.1 of the License, or
/usr/lib/tmpfiles.d/home.conf:# (at your option) any later version.
/usr/lib/tmpfiles.d/home.conf:# See tmpfiles.d(5) for details
/usr/lib/tmpfiles.d/home.conf:Q /home 0755 - - -
/usr/lib/tmpfiles.d/home.conf:q /srv 0755 - - -
/usr/lib/tmpfiles.d/journal-nocow.conf:# This file is part of systemd.
/usr/lib/tmpfiles.d/journal-nocow.conf:#
/usr/lib/tmpfiles.d/journal-nocow.conf:# systemd is free software; you can redistribute it and/or modify it
/usr/lib/tmpfiles.d/journal-nocow.conf:# under the terms of the GNU Lesser General Public License as published by
/usr/lib/tmpfiles.d/journal-nocow.conf:# the Free Software Foundation; either version 2.1 of the License, or
/usr/lib/tmpfiles.d/journal-nocow.conf:# (at your option) any later version.
/usr/lib/tmpfiles.d/journal-nocow.conf:# See tmpfiles.d(5) for details
/usr/lib/tmpfiles.d/journal-nocow.conf:# Set the NOCOW attribute for directories of journal files. This flag
/usr/lib/tmpfiles.d/journal-nocow.conf:# is inheredited by their new files and sub-directories. Matters only
/usr/lib/tmpfiles.d/journal-nocow.conf:# for btrfs filesystems.
/usr/lib/tmpfiles.d/journal-nocow.conf:#
/usr/lib/tmpfiles.d/journal-nocow.conf:# WARNING: Enabling the NOCOW attribute improves journal performance
/usr/lib/tmpfiles.d/journal-nocow.conf:# substantially, but also disables the btrfs checksum logic. In
/usr/lib/tmpfiles.d/journal-nocow.conf:# btrfs RAID filesystems the checksums are needed for rebuilding
/usr/lib/tmpfiles.d/journal-nocow.conf:# corrupted files. Without checksums such rebuilds are not
/usr/lib/tmpfiles.d/journal-nocow.conf:# possible.
/usr/lib/tmpfiles.d/journal-nocow.conf:#
/usr/lib/tmpfiles.d/journal-nocow.conf:# In a single-disk filesystem (or a filesystem without redundancy)
/usr/lib/tmpfiles.d/journal-nocow.conf:# enabling the NOCOW attribute for journal files is safe, because
/usr/lib/tmpfiles.d/journal-nocow.conf:# they have their own checksums and a rebuilding wouldn't be possible
/usr/lib/tmpfiles.d/journal-nocow.conf:# in any case.
/usr/lib/tmpfiles.d/journal-nocow.conf:h /var/log/journal - - - - +C
/usr/lib/tmpfiles.d/journal-nocow.conf:h /var/log/journal/%m - - - - +C
/usr/lib/tmpfiles.d/journal-nocow.conf:h /var/log/journal/remote - - - - +C
/usr/lib/tmpfiles.d/legacy.conf:# This file is part of systemd.
/usr/lib/tmpfiles.d/legacy.conf:#
/usr/lib/tmpfiles.d/legacy.conf:# systemd is free software; you can redistribute it and/or modify it
/usr/lib/tmpfiles.d/legacy.conf:# under the terms of the GNU Lesser General Public License as published by
/usr/lib/tmpfiles.d/legacy.conf:# the Free Software Foundation; either version 2.1 of the License, or
/usr/lib/tmpfiles.d/legacy.conf:# (at your option) any later version.
/usr/lib/tmpfiles.d/legacy.conf:# See tmpfiles.d(5) for details
/usr/lib/tmpfiles.d/legacy.conf:# These files are considered legacy and are unnecessary on legacy-free
/usr/lib/tmpfiles.d/legacy.conf:# systems.
/usr/lib/tmpfiles.d/legacy.conf:L /var/lock - - - - ../run/lock
/usr/lib/tmpfiles.d/legacy.conf:# /run/lock/subsys is used for serializing SysV service execution, and
/usr/lib/tmpfiles.d/legacy.conf:# hence without use on SysV-less systems.
/usr/lib/tmpfiles.d/legacy.conf:d /run/lock/subsys 0755 root root -
/usr/lib/tmpfiles.d/legacy.conf:# /forcefsck, /fastboot and /forcequotacheck are deprecated in favor of the
/usr/lib/tmpfiles.d/legacy.conf:# kernel command line options 'fsck.mode=force', 'fsck.mode=skip' and
/usr/lib/tmpfiles.d/legacy.conf:# 'quotacheck.mode=force'
/usr/lib/tmpfiles.d/legacy.conf:r! /forcefsck
/usr/lib/tmpfiles.d/legacy.conf:r! /fastboot
/usr/lib/tmpfiles.d/legacy.conf:r! /forcequotacheck
/usr/lib/tmpfiles.d/man-db.conf:d /var/cache/man 2755 man root 1w
/usr/lib/tmpfiles.d/passwd.conf:# If a password operation is in progress and we lose power, stale lockfiles
/usr/lib/tmpfiles.d/passwd.conf:# can be left behind. Clear them on boot.
/usr/lib/tmpfiles.d/passwd.conf:r! /etc/gshadow.lock
/usr/lib/tmpfiles.d/passwd.conf:r! /etc/shadow.lock
/usr/lib/tmpfiles.d/passwd.conf:r! /etc/passwd.lock
/usr/lib/tmpfiles.d/passwd.conf:r! /etc/group.lock
/usr/lib/tmpfiles.d/passwd.conf:r! /etc/subuid.lock
/usr/lib/tmpfiles.d/passwd.conf:r! /etc/subgid.lock
/usr/lib/tmpfiles.d/samba.conf:d /run/samba 0755 root root -
/usr/lib/tmpfiles.d/sshd.conf:d /var/run/sshd 0755 root root
/usr/lib/tmpfiles.d/sudo.conf:# Create an empty sudo time stamp directory on OSes using systemd.
/usr/lib/tmpfiles.d/sudo.conf:# Sudo will create the directory itself but this can cause problems
/usr/lib/tmpfiles.d/sudo.conf:# on systems that have SELinux enabled since the directories will be
/usr/lib/tmpfiles.d/sudo.conf:# created with the user's security context.
/usr/lib/tmpfiles.d/sudo.conf:d /var/run/sudo 0711 root root
/usr/lib/tmpfiles.d/sudo.conf:D /var/run/sudo/ts 0700 root root
/usr/lib/tmpfiles.d/systemd.conf:# This file is part of systemd.
/usr/lib/tmpfiles.d/systemd.conf:#
/usr/lib/tmpfiles.d/systemd.conf:# systemd is free software; you can redistribute it and/or modify it
/usr/lib/tmpfiles.d/systemd.conf:# under the terms of the GNU Lesser General Public License as published by
/usr/lib/tmpfiles.d/systemd.conf:# the Free Software Foundation; either version 2.1 of the License, or
/usr/lib/tmpfiles.d/systemd.conf:# (at your option) any later version.
/usr/lib/tmpfiles.d/systemd.conf:# See tmpfiles.d(5) for details
/usr/lib/tmpfiles.d/systemd.conf:d /run/user 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:F! /run/utmp 0664 root utmp -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/ask-password 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/seats 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/sessions 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/users 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/machines 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/shutdown 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/netif 0755 systemd-network systemd-network -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/netif/links 0755 systemd-network systemd-network -
/usr/lib/tmpfiles.d/systemd.conf:d /run/systemd/netif/leases 0755 systemd-network systemd-network -
/usr/lib/tmpfiles.d/systemd.conf:d /run/log 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:z /run/log/journal 2755 root systemd-journal - -
/usr/lib/tmpfiles.d/systemd.conf:Z /run/log/journal/%m ~2750 root systemd-journal - -
/usr/lib/tmpfiles.d/systemd.conf:a+ /run/log/journal/%m - - - - d:group:adm:r-x
/usr/lib/tmpfiles.d/systemd.conf:A+ /run/log/journal/%m - - - - group:adm:r-x
/usr/lib/tmpfiles.d/systemd.conf:z /var/log/journal 2755 root systemd-journal - -
/usr/lib/tmpfiles.d/systemd.conf:z /var/log/journal/%m 2755 root systemd-journal - -
/usr/lib/tmpfiles.d/systemd.conf:z /var/log/journal/%m/system.journal 0640 root systemd-journal - -
/usr/lib/tmpfiles.d/systemd.conf:a+ /var/log/journal - - - - d:group:adm:r-x
/usr/lib/tmpfiles.d/systemd.conf:a+ /var/log/journal - - - - group:adm:r-x
/usr/lib/tmpfiles.d/systemd.conf:a+ /var/log/journal/%m - - - - d:group:adm:r-x
/usr/lib/tmpfiles.d/systemd.conf:a+ /var/log/journal/%m - - - - group:adm:r-x
/usr/lib/tmpfiles.d/systemd.conf:a+ /var/log/journal/%m/system.journal - - - - group:adm:r--
/usr/lib/tmpfiles.d/systemd.conf:d /var/lib/systemd 0755 root root -
/usr/lib/tmpfiles.d/systemd.conf:d /var/lib/systemd/coredump 0755 root root 3d
/usr/lib/tmpfiles.d/systemd-nologin.conf:# This file is part of systemd.
/usr/lib/tmpfiles.d/systemd-nologin.conf:#
/usr/lib/tmpfiles.d/systemd-nologin.conf:# systemd is free software; you can redistribute it and/or modify it
/usr/lib/tmpfiles.d/systemd-nologin.conf:# under the terms of the GNU Lesser General Public License as published by
/usr/lib/tmpfiles.d/systemd-nologin.conf:# the Free Software Foundation; either version 2.1 of the License, or
/usr/lib/tmpfiles.d/systemd-nologin.conf:# (at your option) any later version.
/usr/lib/tmpfiles.d/systemd-nologin.conf:# See tmpfiles.d(5), systemd-user-session.service(5) and pam_nologin(8).
/usr/lib/tmpfiles.d/systemd-nologin.conf:# This file has special suffix so it is not run by mistake.
/usr/lib/tmpfiles.d/systemd-nologin.conf:F! /run/nologin 0644 - - - "System is booting up. See pam_nologin(8)"
/usr/lib/tmpfiles.d/tmp.conf:# This file is part of systemd.
/usr/lib/tmpfiles.d/tmp.conf:#
/usr/lib/tmpfiles.d/tmp.conf:# systemd is free software; you can redistribute it and/or modify it
/usr/lib/tmpfiles.d/tmp.conf:# under the terms of the GNU Lesser General Public License as published by
/usr/lib/tmpfiles.d/tmp.conf:# the Free Software Foundation; either version 2.1 of the License, or
/usr/lib/tmpfiles.d/tmp.conf:# (at your option) any later version.
/usr/lib/tmpfiles.d/tmp.conf:# See tmpfiles.d(5) for details
/usr/lib/tmpfiles.d/tmp.conf:# Clear tmp directories separately, to make them easier to override
/usr/lib/tmpfiles.d/tmp.conf:D /tmp 1777 root root -
/usr/lib/tmpfiles.d/tmp.conf:#q /var/tmp 1777 root root 30d
/usr/lib/tmpfiles.d/tmp.conf:# Exclude namespace mountpoints created with PrivateTmp=yes
/usr/lib/tmpfiles.d/tmp.conf:x /tmp/systemd-private-%b-*
/usr/lib/tmpfiles.d/tmp.conf:X /tmp/systemd-private-%b-*/tmp
/usr/lib/tmpfiles.d/tmp.conf:x /var/tmp/systemd-private-%b-*
/usr/lib/tmpfiles.d/tmp.conf:X /var/tmp/systemd-private-%b-*/tmp
/usr/lib/tmpfiles.d/var.conf:# This file is part of systemd.
/usr/lib/tmpfiles.d/var.conf:#
/usr/lib/tmpfiles.d/var.conf:# systemd is free software; you can redistribute it and/or modify it
/usr/lib/tmpfiles.d/var.conf:# under the terms of the GNU Lesser General Public License as published by
/usr/lib/tmpfiles.d/var.conf:# the Free Software Foundation; either version 2.1 of the License, or
/usr/lib/tmpfiles.d/var.conf:# (at your option) any later version.
/usr/lib/tmpfiles.d/var.conf:# See tmpfiles.d(5) for details
/usr/lib/tmpfiles.d/var.conf:q /var 0755 - - -
/usr/lib/tmpfiles.d/var.conf:L /var/run - - - - ../run
/usr/lib/tmpfiles.d/var.conf:d /var/log 0755 - - -
/usr/lib/tmpfiles.d/var.conf:f /var/log/wtmp 0664 root utmp -
/usr/lib/tmpfiles.d/var.conf:f /var/log/btmp 0600 root utmp -
/usr/lib/tmpfiles.d/var.conf:d /var/cache 0755 - - -
/usr/lib/tmpfiles.d/var.conf:d /var/lib 0755 - - -
/usr/lib/tmpfiles.d/var.conf:d /var/spool 0755 - - -
/usr/lib/tmpfiles.d/x11.conf:# This file is part of systemd.
/usr/lib/tmpfiles.d/x11.conf:#
/usr/lib/tmpfiles.d/x11.conf:# systemd is free software; you can redistribute it and/or modify it
/usr/lib/tmpfiles.d/x11.conf:# under the terms of the GNU Lesser General Public License as published by
/usr/lib/tmpfiles.d/x11.conf:# the Free Software Foundation; either version 2.1 of the License, or
/usr/lib/tmpfiles.d/x11.conf:# (at your option) any later version.
/usr/lib/tmpfiles.d/x11.conf:# See tmpfiles.d(5) for details
/usr/lib/tmpfiles.d/x11.conf:# Make sure these are created by default so that nobody else can
/usr/lib/tmpfiles.d/x11.conf:d /tmp/.X11-unix 1777 root root 10d
/usr/lib/tmpfiles.d/x11.conf:d /tmp/.ICE-unix 1777 root root 10d
/usr/lib/tmpfiles.d/x11.conf:d /tmp/.XIM-unix 1777 root root 10d
/usr/lib/tmpfiles.d/x11.conf:d /tmp/.font-unix 1777 root root 10d
/usr/lib/tmpfiles.d/x11.conf:d /tmp/.Test-unix 1777 root root 10d
/usr/lib/tmpfiles.d/x11.conf:# Unlink the X11 lock files
/usr/lib/tmpfiles.d/x11.conf:r! /tmp/.X[0-9]*-lock
/var/run/tmpfiles.d/kmod.conf:c! /dev/fuse 0600 - - - 10:229
/var/run/tmpfiles.d/kmod.conf:c! /dev/cuse 0600 - - - 10:203
/var/run/tmpfiles.d/kmod.conf:c! /dev/btrfs-control 0600 - - - 10:234
/var/run/tmpfiles.d/kmod.conf:d /dev/net 0755 - - -
/var/run/tmpfiles.d/kmod.conf:c! /dev/net/tun 0600 - - - 10:200
/var/run/tmpfiles.d/kmod.conf:c! /dev/ppp 0600 - - - 108:0
/var/run/tmpfiles.d/kmod.conf:c! /dev/uinput 0600 - - - 10:223
/var/run/tmpfiles.d/kmod.conf:d /dev/mapper 0755 - - -
/var/run/tmpfiles.d/kmod.conf:c! /dev/mapper/control 0600 - - - 10:236
/var/run/tmpfiles.d/kmod.conf:c! /dev/uhid 0600 - - - 10:239
/var/run/tmpfiles.d/kmod.conf:c! /dev/vhci 0600 - - - 10:137
/var/run/tmpfiles.d/kmod.conf:d /dev/snd 0755 - - -
/var/run/tmpfiles.d/kmod.conf:c! /dev/snd/timer 0600 - - - 116:33
/var/run/tmpfiles.d/kmod.conf:d /dev/snd 0755 - - -
/var/run/tmpfiles.d/kmod.conf:c! /dev/snd/seq 0600 - - - 116:1
Run Code Online (Sandbox Code Playgroud)
是的。
\n有两种情况可能会导致文件丢失/tmp:
tmpfs:许多现代系统都会安装临时文件系统(例如 RAM 磁盘),这/tmp意味着内容在关闭时总是会丢失。
清理/tmp. 这是一个可配置的脚本,用于清理/tmp.
请检查命令的输出df /tmp。在情况 1 中,它看起来类似于:
$ df /tmp/\nFilesystem 1K-blocks Used Available Use% Mounted on\ntmpfs 12290040 276 12289764 1% /tmp\nRun Code Online (Sandbox Code Playgroud)\n(重要的是第一栏。. tmpfs)
/etc/tmpfiles.d在情况 2(您的情况)中,您通常可以通过查看-- 请参阅中的文件来了解更多信息man tmpfiles.d。请添加输出
grep -s . /*/tmpfiles.d/*.conf /*/*/tmpfiles.d/*.conf\nRun Code Online (Sandbox Code Playgroud)\n对于你的问题。\xe2\x9f\xb9 您的文件是/usr/lib/tmpfiles.d/tmp.conf您需要编辑的文件,例如sudo nano /usr/lib/tmpfiles.d/tmp.conf根据以下示例应用更改。
这是一个示例文件/etc/tmpfiles.d/tmp.conf:
# see tmpfiles.d(5)\n# always enable /tmp folder cleaning\nD! /tmp 1777 root root 0\n\n# remove files in /var/tmp older than 10 days\nD /var/tmp 1777 root root 10d\nRun Code Online (Sandbox Code Playgroud)\n第一个条目D! /tmp 1777 root root 0意味着该/tmp文件夹将在每次启动时被删除并重新创建。您可以注释掉该行,并可能添加类似于该文件中下一个非注释行的行:
# see tmpfiles.d(5)\n\n# # always enable /tmp folder cleaning\n# D! /tmp 1777 root root 0\n\n# Keep files in /tmp but not very old ones\nD! /var/tmp 1777 root root 30d\n\n# remove files in /var/tmp older than 10 days\nD /var/tmp 1777 root root 10d\nRun Code Online (Sandbox Code Playgroud)\n由于系统现在尚未启动,您需要从 Live DVD/USB 介质启动,然后挂载您的系统分区,例如挂载到/mnt. /mnt/usr/lib/tmpfiles.d/tmp.conf然后按照上述方法编辑该文件。