Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Tuesday, April 29, 2008

grub-install /dev/sdb1

/dev/sdb1 disc does not have any corresponding BIOS drive
| root:gnalle# apt-get install grub grub-doc
|
| root:gnalle# grub-install /dev/hda
| Probing devices to guess BIOS drives. This may take a long time.
| /dev/ide/host0/bus0/target0/lun0/disc does not have any correspondin
|
| root:gnalle# update-grub
| Searching for GRUB installation directory ... found: /boot/grub .
| /dev/ide/host0/bus0/target0/lun0/part1 does not have any correspondi

Edit /boot/grub/device.map and change the line that says
(hd0) /dev/hda
to
(hd0) /dev/ide/host0/bus0/target0/lun0/disc

grub-install doesn't handle the devfs-style symlink naming as
gracefully as it ought.
-----------------------------------------------
Red Hat 3 Enterprise Linux Issue:
I am using a software RAID 1 (mirror) on two drives and the first drive has failed or been physically removed. When trying to make the second drive bootable, grub-install fails telling me '/dev/hdx does not have any corresponding BIOS drive.' How can I make this drive bootable with GRUB?
Resolution:
Release Found: Red Hat Enterprise Linux 3

Symptom:
When the first disk of a software RAID has been removed, the second drive is not bootable. Performing a grub-install fails with the error message: '/dev/hdx does not have any corresponding BIOS drive'.

Solution:
Please note that before performing any of these steps, you should have a recent backup of your important data. If for any reason the primary drive becomes unbootable, you should have your Red Hat Enterprise Linux CD #1 available in order to load the rescue environment.

If you are attempting to run grub-install inside of a rescue environment, you will need to first manually mount the corresponding disk partitions. You can view the partitions with the command:


# fdisk -l


You need to mount any partitions of type Linux or Linux RAID autodetect. In the following example of fdisk output, the /boot partition is /dev/hda1 and the / partition is /dev/hda2:


Device Boot Start End Blocks Id System
/dev/hda1 1 13 104391 fd Linux raid autodetect
/dev/hda2 14 1288 10241437+ fd Linux raid autodetect
/dev/hda3 1289 1352 514080 82 Linux swap


In this example, you would mount the partitions and chroot using the following commands:


# mkdir /mnt/sysimage
# mount /dev/hda2 /mnt/sysimage
# mount /dev/hda1 /mnt/sysimage/boot
# chroot /mnt/sysimage


The next step is to edit the file /etc/grub.conf (which is a symbolic link to /boot/grub/grub.conf). Uncomment the following line by removing the pound sign (#) at the beginning of the line:


from:
#boot=/dev/hda

to:
boot=/dev/hda


Now, to make the drive bootable, GRUB must be installed to the master boot record (MBR) of the disk. To do this, execute the following command (as root) to enter a GRUB shell:


# grub --batch --device-map=/boot/grub/device.map
--config-file=/boot/grub/grub.conf --no-floppy


Now, from the GRUB shell prompt, execute the following commands:


grub> root (hd0,0)

grub> setup (hd0)

grub> quit


The setup command within this shell actually writes GRUB to the MBR, which makes the drive bootable.
----------------------------------------------------------------------------------------

Q. After windows XP installation I lost my Grub boot loader and now when I try to run grub-install command to restore Grub in master boot record. But I am getting an error that read as follows:
/dev/sda does not have any corresponding BIOS drive

How do I fix this problem?

A. grub-install is use to install GRUB on your drive. If you are getting error try to recheck device map.

Type the command as follows:
# grub-install --recheck /dev/sda

Where,

  • --recheck: Probe a device map even if it already exists
  • /dev/sda : Replace /dev/sda with your actual device name.

Above command should fix the problem.

---------------------------------------------------------------------------------------

Restore Debian Linux Grub boot loader

Recently my hard disk went bad (some bad sectors developed), my boot.ini (Windows XP boot file) corrupted. I was using NT boot loader to load Linux. So I need to repair the Grub i.e. restore Grub in master boot record (MBR).
1) Press ALT+F2 (or ALT+CTRL+F2) to get shell prompt
2) Then get the partition tables for the devices using fdisk command:
# fdisk -l

3)When you type fdisk -l, you should see your partition name: /dev/scsi/host0/bus0/target0/lun0/part1 (for IDE disk it display same device file in IDE directory)

4)Once you identified your device file, mount disk using mount command:
# mkdir /mydisk
# mount /dev/scsi/host0/bus0/target0/lun0/part1 /mydisk

5) Next use chroot command to start interactive shell with special root directory i.e. /mydisk will act as root directory.
# chroot /mydisk

6)Use grub-install command to reinstall grub (SCSI disk):
# grub-install /dev/sda

If you have IDE device following command :
# grub-install /dev/hda

Again replace /dev/hda and /dev/sda with your actual device names.

7)Type exit and reboot the system. You should see your GRUB and Linux again.
# exit

Other choice was to use Linux Live CD (e.g. Mepis) and do the above procedure. Well, I could have used the Mepis to watch TV but I had some data and emails in Tunderbird so I opted to restore the Grub.

No comments: