LVM 无法检测到我的交换或“/”卷组,但为什么交换仍然存在

LVM 无法检测到我的交换或“/”卷组,但为什么交换仍然存在

我有一台服务器(运行 OEL/RHEL5 的 hp x86 blade),其 lvm.conf 中配置的 lvm 过滤器存在故障

filter = ["a|^/dev/emcpower.*|", "r/.*/"]

我们还使用 cciss 设备,因此 /dev/cciss 中应该有一个针对它们的 accept 语句。到目前为止,这个疏忽还没有造成问题。“系统”分区(例如 /var、/home 等)不在卷组中,而是在磁盘上。

但是 '/' 挂载和交换空间都配置在 LVM 卷组上,并且 cciss 设备上的物理卷被 lvm 过滤器拒绝。

服务器似乎运行正常但这怎么可能呢?

安装输出

/dev/mapper/VolGroup01-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/cciss/c0d0p8 on /home type ext3 (rw)
/dev/cciss/c0d0p7 on /opt type ext3 (rw)
/dev/cciss/c0d0p6 on /var type ext3 (rw)
/dev/cciss/c0d0p5 on /tmp type ext3 (rw)
/dev/cciss/c0d0p3 on /usr type ext3 (rw)
/dev/cciss/c0d0p2 on /temp type ext3 (rw)
/dev/cciss/c0d0p1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)

来自 /etc/fstab

/dev/VolGroup01/LogVol00 /                       ext3    defaults        1 1
LABEL=/home             /home                   ext3    defaults        1 2
LABEL=/opt              /opt                    ext3    defaults        1 2
LABEL=/var              /var                    ext3    defaults        1 2
LABEL=/tmp              /tmp                    ext3    defaults        1 2
LABEL=/usr              /usr                    ext3    defaults        1 2
LABEL=/temp             /temp                   ext3    defaults        1 2
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup01/LogVol01 swap                    swap    defaults        0 0
/dev/VolGroup01/LogVol02 swap                    swap    defaults        0 0
...

按标签排序磁盘

[user@host~]$ ls -al /dev/disk/by-label/
total 0
drwxr-xr-x 2 root root 180 Apr 12 19:23 .
drwxr-xr-x 6 root root 120 Apr 12 19:23 ..
lrwxrwxrwx 1 root root  18 Apr 12 19:23 boot -> ../../cciss/c0d0p1
lrwxrwxrwx 1 root root  18 Apr 12 19:23 home -> ../../cciss/c0d0p8
lrwxrwxrwx 1 root root  18 Apr 12 19:23 opt -> ../../cciss/c0d0p7
lrwxrwxrwx 1 root root  18 Apr 12 19:23 temp -> ../../cciss/c0d0p2
lrwxrwxrwx 1 root root  18 Apr 12 19:23 tmp -> ../../cciss/c0d0p5
lrwxrwxrwx 1 root root  18 Apr 12 19:23 usr -> ../../cciss/c0d0p3
lrwxrwxrwx 1 root root  18 Apr 12 19:23 var -> ../../cciss/c0d0p6

显示

[user@host ~]$ sudo vgdisplay -v VolGroup01
Using volume group(s) on command line
Finding volume group "VolGroup01"
Wiping cache of LVM-capable devices
Volume group "VolGroup01" not found

开发映射器

[user@host ~]$ ls -al /dev/mapper/VolGroup0*
brw------- 1 root root 253, 0 Apr 12 19:23 /dev/mapper/VolGroup01-LogVol00
brw------- 1 root root 253, 1 Apr 12 19:23 /dev/mapper/VolGroup01-LogVol01
brw------- 1 root root 253, 2 Apr 12 19:23 /dev/mapper/VolGroup01-LogVol02

斯瓦彭

[user@host ~]$ swapon -s
Filename                                Type            Size    Used    Priority
/dev/mapper/VolGroup01-LogVol01         partition       18481144        1860804-1
/dev/mapper/VolGroup01-LogVol02         partition       18874360        0      -2

/etc/lvm/备份/VolGroup01

VolGroup01 {
        id = "KtRbKi-wZ8l-rsgg-LyoT-edcO-2Nzo-qsDmaK"
        seqno = 4
        status = ["RESIZEABLE", "READ", "WRITE"]
        flags = []
        extent_size = 65536             # 32 Megabytes
        max_lv = 0
        max_pv = 0

        physical_volumes {

                pv0 {
                        id = "H9ludV-lTJK-ivK1-HcUf-G8KR-krD9-TsNJrp"
                        device = "/dev/cciss/c0d0p9"    # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 93964122     # 44.8056 Gigabytes
                        pe_start = 384
                        pe_count = 1433 # 44.7812 Gigabytes
                }
        }

        logical_volumes {

                LogVol00 {
                        id = "1P5pnt-jFXu-ec4f-NfWC-q9jx-CRGc-33lyPd"
                        status = ["READ", "WRITE", "VISIBLE"]
                        flags = []
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 125      # 3.90625 Gigabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv0", 0
                                ]
                        }
                }

                LogVol01 {
                        id = "dvqggw-JflJ-KC9Y-QEhw-pejq-GgIv-taDNzj"
                        status = ["READ", "WRITE", "VISIBLE"]
                        flags = []
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 564      # 17.625 Gigabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv0", 125
                                ]
                        }
                }

                LogVol02 {
                        id = "ZDTUSD-ItMw-xxBK-l1Le-DYX7-J4i3-UYKN4Q"
                        status = ["READ", "WRITE", "VISIBLE"]
                        flags = []
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 576      # 18 Gigabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv0", 689
                                ]
                        }
                }
        }
}

答案1

由于 initrd 有一个较旧的 lvm.conf,没有错误的过滤器,因此 LV 在启动时仍处于挂载状态。新的过滤器将阻止 LVM 命令运行,但不会破坏已挂载的 LV。

当您更新内核时,initrd 将使用您当前的 lvm.conf 进行更新,因此请确保在此之前修复过滤器。

相关内容