How to install Grub on second (Linux) Sata drive?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Boo
Level 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

Yes.
I have done this myself for other reasons.
since you can choose the HD to boot off all will work fine unless the bios does some trick to swap the hd0 and hd1 around. (I hope not and dont think so).

if the bios does swap the devices all the hda/b entries on linux will be around the wrong way.

I would try it anyway, it cant do any harm.
If it does not work you can boot off the mint CD and use a grub command to put grub in the MBR of hd0 any way.

:D
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

Yes. Grub can trick the bios into thinking the disks are swapped.
I do this on one system because xp is on the second disk and xp has to think it is on the master disk, so grub tricks the bios and so xp into thinking the second disk is the master (hd0).

so it could have been grub on mepis swapping the drives...

:D
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

the easiest way is to let the install put grub in the mbr of (hd0) and let the system boot normally. this means a reinstall.
:D

I think what is happening is that when you boot off the CD the hard disks are seen in their default order and mint installs that way. but when you boot off the second disk (where mint is) the disks are swapped so grub has the disks around the wrong way. you could manually edit grub at boot but.....

If you want to just for fun (LOL) you could boot off the mint CD, mount the root partition of your mint install, cat the /boot/grub/menu.lst file and post it here.
because it can always be fixed...
(I really just want to see how tricky your bios is with the hd boots.)
:wink:
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

boot off CD.
open terminal window.
list the disk partitions.

sudo fdisk -l

so hdb1 should be your linux / partition and hdb2 your linux swap partiton on the second disk. hda1 should be your windows partition on the first disk.
post this output if you want to.

run mount command: (assuming mint / partition is on hdb1)

sudo mount /dev/hdb1 /tmp

so the grub menu file is now under:
/tmp/boot/grub/menu.lst

fun aint it???
:D
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

after you installed mint to the second disk and wrote grub to the second disk mbr (hd1) when you booted to the second disk did a grub menu appear?

the other think i can think of is that there was no boot flag on a partition on the second disk (I should check my setup for this).

I am thinking that the grub menu for mint is wrong because when you boot off the second disk it then thinks it is the first disk. so your grub menu should look like this.

title Linux Mint, kernel 2.6.17-10-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sda3 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot
...

so i changed (hd1,2) to (hd0,2) and sdb3 to sda3.

BTW i forgot you had sata drives and with the new info my mount command should have been:
sudo mount /dev/sdb3 /tmp

don't give up now!
:D
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

if you are booting to pclinuxos off the second disk could you post its grub menu.lst (or grub.conf) and could you post a df -h from pclinuxos.

if pclinuxos has setup how we want mint to then all we should have to do is copy its grub menu.lst file and substitute mints location...

:D
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

if you change the this line in the pclinuxos ment.lst you should be able to boot linux mint

kernel (hd0,2)/boot/vmlinuz-2.6.17-10-generic root=/dev/sda3 ro quiet splash

the pclinuxos menu.list shows that the bios makes the hd booted off to be hd0. (well sort of, maybe just temp.)

from your earlier post (2 ago)I saw that you changed mints menu.lst but you left sdb3 instead of changing it to sda3. this should work according to your pclinuxos menu.lst post which is the same.

change the pclinuxos menu.lst first if it is now the one used when booting off the second disk.

good luck.

:D
Image
Now where was i going? Oh yes, crazy!
Husse

Post by Husse »

@Boo
The live CD can't mount or do anything to your hdd(s)
I think Clem intends to change this in the future, I read something to this effect somewhere in the forum
User avatar
Boo
Level 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

I have mounted partitions/fs with the live cd lots of times.
that is how you repair your system when it really turns to ****.

:D
Image
Now where was i going? Oh yes, crazy!
Husse

Post by Husse »

Sorry my mistake.
Clem has expressed thoughts about giving read/write access to your disks - you cant do that now. I can't get the Live CD to work on my main PC without the "vesa trick" Thought you had to start the install to get at Gparted but just checked with my reserve....
Had been a bit easier to solve a problem I had some time ago if it wasn't so darn hard to get the live CD to work....
//edit// And if I could mount a partition even better, but at least the first attempt failed
Last edited by Husse on Sat Apr 28, 2007 11:54 am, edited 1 time in total.
Locked

Return to “Installation & Boot”