repair Debian bootloader & GRUB
I'M trying to work my way through the linux from scratch project and I'M on page http://www.linuxfromscratch.org/lfs/...er08/grub.html I've really messed up my boot up process. I did make a boot disk as descriped in the above link.The computer originally had Debian (CLI only) has the host system from which I was building my Linux from scratch system. Now when I turn on the computer it has one OS in the list that's labeled "GRUB Linux...........", when I click enter the screen goes black and says "Press any key to continue", then goes back to the boot loader with "GRUB Linux...........". If I boot the system with the book disk it's just a prompt that says GRUB. Can anyone tell me how to repair my Debian bootloader from my current state? Thanks.
|
Hi
A good place to start, load a live cd, then post the output of Code:
sudo fdisk -l Code:
sudo blkid I,m not saying I can help but it will be good info to get help from others. Think that should be enough for now. |
One thing you can try right now is to manually boot the Debian system from that boot disk's grub> prompt. Debian has been using GRUB 2 for a long time, so I guess your Debian system has a core.img file. You might be able to manually boot it like this rough example (that will need considerable customizing by you)...
Code:
grub> linux (hdx,y)/boot/grub/core.img Next, if your Debian system has a separate boot partition, then omit the "/boot" part of the path in the linux command. Next, the core.img file may be in a folder named differently. Generically, it usually has been in /boot/grub. But in Fedora as an example, it is now in /boot/grub2/i386-pc. It may be something else again in Debian (I don't use Debian at the moment). Change that part of the path when you know where it is in the Debian system. When that linux command line is adjusted perfectly, enter the boot command and see if it boots Debian. If it does, then repair the Debian GRUB boot loader with the usual grub-install command in the running Debian system. If all that worked, it should at least put you back to where you were before. Then continue on with what you want to do next. P.S.: Just FYI, the Super Grub 2 Disk is a free and popular utility for emergency booting a Linux system with a busted GRUB 2 boot loader. It won't repair the boot loader like the old legacy Super Grub Disk did. But that doesn't really matter much if it boots the system. The boot loader is easy to repair after the system is running.. . . |
Quote:
255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sectors size (logical/physical): 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifiers: 0x00006aec sudo fdisk -l Device Boot Start End Blocks Id System /sda1 1 26747 214842368 83 Linux /sda2 26747 26869 976896 82 Linux swap / Solaris /sda3 * 26869 30402 28378112 83 Linux sudo blkid /dev/sda1: UUID="5cde3219-5770-42b9-9daf-b310870dfcdb" SEC_TYPE="ext2" TYPE="ext3" /dev/sda2: UUID="3480e36d-9636-4acl-8461-ea1756499Ob4" TYPE="swap" /dev/sda3: UUID="e4Ob23cl-4127-4575-9902-5ff6f2e5ac32" TYPE="ext4" There is no /grub/grub.cfg on my debian system, I found a few other grub files I'll try and get on here later, I can't copy and past because it's two different machiens. Thanks. |
grub.cfg
Quote:
set default=0 set timeout=5 insmod ext2 set root=(hd0,2) menuentry "GNU/Linux, Linux 3.2.6-lfs-71" { linux /boot/vmlinuz-3.2.6-lfs-7.1 root=/dev/sda1 ro } |
Hi
So there is only 1 os system on this pc? "lfs" Try changing Quote:
Quote:
|
Quote:
|
Did you just copy the commands in the book I see you used scripts to build.
hd0 is the numbering of the harddrive ,2 the two is the partitions on the drive, Hope that clears that bit. So where did you build lfs? sda2 is swap. I dont use Debain but google says /boot/grub/grub.cfg I take it you boot and get a screen similar. I dont know why the live cd wont boot nothing should stop that. |
Lfs requirements state that you must have a running system along with build tools to install LFS to another partition,so I find it hard to believe that LFS is on sda1 unless you partitioned the drive to have the 3 partitions then installed debian to sda3.
I would say that debian is on sda1. & you'll need to reinstall grub. |
Quote:
|
root:/boot/grub# cat grub.cfg
# Begin /boot/grub/grub.cfg set default=0 set timeout=5 set pager=1 insmod ext2 set root=(hd0,1) menuentry "GNU/Linux, Linux 3.2.6-lfs-7.1" { linux /boot/vmlinuz-3.2.6-lfs-7.1 root=/dev/sda1 ro } root:/boot/grub# |
I take it thats the grub.cfg on lfs
|
Quote:
|
Just a little note when you post if you can show the errors or any relevent msgs you are getting it will help.
What errors are you getting. when you boot from grub. The config log from the kernel is in /boot config-3.2 |
Quote:
2.034037] VFS : Cannot open root device "sda2" or unknown-black(2,0) 2.034109] Please append a correct "root=" boot option ; here are the available partitions: 2.034209] Kernel panic - not syncing: VFS : Unable to mount root fs on unknown -block(2,0) |
Can you post /etc/fstab
|
fstab
Quote:
This is from the LFS chroot # Begin /etc/fstab # file system mount-point type options dump fsck # order /dev/sda1 / ext3 defaults 1 1 /dev/sda2 swap swap pri=1 0 0 proc /proc proc nosuid,noexec,nodev 0 0 sysfs /sys sysfs nosuid,noexec,nodev 0 0 devpts /dev/pts devpts gid=4,mod=620 0 0 tmpfs /run tmpfs defaults 0 0 devtmpfs /dev devtmpfs mode=0755,nosuid 0 0 # End /etc/fstab This is from the Debian Host system # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 # / was on /dev/sda3 during installation UUID=e40b23c1-4127-4575-9902-5ff6f2e5ac32 / ext4 errors=remount -ro 0 1 # swap was on /dev/sda2 during installation UUID=3480e36d-9636-4ac1-8461-ea17564990b4 none swap sw 0 0 /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0 |
All ok there.
Do you have all the correct settings in the kernel file systems devices etc. |
Quote:
Someone told me I had a kernel driver problem. |
|
So have you checked that and made sure it not set as a module. I would also set filesystem ext2 to [y] not [m] and check ext3 and maybe ext4
Maybe pastebin your kernel config file |
1 Attachment(s)
Quote:
|
Put it up on pastebin.com It,s not always good opening files.
|
.config.cfg pastebin
Quote:
|
All times are GMT -5. The time now is 10:16 AM. |