Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I did following under the root login (shrinking /home, expanding /var):

umount /home lvresize -L-7G /dev/mapper/myvg-home

it was warning:

WARNING: Reducing active logical volume to 28.89 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)

I thought it is usual warning and accepted

Then I done:

> lvresize -L+7G /dev/mapper/myvg-var

It was successfully done:

Extending logical volume var to 9.79 GiB
Logical volume var successfully resized

But as I saw the /var didn't expanded if looking with df -h. I thought the reboot will solve the problem.

Then I tried to mount the home partition back:

> mount /home

And I got an error:

 mount: wrong fs type, bad option, bad superblock on /dev/mapper/myvg-home,
   missing codepage or helper program, or other error
   In some cases useful info is found in syslog - try
   dmesg | tail  or so

Then I rebooted the machine. Afterwards I got:

Welcome to emergency mode. Use "systemctl default" or ^D to activate default
Give root password for maintenance
(or type Control-D to continue):

So I entered the maintenance console and ran:

> fsck /dev/mapper/myvg-home

But after some questions about errors and whether I would like to abort the operations I got a new error:

fsck.ext4: Can't read an block bitmap while retrying to read bitmaps for /dev/mapper/myvg-home
e2fsck: aborted

So I cannot get the system running. What is the problem and what did I wrong when tried to resize the lvm partitions? It is just unmount, resize and mount back again, isn't it?

Is it possible to recover the partition or at least to create a new and get the system running back, or does it require some special operations to create a new home partition?

share|improve this question
When you lvresize you're only resizing the virtual volume. The actual file system partition isn't affected. You still need to resize it with resize2fs before the space shows up in df. Similarly, you'll first want to shrink your partition before you shrink the volume the partition resides on. – Oliver Salzburg Oct 10 '13 at 17:26
so, is it possible to recover the /home with the files there? I recovered using the vgcfgrestore -f /etc/lvm/archive/ my-vg, so lvs shows now the previous partition table. But if I try to mount home I get the same error message: mount: wrong fs type, .... – static Oct 10 '13 at 17:31
First shrink the file system, then shrink the lvm. For expasion, expand the lvm first, then expand the file system. – RainDoctor Feb 19 '14 at 19:58
You need to use lvresize -r to resize the file system at same time. Basically you only modified LV size but the file system still at old size. – Ask and Learn Nov 17 '15 at 23:05

You must log in to answer this question.

Browse other questions tagged .