|
公司一台redhat5.3服务器2磁盘500G硬件raid卡做raid0 (总大小大概930G左右)。
前些天发现文件系统变成只读模式。重启后发现,系统已经无法识别出raid0, fdisk -l 发现 sda 、sdb 2个500G磁盘。
sda下有2个分区
sda1 ext3 /boot
sda2 ext3 / (lvm)
进入rescue模式,发现pv,vg,lv信息都在,e2fsck -f 修复文件系统。重启后,系统可以启动,并且文件系统完整。
但是发现一个问题,就是sda2的cylinders数量超出sda的实际cylinders数量,原因是因为sda原大小为930G的,而现在变成500G。pvdisplay发现也是大于实际磁盘大小。 超过实际大小肯定会有问题。
于是重启,救援模式,收缩文件系统,收缩pv,重新生成磁盘分区。
#e2fsck -f /dev/vg0/lv00
#lvm.static resize2fs /dev/vg0/lv00 380G
#lvm.static lvreduce /dev/vg0/lv00 -L 380G
#lvm.static pvresize ----setphysicalvolumesize 410G /dev/sda2
#fdsik /dev/sda
d->2->n->p->2->start->end->t->8e-w
#partprobe
[root@serverdb ~]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 59000 473813077+ 8e Linux LVM
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
[root@serverdb ~]# pvdisplay
--- Physical volume ---
PV Name /dev/mapper/nvidia_ffefgabcp2
VG Name VolGroup00
PV Size 410.00 GB / not usable 31.81 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 13119
Free PE 959
Allocated PE 12160
PV UUID 9cc4kL-spEY-TZSr-DM6q-bCV0-aKGF-U11upQ
[root@serverdb ~]# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 409.97 GB
PE Size 32.00 MB
Total PE 13119
Alloc PE / Size 12160 / 380.00 GB
Free PE / Size 959 / 29.97 GB
VG UUID FloHm5-1fw3-b5r2-mEBs-KoK0-AAXr-gjzFQI
[root@serverdb ~]# lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID JyXJMp-dxeJ-Ltlv-c2MV-hUrq-bA9e-2bSmkm
LV Write Access read/write
LV Status available
# open 1
LV Size 380.00 GB
Current LE 12160
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3
重新e2fsck正常,重启后也一切正常,我的问题是:一般都是 分区=PV或者磁盘=PV,PV>LV肯定没问题,而我这种分区>V,将来会不会出线状况?
先谢谢大家了:) |
|