LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-01-2007, 12:39 PM   #1
ShadStar
Member
 
Registered: Feb 2007
Location: South West of the United Kingdom.
Distribution: Ubuntu 8.04 (Hardy Heron)
Posts: 36

Rep: Reputation: 15
Unhappy booting linux from a second drive


Okay guys, I got a new one for you
Before commiting myself to dual-booting my new suse distro using the grub bootloader, I thought I would experiment with a different method

My pc is capable of booting from a second hard-drive by setting the hdd order in the bios (I do this quite often if I need to boot a previous os).

So far I have left my primary drive alone with 2 windows installs on it, and I have installed suse to the second hard drive (that is to say a new drive on the secondary ide channel) Now I am struggling with grub

My drive list is as follows:
hda1 - Windows xp
hda2 - Windows vista (dual-boot with hda1)
hda3 - shared ntfs partition for misc. data

Now my new drive is detected as hdd, so I have partitioned it as follows using the partition tool in suse:

Primary partition:
hdd1 - ext3 file system, mounted as root - 20Gb

Extended partition:
hdd2 - swap file system - 2Gb (twice my ram)
hdd3 - ext3 file system, mounted as home - 80Gb

I have configured grub to put the bootloader into root as I don't YET want to interfere with my windows dual-boot loader (although I have a feeling I may need to...)

My problem is that when I complete the install (successfully with no errors), and the pc reboots, I tell it to boot from the second hard drive using the bios boot priority option, but grub cannot mount my suse root partition and tells me that it is the wrong type (0xf-secondary), despite me having partitioned it as primary when I set it up.

