Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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:

/dev/sda2: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
Welcome to emergency mode. Use "systemctl default" or ^D to activate default
mode.
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
1  
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_00002-692643462.vg 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.