问题:resize2fs: Bad magic number in super-block while trying to open /dev/mapper/cl-root
[root@docker1 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/cl-root xfs 18G 18G 897M 96% /
devtmpfs devtmpfs 901M 0 901M 0% /dev
tmpfs tmpfs 912M 0 912M 0% /dev/shm
tmpfs tmpfs 912M 608K 912M 1% /run
tmpfs tmpfs 912M 0 912M 0% /sys/fs/cgroup
/dev/sda1 xfs 1014M 186M 829M 19% /boot
tmpfs tmpfs 183M 0 183M 0% /run/user/0
添加硬盘后,重新扫描硬盘状态
[root@docker1 ~]# echo "- - -" >/sys/class/scsi_host/host0/scan
[root@docker1 ~]# echo "- - -" >/sys/class/scsi_host/host1/scan
[root@docker1 ~]# echo "- - -" >/sys/class/scsi_host/host2/scan
[root@docker1 ~]# vgdisplay
--- Volume group ---
VG Name cl
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <19.00 GiB
PE Size 4.00 MiB
Total PE 4863
Alloc PE / Size 4862 / 18.99 GiB
Free PE / Size 1 / 4.00 MiB
VG UUID 0g6KUL-2kdC-e4Ml-EMFH-2JYs-SNUT-bn09Od
[root@docker1 ~]# pvcreate /dev/sdc
Physical volume "/dev/sdc" successfully created.
[root@docker1 ~]# pvscan
PV /dev/sda2 VG cl lvm2 [<19.00 GiB / 4.00 MiB free]
PV /dev/sdc lvm2 [20.00 GiB]
Total: 2 [<39.00 GiB] / in use: 1 [<19.00 GiB] / in no VG: 1 [20.00 GiB]
[root@docker1 ~]# vgextend cl /dev/sdc
Volume group "cl" successfully extended
[root@docker1 ~]# resize2fs /dev/mapper/cl-root
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/cl-root
Couldn't find valid filesystem superblock.
[root@docker1 ~]# mount |grep cl-root
/dev/mapper/cl-root on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
[root@docker1 ~]# xfs_
xfs_admin xfs_freeze xfs_logprint xfs_quota
xfs_bmap xfs_fsr xfs_mdrestore xfs_repair
xfs_copy xfs_growfs xfs_metadump xfs_rtcp
xfs_db xfs_info xfs_mkfile
xfs_estimate xfs_io xfs_ncheck
[root@docker1 ~]# xfs_growfs /dev/mapper/cl-root
meta-data=/dev/mapper/cl-root isize=512 agcount=4, agsize=1179136 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=4716544, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
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 4716544 to 5242880
[root@docker1 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/cl-root xfs 20G 18G 2.9G 86% /
devtmpfs devtmpfs 901M 0 901M 0% /dev
tmpfs tmpfs 912M 0 912M 0% /dev/shm
tmpfs tmpfs 912M 640K 912M 1% /run
tmpfs tmpfs 912M 0 912M 0% /sys/fs/cgroup
/dev/sda1 xfs 1014M 186M 829M 19% /boot
tmpfs tmpfs 183M 0 183M 0% /run/user/0
本文转自 Mr_sheng 51CTO博客,原文链接:http://blog.51cto.com/sf1314/2062106