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

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help

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

Postby vdorta on Sun Apr 15, 2007 10:23 pm

My first sata drive (sda) has Vista on it, and I want to install Bianca to a second sata drive (sdb1, sdb2), making the two drives completely independent of each other (I can boot to either one by pressing F8 at startup and I have made a common Fat32 partition, sdb3). When I get to the Bianca "Ready to install" screen, it says "GRUB will be installed to (hd0)". Should I change this to (hd1) to make sure it installs to the Linux drive?
vdorta
Level 1
Level 1
 
Posts: 11
Joined: Sat Nov 18, 2006 10:21 pm

Linux Mint is funded by ads and donations.
 

Postby Boo on Sun Apr 15, 2007 10:43 pm

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
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Postby vdorta on Sun Apr 15, 2007 10:52 pm

Thanks, Boo. I tried PCLinuxOS in this way a while ago and everything was fine; however, a recent Mepis 6.5 install did swap the drive letters.
vdorta
Level 1
Level 1
 
Posts: 11
Joined: Sat Nov 18, 2006 10:21 pm

Postby Boo on Sun Apr 15, 2007 11:15 pm

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 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Postby vdorta on Mon Apr 16, 2007 12:54 pm

My install went bad in this same way, Grub swapped the drives and I can't start Bianca. What is the easiest way to solve this problem?
vdorta
Level 1
Level 1
 
Posts: 11
Joined: Sat Nov 18, 2006 10:21 pm

Postby Boo on Mon Apr 16, 2007 8:03 pm

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 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Postby vdorta on Mon Apr 16, 2007 11:27 pm

Thanks again, Boo. I am no Linux expert, so please explain how to mount the partition. I tried the CD twice but couldn't do anything with it.
vdorta
Level 1
Level 1
 
Posts: 11
Joined: Sat Nov 18, 2006 10:21 pm

Postby Boo on Mon Apr 16, 2007 11:43 pm

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 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Postby vdorta on Thu Apr 19, 2007 1:26 pm

Boo, The CD couldn't mount the partition; neither could my Mepis CD. I could finally get to grub via a second install (PCLinuxOS), from which I am posting this. I haven't tried Linux Mint again, but this is the key part of my menu.lst. It looks OK to me, but what do I know?:

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

title Linux Mint, kernel 2.6.17-10-generic (recovery mode)
root (hd1,2)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sdb3 ro single
initrd /boot/initrd.img-2.6.17-10-generic
boot

title Linux Mint, memtest86+
root (hd1,2)
kernel /boot/memtest86+.bin
quiet
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows Vista/Longhorn (loader)
root (hd0,0)
savedefault
chainloader +1
vdorta
Level 1
Level 1
 
Posts: 11
Joined: Sat Nov 18, 2006 10:21 pm

Postby Boo on Thu Apr 19, 2007 9:35 pm

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 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Postby vdorta on Sat Apr 21, 2007 2:17 pm

Boo, following your instructions I booted into PCLinuxOS, changed the partitions and then copied the modified Linux Mint menu.lst data into the PCLOS menu.lst in the general PCLOS form as this:

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

However, when trying to boot into Mint from the PCLOS grub, I get this error:

kernel /boot/vmlinuz ....
Error 15: file not found

I think I need to install the Mint grub to partition sdb3 for this to work, right? Reinstalling Mint wouldn't help because the (terrible) Ubuntu installer doesn't have the option to install to a partition, but I searched the internet and found these two solutions via CDLive.

1:
mount /dev/sda3 mnt/root
chroot /mnt/root
grub-install /dev/sda3
exit

2:
sudo grub
root (hd0,2) ... should this rather be root (hd0)?
setup (hd0,2)
quit

Which one should I use, if at all, or any other idea?

Thanks again, I won't quit, this has become a challenge for me.
vdorta
Level 1
Level 1
 
Posts: 11
Joined: Sat Nov 18, 2006 10:21 pm

Postby Boo on Sat Apr 21, 2007 8:05 pm

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 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Postby vdorta on Sat Apr 21, 2007 8:51 pm

PCLinuxOS menu.lst:

timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,0)/usr/share/gfxboot/themes/pclinuxos/boot/message
default 0

title PCLinuxOS
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=PCLinuxOS root=/dev/sdb1 splash=silent vga=788
initrd (hd0,0)/boot/initrd.img

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

PCLinuxOS df -h:

[val@localhost ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 29G 2.0G 26G 8% /
[val@localhost ~]$

fdisk -l output (PCLOS sdb1, Mint sdb3):

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

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

Disk /dev/sdb: 80.0 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 3824 30716248+ 83 Linux
/dev/sdb2 3825 4079 2048287+ 82 Linux swap / Solaris
/dev/sdb3 4080 7903 30716280 83 Linux
/dev/sdb4 7904 9733 14699475 b W95 FAT32
vdorta
Level 1
Level 1
 
Posts: 11
Joined: Sat Nov 18, 2006 10:21 pm

Postby Boo on Sun Apr 22, 2007 6:58 am

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!
User avatar
Boo
Level 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Postby vdorta on Sun Apr 22, 2007 3:09 pm

Boo wrote: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

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

Boo, I just rechecked and the line you suggest is already in both menu.lsts. I boot the second drive off PCLOS without problems but can't make Mint boot.

P.S 1. I tried all combinations (hd0,2 hd1,2 sda3 sdb3) and none work, like grub can't find the Mint kernel anywhere (it is in Mint's boot directory). I think I will reinstall both OS, this time starting with PCLOS, to see if modifying the Mint grub solves the problem.

P.S. 2 I installed the alternate CD of Ubuntu 7.04 on top of Mint, installing grub to the sdb3 partition; it also swapped the drive names but booted right off the PCLOS menu.lst once I changed the drive to hd0,2. When the final PCLOS 2007 is out, I will reinstall PCLOS and Mint. Thanks, this was interesting.

Thanks again for your help.
vdorta
Level 1
Level 1
 
Posts: 11
Joined: Sat Nov 18, 2006 10:21 pm

Postby Husse on Tue Apr 24, 2007 8:36 am

@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
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Postby vdorta on Tue Apr 24, 2007 10:23 am

The best thing to do is to add more options to the Ubuntu installer and eliminate its weird behavior of changing drive names. The old Debian-based Mepis didn't do it, PCLOS doesn't do it.
vdorta
Level 1
Level 1
 
Posts: 11
Joined: Sat Nov 18, 2006 10:21 pm

Postby D1Wayne on Sat Apr 28, 2007 8:19 am

Hi vdorta -
F8 at startup and I have made a common Fat32 partition, sdb3

does your mobo bios also allow ordering of drive boot sequence as well as boot device priority?

i'm assuming you are attempting 3 entirely independent boot drives. (each with either NTLoader or a grub on each drive)

I initially tried a independent dual boot where I wanted Bianca on sdo with grub and XP on hd0, neither mint or feisty would install on sd0, so I remove the 1st hd (XP on IDE) then installed to hd0 (SATA), plugged the IDE (XP) drive and was booting directly to xp visa NTLoader, but when I treid Linux (SATA prive, no joy).

I gave up (too early i think) I re-installed linux placed the grub on hd0 (IDE xp drive), could not boot either drive, got really ticked at this point and did some digging in the bios of my mobo found that it not only has the option (esc in my case) to select device priority floppy, cdrom hd etc...) but sub-menu in the bios also allows selection of HD boot sequence (both IDE and SATA ) enabled and changed the boot order and suddenly happy camper. I've got a 2nd Raptor and some sort of IDE around so I'll also try this out aswell. If this goes well then I'll try with 2 SATA (since this one is still not production, seems every 2 - 6 days this ones re-buit)
D1Wayne
Level 3
Level 3
 
Posts: 198
Joined: Tue Apr 24, 2007 6:11 am
Location: Pacific North West

Postby Boo on Sat Apr 28, 2007 8:35 am

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!
User avatar
Boo
Level 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Postby Husse on Sat Apr 28, 2007 9:44 am

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.
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Linux Mint is funded by ads and donations.
 
Next

Return to Installation & Boot

Who is online

Users browsing this forum: jorx and 12 guests