Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

How do I fix grub?

  Date: Nov 29    Category: Unix / Linux / Ubuntu    Views: 654
  

I installed kubuntu on a usb drive and now I can't boot without
the drive plugged in. How do I fix grub so if I want kubuntu i plug in
the the usb and if I want windows I don't? I am using win 2000.

Share: 

 

21 Answers Found

 
Answer #1    Answered On: Nov 29    

I don't have a solution for you but I will share my experiences along
the same lines.

I have two computers that run XP and have drives configured in removable
trays. I installed Ubuntu 8.04 on the first machine using a brand new
drive in the removable tray. I retained another drive on a second
removable tray that was formatted with NTFS. In addition, I had a USB
thumb drive online.

I was initially delighted that Ubuntu came up perfectly and recognized
my NTFS drive and my USB stick right off the bat. I had fun reading and
writing to the NTFS drives from Ubuntu with absolutely no problem.

Then suddenly, I started getting an error when I rebooted. The error
centered around Grub not being able to load the partition. It wouldn't
allow me to load anything.

Pulling the Ubuntu drive from the tray and restoring the XP boot drive
worked fine.

I deleted my Ubuntu partitions on my new drive and freshly installed
Ubuntu 8.04. The same thing occurred.

I wonder what I can do to prevent Grub from installing in the first
place? Do I need this if I do not want multiple OS's on the drive?
Should I install Ubuntu initially with all of my NTFS drives out of the
system?

 
Answer #2    Answered On: Nov 29    

just wanted to inform from what i have been reading along linux does not
work well with ntfs...
you may have to make the file system FAT for linux to be able to read it. or
try using the wui

 
Answer #3    Answered On: Nov 29    

I am looking for some guidance on doing
without the GRUB boot loader. The NTFS R/W support was enabled with the
last release of Ubuntu and I am very pleased with the way it works. It
is GRUB that is causing me a pain.

 
Answer #4    Answered On: Nov 29    

When you hooked up only one drive, then installed Linux, weren't you
prompted if you wanted to then setup Grub or not? And since you have
only one OS per drive, it sounds like your answer to the "Do you want
to setup Grub?" prompt would have been No.

Once the one Linux drive is booting, hookup the USB, NTFS and mount them.

 
Answer #5    Answered On: Nov 29    

I honestly don't ever remember seeing the choice offered to install GRUB
- that is what puzzles me. I am not giving up, I am going to remove all
of my NTFS devices and do a fresh install of Ubuntu 8.04. Then as you
say, I will reintroduce the NTFS drives to a working Ubuntu system
(hopefully without GRUB)!

I have another machine in which I have an NTFS drive that is on a SATA
connector and not resident in a removable tray. I almost had heart
failure when Ubuntu installed just fine and saw my NTFS partitions.
When I rebooted into Ubuntu, Grub came up and said it could not find a
valid partition. I pulled Ubuntu out and had to run a restore console
for Windows XP and invoke the FIXMBR command to restore my XP boot
partition.

My advice to anyone is to be very careful about the initial installation
of Ubuntu if you have Windows XP on a separate drive. I would recommend
disabling NTFS devices on the initial installation pass.

 
Answer #6    Answered On: Nov 29    

Tim the intro screen gives you three option with 8.4 does it not.
You can install it in its own folder on the C: drive within your XP or
Vista with wubi. It build its own partitions in the folder leaving the
mother system alone and give a simple win boot option to either system

Or you can install to another partition or another drive by going for
full install and directing the partitioning to the correct
drive/partition at that point of the install.

This will then load the full grub loader.

 
Answer #7    Answered On: Nov 29    

You've been reading older information. The newer Linux kernels handle
NTFS quite well. Still, it's never a bad idea to have a FAT32
partition around, just don't expect a DVD-sized 4 GB individual file
to fit on FAT32. For that you need Linux's EXT3 or Window's NTFS.

 
Answer #8    Answered On: Nov 29    

The problem is likely one of where grub is installed. If grub is installed on a
removable drive then it won't work properly. It should be installed of the drive
that boots first.

I have two hard drives. I usually want grub installed on my first drive hda and
not my second drive sda because hda is the primary master and sda is the primary
slave. The BIOS will boot hda first. If I press ESC on boot up my HP comes up
with a menu which allows me to choose which device to boot. If I choose sda, the
second drive, it will not have grub and will load Windows which is the first OS
on sda. If I add other OSes to sda, then a second grub menu will pop up which is
entirely different from the previous grub and it will give me choices instead of
booting Windows. In other words you can have more than one grub menu and you can
write them to different drives.

I have a usb stick which I have also had OSes on. Once I had two versions of
Linux on the usb stick. In this case a grub menu was added to the usb stick to
allow me to choose which OS to boot. It made no reference to any other OSes,
only to the ones on the usb stick.

