0

I am using windows and centos 8 stream dual boot. I want to extend the size of the centos root . I found this link

Increase Linux partition with unused Windows partition space on dualbooot system

and followed the step mentioned in it. I shrank some memory from my windows and created a new partition using GParted. And in the rescue mode, I created the physical volume of this partition and tried to use this to extend the size of root in LVM of the centos. When I tried to run e2fsck -f /dev/mapper/cs-root or e2fsck -f /dev/cs/root, it is not running and showing the errors as shown in the figure

enter image description here

Due to this I could not use resize2fs command even though i can use lvextend command. How to remove this error and increase the size of the root partition successfully?

2

No, you should not use e2fsck nor resize2fs here. Because in your picture, e2fsck says:

/dev/mapper/cs-root contains a xfs file system

e2fsck and resize2fs are for ext2, ext3 and ext4 filesystem types only. Trying to use the repair/extension tools of a wrong filesystem type will not work and might cause damage if forced.

If you've already used lvextend, the correct command to extend an XFS root filesystem is xfs_growfs /, or alternatively fsadm resize /dev/mapper/cs-root. Yes, these commands are designed to extend the filesystem while it is mounted and in use.

If you haven't yet used lvextend, you could have it automatically extend the filesystem too, by adding the --resizefs option (or -r for short) to your lvextend command line.

1
  • Ya, I used lvextend and then fsadm resize /dev/mapper/cs-root. Now the size of the root got extended successfully and its working properly.
    – Ara
    Aug 6 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.