LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /dev/sda ? (http://www.linuxquestions.org/questions/linux-newbie-8/dev-sda-822028/)

hadimotamedi 07-25-2010 07:13 AM

/dev/sda ?
 
Dear All
I tried to install RedHat on my external usb disk from the installation cd.At the prompt, I typed 'expert' and tried to install RedHat on the external usb disk as /dev/sda. But when I reboot and choose to boot from the usb disk at the setup menu, it cannot boot. Can you please let me know how to make a bootable usb disk ?
Thank you

saikee 07-25-2010 07:26 AM

Red Hat uses Grub. Grub identifies a system to boot by the disk number and partition number.

When you install Red Hat you could have your internal hard disk as /dev/sda and the USB disk as /dev/sdb.

When you instruct the Bios to boot the USB disk first then Bios tells the boot loader the USB disk is now /dev/sda and the internal hard disk is /dev/sdb.

That means your original sda is now sdb. To Grub your original (hd0) and (hd1) has swapped positions.

Could this make sense to you? It would to me if you see no sign of Grub when trying to boot the USB disk.

hadimotamedi 07-25-2010 07:52 AM

When I installed RedHat, it showed my internal disk as /dev/hda and the usb disk as /dev/sda so I selected to install os on /dev/sda. Can you please confirm if it was a correct selection ?

saikee 07-25-2010 08:11 AM

That is the correct interpretation if you still run your Red Hat with a IDE disk but the disk order would still be

/dev/hda (hd0)
/dev/sda (hd1)

if you check /boot/grub/device.map of the Red Hat partition.

You did not elaborate the error but just said it could not boot so there is no way we could cure your problem with the information supplied.

According to your description you should should have installed Grub into the USB device so you should be able to see a Grub menu. When selecting Red Hat it fails to boot.

If it can't load the kernel or could not find the required partition because the disk order mismatches you can overcome it by asking Grub to swap the disk order on-the-fly with commands
Code:

map (hd0) (hd1)
map (hd1) (hd0)

If Grub loads the kernel but the Red Hat fails to boot, say with a kernel panic, then your Red Hat has not been configured to boot from a USB device.

If you see a Grub menu then you can investigate all the above and try to boot the system manually in a Grub prompt.

hadimotamedi 07-25-2010 08:21 AM

When I reboot the machine and then press 'Esc' and from the select boot device menu I select to boot from usb disk but I don't see any grub menu. But when I select to boot from internal disk I see the grub menu. Please let me know what can I do to correct it?

saikee 07-25-2010 09:17 AM

That means you have a Grub menu in the internal hard disk and not in the USB hard disk. This can be either your internal hard disk is a Sata so Red Hat calls it /dev/sda, as it does to mine, or your installating Grub in the USB disk was unsuccessful.

You can test the system in the following manner.

Tell the Bios you want the internal hard disk as 1st boot disk and get a booting Grub menu but do not select a system to boot. Instead you press the "c" key to drop into a terminal mode with a Grub prompt. If your Red Hat has a Graphic background then before you press the "c" key you may need to press the "esc" key to change it from a graphic to terminal mode first.

Ask Grub to tell you how many partition has a Grub configuration file by this command
Code:

find /boot/grub/menu.lst
Let say Grub return with one of the choice as (hd1,0) that means in the 1st partition of the 2nd hard disk as Grub counts from 0, then you can fire up this system by command
Code:

root (hd1,0)
configfile /boot/grub/menu.lst

Please do adjust the (hd1,0) according to what Grub reports in your case.

If you succeed in the above then you have installed the Red Hat in the second disk but it has no Grub in its MBR.

Let us know your progress for the next fix.

hadimotamedi 07-25-2010 11:54 PM

Please find below the system reply to your commands :
grub>find /boot/grub/menu.lst
ERROR 15: File not found
grub>root (hd1,0)
Filesystem type is ext2fs,partition type 0x83
grub>configfile /boot/grub/menu.lst
ERROR 15: File not found
Please commend me back.

saikee 07-26-2010 03:22 AM

Ask Grub which partition has /boot/grub/menu.lst by
Code:

find /boot/grub/menu.lst
This command also list the partition layout of the second disk
Code:

geometry (hd1)

hadimotamedi 07-26-2010 03:30 AM

I tried for your commands. Please find below the system reply :
grub>find /boot/grub/menu.lst
Error 15: File not found
grub>geometry (hd1)
Error 21: Selected disk does not exist
Please comment me.

saikee 07-26-2010 07:27 AM

At the top of the Grub screen there is a Grub version number. What version of Grub are you using?

It appears your current Grub fails to find the 2nd hard disk.

You can confirm the 1st hard disk by command
Code:

geometry (hd0)
Current Grub1 0.97 has been patched to read Ext4 partition and work with gpt disks and shows no vserion number at the top of the Grub screen.

It is possible older Grub may not be able to see a USB drive unless the Bios arranges the USB drive as the first boot disk. In other word the older Grub cannot detect such a drive unless it is in the (hd0) position which only the Bios can change.

hadimotamedi 07-26-2010 08:00 AM

It shows my grub version as 0.90 .
When I try for the following :
grub>geometry (hd0)
It shows the internal disk geometry.
I need to press 'Esc' after reboot the machine and select the boot device from :
SATA
CD/DVD
USB
Please help.

saikee 07-26-2010 08:12 AM

Boot up Red Hat and post here the output of
Code:

fdisk -l
When I entered Linux the oldest Grub I could lay my hand on was Grub 0.91 off DSL. You must be using the Red Hat 9 or older.

When you run Red Hat Linux its kernel has the driver for the USB device so you should be aboe to see the USB disk.

You can also confirm the availability of the USB disk in Red Hat's Bash terminal. The USB disk (hd1) will be reported by these commands (inside Red Hat terminal)
Code:

su
grub
geometry (hd0)
geometry (hd1)
find /boot/grub/menu.lst
quit

If you can locate a partition in (hd1), say for example (hd1,0), then you can ask Grub to install itself in the MBR of the USB disk by
Code:

grub
root (hd1,0)
setup (hd1)
quit

Please adjust the partition number that has /boot/grub/menu.lst in disk (hd1) in your case and do not put in (hd1,0) blindly. There shoudl be a partition in (hd0) that has /boot/grub/menu.lst too but it will be from the internal disk.

If you have done the above then instruct the Bios to boot the USB and the Red Har there will be fired up. Not saying it will work but it should boot.

hadimotamedi 07-28-2010 02:17 AM

Please find below the output of 'fdisk' :
#fdisk -l /dev/hda
Disk /dev/hda: 16 heads, 63 sectors, 266305 cylinders
Units= cylinders of 1008 * 512 bytes
/dev/hda1 * 1 102 51376+ 83 Linux
/dev/hda2 103 175186 88242336 83 Linux
/dev/hda3 175187 178826 1834560 82 Linux swap
/dev/hda4 178827 266305 44089416 f Win95 Ext'd (LBA)
/dev/hda5 178827 265004 43433680 83 Linux
/dev/hda6 265005 265784 393088 83 Linux
/dev/hda7 265785 266304 262048 83 Linux

#fdisk -l /dev/sda
Disk /dev/hda: 64 heads, 63 sectors, 19077 cylinders
Units= cylinders of 2048 * 512 bytes
/dev/sda1 * 1 50 51184 83 Linux
/dev/sda2 51 1842 1835008 83 Linux swap
/dev/sda3 1843 13018 11444224 82 Linux
/dev/sda4 13019 19077 6204416 f Win95 Ext'd (LBA)
/dev/sda5 13019 18437 5549040 83 Linux
/dev/sda6 18438 18821 393200 83 Linux
/dev/sda7 18822 19077 262128 83 Linux

Then I tried as :
#su
#grub
grub>geometry (hd0)
drive 0x80: C/H/S = 4161/16/63, The number of sectors = 268435455, /dev/hda
Partition num:0,Filesystem type is ext2fs, partition type 0x83
Partition num:1,Filesystem type is ext2fs, partition type 0x83
Partition num:2,Filesystem type unknown , partition type 0x82
Partition num:4,Filesystem type is ext2fs, partition type 0x83
Partition num:5,Filesystem type is ext2fs, partition type 0x83
Partition num:6,Filesystem type is ext2fs, partition type 0x83
grub>geometry (hd1)
drive 0x81: C/H/S = 19077/64/32, The number of sectors = 39070080, /dev/sda
Partition num:0,Filesystem type is ext2fs, partition type 0x83
Partition num:1,Filesystem type unknown , partition type 0x82
Partition num:2,Filesystem type is ext2fs, partition type 0x83
Partition num:4,Filesystem type is ext2fs, partition type 0x83
Partition num:5,Filesystem type is ext2fs, partition type 0x83
Partition num:6,Filesystem type is ext2fs, partition type 0x83
grub>find /boot/grub/menu.lst
Error 15:file not found
grub>root (hd1,0)
Filesystem type is ext2fs, partition type 0x83
grub>setup (hd1)
Checking if"/boot/grub/stage1" exists ... no
Checking if"/grub/stage1" exists ... no
Error 15: file not found

Please help me, based on the above data.

saikee 07-28-2010 03:30 AM

Try to find Grub's configuration file by

Code:

find /boot/grub/grub.conf
Some Red Hat calls Grub's configuration file "grub.conf" which sometimes is symbolic-linked with "menu.lst". Your version of Red Hat doesn't.

It was my mistake. I should have asked you to search grub.conf.

hadimotamedi 07-28-2010 03:39 AM

The file is present on the (hd0) , as the 'ls' from /boot/grub shows it. But on the grub :
grub>find /boot/grub/grub.conf
Error 15 : file not found
Please help me.


All times are GMT -5. The time now is 12:56 AM.