在机器上,有一个大小为 500MiB 的逻辑卷 /dev/lvm/tmp,其大小相同的分区 /dev/mapper/tmp 也安装在 /tmp 上。
检查逻辑卷:
# lvdisplay /dev/lvm/tmp
--- Logical volume ---
LV Path /dev/lvm/tmp
LV Name tmp
VG Name lvm
LV UUID R1a6Yq-b5jt-Y5rF-sCma-50yh-rg19-LB21qs
LV Write Access read/write
LV Creation host, time anarchy, 2021-04-01 13:28:12 -0400
LV Status available
# open 1
LV Size 500.00 MiB
Current LE 125
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0
但是,检查/tmp的大小显示其大小为7.8G:
# df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/tmp 7.8G 34M 7.8G 1% /tmp
/etc/crypttab 中的相关行:
tmp /dev/lvm/tmp /dev/urandom tmp,cipher=aes-xts-plain64,size=256
/etc/fstab 中的相关行:
/dev/mapper/tmp /tmp tmpfs defaults 0 0
附加信息:
# cryptsetup status tmp
/dev/mapper/tmp is active.
type: PLAIN
cipher: aes-xts-plain64
keysize: 256 bits
key location: dm-crypt
device: /dev/mapper/lvm-tmp
sector size: 512
offset: 0 sectors
size: 1024000 sectors
mode: read/write
为什么/tmp的大小是7.8G而不是500M?