LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-23-2010, 11:05 PM   #1
magic8ball88
LQ Newbie
 
Registered: Nov 2009
Distribution: Linux Mint 8
Posts: 21

Rep: Reputation: 15
Problems With Grub


Hello,

Thank you for taking the time to read this post. I am still very new to Linux and I don't understand a lot about this OS yet but I'm learning.

Here's the story.

I installed Windows 7 Beta (I know the Beta is outdated but a friend gave it to me a while ago and I was unable to install it because my computer was broken. My computer works now and I decided to give it a whirl.)

After installing Windows I installed Linux Mint 8 on a separate partition.

As you probably know the Beta will shut down, so I installed Windows 7 over that Beta partition.

Linux was no more but the partition was still there. I tried re-installing grub through a live cd but it wouldn't let me so I installed Linux Mint 8 a SECOND time. Everything works but I have 3 OS's on my computer and the newest Linux Mint is serving me no good. How can I delete it but still have grub installed?

Hope this makes sense (noobs, like myself, tend not to)

Thanks,

-Matt
 
Old 03-23-2010, 11:28 PM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
I'm not quite sure about the 3 OS's, except that if I understand you correctly, it sounds as though you really didn't install Windows 7 over the Windows 7 beta, even though you may have wanted to do so.

As to Linux not being there, if you appear to have 3 OS's, then you likely do have 3 OS's.

I'm not sure about Windows 7, but various versions of Windows have had this unfortunate tendency to mark partitions where other OS's are, as in-active/not-boot-able, which generally makes them ineligible for booting. I've had that sort of problem running Vista and Linux on the same machine.

I generally try to avoid even looking at Linux partitions with Vista, and generally shut Vista down fully, rather than allowing it to re-start.

That seems to keep both OS's boot-able.

You should double check that your Linux partition is marked active/boot-able.

If it isn't, re-gaining access to Linux could be as simple as marking the Linux partition as active/boot-able.
 
Old 03-24-2010, 12:03 AM   #3
kainosnous
Member
 
Registered: Mar 2010
Location: Tennessee, USA
Distribution: Arch, Fedora
Posts: 59

Rep: Reputation: 18
When you install grub, it does a couple of things. It will overwrite the MBR (master boot record) so that it will be loaded when the computer boots. It will also need a place to put it's configuration files. That is typically in the /boot directory of your Linux OS. For instance, on Fedora, grub will be installed in /boot/grub.

Typically, part of your install procedure determines the location of that directory and informs grub. If you don't tell grub where those files can go, then it won't install.

I said all that to say that if you have two copies of Linux Mint and don't want one of them, be sure that grub's files are on the one that you will keep. Otherwise grub will fail to know to boot your system. Keep a live CD handy and move the grub directory out of place to be sure that it isn't accessing those file before you delete the partition. Also, you could just back up your files and reinstall.
 
Old 03-24-2010, 02:19 AM   #4
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
Sorry, the newest Linux Mint *is* , or is *not* working?
 
Old 03-24-2010, 10:25 AM   #5
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
can you please post the output of fdisk -l

if poossible, determine from the above output what you want to keep/ delete.

what i think you need to do (if i understand your post) is to use gparted to move/copy/delete/resize/mark bootable/... your partitions.

Last edited by schneidz; 03-24-2010 at 10:27 AM.
 
Old 03-24-2010, 12:48 PM   #6
divyashree
Senior Member
 
Registered: Apr 2007
Location: Bangalore, India
Distribution: RHEL,SuSE,CentOS,Fedora,Ubuntu
Posts: 1,386

Rep: Reputation: 135Reputation: 135
You have to just reinstall the grub ,

Boot from cd and getin by rescue mode ,
then chroot /mnt/sysimage

then grub-install /dev/<hdd-name>

name- hda/sda/or what u have ,check it and put here .
 
Old 03-24-2010, 03:46 PM   #7
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
Ah yes, I have to stop trying to answer questions in the middle of the night. I broke my own rule, if it's unclear, don't make suggestions, ask for output!

