Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Please dont be mad at me, i ran into this issue only because i wanted to learn. I was reading the book, linux troubleshooting and decided to give it a try.
1) I went to /boot/ and moved vmlinuz (kernel file) to my home directory. (/root/)
2) I booted, it didnt boot (as expected) and now the troubleshooting part begins.
3) i entered to grub config mode using c
4) When i press root (hd0, (tab)
it gave me 2 partitions.
hd0 which is my boot partition
hd1 which is my '/' partition. Please keep in mind its LVM and not a physical partition
5) If i do this, root (hd0,1), and press boot, it gives the following error
Error 17: Cannot mount selected partition
During my research i found that, LVM is not supported by grub, so kindly confirm me this ? is this the reason i am not able to access my root partition ? i am doing this on vmware so no issues, but just for the sake of learning, can someone tell me some way of restoring it without using any rescure disk (livecd, liveusb etc) ?
I checked on internet, and i found that in Grub 1.98, it can access LVM partitions. After installing 1.98, i am still not able to read the partitions from grub prompt !!
I second. This is going to be easier to fix if we know what distro you use.
Bear in mind, you can restore vmlinuz from other sources. Your installation disk would be a good source (generally, though it probably has a different name). For example, if you have Ubuntu already installed, you can boot the install disk, and copy the kernel to your /boot partition. This way, you don't need to read your root partition at all. Once your system boots again, I'd move your original back, just to be safe.
This is most likely to work with a kernel compiled by your distro.
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS
root (hd0,0)
kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-194.el5.img
[root@WAN-Admin ~]#
[root@WAN-Admin ~]# cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}
if sleep --interruptible 0 ; then
set timeout=3
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "GNU/Linux, with Linux 2.6.18-194.el5" --class gnu-linux --class gnu --class os {
set gfxpayload=keep
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set e27eef61-f761-449c-bcb7-2f4e7620b4a2
echo Loading Linux 2.6.18-194.el5 ...
linux /vmlinuz-2.6.18-194.el5 root=/dev/mapper/VolGroup00-LogVol00 ro
echo Loading initial ramdisk ...
initrd /initrd-2.6.18-194.el5.img
}
menuentry "GNU/Linux, with Linux 2.6.18-194.el5 (recovery mode)" --class gnu-linux --class gnu --class os {
set gfxpayload=keep
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set e27eef61-f761-449c-bcb7-2f4e7620b4a2
echo Loading Linux 2.6.18-194.el5 ...
linux /vmlinuz-2.6.18-194.el5 root=/dev/mapper/VolGroup00-LogVol00 ro single
echo Loading initial ramdisk ...
initrd /initrd-2.6.18-194.el5.img
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
[root@WAN-Admin ~]#
So basically, what i did, i simply moved the kernel (vmlinuz) from /boot to my home directory i.e. /root/
Now when i was using grub 0.97, i came to know that it cant read LVM partitions. So i upgraded it to grub 1.98. Even now, its not able to read lvm partition. When i do the following on grub prompt
grub> root (hd0, (press tab)
1 -> /boot
2 -> unknown filesystem
I am really lost here, kindly guide me. My task is simple. I want to boot kernel from by /root/ partition which is a LVM partition.
Yes sir, i did above commands without sudo since i was logged in as root
I didnt get your second part, kindly guide me, what i missed ?
I downloaded grub 1.98 from a site and simply installed as was told. Kindly guide me what shall i do ? i have vmware image of my machine in which grub 0.97 was installed, so what shall i do now ?
I mentioned above that due to knowledge gain, i dont want to use any live cd approach. I want to solve it as it is. In this exercise i want to learn how should i make grub to load kernel from a non boot partition i.e. lvm partition.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.