Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Fails to boot after installation

Ask for help with issues regarding the Installations of the Debian O/S.
Message
Author
NickC
Posts: 129
Joined: 2012-02-09 17:56

Re: Fails to boot after installation

#16 Post by NickC »

Don't happen to have a Debian live CD or DVD so would have to download that. I do however had a Knoppix boot CD available which I recently downloaded is that any help?

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Fails to boot after installation

#17 Post by kiyop »

I am not sure whether "grub-install" does well in chrooting from knoppix to debian, because I have never done such a thing.

The size of Super Grub2 Disk is only 2MB, while debian live cd image is by far larger.
You can dd the image to USB flash or CD-R from linux or:
http://www.debian.org/CD/faq/#record-unix
If you want to make Super Grub2 Disk from Windows, you can refer to
http://www.debian.org/CD/faq/#record-windows

With Super Grub2 Disk, the only thing you must do to try to boot debian installed on your hdd is:
1) Boot with Super Grub2 Disk.
2) Select "Detect any Operating System"
3) Select detected debian.
That is all.

If you prefer chrooting, read the following:
In debian, I chroot like the following:

Open terminal and to get root privilege,

Code: Select all

su -
and type root password.
In some live system,

Code: Select all

sudo su -
may help instead.

To confirm the device file name of your installed debian partition,

Code: Select all

blkid
You mentioned that /boot partition is /dev/sdb5 and I guess that /(root) partition is /dev/sdb7. I assume so.
To chroot, (because I do not know well where should be mounted on with Knoppix.)

Code: Select all

mkdir /mnt2
mount -t auto /dev/sdb7 /mnt2 -o rw
mount -t auto /dev/sdb5 /mnt2/boot -o rw
mount --bind /dev /mnt2/dev
mount --bind /dev/pts /mnt2/dev/pts
mount --bind /sys /mnt2/sys
mount --bind /proc /mnt2/proc
chroot /mnt2 /bin/bash
You can modify above "auto" to a certain name of the filesystem, such as ext4, ext3, and so on. The filesystem must be shown in the output of "blkid" command.
I am not sure whether knoppix and debian use same device file name system or not.
I heard that knoppix is a derivative from debian. I hope they use similar device file name system.
If not, executing the above may harm your system. I am not sure.

After successful chroot, you can install grub2 code onto MBR of second hard disk by

Code: Select all

grub-install /dev/sdb
If you want to install grub2 code onto MBR of first hard disk,

Code: Select all

grub-install /dev/sda
But, be careful.
If you execute "grub-install /dev/sd?" ("?" is a or b), the boot loader written on the MBR is destroyed.
You can backup the code on the MBR of the first hard disk (/dev/sda) by

Code: Select all

dd if=/dev/sda bs=512 count=1 of=/mbrbackup
before you run "grub-install".
You can increase above "1" to "63" or so, if you want to backup more than one sector.
I know that grub-isntall to MBR writes more than one sector for "MS-DOS partition table" system.

Even if you can successfully install and configure Grub2 code, you may be unable to boot debian due to some problem like that observed before (although now you have installed wheezy while you installed stable at that time.)
http://forums.debian.net/viewtopic.php? ... 81#p420571
NickC wrote:My first install of Debian so forgive me if I miss something obvious.

Just installed Debian Squeeze using graphical install, standard options. Problem is after installation the system won't boot, just gets to a certain point and drops the monitor output and appears to lock-up. I have tried recovery mode, messages scroll past the screen but I can't see what the last line was before it failed.

The only 'non-free' driver required was for the NICs: rtl_nic/rtl8168-2.fw which I obtained from firmware-realtek_0.28+squeeze1_all.deb.
I should again mention that I have never chroot from Knoppix to Debian. Thus chrooting from Knoppix to Debian may be dangerous. I am not sure.
You should wait Guru's reply.
Or you can use Super Grub2 Disk, which I suggest to use,
or
download debian live cd and use it.