My questions are:
1. Am I using an incorrect file system (ext3) for the primary boot partition (it wouldn't let me use fat)?

2. Should my swap partition be in a primary partition and not in a secondary partition?

3. Should I install a /boot partition into hdd1 formatted as fat, and put root into the extended or into a second primary partition?

4. Is it possible for me to boot straight to the second hard drive with grub installed in it's root, or am I FORCED to put grub on my primary drive? (I was under the impression that the bios boot priority would let me boot straight to any drive I wanted to regardless of order, providing that there is a valid mbr and bootloader on the drive in question of course)

If I can get suse to boot straight off the second drive without having to touch the primary I will be a very happy bunny indeed. Any thoughts and advice MOST welcome at this point as I have been at this all day and have tried various partition configurations, and am now in need of a little expert advice.

Thanks for bearing with me guys, I appreciate your experience in this.

 
Old 03-01-2007, 01:56 PM   #2
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
Quote:
Originally Posted by ShadStar
Okay guys, I got a new one for you
Before commiting myself to dual-booting my new suse distro using the grub bootloader, I thought I would experiment with a different method

My pc is capable of booting from a second hard-drive by setting the hdd order in the bios (I do this quite often if I need to boot a previous os).

So far I have left my primary drive alone with 2 windows installs on it, and I have installed suse to the second hard drive (that is to say a new drive on the secondary ide channel) Now I am struggling with grub

My drive list is as follows:
hda1 - Windows xp
hda2 - Windows vista (dual-boot with hda1)
hda3 - shared ntfs partition for misc. data

Now my new drive is detected as hdd, so I have partitioned it as follows using the partition tool in suse:

Primary partition:
hdd1 - ext3 file system, mounted as root - 20Gb

Extended partition:
hdd2 - swap file system - 2Gb (twice my ram)
hdd3 - ext3 file system, mounted as home - 80Gb

I have configured grub to put the bootloader into root as I don't YET want to interfere with my windows dual-boot loader (although I have a feeling I may need to...)

My problem is that when I complete the install (successfully with no errors), and the pc reboots, I tell it to boot from the second hard drive using the bios boot priority option, but grub cannot mount my suse root partition and tells me that it is the wrong type (0xf-secondary), despite me having partitioned it as primary when I set it up.

My questions are:
1. Am I using an incorrect file system (ext3) for the primary boot partition (it wouldn't let me use fat)?
Perhaps you should post the actual message with the 0xf-secondary notation. It doesn't make much sense.

There is no partition type of ext3. It should be marked as 82 (Linux) and you can use any type of filesystem supported by GRUB and your distro. I don't know why GRUB shouldn't be able to boot from ext3. Linux can be booted from either primary or logical partitions.

Quote:
Originally Posted by ShadStar
2. Should my swap partition be in a primary partition and not in a secondary partition?
No, and it's probably 2-4 times larger than needed. You might reduce it to 512k but you'll have to decide what you want to use.

Quote:
Originally Posted by ShadStar
3. Should I install a /boot partition into hdd1 formatted as fat, and put root into the extended or into a second primary partition?
Absolutely not. There is no need for a boot partition with modern distros except for some very unsual multiboot/file system combinations and there's no reason to use FAT for any Linux partition unless you want to share data with *bloze.

Quote:
Originally Posted by ShadStar
4. Is it possible for me to boot straight to the second hard drive with grub installed in it's root, or am I FORCED to put grub on my primary drive? (I was under the impression that the bios boot priority would let me boot straight to any drive I wanted to regardless of order, providing that there is a valid mbr and bootloader on the drive in question of course)
If you change your BIOS to boot from hdd, then GRUB should be installed in the MBR of hdd and/or the partition with the kernel has to be marked as bootable in the DOS partition table.

If you want to multiboot with GRUB and not change your drive order in BIOS, then just install your bootloader in the MBR of your primary drive and add the correct entries to GRUB's menu.lst

Quote:
Originally Posted by ShadStar
If I can get suse to boot straight off the second drive without having to touch the primary I will be a very happy bunny indeed.
Then install GRUB in the MBR of hdd and add an entry for your SUSE system in menu.lst and you should be fine.

This is really more complicated than necessary. I boot many OS from two drives just by setting up LILO properly in the MBR of the primary drive. I also install LILO in the MBR of the second drive, but that's only to make life simpler if the primary drive fails and I need to change the BIOS to boot from the second drive. You can certainly make your life simple and use one bootloader to boot all your winbloze and OS from any number of drives with one menu and no need to change BIOS.

Last edited by Randux; 03-01-2007 at 02:07 PM.
 
Old 03-01-2007, 03:51 PM   #3
ShadStar
Member
 
Registered: Feb 2007
Location: South West of the United Kingdom.
Distribution: Ubuntu 8.04 (Hardy Heron)
Posts: 36

Original Poster
Rep: Reputation: 15
Thanks for the reply Randux, very much appreciated.

My apologies for the vagueness of the 0xf message, I post the full boot message as follows:

Grub loading stage 2..
hd1,0 /boot/message: file not found


Following a short delay I get the Grub boot menu, but when selecting my suse installation I get the following error:

root (hd1,0)
filesystem type unknown, partition type 0xf
kernel /boot/vmlinuz root= /dev/hdd1 vga=0x317
resume=/dev/hdd5 splash=silent showopts

Error 17: cannot mount selected partition
press any key to continue...


This is what prompted my question about the partition type. Following your advice I double-checked the partition types that I had created and confirmed the following:

hdd1 - primary - type083 linux native
hdd5 - extended logical - type082 linux swap
hdd6 - extended logical - type083 linux native

I did also check the Grub script (limited knowledge) and it lists the following as being default:

Type - Image

append= resume=/dev/hdd5 splash=silent showopts, image=/boot/vmlinuz, initrd=/boot/initrd, root=/dev/hdd1, vgamode=0x317

Just to clarify, this was generated by the suse install, not by me. I notice a reference to hdd5 (swap partition), should that be there?

I also made sure that I made the primary partition active, and made sure that I installed grub into the root partition (hdd1).

Having said that, I notice that the problem seems to be at Stage 2...

My references to ext3 are, I admit, slightly misleading, I do apologise. It refers to a file system type, whereas I should have stated the partition types as above.

I also take on board your advice about my swap partition, I read in several posts that it was a guideline to set it to twice the ram, which is in my case is 1Gb. I agree that 512Mb would seem to be adequate.

Thank you for clarifying the /boot question, being new to Linux I was a little unsure about that.

My bios boot option is actually quite convenient on my current pc, as I merely press the f11 key at machine-boot to bring up a list of boot drives. I find this convenient for booting earlier versions of 'doze' by slotting them into my drive cradle, booting, pressing f11 and selecting the cradle drive as boot drive. But I take on board your advice about using Grub to chainload the main boot-menu. I am hesitant to do this at the moment as I already use the Vista bootloader for my 'doze' drive and it is a little picky about being disturbed.

My idea is both simple and complicated, as I was trying to achieve a similar boot option to the one mentioned above using f11, without disturbing my current installs, hoping that the second drive would be a self-contained bootable hdd that I could boot straight onto. However if I have to install grub to the mbr then that is what I will do.

I appreciate any experienced input on this problem, and I am always open to suggestions, after all I am the newbie here
 
Old 03-01-2007, 04:59 PM   #4
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I believe if you have installed Suse with a certain disk order please "stick" with it.

Your problem is likely to be self inflicted by changing the boot disk order after the installation.

At time of Suse installation Grub arranged everything according to

(hd0) is hda
(hd1) is hdd

So the displayed message would be "sourced" from /boot partition of hdd1 or in Grub's term (hd1,0).

Now a smart user came along and reversed the boot disk order so that Bios tells Grub

(hd0) is now hdd
(hd1) is now hda

Grub goes to (hd1,0) or hda1 to get the /boot/message file and it runs into XP.

Isn't the use of the word "self-inflicted" appropriate here?

I used this word because Grub can do the disk swapping for you. After you have successfully booted up Suse in the disk hdd as the first bootable disk your two Windows should become unbootable temporaily.

You can then have these lines in Suse's /boot/grub/menu.lst to fire up XP & Vista
Code:
title Dude said let Grub boot XP/Vista in hda1 by map statements
root (hd1,0)
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1
I've colored the two map statements red because I advocate if a user alters the boot disk order after the installation then his/her hand should be chopped off so that he/she can no longer interfere with a job that belongs to Grub. The other Linux boot loader Lilo can do the same thing as Grub too.
 
Old 03-01-2007, 05:43 PM   #5
ShadStar
Member
 
Registered: Feb 2007
Location: South West of the United Kingdom.
Distribution: Ubuntu 8.04 (Hardy Heron)
Posts: 36

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by saikee
At time of Suse installation Grub arranged everything according to

(hd0) is hda
(hd1) is hdd

So the displayed message would be "sourced" from /boot partition of hdd1 or in Grub's term (hd1,0).

Now a smart user came along and reversed the boot disk order so that Bios tells Grub

(hd0) is now hdd
(hd1) is now hda

Grub goes to (hd1,0) or hda1 to get the /boot/message file and it runs into XP.
Thank you, I am most humbly and suitably embarrassed

Seriously, I completely missed that one, plus the fact that I am still VERY new to Linux and to how the Grub bootloader works (and how it interacts with the bios.) This explanation makes perfect sense to me, don't know how I missed it.

Let this be a lesson to others out there, listen to the words of the wise, leave Grub alone!

Thanks again.
 
Old 03-01-2007, 05:49 PM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Let us know if that was the root cause to your problem.

I know I put a bit of drama into the the discussion of having the hand chopped off but it is designed to focus the point to the readers.

Grub and Lilo donot actually own to right to swap the disks for you. It just happens such facility is available as standard in these Linux boot loaders. The "map" statement in combination of "hide", "unhide" and "makeactive" statements are sufficient for a Linux user to boot as many MS systems one can installed into a PC.

Last edited by saikee; 03-01-2007 at 05:56 PM.
 
Old 03-02-2007, 09:24 AM   #7
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
When Saikee talks booting, the smart people listen
 
Old 03-02-2007, 01:57 PM   #8
ShadStar
Member
 
Registered: Feb 2007
Location: South West of the United Kingdom.
Distribution: Ubuntu 8.04 (Hardy Heron)
Posts: 36

Original Poster
Rep: Reputation: 15
Thumbs up

Quote:
Originally Posted by Randux
When Saikee talks booting, the smart people listen
Yes indeed, I must agree with you there...

Sorry for the delay, I've been out most of the day and I just got back in.

Yes, that did work (I never doubted it for a minute ). After many struggles on trying to work out how to edit the necessary file from the command line (still new to the shell commands) it booted just fine, so I am now a happy bunny.

Just some info for other suse users here, my version of suse (10.2gm) had the old problem of not letting me log-in as su due to me not having set a password. I had only completed stage 1 of the install and the password is set up in stage 2, which I couldn't get to due to me not being able to boot.

Eventually I worked out that all I had to do was to boot from the install cd, select the rescue mode, then at the command prompt simply type the word "root". This let me in as su without a password. From there it was easy.

Note that once you have set up a password in stage 2 of the install, then typing root at this prompt WILL ask you for a password!

I appreciate what was mentioned earlier about adding grub to the mbr, but I really really didn't want to mess with Vista's bootloader, it can be a real b*tch if you get it wrong, so this method works better for my situation.

HOWEVER, that being said, I do agree that this is an odd way of booting, definitely NOT recommended, and I totally agree with Saikee when he advises NOT to mess with the drive order, it does cause problems.

This has been a bit of a crash-course for me on the grub loader, and in the way Linux boots in general, and I have learned a lot from it, so thank you to Saikee and everybody else that has contributed here. Now that I have a working installation I can start learning about Linux properly.

Cheers guys
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting Linux off of a USB drive hari69 Linux - Laptop and Netbook 0 10-23-2004 11:08 AM
booting linux on a external hard drive servo Linux - General 5 04-15-2004 06:26 AM
Why linux not booting in my new hard drive? redship Linux - General 2 02-25-2004 03:37 PM
why linux booting in my new hard drive? redship Linux - Hardware 1 02-25-2004 09:56 AM
how do i hide my linux drive when booting windows spiderworm Linux - Software 5 11-14-2003 06:26 PM


All times are GMT -5. The time now is 07:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration