[root@GZekcapp ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sr0 11:0 1 1024M 0 rom
sr1 11:1 1 1024M 0 rom
vda 253:0 0 100G 0 disk
└─vda1 253:1 0 100G 0 part /
vdb 253:16 0 1.4T 0 disk
├─vdb1 253:17 0 100G 0 part
└─vdb2 253:18 0 1.3T 0 part /soft
vdc 253:32 0 1000G 0 disk
└─centos-fdfs 252:0 0 24T 0 lvm /fdfs
vdd 253:48 0 3T 0 disk
└─centos-fdfs 252:0 0 24T 0 lvm /fdfs
vde 253:64 0 2T 0 disk
└─centos-fdfs 252:0 0 24T 0 lvm /fdfs
vdf 253:80 0 3T 0 disk
└─centos-fdfs 252:0 0 24T 0 lvm /fdfs
vdg 253:96 0 9.8T 0 disk
└─centos-fdfs 252:0 0 24T 0 lvm /fdfs
vdh 253:112 0 4.9T 0 disk
└─centos-fdfs 252:0 0 24T 0 lvm /fdfs
vdi 253:128 0 600G 0 disk
└─centos-fdfs 252:0 0 24T 0 lvm /fdfs
-----
[root@GZekcapp ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 100G 9.1G 91G 10% /
devtmpfs 24G 0 24G 0% /dev
tmpfs 24G 0 24G 0% /dev/shm
tmpfs 24G 8.5M 24G 1% /run
tmpfs 24G 0 24G 0% /sys/fs/cgroup
/dev/vdb2 1.3T 1.1T 104G 92% /soft
/dev/mapper/centos-fdfs 23T 22T 505G 98% /fdfs
tmpfs 4.8G 0 4.8G 0% /run/user/0
pvcreate /dev/vdi
lvdisplay
vgextend centos /dev/vdi
lvextend -L +800G /dev/centos/fdfs
resize2fs /dev/centos/fdfs
resize2fs -p /dev/centos/fdfs
[root@GZekcapp ~]# ps -aux|grep resize2fs
root 2412 99.9 0.0 128452 12724 pts/0 R+ 15:02 124:33 resize2fs -p /dev/centos/fdfs
root 12298 0.0 0.0 112652 960 pts/2 S+ 17:07 0:00 grep --color=auto resize2fs
-------------------------[root@GZekcapp ~]# vgdisplay --verbose
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 7
Metadata Sequence No 20
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 7
Act PV 7
VG Size 24.02 TiB
PE Size 4.00 MiB
Total PE 6297593
Alloc PE / Size 6297332 / 24.02 TiB
Free PE / Size 261 / 1.02 GiB
VG UUID NseWfZ-33vu-5dXD-34HW-ik0X-Z6rN-TLEsO7
--- Logical volume ---
LV Path /dev/centos/fdfs
LV Name fdfs
VG Name centos
LV UUID LWlPVD-kv6B-8xMy-oH3u-coR5-84Ox-qkIq2j
LV Write Access read/write
LV Creation host, time GZekcapp, 2020-05-29 16:26:42 +0800
LV Status available
# open 2
LV Size 24.02 TiB
Current LE 6297332
Segments 7
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 252:0
--- Physical volumes ---
PV Name /dev/vdc
PV UUID d22GLB-0MRD-wu6d-Iepk-anFH-WyJm-eJFAl8
PV Status allocatable
Total PE / Free PE 255999 / 0
PV Name /dev/vdd
PV UUID z2sxyF-e6Bw-PpJw-9UMx-DIQr-MCRq-btgdjF
PV Status allocatable
Total PE / Free PE 767999 / 0
PV Name /dev/vde
PV UUID 4sZRop-YF8H-3D4e-mzAT-zBYJ-FrIG-gCqJMy
PV Status allocatable
Total PE / Free PE 511999 / 0
PV Name /dev/vdf
PV UUID CzFpT3-IrWk-eFIE-1C0B-I1zb-T1eZ-cf9YoE
PV Status allocatable
Total PE / Free PE 767999 / 0
PV Name /dev/vdg
PV UUID oHvJpF-oOU7-aadU-ZzO9-apCW-tZHX-xseDYR
PV Status allocatable
Total PE / Free PE 2559999 / 0
PV Name /dev/vdh
PV UUID 3dtjZm-uhva-n8J2-jcpL-gI0i-5lSa-vAmseZ
PV Status allocatable
Total PE / Free PE 1279999 / 0
PV Name /dev/vdi
PV UUID nRAvYC-Ab0E-LJ1S-LdnJ-YpK2-LaW2-HlP502
PV Status allocatable
Total PE / Free PE 153599 / 261
------测试环境
数据节点:68.105.245.24:10022 root/root11
vgdisplay --verbose
pvcreate /dev/vdi
lvdisplay
vgextend centos /dev/vdi
lvextend -L +800G /dev/centos/fdfs
resize2fs /dev/centos/fdfs
resize2fs -p /dev/centos/fdfs
[root@slave2 u01]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 100G 12G 89G 12% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 100K 16G 1% /dev/shm
tmpfs 16G 1.6G 14G 11% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sdh1 1.1T 157M 1.1T 1% /dfs6
/dev/sdb1 1.1T 171M 1.1T 1% /dfs0
/dev/sdj1 1.1T 142M 1.1T 1% /dfs8
/dev/sdi1 1.1T 144M 1.1T 1% /dfs7
/dev/sdc1 1.1T 147M 1.1T 1% /dfs1
/dev/sdk1 1.1T 140M 1.1T 1% /dfs9
/dev/sdd1 1.1T 150M 1.1T 1% /dfs2
/dev/sdf1 1.1T 163M 1.1T 1% /dfs4
/dev/sdg1 1.1T 158M 1.1T 1% /dfs5
/dev/sde1 1.1T 131G 913G 13% /dfs3
/dev/sda2 1016M 164M 852M 17% /boot
/dev/mapper/centos-u01 895G 35G 861G 4% /u01
/dev/mapper/centos-home 100G 2.5G 98G 3% /home
tmpfs 3.1G 0 3.1G 0% /run/user/0
tmpfs 3.1G 16K 3.1G 1% /run/user/42
cm_processes 16G 739M 15G 5% /run/cloudera-scm-agent/process
----缩减逻辑卷大小
fuser -m -v -i -k /dev/mapper/centos-u01
umount /u01
--e2fsck -f /dev/mapper/centos-u01
---xfs_growfs /dev/mapper/centos-u01 10G
lvreduce -L 10G /dev/mapper/centos-u01 ---直接减少到10G
lvextend -L +800G /dev/mapper/centos-u01
xfs_growfs /dev/mapper/centos-u01
mount /dev/mapper/centos-u01 /u01
mkfs.xfs -f /dev/mapper/centos-u01
mount /dev/mapper/centos-u01 /u01
----------------
1011 umount /dev/mapper/centos-fdfs
1012 df -h
1013 resize2fs /dev/mapper/centos-fdfs
1014 e2fsck -f /dev/mapper/centos-fdfs
1015 resize2fs /dev/mapper/centos-fdfs
1016 lvdisplay
1017 resize2fs -p /dev/mapper/centos-fdfs
1018 df -h
1019 lsblk
1020 ls
1021 mount /dev/mapper/centos-fdfs /fdfs
[root@GZekcapp ~]# mount /dev/centos/fdfs /fdfs
mount: wrong fs type, bad option, bad superblock on /dev/mapper/centos-fdfs,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
You have new mail in /var/spool/mail/root
-----------------------------
[1360745.270475] traps: nginx[7087] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360745.444942] traps: nginx[7163] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360745.509876] traps: nginx[7167] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360745.554970] traps: nginx[7169] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360745.612269] traps: nginx[7171] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360745.658354] traps: nginx[7173] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360763.152443] traps: nginx[7175] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360763.197801] traps: nginx[7192] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360763.249853] traps: nginx[7194] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360763.298226] traps: nginx[7196] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360763.340707] traps: nginx[7198] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360763.390929] traps: nginx[7200] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360768.045337] traps: nginx[7202] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360768.137866] traps: nginx[7211] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360768.178144] traps: nginx[7215] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360768.231763] traps: nginx[7218] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360768.276385] traps: nginx[7220] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360768.329220] traps: nginx[7222] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360774.360516] traps: nginx[7224] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360774.416681] traps: nginx[7226] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360774.460749] traps: nginx[7228] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360774.507153] traps: nginx[7230] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360774.560130] traps: nginx[7232] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1360774.608367] traps: nginx[7234] general protection ip:472e2a sp:7ffed6fced78 error:0 in nginx[400000+93000]
[1365598.799878] pci 0000:00:0f.0: [1af4:1001] type 00 class 0x010000
[1365598.799986] pci 0000:00:0f.0: reg 0x10: [io 0x0000-0x003f]
[1365598.800114] pci 0000:00:0f.0: reg 0x14: [mem 0x00000000-0x00000fff]
[1365598.801284] pci 0000:00:0f.0: BAR 1: assigned [mem 0xe0000000-0xe0000fff]
[1365598.801315] pci 0000:00:0f.0: BAR 0: assigned [io 0x1000-0x103f]
[1365598.801489] virtio-pci 0000:00:0f.0: enabling device (0000 -> 0003)
[1365598.819322] virtio-pci 0000:00:0f.0: virtio_pci: leaving for legacy driver
[1365598.834766] virtio-pci 0000:00:0f.0: irq 45 for MSI/MSI-X
[1365598.834801] virtio-pci 0000:00:0f.0: irq 46 for MSI/MSI-X
[1365598.898425] vdj:
[1378337.068153] EXT4-fs (dm-0): ext4_check_descriptors: Block bitmap for group 190392 not in group (block 13144609553842700288)!
[1378337.068411] EXT4-fs (dm-0): group descriptors corrupted!
[1378430.074401] EXT4-fs (dm-0): ext4_check_descriptors: Block bitmap for group 190392 not in group (block 13144609553842700288)!
[1378430.074569] EXT4-fs (dm-0): group descriptors corrupted!
[1378618.314420] EXT4-fs (dm-0): ext4_check_descriptors: Block bitmap for group 190392 not in group (block 13144609553842700288)!
[1378618.314569] EXT4-fs (dm-0): group descriptors corrupted!
fsck -t ext4 /dev/centos/fdfs
[root@GZekcapp ~]# fsck -t ext4 /dev/centos/fdfs
fsck from util-linux 2.23.2
e2fsck 1.42.9 (28-Dec-2013)
ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
fsck.ext4: Group descriptors look bad... trying backup blocks...
Block bitmap for group 190392 is not in group. (block 13144609553842700288)
Relocate<y>? yes
Inode bitmap for group 190392 is not in group. (block 18007717468809723904)
Relocate<y>? yes
Inode table for group 190392 is not in group. (block 1614126719327797248)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? yes
One or more block group descriptor checksums are invalid. Fix<y>? yes
Group descriptor 190392 checksum is 0x375d, should be 0x035a. FIXED.
Block bitmap for group 190393 is not in group. (block 16862280511651840000)
Relocate<y>? yes
Inode bitmap for group 190393 is not in group. (block 2729857234535186432)
Relocate<y>? yes
Inode table for group 190393 is not in group. (block 15652517412689936384)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? yes
Group descriptor 190393 checksum is 0x5d8d, should be 0x83d2. FIXED.
Block bitmap for group 190394 is not in group. (block 5214921953336360960)
Relocate<y>? yes
Inode bitmap for group 190394 is not in group. (block 6384670568578285568)
Relocate<y>? yes
Inode table for group 190394 is not in group. (block 14486237193992929280)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? yes
Group descriptor 190394 checksum is 0xd8ff, should be 0x565b. FIXED.
Block bitmap for group 190395 is not in group. (block 13113027791731818496)
Relocate<y>? yes
Inode bitmap for group 190395 is not in group. (block 2303350102820913152)
Relocate<y>? yes
Inode table for group 190395 is not in group. (block 8795765526656712704)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? yes
Group descriptor 190395 checksum is 0x23e6, should be 0x2bd8. FIXED.
Block bitmap for group 190396 is not in group. (block 759913971045105664)
Relocate<y>? yes
Inode bitmap for group 190396 is not in group. (block 1871511533712834560)
Relocate<y>? yes
Inode table for group 190396 is not in group. (block 7652671938015264768)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? yes
Group descriptor 190396 checksum is 0x24f4, should be 0xa930. FIXED.
Block bitmap for group 190397 is not in group. (block 8256538868044529664)
Relocate<y>? yes
Inode bitmap for group 190397 is not in group. (block 9338930000264429568)
Relocate<y>? yes
Inode table for group 190397 is not in group. (block 2777306607292252160)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? yes
Group descriptor 190397 checksum is 0x4ad9, should be 0x0486. FIXED.
Block bitmap for group 190398 is not in group. (block 16845158929469014016)
Relocate<y>? yes
Inode bitmap for group 190398 is not in group. (block 10987780168675753984)
Relocate<y>? yes
Inode table for group 190398 is not in group. (block 13944691970300444672)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? yes
Group descriptor 190398 checksum is 0x0031, should be 0xfa4e. FIXED.
Block bitmap for group 190399 is not in group. (block 8363914287395110912)
Relocate<y>? yes
Inode bitmap for group 190399 is not in group. (block 8865614472417378304)
Relocate<y>? yes
Inode table for group 190399 is not in group. (block 15447131243371560960)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? yes
Group descriptor 190399 checksum is 0x9a2f, should be 0x3831. FIXED.
/dev/mapper/centos-fdfs contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
------
mount -t ext4 -o nouuid,noload,ro /dev/centos/fdfs /fdfs
dumpe2fs /dev/centos/fdfs|more
/usr/lib/udev/scsi_id -g -u -d /dev/centos/fdfs
----可以尝试方案
1、把新vg和pv删除掉;
[root@GZekcapp archive]# pvscan
PV /dev/vdc VG centos lvm2 [1000.00 GiB / 0 free]
PV /dev/vdd VG centos lvm2 [2.93 TiB / 0 free]
PV /dev/vde VG centos lvm2 [1.95 TiB / 0 free]
PV /dev/vdf VG centos lvm2 [2.93 TiB / 0 free]
PV /dev/vdg VG centos lvm2 [9.77 TiB / 0 free]
PV /dev/vdh VG centos lvm2 [4.88 TiB / 0 free]
PV /dev/vdi VG centos lvm2 [600.00 GiB / 1.02 GiB free]
Total: 7 [24.02 TiB] / in use: 7 [24.02 TiB] / in no VG: 0 [0 ]
vgreduce centos /dev/vdi
pvremove /dev/vdi
2、还原自动备份超级块
dumpe2fs /dev/centos/fdfs > /home/dumpe2fs_fdfs.txt
-----备份/dev/sde superblock(超级块)
dd if=/dev/centos/fdfs of=/home/backup-fdfs bs=4096 count=1
----恢复vg
[root@slave2 archive]# ll
-rw------- 1 root root 2584 Apr 2 2021 centos_00010-1212912246.vg
-rw------- 1 root root 2591 Apr 2 2021 centos_00011-1667986337.vg
-rw------- 1 root root 2591 Apr 2 2021 centos_00012-16939557.vg
-rw------- 1 root root 2581 May 17 2021 centos_00013-23426056.vg
-rw------- 1 root root 2839 May 17 2021 centos_00014-494789311.vg
-rw------- 1 root root 3021 May 17 2021 centos_00015-1462270494.vg
-rw------- 1 root root 3010 Nov 3 15:10 centos_00016-1663847809.vg
-rw------- 1 root root 3268 Nov 3 15:12 centos_00017-1713226575.vg
-rw------- 1 root root 3438 Jan 29 10:19 centos_00018-2043388621.vg
-rw------- 1 root root 3689 Jan 29 10:20 centos_00019-1768143128.vg
-----查看具体操作的备份信息
vgcfgrestore --list centos
[root@GZekcapp home]# vgcfgrestore --list centos
File: /etc/lvm/archive/centos_00010-1212912246.vg
Couldn't find device with uuid d22GLB-0MRD-wu6d-Iepk-anFH-WyJm-eJFAl8.
Couldn't find device with uuid z2sxyF-e6Bw-PpJw-9UMx-DIQr-MCRq-btgdjF.
Couldn't find device with uuid 4sZRop-YF8H-3D4e-mzAT-zBYJ-FrIG-gCqJMy.
Couldn't find device with uuid CzFpT3-IrWk-eFIE-1C0B-I1zb-T1eZ-cf9YoE.
VG name: centos
Description: Created *before* executing 'lvextend -L +199G /dev/centos/fdfs'
Backup Time: Fri Apr 2 16:01:08 2021
File: /etc/lvm/archive/centos_00011-1667986337.vg
VG name: centos
Description: Created *before* executing 'lvextend -L +1999G /dev/centos/fdfs'
Backup Time: Fri Apr 2 16:01:32 2021
File: /etc/lvm/archive/centos_00012-16939557.vg
VG name: centos
Description: Created *before* executing 'lvextend -L +800G /dev/centos/fdfs'
Backup Time: Fri Apr 2 16:01:46 2021
File: /etc/lvm/archive/centos_00013-23426056.vg
VG name: centos
Description: Created *before* executing 'vgextend centos /dev/vdg'
Backup Time: Mon May 17 09:29:09 2021
File: /etc/lvm/archive/centos_00014-494789311.vg
Couldn't find device with uuid oHvJpF-oOU7-aadU-ZzO9-apCW-tZHX-xseDYR.
VG name: centos
Description: Created *before* executing 'lvextend -L +9000G /dev/centos/fdfs'
Backup Time: Mon May 17 09:30:53 2021
File: /etc/lvm/archive/centos_00015-1462270494.vg
VG name: centos
Description: Created *before* executing 'lvextend -L +1000G /dev/centos/fdfs'
Backup Time: Mon May 17 09:35:33 2021
File: /etc/lvm/archive/centos_00016-1663847809.vg
VG name: centos
Description: Created *before* executing 'vgextend centos /dev/vdh'
Backup Time: Wed Nov 3 15:10:04 2021
File: /etc/lvm/archive/centos_00017-1713226575.vg
Couldn't find device with uuid 3dtjZm-uhva-n8J2-jcpL-gI0i-5lSa-vAmseZ.
VG name: centos
Description: Created *before* executing 'lvextend -L +4800G /dev/centos/fdfs'
Backup Time: Wed Nov 3 15:12:05 2021
File: /etc/lvm/archive/centos_00018-2043388621.vg
VG name: centos
Description: Created *before* executing 'vgextend centos /dev/vdi'
Backup Time: Sat Jan 29 10:19:08 2022
File: /etc/lvm/archive/centos_00019-1768143128.vg
Couldn't find device with uuid nRAvYC-Ab0E-LJ1S-LdnJ-YpK2-LaW2-HlP502.
VG name: centos
Description: Created *before* executing 'lvextend -L +800G /dev/centos/fdfs'
Backup Time: Sat Jan 29 10:20:41 2022
File: /etc/lvm/backup/centos
VG name: centos
Description: Created *after* executing 'lvextend -L +800G /dev/centos/fdfs'
Backup Time: Sat Jan 29 10:20:42 2022
vgcfgrestore -f /etc/lvm/archive/centos_00018-2043388621.vg centos ----恢复到 *before* executing 'vgextend centos /dev/vdi'
[root@GZekcapp /]# vgcfgrestore -f /etc/lvm/archive/centos_00018-2043388621.vg centos
Restored volume group centos
WARNING: Inconsistent metadata found for VG centos
lvscan
lvchange -ay centos
mount /dev/centos/fdfs /fdfs
[root@GZekcapp /]# vgcfgrestore -f /etc/lvm/archive/centos_00019-1768143128.vg centos
Restored volume group centos
[root@GZekcapp /]# mount /dev/centos/fdfs /fdfs
mount: wrong fs type, bad option, bad superblock on /dev/mapper/centos-fdfs,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
e2fsck -f /dev/centos/fdfs
[root@GZekcapp /]# e2fsck -f /dev/centos/fdfs
e2fsck 1.42.9 (28-Dec-2013)
ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
e2fsck: Group descriptors look bad... trying backup blocks...
Block bitmap for group 190392 is not in group. (block 13144609553842700288)
Relocate<y>?
----备份/home superblock
dd if=/dev/mapper/centos-home of=./backup_after_vgreduce bs=4096 count=1
-----尝试修复/dev/sde
[root@fsapp /]# dumpe2fs /dev/sde > /maihuajin/dumpe2fs_sde.txt
dumpe2fs 1.42.9 (28-Dec-2013)
dumpe2fs: A block group is missing an inode table while reading journal inode
e2fsck -f /dev/sde
e2fsck -b 32768 /dev/sde
----------------------
[root@GZekcapp ~]# mke2fs -n /dev/centos/fdfs
mke2fs 1.42.9 (28-Dec-2013)
mke2fs: Size of device (0x173dbd000 blocks) /dev/centos/fdfs too big to be expressed
in 32 bits using a blocksize of 4096.
dumpe2fs /dev/centos/fdfs|grep superblock
mount -o sb=32768 /dev/centos/fdfs /fdfs
[root@GZekcapp ~]# tune2fs -l /dev/mapper/centos-fdfs
tune2fs 1.42.9 (28-Dec-2013)
tune2fs: Invalid argument while trying to open /dev/mapper/centos-fdfs
Couldn't find valid filesystem superblock.
-----测试环境
dd if=/dev/mapper/centos-u01 of=/home/backup-centos-u01 bs=4096 count=1
vgcfgrestore -f /etc/lvm/archive/centos_00001-611175114.vg centos
lvscan
lvchange -ay centos
mount /dev/mapper/centos-u01 /u01
[root@slave2 ~]# umount /u01
[root@slave2 ~]# mke2fs -n /dev/mapper/centos-u01
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=64 blocks, Stripe width=64 blocks
58654720 inodes, 234618880 blocks
11730944 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
7160 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
[root@slave2 ~]#
dumpe2fs 1.42.9 (28-Dec-2013)
Primary superblock at 0, Group descriptors at 1-15
Backup superblock at 32768, Group descriptors at 32769-32783
Backup superblock at 98304, Group descriptors at 98305-98319
Backup superblock at 163840, Group descriptors at 163841-163855
Backup superblock at 229376, Group descriptors at 229377-229391
Backup superblock at 294912, Group descriptors at 294913-294927
Backup superblock at 819200, Group descriptors at 819201-819215
Backup superblock at 884736, Group descriptors at 884737-884751
Backup superblock at 1605632, Group descriptors at 1605633-1605647
Backup superblock at 2654208, Group descriptors at 2654209-2654223
Backup superblock at 4096000, Group descriptors at 4096001-4096015
Backup superblock at 7962624, Group descriptors at 7962625-7962639
Backup superblock at 11239424, Group descriptors at 11239425-11239439
Backup superblock at 20480000, Group descriptors at 20480001-20480015
Backup superblock at 23887872, Group descriptors at 23887873-23887887
---用备份出来的超级块来挂载/dev/mapper/centos-u01
mount -o sb=32768 /dev/mapper/centos-u01 /u01
---用mke2fs -S重新生成超级块
mke2fs -S /dev/mapper/centos-u01
[root@slave2 ~]# mke2fs -S /dev/mapper/centos-u01
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=64 blocks, Stripe width=64 blocks
58654720 inodes, 234618880 blocks
11730944 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
7160 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Allocating group tables: done
Writing superblocks and filesystem accounting information: done
----重新挂载
mount /dev/mapper/centos-u01 /u01
挂载不成功,报stale file handle错误。
----fsck -y /dev/mapper/centos-u01
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。