LinuxQuestions.org

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

saikee 07-28-2010 05:02 AM

When you boot up your Red Hat do you know which is you /boot? and post here the directory of /boot/grub. My Red Hat 9 looks like the following
Code:

[saikee@localhost saikee]$ su
Password:
[root@localhost saikee]# ls /boot/grub
device.map    ffs_stage1_5  menu.lst          splash.xpm.gz    xfs_stage1_5
device.map~    grub.conf    menu.lst~          stage1
e2fs_stage1_5  grub.conf~    minix_stage1_5    stage2
fat_stage1_5  jfs_stage1_5  reiserfs_stage1_5  vstafs_stage1_5
[root@localhost saikee]#

When I issue a Grub shell and ask Grub to find /boot/grub/grub.conf I got
Code:

    GRUB  version 0.93  (640K lower / 3072K upper memory)
                                                                               
 [ Minimal BASH-like line editing is supported.  For the first word, TAB
  lists possible command completions.  Anywhere else TAB lists the possible
  completions of a device/filename.]
                                                                               
grub> find /boot/grub/grub.conf
 (hd0,9)
 (hd0,10)
 (hd0,20)
 (hd0,21)
 (hd0,23)
 (hd0,24)
 (hd0,28)
 (hd0,29)
 (hd0,32)
 (hd0,46)
 (hd0,57)
 (hd0,58)
 (hd0,59)

My Red Hat 9 is in hda11 or (hd0,10) among the 145 OSes I have booted and documented.
My (hd0,9) is Turbo Linux, (hd0,20) is Blag, (hd0,21) is Fedora Core 4, (hd0,23) is Red Flag, (hd0,24) is Linare, (hd0,28) is Vine, (hd0,29) is Specific, (hd0,32) is Asian Linux, (hd0,46) is Foresight, (hd0,57) is Haansoft, (hd0,58) is Fedora Core 3 and (hd0,59) is Scientific Linux, all of which are based on Red Hat and so have grub.conf inside their partitions.

The Grub in my Red Hat 9 is version 0.93 and the Red Hat 9 has a 2.4.20 kernel from command "uname -r" as indicated below
Code:

[root@localhost saikee]# uname -r
2.4.20-8


hadimotamedi 07-31-2010 02:53 AM

Please find below the stuff of my /boot/grub from the primary disk (hd0):
'device.map e2fs_stage1_5 fat_stage1_5 ffs_stage1_5 grub.conf menu.lst->./grub.conf minix_stage1_5 reiserfs_stage1_5 splash.xpm.gz stage1 stage2 vstafs_stage1_5'
Then I issue grub shell and ask grub to find /boot/grub/grub.conf but I got :
Error 15: file not found
Please find below the output of 'uname -r' :
2.4.7-10
Please comment me back.

saikee 07-31-2010 04:48 AM

According to your information of /boot/grub
Quote:

'device.map e2fs_stage1_5 fat_stage1_5 ffs_stage1_5 grub.conf menu.lst->./grub.conf minix_stage1_5 reiserfs_stage1_5 splash.xpm.gz stage1 stage2 vstafs_stage1_5'
The file grub.conf is inside but your v0.93 Grub refuses to acknowledge it.

If I have guess a reason why Grub behaves like this I would suspect your Grub V0.93 is too old for the job and may not have the driver to read a USB disk during boot time. Once booted the Linux kernel with the help of drivers can see your second hard disk and its contents.

Your Red Hat is indeed very old as I have not worked with such an old 2.4 kernel and such a ancient Grub, even I did have a V0.90 but it was a patched version for DSL.

My guess is even if you manage to get Grub working you still have one hell of an uphill struggle to get Red Hat working with the USB device as that kernel is clearly not equipped to work on USB.

For the cure I am pretty sure you can put a newer version of Grub into your existing installation. You can boot up a recent Linux that has Grub1, say from a Fedora, and copy the booted up /boot/grub directory into your Red Hat directory, which must be of course mounted first. You then used the new Grub from the booted up Fedora, which you use as a Live CD only, to set Grub1 up by command
Code:

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

You should find the new Grub able to detect the (hd1).

Changing the Grub version is a simple matter. I often install Grub on its own this way.

hadimotamedi 07-31-2010 11:42 PM

I have a centos5 machine ,so I burned a cd containing its /boot/grub contents. Then I copied it into the same folder on my redhat machine but nothing changed. Can you please confirm if my understanding of your comment is right?

saikee 08-01-2010 06:52 AM

Here is the verdict.

I attached 2 flash drives, one without any partition and another with several partitions, to one of my boxes and booted up several version of Grub as I keep a few version in floppies.


V0.91, V0.95, V0.97 and v1.97 - All two flash drives (hd1) & (hd2) were reported.

However if I switch in the Bios page "USB legacy support" from "Enabled" to "Disabled" all the flash drives were not reported.

Conclusion : You need the motherboard to have the feature to present USB devices as disks by the Bios before Grub can see them.

hadimotamedi 08-03-2010 06:14 AM

I didn't have success to accomplish this. So I thought if I can resort it and try to install my old redhat on one of my centos partitions and them copy its contents via 'dd if of' to the usb disk (as my centos can recognize the usb disks). Can you please let me know how it can be accomplished (I mean dual booting centos with redhat) ?

saikee 08-03-2010 06:39 AM

Don't think you can dd it out as your hard disk geometry is different to the USB disk.

You could transfer the content of an installed Red Hat by copying every partition of one disk to another disk with the same number of partitions by tar, cp etc commands and then repair Grub and the /etc/fstab. Your Red Hat should be old enough to permit migration.

It is a lot faster if you just take the Red Hat installation CD to the CentOS computer and install it there. I think you should be able to down load the old Red Hat from the Internet.

hadimotamedi 08-03-2010 06:57 AM

I have the redhat install cd but my redhat machine does not recognize usb disk (but my centos does). So I thought if I can install redhat on one of its partitions and then copy its contents to usb disk.

hadimotamedi 08-03-2010 07:06 AM

If so, then how can I make the usb disk geometry the same as my internal disk when formatting it? (I mean making the same number of partitions)

saikee 08-03-2010 12:28 PM

You clone the whole disk. This way you get exactly the same geometry on the target disk as the source disk.

hadimotamedi 08-06-2010 10:41 PM

Sorry. How it can be done with he 'tar' command ?

saikee 08-07-2010 06:41 AM

tar command operates on files inside a partition. It is a file-copying command, not one that transfers boot sectors, partition table, MBR and the entire disk using a sector-by-sector cloning.

hadimotamedi 08-07-2010 06:55 AM

Sorry. You mean it cannot be used as what 'cp' is doing in the following?
#cp -ax / /new-disk

saikee 08-07-2010 04:36 PM

Nop. You are copying folder / to folder /new-disk only.

You use dd to clone disk sda to sdb by
Code:

dd if=/dev/sda of=/dev/sdb
Just make sure the target disk to be written on sdb is bigger or exactly in size to the source disk and do not mount any of them. This way you copy only the "1" and "0" of the hard disk and so the boot sector, partition table and MBR are cloned.

Read

man cp
man tar
man dd

hadimotamedi 08-08-2010 01:32 AM

Sorry. You mean two ide disks? But not one ide and one usb disks? Can you please confirm if your proposed 'dd if of' procedure can be used for one ide disk as primary and one usb disk as secondary?


All times are GMT -5. The time now is 03:08 AM.