LVM 空间突然消失了

LVM 空间突然消失了

我在 Debian Jessie 服务器上遇到了 LVM 问题。在将新 SSD 添加到组后贮存我扩展了卷,没有发现任何问题。不过,停电后,服务器离线了一段时间。最后它恢复了。就在那时,我注意到缺少了很多空间。根据 df,只有 50GB。我觉得我缺少了一些东西。

有任何想法吗?

DF-H

Filesystem                Size  Used Avail Use% Mounted on
/dev/dm-0                 106G  102G     0 100% /
udev                       10M     0   10M   0% /dev
tmpfs                     1.4G  9.7M  1.4G   1% /run
tmpfs                     3.4G     0  3.4G   0% /dev/shm
tmpfs                     5.0M     0  5.0M   0% /run/lock
tmpfs                     3.4G     0  3.4G   0% /sys/fs/cgroup
/dev/sda1                 236M   36M  188M  16% /boot
/dev/mapper/storage-stor   50G   50G     0 100% /storage_share
tmpfs                     695M     0  695M   0% /run/user/1000

电压

VG             #PV #LV #SN Attr   VSize   VFree
home-server-vg   1   2   0 wz--n- 111.55g     0
storage          3   1   0 wz--n- 400.56g 97.66g

光伏系统

  PV         VG             Fmt  Attr PSize   PFree
  /dev/sda5  home-server-vg lvm2 a--  111.55g     0
  /dev/sdb1  storage        lvm2 a--  111.79g     0
  /dev/sdc1  storage        lvm2 a--   55.89g 55.89g
  /dev/sdd1  storage        lvm2 a--  232.88g 41.77g

lvs

LV     VG             Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   home-server-vg -wi-ao---- 106.98g
  swap_1 home-server-vg -wi-ao----   4.56g
  stor   storage        -wi-ao---- 302.90g

fdisk -l

Disk /dev/sdb: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc99fa34a

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1        2048 234441647 234439600 111.8G 83 Linux

Disk /dev/sdd: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe95e10c9

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdd1        2048 488397167 488395120 232.9G 83 Linux

Disk /dev/sdc: 55.9 GiB, 60022480896 bytes, 117231408 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb18e3326

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdc1        2048 117231407 117229360 55.9G 83 Linux

Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xedbe0f11

Device     Boot  Start       End   Sectors   Size Id Type
/dev/sda1  *      2048    499711    497664   243M 83 Linux
/dev/sda2       501758 234440703 233938946 111.6G  5 Extended
/dev/sda5       501760 234440703 233938944 111.6G 8e Linux LVM

Disk /dev/mapper/home--server--vg-root: 107 GiB, 114873597952 bytes, 224362496 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/home--server--vg-swap_1: 4.6 GiB, 4898947072 bytes, 9568256     sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/storage-stor: 302.9 GiB, 325238915072 bytes, 635232256 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

答案1

您的 /dev/sdb1、sdc1 和 sdd1 分区没有正确的分区类型。它被列为“Linux”,因此内核将期望那里有一个常规文件系统。我猜 /dev/sda5 是用于根文件系统的 LVM 类型(顺便说一句,是时候清理该分区了……)

我猜它之前能正常工作是因为内核在扫描磁盘以查找 LVM 签名时,在第一个磁盘上发现了一个。添加磁盘会改变扫描磁盘的顺序,但问题只有在第一次重新启动后才会显现出来,因为那时新磁盘上会有东西。我认为纯属偶然,您的超级块位于 /dev/sdc1 的开头,内核会说“嘿,这是一个文件系统。很好,让我们挂载它。”,而忽略了其余部分。

我认为修复此问题后您可能还需要重建 LVM,因为您的文件系统现在很可能已损坏。

相关内容