# re: can't boot ubuntu



## ehababoud (Jun 17, 2006)

*re: can't boot ubuntu*

hi i'm new to linux and i've installed ubuntu as instructed on the ubuntu website and many other sites similar to it. the problem is that it asks me to restart and then it does restart and when booting it goes straight to my windows operating system and i don't know how to solve this.

although i have used zandros for a couple of days it was for doing some essays on a netbook borrowed from my college so i am unfamiliar with anything technical

my drive is partitioned and there is plenty of free space on the partition made for linux (nearly 20Gb).

my system is a 1.6GHz intel core 2 T5200 and the laptop model is a hp530 so it runs ROMPaq for HP Notebook System BIOS (68MVU). i am currently on windows vista operating system and want to make a steady transition to linux but this booting thing is the only thing bothering me. i have researched loads of stuff but they are all irrelevant so i'm not searching the right things and thus i do not know what else to search. please help if possible

thank you for your time :smile:

ehab


----------



## wmorri (May 29, 2008)

*Re: can't boot ubuntu*

Hi,

What I would like you to do is to boot up your livecd. Once that is all set and going I need to you find your linux root partition on the computer. To reach that go to Places -> Computer. That should list all of the file systems that are on the computer. Once you are you in the root file system for the computer not the livecd, you need to browse to the boot folder of the computer, then you need to reach the grub folder. In the grub folder you should find a file called menu.lst l=L. I would like you to open it in gedit next. Then you need to copy everything in that file, then post it up here in your next reply. If you could use the 'code' and '/code' brackets that would be great. The are used the same way as the 'quote' brackets if you have never used them before. This will keep your post more neat.

Cheers!


----------



## ehababoud (Jun 17, 2006)

*Re: can't boot ubuntu*

hi great thanks for the help and i'll be doing that within the next few minutes

thanks again


----------



## ehababoud (Jun 17, 2006)

*Re: can't boot ubuntu*

hi here it is, by the way, as you know from before i don't know much about linux so i'm not sure if i done everything perfect.
please let me know if you need more done.

thanks

ehab



```
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default		0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout		10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title		Windows 95/98/NT/2000
# root		(hd0,0)
# makeactive
# chainloader	+1
#
# title		Linux
# root		(hd0,1)
# kernel	/vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=2705b2a8-260d-45a7-b96b-dea0ad61c506 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=2705b2a8-260d-45a7-b96b-dea0ad61c506

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title		Ubuntu 8.10, kernel 2.6.27-7-generic
uuid		2705b2a8-260d-45a7-b96b-dea0ad61c506
kernel		/boot/vmlinuz-2.6.27-7-generic root=UUID=2705b2a8-260d-45a7-b96b-dea0ad61c506 ro quiet splash 
initrd		/boot/initrd.img-2.6.27-7-generic
quiet

title		Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
uuid		2705b2a8-260d-45a7-b96b-dea0ad61c506
kernel		/boot/vmlinuz-2.6.27-7-generic root=UUID=2705b2a8-260d-45a7-b96b-dea0ad61c506 ro  single
initrd		/boot/initrd.img-2.6.27-7-generic

title		Ubuntu 8.10, memtest86+
uuid		2705b2a8-260d-45a7-b96b-dea0ad61c506
kernel		/boot/memtest86+.bin
quiet

### 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


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda3
title		Windows Vista/Longhorn (loader)
root		(hd0,2)
savedefault
chainloader	+1
```


----------



## wmorri (May 29, 2008)

*Re: can't boot ubuntu*

Hi,

Yes this is exactly what I was looking for. When you installed ubuntu, did you install it after Vista was on the computer or did you install Ubuntu first then Vista? This will help us figure out why vista was added twice.

Cheers!


----------



## ehababoud (Jun 17, 2006)

*Re: can't boot ubuntu*

hello again,

