LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Where is GRUB? (https://www.linuxquestions.org/questions/linux-general-1/where-is-grub-708572/)

Windows to Linux 03-02-2009 07:43 AM

Where is GRUB?
 
I ned to give a Hard disk to my brother, but I can't tell which disk GRUB is on
Is thiere any way to move it or something?

pixellany 03-02-2009 08:09 AM

If you mean the GRUB code in the boot record, then you cannot just move it. GRUB gets "hard-coded" to point to the directory with its files.

I'm guessing you have 2 drives in the system, and you want to remove one. Suppose you have Linux running on HD#1. You can simply install GRUB to that disk---like so:
Code:

grub  ##starts the GRUB shell
root (hd0,0)  ##tells GRUB where its files are---I assumed you have Linux on the partition #1 of drive #1
setup (hd0)  ##puts GRUB on the MBR of disk 1.

For more and better help, give us the details of the system---including the output of "fdisk -l" (run as root or with sudo)

CJS 03-02-2009 05:09 PM

To find which drive contains Grub in the MBR (Master Boot Record), you could do:
Code:

sudo dd if=/dev/sda count=1 2>/dev/null | strings | grep -i grub
And replace sda with each of your drives; if the above command returns "GRUB", that means that particular drive has Grub in the MBR.

jay73 03-02-2009 07:33 PM

Check your BIOS. GRUB should be on the first drive. Of course, if your system is on another drive, keeping only the first drive won't be any good and you'll need to move either GRUB or the system.

ukstar 03-31-2009 04:23 AM

Here's a poser guys, which will you probably find simple to set up but I'm totally confused.
When I initially installed Mint onto the same drive as XP, no problem. I then did fixmbr so I could boot from F10. But now of course I can't boot into Mint. How do I install grub onto the root partition of Mint. If I detach the other three drives can I then move the Mint to the root from the live CD?
Any help would be appreciated.


# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=1
timeout=20
splashimage=(hd0,0)/grub/splash.xpm.gz
# hiddenmenu
title Fedora (2.6.27.19-170.2.35.fc10.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.27.19-170.2.35.fc10.x86_64 ro root=UUID=dd93e8af-8915-444c-915e-70dffec42851 rhgb quiet
initrd /initrd-2.6.27.19-170.2.35.fc10.x86_64.img
title Windows 7 (x86_64)
rootnoverify (hd1,0)
chainloader +1

title Windows 7 build 7057(x86_64)
root (hd2,0)
savedefault
makeactive
map (hd0) (hd2)
map (hd2) (hd0)

chainloader +1

title Windows XP
root (hd3,0)
savedefault
makeactive
map (hd0) (hd3)
map (hd3) (hd0)

chainloader +1

title Linux Mint 6, kernel 2.6.27-7-generic
root (hd0,5)
kernel /boot/vmlinuz-2.6.27-7-generic root=/dev/sda6 ro quiet splash
initrd /boot/initrd.img-2.6.27-7-generic

yancek 03-31-2009 09:58 AM

Assuming this is your Fedora grub.conf/menu.lst file?
You state that you had Mint and xp on the same drive yet your entries show xp on (hd3,0) and Mint (hd0,5). If you have them both on the same drive all you need to do is change the Mint entry to (hd3,5). If that doesn't work, post the output of 'fdisk -l' command.

ukstar 03-31-2009 06:16 PM

[QUOTE=yancek;3493757]Assuming this is your Fedora grub.conf/menu.lst file?
You state that you had Mint and xp on the same drive yet your entries show xp on (hd3,0) and Mint (hd0,5). If you have them both on the same drive all you need to do is change the Mint entry to (hd3,5). If that doesn't work, post the output of 'fdisk -l' command.[/QUOTE



whoops didn't notice that, rectified. Now boots into Mint but get this
/dev/sda6 does not exist
then drops to shell (initramfs)
When I originally installed Mint with XP it of course replaced the XP mbr, so now Mint can't find it. Do you think I can change it using shell?

[root@localhost ~]# fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb0df4ad9

Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 30401 243995220 8e Linux LVM

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2773b447

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 30401 244196001 7 HPFS/NTFS

Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000eeac8

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 13 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary. (not worried about this, it's OK)
/dev/sdc2 13 9730 78046208 7 HPFS/NTFS

Disk /dev/sdd: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xbe3070f2

Device Boot Start End Blocks Id System
/dev/sdd1 * 2 24028 192996877+ 7 HPFS/NTFS
/dev/sdd2 24029 30401 51191122+ 5 Extended
/dev/sdd5 24029 25001 7815591 82 Linux swap
/dev/sdd6 25002 30401 43375468+ 83 Linux

yancek 03-31-2009 10:59 PM

You've got some version of windows on each of your drives, the first partition of each. I don't know which has the the OS files you need to boot? Assuming it is on partition sdb1, you would enter the following in your menu.lst file for Fedora (assumes you still use Fedora to boot?):

title windows xp
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

The map commands are to get windows to 'think' it is on the first drive. If your OS system files are on a different drive, you need to make appropriate changes.

meierfra 03-31-2009 11:08 PM

Quote:

dev/sda6 does not exist
Change

kernel /boot/vmlinuz-2.6.27-7-generic root=/dev/sda6 ro quiet splash

in the fedora grub.conf to

kernel /boot/vmlinuz-2.6.27-7-generic root=/dev/sdd6 ro quiet splash

ukstar 04-01-2009 04:02 AM

Hi Guys,
Thanks for all your help. The problem was I had overwritten the Mint MBR by doing a fxmbr in XP, so it didn't exist. Have now re-installed Mint and all OK.
title Linux Mint 6, kernel 2.6.27-7-generic
root (hd3,5)
kernel /boot/vmlinuz-2.6.27-7-generic root=/dev/sdd6 ro quiet splash
initrd /boot/initrd.img-2.6.27-7-generic
quiet


All times are GMT -5. The time now is 04:06 PM.