If you install Linux to a removable drive and grub is written to it instead of
the permanent one then you will get the situation that grub is missing when the
drive is removed and you won't be able to choose which OS to boot from the
permanent drive. The solution is to have two grub menus, one for the removable
and one for the permanent one.

Possible problems can occur when you fool around with grub and removable drives.
Drives are named in sequence. When they are mounted they become sda1, sda2, sda3
or hda1, hda2, etc. However grub uses (hd0,0), (hd0,1), (hd0,2) instead of sda1,
sda2, sda 3 for the first drive and it uses (hd1,0), (hd1,1) (hd1,2) for the
second drive. These things are relative to when grub was written. If you modify
grub and a drive that you had in sequence is removed at the time you can foul
things up. For example if you remove the drive that was hd0, the second drive is
now hd0 as far as the machine is concerned. But grub will still point to hd1 for
that drive which is what it was at the time grub was saved to the drive and it
will not boot unless you press 'e' in grub and change (hd1,0) to (hd0,0) then
press 'b'.

This should be clear as mud, but it shows that grub is incredibly logical and
when we mess with things it throws the machine off.

 
Answer #9    Answered On: Nov 29    

Linux works great with NTFS. You must be reading old material. There was a time,
years ago, when this was problematic, but most modern distros mount and
read/write NTFS just fine.

 
Answer #10    Answered On: Nov 29    

I cannot boot from my cd. BIOS has been set to load cd first but all I
get is the Grub menu (grub was installed with Ubuntu 6.10). I have
tried Ubuntu 7.04 cd and WinXp cd and no boot from cd. Help.

 
Answer #11    Answered On: Nov 29    

Are you trying to boot an install disk or a live disk?

It sounds like you are saying that the Grub on your hard drive comes
up. Correct?

If the bios is set to boot from the CD first, then it could be a CD
drive problem. Can you read from the CD once the computer is booted
from the hard drive?

Is this an older computer?

 
Answer #12    Answered On: Nov 29    

Try opening the boot menu as your computer starts. Instead of going into
the BIOS hit the F key for a boot Menu, mine is F12, yours may be different.

There you can choose the drive.

 
Answer #13    Answered On: Nov 29    

If I make a new fat32 partition for installing windows into, can i easily repair
grub by merely stating up ubuntu off a disc and copying over the grub.cfg file
into the boot/grub directory?

 
Answer #14    Answered On: Nov 29    

If Windows overwrites the MBR then use the Live CD to re-install grub. It
will do it from scratch and not copy what is already there. Follow the
instructions here:
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

 
Answer #15    Answered On: Nov 29    

You should be able to rebuild the grub config file with:

sudo update-grub

which will scan all of your partitions for bootable O/S's, and rewrite grub.cfg.
(Assuming that your repartitioning hasn't made your system unbootable.)

 
Answer #16    Answered On: Nov 29    

Does this command work from a live disc?

 
Answer #17    Answered On: Nov 29    

From a live disc, it won't do what you want it to do. However, quoting from the
man page:

"update-grub is a stub for running

grub-mkconfig -o /boot/grub/grub.cfg

to generate a grub2 config file."

So, if all you need to do is regenerate grub.cfg (i.e., your MBR is OK) you can
boot from the Live CD, mount your normal boot partition (I'll assume as /mnt)
and run these commands from terminal:

cd /mnt
cd boot/grub
sudo cp grub.cfg grub.cfg_BAK
sudo grub-mkconfig -o ./grub.cfg

(Caveat: I haven't tested this.)

If you *do* have to repair the MBR, use the instructions in this link from
someone else's post:

https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

 
Answer #18    Answered On: Nov 29    

This is incorrect. It will do exactly what the OP wants. I've done it within the
past week.

 
Answer #19    Answered On: Nov 29    

I'm not sure, but... I may be misunderstanding you.

It's always necessary to install Windows first as it will overwrite
the Boot Record and disable any other Operating System. Ubuntu isn't
so rude! You are asked in the Ubuntu setup whether you want to install
it to dual boot or take over the whole hard drive. If the former it
creates a boot menu which allows you to choose each time which you
want to start. When Ubuntu is installed it will create or modify grub
for you, other methods I wouldn't want to guarantee.

 
Answer #20    Answered On: Nov 29    

I want to add a new partition to put windows into is what I was saying.

 
Answer #21    Answered On: Nov 29    

I understand better now... It can be done, and grub can be repaired as
several have stated, but it's easier to install Windows first and then
Ubuntu will recognize it and create a grub which gives the choice of
O/S's automatically. In other words, Ubuntu is Windows aware and
friendly, but Windows ignores any other O/S and won't let you boot to
anything but Windows without taking special steps. That can be done
fairly easily and successfully, but it's a nuisance!

 
Didn't find what you were looking for? Find more on How do I fix grub? Or get search suggestion and latest updates.




Tagged: