cfdisk, add new partition, boot problems
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. Partitions: BEFORE: /dev/hda1 FAT32 (primary) /dev/hda2 NTFS (primary) /dev/hda3 (extended) /dev/hda5 Linux LVM (logical) /dev/hda6 swap (logical) /dev/hda7 / (logical) /dev/hda8 /boot (logical) AFTER: /dev/hda1 FAT32 (primary) /dev/hda2 NTFS (primary) /dev/hda3 (extended) /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: Code:
VFS: can't find ext3 filesystem on dev hda7 I must have missed something simple in my above steps. Anybody know WHAT? [edit] 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. [/edit] Thanks! |
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. |
Quote:
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). [edit] Duh! It helps to become root while in Knoppix if you want fdisk output! Here it is: Code:
Disk /dev/hda: 200.0 GB, 200049647616 bytes [/edit] Code:
# /etc/fstab: static file system information. Code:
# menu.lst - See: grub(8), info grub, update-grub(8) |
Either you have an error in fstab, or grub is more flexible that I was aware. In your fstab, you have "/dev/hda7 none swap". In Suse, that would be "/dev/hda7 swap swap".
Also, your menu.lst is significantly different from mine. Yours: titleDebian GNU/Linux, kernel 2.6.14-1-686 root (hd0,8) kernel /vmlinuz-2.6.14-1-686 root=/dev/hda8 ro initrd /initrd.img-2.6.14-1-686 Mine: title SUSE LINUX 9.3 kernel (hd0,8)/vmlinuz root=/dev/hda8 initrd (hd0,8)/initrd 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. |
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): BEFORE: Code:
BEFORE: Code:
AFTER: |
It looks like I may need to make a new initrd image. Some other poor soul here seems to have the same problem as me. The last post in the thread below mentions the initrd image.
http://kerneltrap.org/node/5925 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! |
Continuing talking to myself ... (in case anyone else has similar problems and is following this).
I got it to boot, finally. Grub still can't find it's menu.lst, but I'll figure that out later. I had to rebuild my initrd image. From Knoppix: ============= $ su - # mount /dev/hda8 /mnt/hda8 # mount /dev/hda9 /mnt/hda9 # mv /mnt/hda9/initrd.img-2.6.14-1-686 /mnt/hda9/BAK.initrd.img-2.6.4-1-686 # ln -s /mnt/hda8/lib/modules/2.6.14 /lib/modules/2.6.14 # ln -s /mnt/hda8/lib/modules/2.6.14-1-686 /lib/modules/2.6.14-1-686 # mkinitrd -r /dev/hda8 -d /mnt/hda8/etc/mkinitrd -o /mnt/hda9/initrd.img-2.6.14-1-686 2.6.14-1-686 # rm /lib/modules/2.6.14 # rm /lib/modules/2.6.14-1-686 # umount /dev/hda9 # umount /dec/hda8 # reboot 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. Plans: ====== 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. |
Quote:
|
Quote:
Thanks! |
As expected, "grub-install /dev/hda9" reinstalled grub to the /boot partition. This didn't mess with the menu.lst file (as expected).
Rebooted and my system was all back to normal. Yeah! |
All times are GMT -5. The time now is 07:45 AM. |