LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Did I put GRUB in the right spot? (https://www.linuxquestions.org/questions/linux-newbie-8/did-i-put-grub-in-the-right-spot-672974/)

357mag 09-28-2008 08:07 PM

Did I put GRUB in the right spot?
 
Okay I just installed Ubuntu on my second hard drive. But I think I screwed up at the part of the installation when it asks you where you want GRUB put. I said put GRUB here:

/dev/sdb1

I'm getting this error:

Error 17: Cannot mount selected partition

But I think that put GRUB in the first partition when it needs to be in the boot sector. So could someone tell me exactly what to type at that part of the installation to tell it to put GRUB in the boot sector? I'll just redo the installation. It's simple enough.

When all this is done my plan is to just go into the BIOS and and use the BIOS to control which operating system gets booted.

pinniped 09-28-2008 08:17 PM

What operating systems do you have?

I wouldn't advise using the BIOS to select what boots; this is too much of a hassle. The Linux bootloader can boot from any drive, unlike the seriously defective WinDuhs bootloaders.

Now how did you install - did you remove the first disk before installing or what? Since GRUB is complaining that it cannot mount /dev/sdb1, what filesystem did you put on sdb1? Are you sure 'sdb1' was really your install disk and not the other disk?

You should be able to use the Ubuntu disc as a live CD and fix up any problems - but first we have to find out what your problem is.

ronlau9 09-28-2008 08:20 PM

Quote:

Originally Posted by 357mag (Post 3294539)
Okay I just installed Ubuntu on my second hard drive. But I think I screwed up at the part of the installation when it asks you where you want GRUB put. I said put GRUB here:

/dev/sdb1

I'm getting this error:

Error 17: Cannot mount selected partition

But I think that put GRUB in the first partition when it needs to be in the boot sector. So could someone tell me exactly what to type at that part of the installation to tell it to put GRUB in the boot sector? I'll just redo the installation. It's simple enough.

When all this is done my plan is to just go into the BIOS and and use the BIOS to control which operating system gets booted.

You can use the BIOS to control which operating system get booted ,
but during install this during should the first boot drive too
I mean installing on SDB than SDB is boot HD
Maybe it is not necessary to reinstall ,what is the outcome
of the command fdisk -l

357mag 09-28-2008 08:25 PM

I got XP on my first disk. I wanna put Ubuntu on my second. I did not remove any disks. I shouldn't have to do that I don't think. I just followed the defaults in the installation so I would imagine it used the correct Linux filesystems.

pinniped 09-28-2008 09:02 PM

OK, since the XP bootloader starts first, you don't have an option to boot Linux. If you were to swap things over in the BIOS then you should see GRUB start up but then fail to load the system.

You can either install GRUB to the MBR of the fist disk where it can boot Linux or chain to XP's ntldr, or you can install GRUB on the second HD and set up ntldr to chain to GRUB (in which case you get two sets of boot menus when you want to boot Linux) - so which one do you want? Booting via nldr means that you will have to update a file each time you upgrade your Linux kernel.

sundialsvcs 09-28-2008 09:05 PM

Remember that Linux counts partitions from '1' whereas Grub counts them from '0'.

The best way to solve problems like this is to visualize what you have now, then compare it to what you intended to set up.
  1. Most basically, your BIOS needs to have something to boot. That "something" needs to be Grub's first-stage loader, which grub-install can set up. And, your BIOS has to know where to find it. If you see anything that "looks vaguely like GRUB" when you start the computer, you've cleared this hurdle. Otherwise, you haven't.
  2. Grub's first-stage loader needs to be able to find, in the designated partition, its own second-stage image and its configuration file. (If you're using a background-image, it needs to find that, too. The symptoms if it cannot are much uglier than you might have expected.)
  3. Grub now needs to find, at each of the locations specified in the configuration file, the proper operating-system to be booted according to the directions given in that file.
"So, what's wrong?" You'll need to figure that out, I am afraid, for yourself. But your careful observations, coupled with this description of the general process that Grub is attempting to go through, ought to help you to see your way clear. And, to learn something in the process. (Still stuck? Write back.)

357mag 09-28-2008 09:20 PM

Well what I tried now was I used something called Super Grub Disk. I ran it from the CD and just followed the menu and it fixed GRUB, and I was able to boot into Ubuntu.

But I got a new problem. When I entered my username and password, it would not let me in. And I know I entered them correctly.

My initial intention was to always go into the BIOS and just change which drive gets booted. My friend at the local tech shop told me I could do it that way. But after awhile that may get a little sickening. Cuz everytime I want to boot into the other system I would have to go back into the BIOS and change it again.

My next preference I think would be to use the Windows bootloader to load both operating systems. I believe you gotta copy the contents of the first 512 bytes or something of GRUB and place that in the boot.ini file of Windows. From what I've read this can either be done manually or by using BootPart.

pinniped 09-28-2008 09:50 PM

Fixing the username/password issue should be simple -

1. Boot from the LiveCD and check out the /etc directory of your installed system
2. look in the 'passwd' file to see that you do have the username you expected
3. make a backup copy of 'shadow'
4. remove the user's password entry from 'shadow' - for example:

bob:$1$12345678$r/i3hP5obnYnQeyqmsJkU1:13559:0:99999:7:::

would become:

bob::13559:0:99999:7:::

and when you boot to the system, 'bob' should be able to log in without a password - unless of course PAM is misconfigured, in which case you'll need to check the Ubuntu website to see if there are any such known issues. Of course 'bob' has to change the password after logging in. There are other alternatives in which you can generate a proper md5 hash password entry, but simply removing the password is easier. :)


All times are GMT -5. The time now is 02:21 PM.