我正在 Amazon Web Services 中运行 RHEL 7.2,并尝试使用/tmp
附加的 10 GB 卷/dev/xvdh
。数据不需要持久化,但由于客户要求,我必须为 tmp 提供更大的容量。这是我的fstab
.
/dev/xvdh /tmp xfs defaults,nofail 0 2
当我运行时sudo mount -a
,我没有收到任何错误,但是,当我重新启动时,我在运行时没有看到此安装lsblk
,如下所示。
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 10G 0 disk
├─xvda1 202:1 0 1M 0 part
└─xvda2 202:2 0 10G 0 part /
xvdb 202:16 0 8G 0 disk /grid/01
xvdc 202:32 0 8G 0 disk /grid/02
xvdd 202:48 0 8G 0 disk /grid/03
xvde 202:64 0 8G 0 disk /grid/04
xvdf 202:80 0 8G 0 disk /grid/05
xvdg 202:96 0 20G 0 disk /var/log
xvdh 202:112 0 10G 0 disk
有任何指点吗?该驱动器肯定存在...
我被要求添加 的输出mount
,这里是:
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=484472k,nr_inodes=121118,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/xvda2 on / type xfs (rw,relatime,attr2,inode64,noquota)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/xvdb on /grid/01 type xfs (rw,relatime,attr2,inode64,noquota)
/dev/xvde on /grid/04 type xfs (rw,relatime,attr2,inode64,noquota)
/dev/xvdd on /grid/03 type xfs (rw,relatime,attr2,inode64,noquota)
/dev/xvdg on /var/log type xfs (rw,relatime,attr2,inode64,noquota)
/dev/xvdf on /grid/05 type xfs (rw,relatime,attr2,inode64,noquota)
/dev/xvdc on /grid/02 type xfs (rw,relatime,attr2,inode64,noquota)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=101548k,mode=700,uid=1000,gid=1000)
这是输出df /tmp
:
/dev/xvda2 10473452 1603440 8870012 16% /
编辑:就像爱迪生说的......
好吧,我找到了另一种方法,但行不通。 根据这个线程,我尝试屏蔽此文件/usr/lib/systemd/system/tmp.mount
,但我的映射/tmp
在重新启动时仍然无法工作。于是我尝试重命名该文件,也没有成功。我恢复了文件并删除了蒙版。
答案1
您可能想尝试使用 UUID。就像将 fstab 更改为
UUID=xxxxxxxxxxxx /tmp xfs defaults,nofail 0 2
答案2
我在 AWS RHEL 7.3 服务器上也遇到了这个问题(2016 年 12 月)。
我还能够在非 AWS 虚拟机(通过 VMware)中重现该问题,但只有在掩蔽 临时挂载在系统。
以下是如何检查以确保临时挂载现在在 RHEL 7 上通过 systemd 进行屏蔽。
要测试它:
# systemctl tmp.mount Unknown operation 'tmp.mount'.
# systemctl unmask tmp.mount Removed symlink
/etc/systemd/system/tmp.mount.
# systemctl status tmp.mount ● tmp.mount - /tmp Loaded: loaded
(/etc/fstab; disabled; vendor preset: disabled) Active: inactive
(dead) since Fri 2016-12-02 18:39:04 PST; 2min 47s ago
# systemctl enable tmp.mount Created symlink from
/etc/systemd/system/local-fs.target.wants/tmp.mount to
/usr/lib/systemd/system/tmp.mount.
# systemctl status tmp.mount ● tmp.mount - /tmp Loaded: loaded
(/etc/fstab; enabled; vendor preset: disabled)