well basically what happened was that the vista was preloaded on the laptop from when i purchased it. i installed linux but not too sure why vista is on twice though - first time i heard of this (and it makes sense as it explains why so much of my vista partition space has been taken up without even adding media or games.

by the way this laptop was all boxed up from a licensed seller (as if it came from the manufacturer) but did not come with a vista CD, just thought i'd mention so the idea of me installing it twice is ruled out.
thanks
ehab


----------



## Rome5 (Nov 25, 2008)

*Re: can't boot ubuntu*

If you didn't get a Vista CD, the second Vista partition is likely your recovery partition. It should say 'Recovery' in Disk Management in Vista and should be fairly small (8-9GB?). (hd0,0) would be C: and (hd0,2) would be recovery partition.


----------



## wmorri (May 29, 2008)

*Re: can't boot ubuntu*

Hi,

Rome, when you look at this menu.lst file, do you see anything that is out of place. I am not seeing anything there. I am not too sure about the "savedefault", but other than that I don't see anything out of place. 

I know that he could remove:
title Other operating systems:
root

But that is only trivial.

A little help would be great.
Cheers!


----------



## Rome5 (Nov 25, 2008)

*Re: can't boot ubuntu*

'savedefault' would merely use the last booted kernel as the new default. So in 10 seconds if he didn't take action, grub would load whichever OS was loaded last. For that to work, though, 'default' would have to be set to 'saved' and not '0.' His current default is Ubuntu. Even if savedefault was being used, he would still get the grub screen and be given 10 seconds to take action.


*@ehababoud*:
If you would boot Ubuntu from a LiveCD and once it loads, open a terminal. You'll find a link to a terminal on your desktop. At the prompt, if you would type in the following:

```
# [color=red]sudo fdisk -l[/color]
[i]-l is a lowercase L[/i]
```
##NOTE: if you had an external hard drive connected when you installed Ubuntu; make sure it's hooked up again before running the 'fdisk -l' command.

The problem may be a grub issue which 'fdisk -l' will help in fixing. However; it may also be that Ubuntu isn't installed on your Vista drive. You should have four partitions ( 1 Vista, 2 Ubuntu, 1 Recovery). If that second Vista partition is a recovery partition, it should be the last partition on the drive which would mean you only have 3. (hd0,2) = 3rd partition on the first drive. Numbering starts at 0. 'fdisk -l' will also help determine where Ubuntu is installed.


----------



## ehababoud (Jun 17, 2006)

*Re: can't boot ubuntu*

hi sorry if there were any delays in me replying but i had no email notifications - all sorted now though..... before copying down what i typed down you're right there's a OS_TOOLS drive and another recovery drive which is approximately that size. i made two linux drives, one which is about 20Gb and the other is a swap drive. and i tried this a few times too before making the original post but nothing has changed and vista still loads. here is what was written:


```
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0a910a91

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       10842    87083608+   7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2           10843       13500    21350385    5  Extended
/dev/sda3           13501       14318     6561523+   7  HPFS/NTFS
/dev/sda4           14391       14476      683594    7  HPFS/NTFS
/dev/sda5           11070       13500    19527007+  83  Linux
/dev/sda6           10843       10963      971869+  82  Linux swap / Solaris

Partition table entries are not in disk order
```
thanks 

ehab


----------



## Bartender (Jun 10, 2005)

*Re: can't boot ubuntu*

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0a910a91

Device Boot Start End Blocks Id System
/dev/sda1 * 1 10842 87083608+ 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 10843 13500 21350385 5 Extended
/dev/sda3 13501 14318 6561523+ 7 HPFS/NTFS
/dev/sda4 14391 14476 683594 7 HPFS/NTFS
/dev/sda5 11070 13500 19527007+ 83 Linux
/dev/sda6 10843 10963 971869+ 82 Linux swap / Solaris

Can you boot from the Ubuntu LiveCD, let it start the desktop, plug in a thumbdrive, watch for it to come up on desktop. Then go into System>Admin>Gnome Partitioner. When the partition map is up, go to Applications>Accessories>Take Screenshot. Save the screenshot to the thumbdrive. Come back to the forum and post the screenie


----------



## ehababoud (Jun 17, 2006)

*Re: can't boot ubuntu*

here's the picture - didn't know how to add it straight into the forum part so i had to attach it.
thanks
ehab


----------



## Bartender (Jun 10, 2005)

*Re: can't boot ubuntu*

No, you did perfect.
I get lost trying to read those fdisk -l lists.
That's a pretty complex mess of partitions you've got there.

Have you burned recovery discs? If you haven't, you should. Then you could delete the "HP RECOVERY" partition. I believe HP recommends deleting it after making your discs because it's designed to become unusable afterwards.

I don't know what "OS TOOLS" is. Shouldn't be hard to figure out. Probably some sort of HP diagnostics or HP special features.

So you've got a primary Windows partition. That's sda1.
sda3 is a primary partition. If you make your recovery DVD's you could delete that partition.
sda4 is also a primary partition.
Ubuntu did what I'd expect it to - created an extended partition (sda2) with the logical Linux partitions (sda5 & sda6) inside.

There's absolutely no reason for all those unallocated's. You could dump them all and do something with the room.

Tell you what I'd do. This is just me. 
I'd make those recovery DVD's. Then I'd use GPartedLiveCD to wipe the extended partition (sda2). The only reason I'd do that is because the recovery discs might try to work around the extended partition. Then I'd boot into the DVD's and run them. Betcha you'll end up with just one Vista partition, or maybe one Vista partition and the OSTOOLS partition. 
Then I'd use the Vista partitioner to resize Vista, then install Ubuntu to the "largest freed space". I don't know why Ubuntu's not booting now, but I'm thinking that GRUB got mixed up with all the partitions and it'd work after you cleaned things up.


----------



## Rome5 (Nov 25, 2008)

*Re: can't boot ubuntu*

Hopefully this makes sense:

As bartender suggested, backup the recovery partition on discs. You can do using HP's recovery tool in Vista. You can then delete the recovery and os tools partition for more space. I wouldn't; however, use the recovery already. You'll wipe out any personal files/settings/programs you have on Vista and you'd do so just to get the system back to factory. By factory, I mean you'd end up with the Vista drive, the recovery partition, and the os tools partition. If Vista works; no reason to wipe it.

You can use your current Ubuntu install just fine or you may want to remove it and start from scratch. Starting from scratch would make it a little easier to configure you partition scheme a little better, but it's not a must. You do have lots of unallocated space; as bartender mentioned, and you could certainly use that for something.


## Boot problem ##
My guess was obviously off, but the concept is the same. When you install grub it writes to the mbr (supposed to) and then takes over booting. When you boot your pc with grub installed, you should see it and not just be taken directly into an OS. So grub either botched writing to the mbr or it wrote to the ebr instead (ebr is the boot record for an extended partition). The fix is fairly simple, but there are a few things to think about first.

If you plan on starting over with Ubuntu; there's no need to fix the mbr right now. If you plan on keeping the current Ubuntu install, but want to remove and create new partitions; your root partition may change addresses and if grub is setup beforehand, it will not longer work. Basically, if that happens, you'd have to go through the same steps below so you'd end up doing it twice. Just know that once the mbr is modified, you won't be able to boot into Vista without grub installed and working. If Ubuntu is removed or the root partition changes address; it will require a fix before it works again.



Boot Ubuntu using the liveCD and open a terminal. Once there, we want to get to grub's command-line (commands shown in red):

```
$ [color=red]grub --no-floppy[/color]
```
You'll notice the prompt changes to _grub>_ indicating we're using the CL. Now we need to set the root partition so grub knows where to look when it loads (sda5). We do that with:

```
grub> [color=red]root ([i]hd0,4[/i])[/color]
```
Now we need to actually write to the mbr so we point grub to the drive and it will find the mbr on it's own. _note: this can be modified to write to a specific partition as well, but that isn't needed here._

```
grub> [color=red]setup (hd0)[/color]
```
Now we've setup grub and all we need to do is exit and reboot:

```
grub> [color=red]quit[/color]
```


----------



## Bartender (Jun 10, 2005)

*Re: can't boot ubuntu*

Hi, Rome -
I sure wish all these manufacturers would get on the same page. When I ran the Acer recovery DVD's on my lappy, I went from 4 (!) primary partitions to just one Vista partition. I don't know how HP does it, but I'm assuming that HP's recovery discs do not leave you with a HDD that's identical to the as-purchased state. Maybe it does.

It's just so hard to say from a distance what the best option is for someone. I don't want to ruin their computer, or make the instructions more complex than necessary.


----------



## ehababoud (Jun 17, 2006)

*Re: can't boot ubuntu*

hello all, 
i just wanted to update you with whats going on. i done the recovery discs and found out what the "OS_TOOLS" drive is. it contains two folders and a file, one folder is called "boot" and the other is called "sources". the file is named HP WINRE. inside the boot folder there is a file called "boot.sdi" and inside the "sources" folder there is a file called "winre.wim" not sure what these all mean but seeing as it says boot i thought i'd tell you all before i continue with the rest of the instructions. do i still delete or could this be another reason for the instant vista boot?
thanks
ehab


----------



## ehababoud (Jun 17, 2006)

*Re: can't boot ubuntu*

hello again guys,

just thought that i'd tell you that i partitioned the discs as asked and i installed linux from scratch but nothing happens still.

about the terminal codes that i had to use, it didn't work. i said "grub --no-floppy" and that worked but i tried stuff after that and it just said that the disk does not exist. i tried restarting again and doing it again but still the same message. 

thanks again
ehab


----------



## wmorri (May 29, 2008)

*Re: can't boot ubuntu*

Hi,

Just let me catch up to what is going on now. You did a fresh install of Ubuntu. But know grub still isn't letting you access windows? I just want to make sure that we are all on the same page before I offer information that may not be what is needed.

Cheers!


----------



## Rome5 (Nov 25, 2008)

*Re: can't boot ubuntu*

The commands were meant for your previous install and partition layout. I noted that it wouldn't work if you changed things around as the root patition would be moved.


```
root (hd0,4)
```
The above command sets the 'root' partition for grub. By root, I mean, it tells grub on which drive and partition it will find the /boot directory. For a basic Ubuntu install, that partition is always whatever partition Ubuntu is installed on (not swap). For you, that _was_ (hd0,4). Now that you've removed partitions and reinstalled Ubuntu; that has to be changed before it will work.

Just to explain why it didn't work after you reinstalled.


----------



## ehababoud (Jun 17, 2006)

*Re: can't boot ubuntu*

hi all,
basically to answer bartender's question, that's exactly what has happened. Rome5: thanks for the info and that definitely seems to make sense to me, never the less i tried the commands before and after install and basically got the same results. i can present a new set of results for my partitions if you want, as i've tried to clean it up a little.

thanks again for your help, much appreciated.
ehab


----------



## Rome5 (Nov 25, 2008)

*Re: can't boot ubuntu*

If you would post the output of _fdisk -l_ again, I'm sure we can get it squared away.


----------



## ehababoud (Jun 17, 2006)

*Re: can't boot ubuntu*

hi sorry i should have thought of that before but its been so long since the last change i made, never the less here is what i found.


```
Disk /dev/sda: 120.0 GB, 120034123776 bytes
240 heads, 63 sectors/track, 15505 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x0a910a91

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       11519    87083608+   7  HPFS/NTFS
/dev/sda2           15290       15381      683594    7  HPFS/NTFS
```


----------



## ehababoud (Jun 17, 2006)

*Re: can't boot ubuntu*

sorry wrong one - my mistake [i'm very tired after exam revision]. here's the original one:


```
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0a910a91

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       10842    87083608+   7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2           14391       14476      683594    7  HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3           10843       12848    16113195    5  Extended
/dev/sda5           10843       12787    15623181   83  Linux
/dev/sda6           12788       12848      489951   82  Linux swap / Solaris

Partition table entries are not in disk order
```


----------



## Rome5 (Nov 25, 2008)

*Re: can't boot ubuntu*

@DeepSpin : You should create a new thread for your issue. You'd find responses come faster that way. 

Can you be more specific with the error message being given?
Would you also post the output of the following command (using a live CD):

```
[color=red]sudo fdisk -l[/color]  <--- -l is a lowercase L
```


----------

