We help IT Professionals succeed at work.

LVM or FS corruption

g0all
g0all asked
on
607 Views
Last Modified: 2012-03-11
Hi,

I've online shrinked online my lv_root partition and increased lv_home partition.

Bad thing to do, tried to run resize2fs on root partition and after receiving the error that this should be done offline my laptop doesn't boot anymore.

Used the live CD with CentOS and tried to find out what are the superblocks numbers. After that, I've managed to fsck the root partition (some errors where found).

Now, the problem is I cannot see any LV, VG or anything else related to my data. pvdisplay or vgdisplay shows nothing. In rescue mode any of these aren't seen.

When trying to boot in init 5, I get the following:

dracut: warning: no root device bloock:/dev/mapper/vg-home-lv_root found

dracut: warning: no root device bloock:/dev/mapper/vg-home-lv_root found
dracut: warning: no root device bloock:/dev/mapper/vg-home-lv_swap found
dracut: warning: boot has failed.


Please help me with this huge issue.
Comment
Watch Question

President
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
It is possible to boot using clonezilla and properly mount your logical volumes

http://clonezilla.org/downloads.php

Follow the menus mirriored on the link below until you get to the option "start clonezilla" and select "enter shell" instead

http://clonezilla.org/fine-print-live-doc.php?path=./clonezilla-live/doc/01_Save_disk_image/01-clonezilla-boot-menu.doc

once in the shell
sudo su - (to gain super user access)
lvchange -a y (to make your logical volumes available)
lvdisplay (to view your available logical volumes)

you can try running e2fsck at this point or attempt to recover data

________________________________________________________________

You may have put yourself up a creek if you reduced the logical volume without first resizing the file system on the disk.

unmount /dev/to/resize
e2fsck -f /dev/to/resize
resize2fs  -p /dev/to/resize1 ##G (resize to some number in gigabytes)

lvreduce -L ## /dev/to/resize
e2fsck -f /dev/toresize

resize2fs -p /dev/to/resize (grow Filesystem to partition)
e2fsck -f /dev/to/resize

done eat cake

Author

Commented:
KeremE - I'm not so pessimistic. :)

TO resize, I did a
lvresize -L 100G /dev/mapper/vg-home-lv_root
After that I did a
lvresize -L+100G /dev/mapper/vg-home-lv_home

On root lv I had like 500G free when I did the resize, so I don't think I've rewrite the root lv.

After that, I ran resize2fs for lv_home partition. And tried the same for lv_root but I've received the warning that this should be unmounted first.

After reboot I found my blocked device, and fsck the partitions after that (I cannot fsck the all sda because I have some other partitions also).

Author

Commented:
@linksrus - CentOS live CD did not see my LVs (partitions are seen). Do you belive CloneZilla will see the VGs and LVs?

Thanks

Author

Commented:
Sorry had a type'o on my post:

TO resize, I did a
lvresize -L-100G /dev/mapper/vg-home-lv_root
After that I did a
lvresize -L+100G /dev/mapper/vg-home-lv_home

So I took 100G from lv_root and added to lv_home.

Author

Commented:
Tried Clonezilla . booted, but lvchange -ay output asks for logical path witch I don't have.



lvdisplay, pvdisplay or vgdisplay shows nothing. Same with pvscan, vgscan, lvscan.

I can only see partitions.

Please feedback.

Author

Commented:
You were right about the order.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.