learnitguide

resize2fs: Bad magic number in super-block while trying open

You may get an error as below when you are trying to resize a logical volume on linux. Even after you extended the filesystem using lvextend. But when we do lvdisplay it will shows the correct size as you extended, but we will be getting an error as below.
[root @linux ~]# resize2fs /dev/centos/root
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/centos-root
Couldn't find valid filesystem superblock.
Possible reason is, the mounted filesystem would be XFS filesystem. SO resize2fs wont work for xfs filesystem, we should use xfs_growfs instead of resize2fs.
[root @linux ~]# xfs_growfs /dev/centos/root
Lets do a final check.
[root @linux ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root  115G  7.0G  108G   7% /

Keywords : resize2fs Bad magic number in super-block while trying open, Bad magic number in super-block, resize2fs error in linux, bad magic number in superblock centos

Related Something You missed?

Linux FAQs 5202922544461524403

item