after lvreduce reboot now can't read superblock
Originally on my CentOS 7 virtual machine, I created 2 partitions:
sda1 for /boot sda2 with 1 volume group "centos" with 5 logical volumes: / /home /var /tmp swap I noticed later that I had needed more space from /home lvm. It was 15GB, it was only using 1.5GB, so I decided to reduce it down to 5GB: Code:
# lvreduce -L 5GB /dev/mapper/centos-home Upon reboot, I was sent to emergency mode, and noticed /home was not listed under df, so I mounted everything in fstab but received an error: Code:
#mount -a Code:
# xfs_repair /dev/mapper/centos-home Oddly enough, the lvdisplay /dev/mapper/centos-home works and now shows LV Size as 5.00GB down from 15.00GB with all the other information listed... So how do I fix this issue so I can remount the home logical volume? SK |
Increase the lv to at least the same size as it was - personally I would make it larger if space exists.
Then run a fsck - and hope. xfs cannot be reduced by command - do some searching before using potentially destructive commands. Backups are never a bad idea also. |
In addition, lvreduce shrinks the volume i.e the container but not the file system. As stated there isn't a way to reduce an xfs file system so you need to copy it first, shrink the volume, make a new file system and the copy data back. Hopefully, you haven't lost any important data.
|
Thanks for the info that's really good to know about xfs. No worries about data or backups as this is my play / test lab, I'm only using it to learn for the last few months. I'll remake the volume group with the 5 logical volumes as ext4 and try again. Or is ext4 also limited to a file system that cannot be reduced?
|
Quote:
|
Thanks for the link, it was a good read.
I'm curious now though. If resize2fs is the way to resize the file system, and lvreduce doesn't work on xfs, then when would I ever use lvreduce? The only time I can think of using it would be when I've created a logical volume, but have not yet made the file system. Its like its a tool for someone who has made the LV, then thinks "you know what, that's too big, I'm going to resize it before I make it ext4 file system". Is that accurate? |
Quote:
Then you reduce the size of the underlying block device (lvreduce for LVM logical volumes). |
Ahhh...lightbulb
Thanks for the clarification |
Quote:
The issue with xfs is that there is no ready equivalent to ext's resize2fs (for shrinking anyhow). |
In fact lvreduce can also reduce the filesystem - if the filesystem is "sane". IMHO that excludes xfs. Similarly lvextend, but in that case xfs is also catered for.
|
Quote:
|
Hello,
I have the same issue but I need more help. I reduced home partition using command below: Code:
[root@sfvm08 mapper]# lvreduce -L 70G /dev/mapper/centos_sfvm03-home after that I increased root partition using command below: Code:
[root@sfvm08 mapper]# lvextend -r -l+100%FREE /dev/mapper/centos_sfvm03-root Tried to repair using command below in rescue mode: Code:
xfs_repair /dev/mapper/centos_sfvm03-home unfortunately I don't have any backup and my data is important :( I need more detailed guide for my case. This is a Virtual Machine and I have access to virtualization environment so I can increase hard disk over VMWare ESXi. Does it harm hard disk? as far as I read over the similar threat, I should increase reduced LV, can someone help me more detail on how to do that? |
@sahruk,
Hello and welcome to LQ. Please post your issue in only one thread. Posting your issue once will make it easier for members to help you and will keep the discussion in one place. While I do realize this issue is similar, please use your new thread question for better assistance: http://www.linuxquestions.org/questi...ck-4175593319/ |
All times are GMT -5. The time now is 05:53 AM. |