One another way is to use Boot Repair:
https://help.ubuntu.com/community/Boot-Repair
http://sourceforge.net/p/boot-repair/home/Home/
but it is also very large like debian live cd.

And again I suggest you to run "boot info script" (you can run while knoppix is booting) and post the contents of the generated RESULTS.txt.
http://bootinfoscript.sourceforge.net/
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

NickC
Posts: 129
Joined: 2012-02-09 17:56

Re: Fails to boot after installation

#18 Post by NickC »

Super Grub 2 iso now downloaded and written to CD, like you say very quick to download.

Boot to Super Grub2 Disk 1.99b1, select Detect any Operating System and:

Code: Select all

error: unrecognised fs. - repeatyed 12 times
Only OSs listed are:

Code: Select all

Windows Vista (hd0,msdos1)
Windows Vista (hd1,msdos1)
I guess these correspond to my installed Win 2003 & Win 2008.

So for some reason Grub2 can't see either Debian which is on the same disk as Win 2008 or Arch which is on it's own disk.

Next option is to download Rescatux from Grub2, see if that works...
Nope that just freezes at Boot from CD/DVD:

What about just doing the Grub install bit from the Debian install DVD, let me try that...
Running Debian installer, select Install the GRUB boot loader on a hard disk, unfortunately this depends upon perviously performing Install the base system, which inturn depends upon partition didks, which depends upon detect disks. Argg... nope thats not going to work unless I reformat the partitions again and because there is no quick format option that takes hours.

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Fails to boot after installation

#19 Post by kiyop »

Boot with Knoppix Live CD and download boot info script and execute it and post the contents of generated RESULTS.txt.

And execute the following in terminal and post the results, while booting with Knoppix Live CD.

Code: Select all

sudo su
grub-install -v
EDIT at 12:50 2012/2/19 in JAPAN:

http://forums.debian.net/viewtopic.php? ... 81#p420799
NickC wrote:Completely fresh install of wheezy now completed. But won't even try to boot due to a GRUB error!
What is shown when you boot without live cd (knoppix)?
Is there "grub rescue>" or so?
Can you type something or is it totally freeze (no response)?
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

NickC
Posts: 129
Joined: 2012-02-09 17:56

Re: Fails to boot after installation

#20 Post by NickC »

Yes grub rescue> prompt but don't know where to go from there.

I have encountered this a few times now with other linux distros as well, it seems as if linux just can't co-exist happily in a multi disk environment. I have many disks in caddies which get plugged in and out depending on what I am doing that day. Coming from the windows world I have for many years just relied on being able to change the order of drives in the BIOS to choose which MBR to boot from, I just assumed that could still be done with linux. It appears not.

Aris Veresie
Posts: 562
Joined: 2011-06-02 15:55
Location: Limassol, Cyprus

Re: Fails to boot after installation

#21 Post by Aris Veresie »

being able to change the order of drives in the BIOS to choose which MBR to boot from, I just assumed that could still be done with linux
If you have your disks properly setup (bootable), I see no reason why you cannot from the BIOS pointing to the disk you want. It is neither Linux nor Windows. It is a BIOS function calling the certain disk.
Being anonymous is the same as being an idiot.

NickC
Posts: 129
Joined: 2012-02-09 17:56

Re: Fails to boot after installation

#22 Post by NickC »

Let me try an example, first a single drive environment:

Code: Select all

hd0,0 = NTFS boot partition
hd0,1 = /Boot - this contains grub & vmlinuz-linux
hd0,2 = swap
hd0,3 = /
If I want to boot Windows I set hd0,0 as active/bootable, if I want to boot Debian I set hd0,1 as active/bootable. Actually not sure how to change the active partition to a linux one but come back to that later. For the moment hd0,1 is the bootable partition. This is the only drive in the system. menu.lst looks like this:

Code: Select all

# (0) Debian Linux
title  Debian Linux
root   (hd0,1)
kernel /vmlinuz-linux root=/dev/sda4 ro
initrd /initramfs-linux.img
The root line actually points to the 'grub root' / 'linux boot' not the 'linux root'. Also the kernel line root= does not refer to the location of /vmlinuz-linux but to the actual linux root.

Now to add another disk to the system. Change drive order in BIOS so that Debian disk is top of the boot order.

Fails to boot: Unable to find root device /dev/sda4!

Boot to knoppix to see the disk & partition layout:

Code: Select all

hd0,0 = NTFS
hd0,1 = NTFS
hd0,2 = NTFS
hd0,3 = NTFS
hd0,4 = NTFS
hd0,4 = NTFS
hd0,4 = NTFS
hd1,0 = NTFS boot partition
hd1,1 = Arch /Boot - this contains grub & vmlinuz-linux
hd1,2 = Arch swap
hd1,3 = Arch /
So clearly /dev/sda4 is now an NTFS partition.

If appears that grub & linux do not see disk drives in the same order as the BIOS boot order causing /dev/sda4 to point towards the wrong partition.

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Fails to boot after installation

#23 Post by kiyop »

http://forums.debian.net/viewtopic.php? ... 63#p421714
NickC wrote:If appears that grub & linux do not see disk drives in the same order as the BIOS boot order causing /dev/sda4 to point towards the wrong partition.
Sometimes.
But you can repair.

http://forums.debian.net/viewtopic.php? ... 63#p421662
NickC wrote:Yes grub rescue> prompt but don't know where to go from there.
If the /(root) partition (and/or in some case, /boot partition) of debian can be recognized by Grub2 code (grub rescue), maybe
http://forums.debian.net/viewtopic.php? ... 13#p421145
will help you.

http://forums.debian.net/viewtopic.php? ... 63#p421662
NickC wrote:I have encountered this a few times now with other linux distros as well, it seems as if linux just can't co-exist happily in a multi disk environment. I have many disks in caddies which get plugged in and out depending on what I am doing that day. Coming from the windows world I have for many years just relied on being able to change the order of drives in the BIOS to choose which MBR to boot from, I just assumed that could still be done with linux. It appears not.
Grub can install its code on MBR and its code can try to read from the partition in the same HDD if you configure correctly, for example, you set your HDD (to the partition of which you install debian) recognized first, and you start installation and install grub onto the MBR of the HDD.
Furthermore Grub can detect partitions by using UUID, which is not affected by the order of HDDs.

I am confused after reading the following posts of yours. :?

http://forums.debian.net/viewtopic.php? ... 81#p420799
NickC wrote:Completely fresh install of wheezy now completed. But won't even try to boot due to a GRUB error! Is there some way to reinstall the GRUB bootloader only, I don't thing I have the energy to go through another four hour install again.

I have booted from Knoppix and established that I have the following partitions:

/dev/sda1 - ntfs
/dev/sda2 - ntfs
/dev/sda3 - extended
/dev/sda5 - ntfs
/dev/sda6 - ntfs
/dev/sda7 - ntfs

/dev/sdb1 - ntfs
/dev/sdb2 - extended
/dev/sdb5 - ext3, boot
/dev/sdb6 - linux-swap
/dev/sdb7 - root?

What do I need to do to install GRUB to /dev/sdb5?
http://forums.debian.net/viewtopic.php? ... 15#p421150
NickC wrote:Super Grub 2 iso now downloaded and written to CD, like you say very quick to download.

Boot to Super Grub2 Disk 1.99b1, select Detect any Operating System and:

Code: Select all

error: unrecognised fs. - repeatyed 12 times
Only OSs listed are:

Code: Select all

Windows Vista (hd0,msdos1)
Windows Vista (hd1,msdos1)
I guess these correspond to my installed Win 2003 & Win 2008.

So for some reason Grub2 can't see either Debian which is on the same disk as Win 2008 or Arch which is on it's own disk.
Did you install debian? Where?
Was the disk containing the /(root) partition of debian installed connected to your PC when you checked the above?

I wonder if you misunderstand the current situation of your HDD.
How many media (internal HDD, external HDD, USB flash and so on) are connected to your computer now?

So I ask you again (to know the current situation),
http://forums.debian.net/viewtopic.php? ... 15#p421263
kiyop wrote:Boot with Knoppix Live CD and download boot info script and execute it and post the contents of generated RESULTS.txt.

And execute the following in terminal and post the results, while booting with Knoppix Live CD.

Code: Select all

sudo su
grub-install -v
after booting with only the HDD which contains the installed debian / partition.

http://forums.debian.net/viewtopic.php? ... 63#p421714
NickC wrote:Let me try an example, first a single drive environment:

Code: Select all

hd0,0 = NTFS boot partition
hd0,1 = /Boot - this contains grub & vmlinuz-linux
hd0,2 = swap
hd0,3 = /
If I want to boot Windows I set hd0,0 as active/bootable, if I want to boot Debian I set hd0,1 as active/bootable. Actually not sure how to change the active partition to a linux one but come back to that later. For the moment hd0,1 is the bootable partition. This is the only drive in the system. menu.lst looks like this:

Code: Select all

# (0) Debian Linux
title  Debian Linux
root   (hd0,1)
kernel /vmlinuz-linux root=/dev/sda4 ro
initrd /initramfs-linux.img
The root line actually points to the 'grub root' / 'linux boot' not the 'linux root'. Also the kernel line root= does not refer to the location of /vmlinuz-linux but to the actual linux root.
I can understand that the above-mentioned menu.lst works well for the situation where /boot is /dev/sda2 and / is /dev/sda4.
You can easily change boot flag by for example, gparted or fdisk and so on.
But I prefer chainload to partition boot records by boot loader installed on the MBR of the HDD.
There are many good chainloader like MBM, PLoP, GAG, and so on.
You can even chainload by Grub2, Grub legacy, Grub4dos.
And menu.lst is used by Grub legacy (version 0.9...), which is not the same as Grub2 (version 1.9...), which is used by debian-6.0.4 or newer as default (? I may be wrong, because I have never used debian-wheezy installer CD).
In Grub legacy, the partition is numbered from "0" while it is numbered from "1" in Grub2.
And you should understand that Grub2 uses /boot/grub/grub.cfg instead of menu.lst and that "grub rescue>" prompt is only shown when Grub2 is used.

Even with Grub legacy, you can use UUID of partition. The command is "uuid".

Code: Select all

uuid UUID_OF_/dev/sda2
instead of "root (hd0,1)". But, I used this "uuid" command on Ubuntu a few years ago. Maybe in Debian it is not effective, though I am not sure.

Grub2 can use UUID to detect the partition where grub2 modules and the configuration file (grub.cfg in debian) exist by "search --fs-uuid --set UUID_OF_PARTITION"
Please refer to:
http://ubuntuforums.org/showthread.php?t=1195275

Furthermore, you should replace "root=/dev/sda2" with "root=UUID=UUID_OF_/dev/sda2".
You can use "root=LABEL=LABEL_OF_/dev/sda2" instead of "root=UUID=...".

Please be noticed that "root=/dev/sda4" is not used by Grub itself, but is sent from Grub to kernel (vmlinuz-...) (as "kernel option") and the kernel use it.
And so,
http://forums.debian.net/viewtopic.php? ... 63#p421714
NickC wrote:Now to add another disk to the system. Change drive order in BIOS so that Debian disk is top of the boot order.

Fails to boot: Unable to find root device /dev/sda4!
The above error is not due to Grub (kernel loader), but due to the bad kernel option "root=/dev/sda4" sent to kernel.
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

Post Reply