Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
This has got to be simple, but I'll ask in case someone knows the answer and can shorten my research and recovery time.
I used cfdisk to add a new partition in unused space. This shifted all my existing Linux partitions up by one number (because my free space was in the middle of the disk, not the end). Now I have two boot problems: (1) grub appears to have lost it's menu.lst, and (2) if I manually boot from grub it dies with a kernel panic that it can't find an ext3 filesystem on /dev/hda7 (and it won't, because /dev/hda7 is the new swap). I made changes to menu.lst and also to fstab before rebooting, but something didn't work as I expected.
/dev/hda1 FAT32 (primary)
/dev/hda2 NTFS (primary)
/dev/hda5 Linux LVM (logical) <- the newly created LVM
/dev/hda6 Linux LVM (logical) <- the original LVM
/dev/hda7 swap (logical)
/dev/hda8 / (logical)
/dev/hda9 /boot (logical)
Before rebooting, I changed /boot/grub/menu.lst as appeared appropriate. "root (hd0,7)" was changed to "root (hda0,8)" and the kernel line was changed to reflect "root=/dev/hda8". I also edited /etc/fstab and changed the line for swap from /dev/hda6 to /dev/hda7. Similar changes for the / (changed /dev/hda7 to /dev/hda8) and /boot (changed /dev/hda8 to /dev/hda9). I thought this should have repointed everything to the newly numbered partitions. I thought these changes would make me good to go. Wrong!
Reboot, and it comes straight up to a grub> prompt. No errors. It just looks like it doesn't know about /boot/grub/menu.lst anymore.
I can force it to continue boot by manually typing in the appropriate root, kernel, initrd, and boot lines at the grub> prompt and off it goes. It finds vmlinuz, etc., and starts to boot.
Shortly thereafter it dies with a kernel panic saying it can't find an ext3 filesystem on /dev/hda7. Well, I guess that's true given /dev/hda7 is now the swap partition. What I don't understand is WHY is it looking for ext3 on hda7? Nothing in fstab tells it that. I booted Knoppix and verified the changes to menu.lst and fstab were accurately done. I will triple check this, but my eyeballs and Knoppix keep telling me I did what I intended!
The specific messages when it dies are:
VFS: can't find ext3 filesystem on dev hda7
mount: wrong fstype, bad option.....
/usr/lib/yaird/exec/run_init: current directory is on same fielsystem as the root: Success
Kernel panic - not syncing: Attempted to kill init!
Note: /usr is mentioned above. I have /usr as a seperate mountpoint on LVM. I can't scroll back on the screen to see what messages have already flown past (the system is halted) but I don't think any LVM stuff would have been done yet.
I must have missed something simple in my above steps. Anybody know WHAT?
I should have mentioned, but forgot: Grub is not installed in my MBR. It is installed up there in /boot (hda9). I use XOSL as a boot loader to jump things up to hda9. That part works fine, as I'm getting to a grub> prompt.
Since you can manually get it to boot from grub prompt, all is not lost.
Question: did you format /dev/hda7 for swap after creating the partition? If not, mkswap /dev/hda7 will fix that. The error message you are getting seems to indicate that it's not formated yet.
"I changed /boot/grub/menu.lst as appeared appropriate. "root (hd0,7)" was changed to "root (hda0,8)""
I hope that "root (hda0,8)" is a typo. It should be "root (hd0,8)"
Beyond this, I'd need to see the menu.lst entry and fstab entries for the partitions.
Thanks for the quick reply!
I did not do a mkswp on /dev/hda7. That is because this partition was previously /dev/hda6 and had already been functioning as a swap file. My cfdisk renumbered the partitions, but I figure if /dev/hda6 used to be a swap, and now it's /dev/hda7 then it would still be a swap ... without any further mkswp-ing on my part.
(hda0,8) was a typo. I meant (hd0,8).
Below are my fstab and menu.lst. These are my modified versions, after I made changes that I thought would work with my cfdisk.
I tried to run a "fdisk -l /dev/hda" from Knoppix, but it just doesn't seem to want to give me any output. I'm not sure about how to get that info dumped from within Knoppix. It appears that it can't read /dev/hda. however, it has automounted /dev/hda7, 8, and 9 (also /dev/hda1 and 2 - my Windows partitions).
Duh! It helps to become root while in Knoppix if you want fdisk output! Here it is:
Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 34 273073+ b W95 FAT32
/dev/hda2 35 799 6144862+ 7 HPFS/NTFS
/dev/hda3 2272 24321 177116625 f W95 Ext'd (LBA)
/dev/hda5 2272 22939 166015678+ 8e Linux LVM
/dev/hda6 22940 24214 10241406 8e Linux LVM
/dev/hda7 24215 24278 514048+ 82 Linux swap / Solaris
/dev/hda8 24279 24317 313236 83 Linux
/dev/hda9 * 24318 24321 32098+ 83 Linux
Also note: When booting Knoppix, it recognizes and uses /dev/hda7 as swap space.
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
# Pretty colours
color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
# title Windows 95/98/NT/2000
# root (hd0,0)
# chainloader +1
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hda7 ro
## default grub root device
## e.g. groot=(hd0,0)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## ## End Default Options ##
title Debian GNU/Linux, kernel 2.6.14-1-686
kernel /vmlinuz-2.6.14-1-686 root=/dev/hda8 ro
title Debian GNU/Linux, kernel 2.6.14-1-686 (recovery mode)
kernel /vmlinuz-2.6.14-1-686 root=/dev/hda8 ro single
### END DEBIAN AUTOMAGIC KERNELS LIST
## This is a divider, added to separate the menu items below from the Debian
#title Other operating systems:
## This entry automatically added by the Debian installer for a non-linux OS
## on /dev/hda2
#title Microsoft Windows 2000 Professional
title SUSE LINUX 9.3
kernel (hd0,8)/vmlinuz root=/dev/hda8
Notice that (hd0,8) in mine is the /boot partition, followed by root=/dev/hda8, the root of the filesystem.
I don't know if "root (hd0,8)" is throwing things off or not, since the root of your installation is /dev/hda8 (hd0,7), and /boot is /dev/hda9 (hd0,8). It could be just two ways of doing the same job, in two different distros.
Last edited by bigrigdriver; 01-07-2006 at 01:04 AM.
I went back and checked my before and after copies of fdisk -l output, /etc/fstab, and /boot/grub/menu.lst Luckily I use RCS to keep backup versions of all system files that I modify, and I could get at those RCS files using Knoppix. I'm really scratching my head on this one. Everything looks good to me. Obviously I don't know what I'm doing (just thought I did!)
I think the minor differences in menu.lst and fstab formats are OK. Probably just differences in the way SUSE and Debian set things up. I checked another Debian box and found it also does the fstab "none swap" thing rather than the "swap swap" like SUSE. Ditto for the "root (hd0,x)" thing in menu.lst.
Maybe it will be easier to pick out my error(s) looking at my before's and after's below (I edited out the irrelevent and coment lines from menu.lst for brevity, sorry for some duplication of data presented above):
Now, I'm trying to figure out how I go about using mkinitrd, since I can't boot into my Debian install (2.6.14-1-686). I can boot Knoppix (2.6.11, and it can mount /boot and / from the non-bootable Debian) but I'm not quite sure how to use mkinitrd from within Knoppix to create myself the Debian image I need. Hmmm ... any suggestions or tips welcome. I've never used mkinitrd before. I'm just now researching and learning what an initrd image is in the first place!
Then from the grub> prompt:
grub> configfile (hd0,8)/grub/menu.lst
It booted fine from there. It did complain about the LVM volume's last mount time being in the future, but I know that one. It's just a system clock setting thing. Easily fixed.
From within my freshly booted Debain, I will redo the mkinitrd thing. Because if you look closely enough above you'll see I was using some stuff (the command itself) from Knoppix and files from my Knoppix-mounted Debian partitions. I'm not sure if that was all 100% correct, given possible version mismatch, but it did get me a bootable initrd image at least.
Figure out why grub can't find menu.lst. If I have to, I can just reinstall grub to /dev/hda9.
If I have to, I can just reinstall grub to /dev/hda9.
Yep, as simple as that - re-installing is trivial. Bootloaders are by their nature sensitive to the location of (later) stage files. Shouldn't trash your conf file, but you'd best back it up just to be safe.
Always! That's why I didn't panic terribly (OK, a *little* bit) when I couldn't boot Debian. I could have restored from backups, but I wanted to work and learn if I could recover given what was right in front of me.