schneidz has the perfect next step. That output will provide the type and status ( whether it's active/bootable ) of each partition. If you are able to boot some installed Linux, if you could also provide us with the /boot/grub/menu.lst file from that system, that could give us even more information about situation.
 
Old 03-25-2010, 12:02 AM   #8
magic8ball88
LQ Newbie
 
Registered: Nov 2009
Distribution: Linux Mint 8
Posts: 21

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by kakaka View Post
Sorry, the newest Linux Mint *is* , or is *not* working?
It is working but its the only way I can access my other linux partition, the one that I actually use. I only installed linux again to get grub so I can access my other Linux Mint partition.

I don't use this partition for anything. I installed it so that when I boot up my computer it asks what I want to boot into. After installing Windows 7 over the beta copy, every time I reboot it doesn't give me a choice, it automatically boots into windows. For a quick fix I installed Linux on a 2.5 gb partition (just enough so I could actually install it) now when I boot it give me the choice to boot into Linux Mint 8 (2.5 gb useless partition) Linux Mint 8 (the one I actually use) and Windows 7.

I hope this is making sense because even as I try to explain it I don't think I'm making much sense.
 
Old 03-25-2010, 12:07 AM   #9
magic8ball88
LQ Newbie
 
Registered: Nov 2009
Distribution: Linux Mint 8
Posts: 21

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by divyashree View Post
You have to just reinstall the grub ,

Boot from cd and getin by rescue mode ,
then chroot /mnt/sysimage

then grub-install /dev/<hdd-name>

name- hda/sda/or what u have ,check it and put here .
I tried doing that earlier with instructions from ubuntu's website (from my understanding Ubuntu and Linux Mint are nearly the same because Linux Mint is based off Ubuntu correct?) the method was not the same but in terminal it told me something along the lines of "this is a very bad idea and is strongly unrecommended" then it would attempt to do it and say that the process could not be completed.
 
Old 03-25-2010, 03:00 AM   #10
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
OK!

So this is the sequence of events that happened:

1) Install Windows 7 - beta, in first partition
2) Install Linux Mint 8, on a second partition of substantial size
3) Install Windows 7 - standard released version, in first partition
4) Discovered you could no longer boot Linux on second partition
5) Installed Linux on third partition, of just 2.5 GB size

Now when you boot, you get the grub menu from the third partition, which allows you to boot any of the 3 installed OS's. If you want to boot Linux, you usually boot the Linux you installed on the second partition, from the grub menu on the third partition.

Is that right?

If it is right, then we *probably* have a pretty good idea what's going on, and what you need to do, to fix it. In fact, I understand what other people have said in this thread, it is all valid advice, if it's properly applied.

But as schneidz suggested, we could use the output from an fdisk -l.

It would be nice if you could also show us the contents of the /boot/grub/menu.lst file from the Linux in the 2.5 GB partition. If I understand correctly, you normally don't want to use that Linux, but you can boot into it, and it is what you are usually using to boot one of the other two OS's.

So for example, if the disk drive you have partitioned shows up in linux as device /dev/sda then if you boot fully into the Linux in the 2.5 GB partition and login as root, you would issue these commands:

Code:
fdisk  -l  /dev/sda

cat  /boot/grub/menu.lst
To be clear, the option for the fdisk command is not a one, it is the first letter of the word linux.

If you could then copy the output of those two commands, and post it in this thread, that would be great.

Last edited by rigor; 03-25-2010 at 03:02 AM.
 
Old 03-25-2010, 07:31 AM   #11
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
^ thanks for the order of events kakaka.
Quote:
Originally Posted by magic8ball88 View Post
(from my understanding Ubuntu and Linux Mint are nearly the same because Linux Mint is based off Ubuntu correct?) ...
yes they are both debian based distros.
fyi, window's ntldr is only capable of booting windows. it automatically installs to the master boot record and wipes out any existing boot loader. also windows must be in the first partition of the first harddisk. because windows isnt as flexible it is always a good idea to install windows first then set-up linux around it.

i wouldnt delete anything until you know what boot directory you are using (this is probably why red-hat distros like fedora use a separate boot partition).

there are 2 possibilities:
1. the 2nd linux mint install simply repaired the existing grub directory from the first linux mint install then installed in a small partition (unlikely).
2. the 2nd linux mint install ignored the grub directory from the first linux mint install and created a new one in someplace like /dev/sda3 (probable).

assuming the 2nd to be correct i would just rm everything in the 2nd install except for the /boot directory (essentially preserving a boot partition) then you can shrink it.
without seeing your fdisk -l as well as your /boot/grub/menu.lst it is close to impossible to guess what partition/s you need to modify. my advice is to run gparted to get a graphical layout of your harddisk but dont commit any changes.

