LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Unable to boot RHEL 5.2 and Unable to mount root file system in rescue mode (https://www.linuxquestions.org/questions/red-hat-31/unable-to-boot-rhel-5-2-and-unable-to-mount-root-file-system-in-rescue-mode-785266/)

vknemannavar 01-28-2010 01:33 AM

Unable to boot RHEL 5.2 and Unable to mount root file system in rescue mode
 
Environment:
A 32-bit kernel RHEL5.3 system running on a virtual machine. The root(/) filesystem is on an LV.

Issue:
Unable to resize the FS after extending the root LV since it is mounted. After extending the LV, online resizing of the FS was not supported and the root filesystem could not be unmounted while it was in use. On rebooting, I got a kernel panic error. In runlevel 1, I couldn't run chroot, couldn't find the /etc/fstab, root FS could not be mounted, fsck did not run (tried block 31 for second copy of superblock using dd count=1 bs=4k skip=31 seek=1 if=/dev/sda2 of=/dev/sda2), couldn't find any rpm on installation media to install unix-utils rpm. On running commands in runlevel 1, I got the following output. Please advise.

chroot /mnt/sysimage/
chroot:cannot run command '/bash/sh': No such file or directory

fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1305 10377990 8e Linux LVM

fsck -p /dev/sda2
fsck 1.39 (29-May-2006)
WARNING: couldn't open /etc/fstab: No such file or directory
e2fck 1.39 (29-May-2006)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext2: Bad magic nimber in super-block while trying to open /dev/sda2

DrLove73 01-28-2010 05:14 AM

Hi, welcome to the LQ forums.

Your problem is that when you boot like that your lvm volumes are not recognized and mounted. You need to mount them first with:

Code:

lvm pvscanv
Code:

lvm vgscan
Code:

lvm vgchange VolGroup00 -a y
(If your Volume Group has that name, or change it to match the output of the previous command
Code:

lvm lvscan
If lvm does not work, you need to boot from Installation media with "linux rescue". DVD or what ever. LVM volumes should be mounted automatically when rescue searches for existing installations.

Now you can use
Code:

fsck -p /dev/VolGroup00/LogVol00
or what ever partition you need to check.

If you boot from Installation media, you can mount partitions with:
Code:

mount /dev/VolGroup00/LogVol?? /mnt/sysimage
, etc

DrLove73 01-28-2010 05:35 AM

The way I resize(d) LVM partition is following:

Boot from Installation media, let it find and mount partitions (or avoid searching for them and use above post until mounting segment).
then
Code:

lvm vgdisplay VolGroup00
to see LVM related data.
Now unmount LVM partitions like this:
Code:

umount /mnt/sysimage/boot
and
Code:

umount /mnt/sysimage
,
order LVM do deactivate partitions from that volume group:
Code:

lvm lvchange -a n /dev/VolGroup00/LogVol00 /dev/VolGroup00/LogVol00
(add more at the end if you have more inside that volume group), then resize phisical volume is necesary. I used following syntax for single drive (on the RAID):
Code:

lvm pvresize -v -d /dev/md3
, you use your correct disk instead of "/dev/md3".

Then activate volume groups again:
Code:

lvm vgchange -ay
and activate LV's with
Code:

lvm lvscan
Then read volume group to see the Free PE size:
Code:

lvm vgdisplay VolGroup00
, and resize the LV you want (in this case for another 3GB):
Code:

lvm lvresize -L +3GB /dev/VolGroup00/LogVol00
OR to use number of entities use
Code:

lvm lvresize -l +<number> /dev/VolGroup00/LogVol00
this last syntax I have not tested!.

Now see what you have done with
Code:

lvm lvdisplay /dev/VolGroup00/LogVol00
and
Code:

df -kh
, then fix partition with
Code:

umount /dev/VolGroup00/LogVol00
Code:

resize2fs -p /dev/VolGroup00/LogVol00
THIS MAY BE REDUNANT:
Code:

e2fsck -f /dev/VolGroup00/LogVol00
That should be it.

vknemannavar 01-28-2010 11:33 PM

Quote:

Originally Posted by DrLove73 (Post 3843460)
The way I resize(d) LVM partition is following:

Boot from Installation media, let it find and mount partitions (or avoid searching for them and use above post until mounting segment).
then
Code:

lvm vgdisplay VolGroup00
to see LVM related data.
Now unmount LVM partitions like this:
Code:

umount /mnt/sysimage/boot
and
Code:

umount /mnt/sysimage
,
order LVM do deactivate partitions from that volume group:
Code:

lvm lvchange -a n /dev/VolGroup00/LogVol00 /dev/VolGroup00/LogVol00
(add more at the end if you have more inside that volume group), then resize phisical volume is necesary. I used following syntax for single drive (on the RAID):
Code:

lvm pvresize -v -d /dev/md3
, you use your correct disk instead of "/dev/md3".

Then activate volume groups again:
Code:

lvm vgchange -ay
and activate LV's with
Code:

lvm lvscan
Then read volume group to see the Free PE size:
Code:

lvm vgdisplay VolGroup00
, and resize the LV you want (in this case for another 3GB):
Code:

lvm lvresize -L +3GB /dev/VolGroup00/LogVol00
OR to use number of entities use
Code:

lvm lvresize -l +<number> /dev/VolGroup00/LogVol00
this last syntax I have not tested!.

Now see what you have done with
Code:

lvm lvdisplay /dev/VolGroup00/LogVol00
and
Code:

df -kh
, then fix partition with
Code:

umount /dev/VolGroup00/LogVol00
Code:

resize2fs -p /dev/VolGroup00/LogVol00
THIS MAY BE REDUNANT:
Code:

e2fsck -f /dev/VolGroup00/LogVol00
That should be it.

I have tried all the option, I am not finding the Volume group itself

vknemannavar 01-28-2010 11:39 PM

I have tried all the above mentioned options, but i am not finding volume group itself

DrLove73 01-29-2010 09:05 AM

If you can not find any volume group (VolGroup00 is just a default name), then it seams you have messed up your LVM partition. I have never had this problem, so somone else will have to step in.


All times are GMT -5. The time now is 12:28 PM.