when I am trying to extend the root partition , using below method
[root@oel7 ~]# resize2fs /dev/root_vg/root
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/root_vg/root
Couldn't find valid filesystem superblock.
I am unable to do the same with above last line error.
There are three common ways to increase disk space on the root partition or any partition for that matter. Delete aging, rotated or unused files. Increase the size of the root partition and resize its filesystem. Add disks and subpartition the root filesystem.
You're working on an XFS filesystem, in this case you need to use xfs_growfs instead of resize2fs. Two commands are needed to perform this task :
# growpart /dev/sda 1
growpart is used to expand the sda1 partition to the whole sda disk.
# xfs_growfs -d /dev/sda1
xfs_growfs is used to resize and apply the changes.
# df -h
NB: You can check this script : https://gist.github.com/OmarTrigui/7d6ec92c8f2ef83ba15b80e30fb6a5be
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With