Last edited by schneidz; 03-25-2010 at 07:50 AM.
 
Old 03-25-2010, 09:16 PM   #12
magic8ball88
LQ Newbie
 
Registered: Nov 2009
Distribution: Linux Mint 8
Posts: 21

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by kakaka View Post
OK!

So this is the sequence of events that happened:

1) Install Windows 7 - beta, in first partition
2) Install Linux Mint 8, on a second partition of substantial size
3) Install Windows 7 - standard released version, in first partition
4) Discovered you could no longer boot Linux on second partition
5) Installed Linux on third partition, of just 2.5 GB size

Now when you boot, you get the grub menu from the third partition, which allows you to boot any of the 3 installed OS's. If you want to boot Linux, you usually boot the Linux you installed on the second partition, from the grub menu on the third partition.

Is that right?

If it is right, then we *probably* have a pretty good idea what's going on, and what you need to do, to fix it. In fact, I understand what other people have said in this thread, it is all valid advice, if it's properly applied.

But as schneidz suggested, we could use the output from an fdisk -l.

It would be nice if you could also show us the contents of the /boot/grub/menu.lst file from the Linux in the 2.5 GB partition. If I understand correctly, you normally don't want to use that Linux, but you can boot into it, and it is what you are usually using to boot one of the other two OS's.

So for example, if the disk drive you have partitioned shows up in linux as device /dev/sda then if you boot fully into the Linux in the 2.5 GB partition and login as root, you would issue these commands:

Code:
fdisk  -l  /dev/sda

cat  /boot/grub/menu.lst
To be clear, the option for the fdisk command is not a one, it is the first letter of the word linux.

If you could then copy the output of those two commands, and post it in this thread, that would be great.
YES! That's what happened.

After running the fdisk -l command in my primary Linux partition nothing happens? It just starts a new line in the terminal? What did I do wrong? If it helps I know where all the partitions are. My primary windows partition is /dev/sda1 my primary linux partition is /dev/sda5 and the new 2.5 gb partition is /dev/sda7.

If it helps I can take a picture of my grub screen.
 
Old 03-25-2010, 09:37 PM   #13
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
Hi magic8ball88,

My main disk drive is identified to Linux as /dev/sda. So if,
as root, I run fdisk -l /dev/sda you can see below, I get
this output:

Code:
# fdisk -l /dev/sda

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00070080

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       52218   419441053+  8e  Linux LVM
/dev/sda2   *       52219       52238      160650   83  Linux
/dev/sda3           52239      117509   524289307+  8e  Linux LVM
#
In the column labeled System it shows the type of each partition
and in the column labeled Boot an asterisk * indicates that the partition
is bootable/active, whichever you wish to call it.

Could you perhaps paste into this thread, the characters you see on
your screen as you go to execute the command, starting with the command
prompt prior to entering the command and continuing up to and including
the command prompt, after the command concludes. That could be helpful
in determining what the problem is with command execution.

It looks like your most recent message to this thread wasn't made
very long ago. I'll try to stick around for a while and watch this
thread. If you are still available, if you would be willing to
provide that information and are able to do it soon, perhaps I could
get back to you soon with some idea what's happening.
 
Old 03-25-2010, 09:39 PM   #14
magic8ball88
LQ Newbie
 
Registered: Nov 2009
Distribution: Linux Mint 8
Posts: 21

Original Poster
Rep: Reputation: 15
Okay just to clarify, to run a command as root I first type in sudo correct?
 
Old 03-25-2010, 09:42 PM   #15
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
sudo or su, whichever you prefer.
 
  


Reply



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
Gentoo... grub problems... "/boot/grub/stage1" exists... no halo14 Gentoo 5 02-06-2011 04:50 PM
Problems with /boot/grub/grub.conf not being read properly on reboots cmeyer Linux - Software 1 10-11-2008 06:34 PM
Problems with GRUB, not using whats in grub.conf **FIXED silentpetey Linux - General 1 11-06-2006 09:24 AM
Grub Error 17: Cannot mount selected partition and other Grub problems Sebastian Naitsabes Linux - General 1 07-05-2005 08:33 AM
grub problems alaios Linux - Software 2 04-24-2003 11:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:31 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
Open Source Consulting | Domain Registration