LVM error:resize2fs: Bad magic number in super-block while trying to open xxxxx
出现这个错误是在我试图将扩容的LV应用到文件系统上的时候爆出的,具体的情况如下所示:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
[root@oel71 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/ol-root 18G 11G 6.7G 62% / devtmpfs 1.8G 0 1.8G 0% /dev tmpfs 1.8G 80K 1.8G 1% /dev/shm tmpfs 1.8G 8.9M 1.8G 1% /run tmpfs 1.8G 0 1.8G 0% /sys/fs/cgroup /dev/sda1 497M 150M 348M 31% /boot [root@oel71 ~]# [root@oel71 ~]# lvdisplay --- Logical volume --- LV Path /dev/ol/swap LV Name swap VG Name ol LV UUID AbAcmW-6Ar7-N0IY-DTwv-VfUf-nGuc-dhlDcw LV Write Access read/write LV Creation host, time localhost, 2015-12-04 06:20:48 +0800 LV Status available # open 2 LV Size 2.00 GiB Current LE 512 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 252:1 --- Logical volume --- LV Path /dev/ol/root LV Name root VG Name ol LV UUID GY9Oto-5SR7-GrbL-Ml6i-8Cwu-sy79-Cfz01X LV Write Access read/write LV Creation host, time localhost, 2015-12-04 06:20:49 +0800 LV Status available # open 1 LV Size 57.47 GiB Current LE 14712 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 252:0 [root@oel71 ~]# [root@oel71 ~]# resize2fs /dev/mapper/ol-root resize2fs 1.42.9 (28-Dec-2013) resize2fs: Bad magic number in super-block while trying to open /dev/mapper/ol-root Couldn't find valid filesystem superblock. [root@oel71 ~]# |
解法:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[root@oel71 ~]# xfs_growfs /dev/mapper/ol-root meta-data=/dev/mapper/ol-root isize=256 agcount=4, agsize=1144832 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 finobt=0 data = bsize=4096 blocks=4579328, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0 log =internal bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 4579328 to 15065088 [root@oel71 ~]# [root@oel71 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/ol-root 58G 11G 47G 19% / devtmpfs 1.8G 0 1.8G 0% /dev tmpfs 1.8G 80K 1.8G 1% /dev/shm tmpfs 1.8G 8.9M 1.8G 1% /run tmpfs 1.8G 0 1.8G 0% /sys/fs/cgroup /dev/sda1 497M 150M 348M 31% /boot [root@oel71 ~]# |
————————————————————————
Done。
真是醉了