Grub/Ubuntu

PostmanPot

Honorary Master
Joined
Jul 16, 2005
Messages
35,014
Reaction score
81
Location
Cape Town
Morning.

In the past when I've fiddled with Linux I've normally loaded Windoze and Linux both on the same HDD and dual-booted.

So I resized my older 80GB PATA (E:\) to 40/40GB. First partition is NTFS for game installs, and second is ext3 for Ubuntu which I formatted when installing. Installation went 100%. Btw, Windoze is installed on a 160GB SATA (C:\).

Now, I can't boot into Ubuntu from the 80GB PATA. It does not show up when selecting which device to boot from. I think I need to install Grub or something similar. So I tried this. I've tried a few Live CD/terminal methods like post #5 but haven't found any that work yet. I get error messages (can't remember exactly what). I'm not following #1 as I have already installed Ubuntu.

Can anyone help? Do I need to make a boot CD or something?

Also, what's the password for the Ubuntu Live CD su? :confused:

Thanks very much.
 
It's actually easier these days to do a full install of either Windows or Linux onto the machine, then run the other OS in a virtual machine.

Windows/Linux bootloaders have never played nicely with one another and I think most people have found it easier to go the virtual machine route.
 
Except that gaming inside a VM is not really an option.

Postman, which OS did you install first. I've never had a problem when windows has been installed first, then ubuntu (or whatever linux) installed second - ubuntu will pick up the Windows partition and add it to grub.

The other way around, I think, is a world of pain.
 
Except that gaming inside a VM is not really an option.

Postman, which OS did you install first. I've never had a problem when windows has been installed first, then ubuntu (or whatever linux) installed second - ubuntu will pick up the Windows partition and add it to grub.

The other way around, I think, is a world of pain.

Windoze first.

I just don't think Grub was installed... :(

Unless it's something else. When I resized the 80GB PATA in Windoze, the app did say something about "1024 cylinders" and that it wouldn't be bootable. I assume that would change once i've made a seperate ext3 partition with Linux. hope that's not the prob.

*edit*

This looks like a better method - brb fiddling.
 
Last edited:
Trying this guide, can't get further than "sudo mount -t ext3 /dev/sda6 /mnt/root". Gives me an error "special device /dev/sda6 does not exist". Is this because "sda6" was for his PC? Do I need to specify another device?

How do I find out the labels for my hard drives such as hd and sda etc.?

*edit*
df -h
*/edit*

Quote:
Mine was a slightly different story. I couldn't get grub to find the stage1 file or even recognize my drive. So I borrowed some knowledge I picked up while using Gentoo:

You have to mount your root partition using the livecd:
Code:

$
Code:

sudo mkdir /mnt/root

$
Code:

sudo mount -t ext3 /dev/sda6 /mnt/root

Then you have to mount the proc subsystem and udev inside /mnt/root also:
Code:

$
Code:

sudo mount -t proc none /mnt/root/proc

$
Code:

sudo mount -o bind /dev /mnt/root/dev

Doing this allows grub to discover your drives. Next you have to chroot:
Code:

$
Code:

sudo chroot /mnt/root /bin/bash

Now that you're chrooted into your drive as root everything should work.
Code:

#
Code:

sudo grub

I edited in the sudo, just to be safe. When I enter grub and not sudo grub, grub cannot find the file. I do not know if the chroot changes this because I did not try it that way. In the end I figured it was better to err on the side of caution. Tosk I hope you don't mind my editing of your reply.
grub>
Code:

find /boot/grub/stage1

It found mine on (hd0,5)
Code:

grub>
Code:

root (hd0,5)

It successfully scanned the partition and recognized the filesystem-type
Code:

grub>
Code:

setup (hd0)

That was it. It installed and on reboot I was thrown back into Ubuntu.

This might help some people who are having issues so I thought I would post it.

PLEASE NOTE: My Ubuntu was installed to /dev/sda6. This may not be the same for everyone. /dev/sdaX means it's SCSI/SATA/USB/FireWire drive. And it's partition 6 because I have a weird partitioning scheme in place.

--Tosk
 
Last edited:
You can find out the what hd's you have by runing:
df -h

from inside a liveCD.

I wrote quote a in depth "tutorial" on Grub on the Ubuntu forums for a friend, let me see if I can get it since I never use Ubuntu forums (Gentoo user here!)

BTW, to help you out a little:
/dev/sda1 = First SATA device (a), first partition (1)
/dev/sdb1 = Second SATA device (hence the b), first partition (1)

/dev/sda3 = First SATA device (a), third partition (3)
etc.
 
Last edited:
Thanks MyWorld.

I have made progress. But I still don't think it will work.

So I've come to this:

If someone wants GRUB on a partition, the 'setup (hd0)' step can be modified to 'setup (hdX,Y)'. Where X is the hard disk, and Y the partition using GRUB's nomenclature of starting from 0 (first partition=0, second=1,...).

But now df -h only shows labels as sda...

Need to find out the "hd" label for my Windows HDD (the one that is always found when booting up). That drive is labeled "sdb1". Linux partition is "sda2".

So I'd change the one command to "setup (hd*,0)" (since 0 is my root drive I'd imagine).

So how do I get the hd labels? :D
 
Last edited:
Boot into the live CD and issue the commands:
Code:
sudo su [PRESS ENTER]
mkdir /mnt/hdd [PRESS ENTER]
mount /dev/sda2 /mnt/hdd [PRESS ENTER]
cd /mnt/hdd [PRESS ENTER]
mount --bind /dev /mnt/hdd/dev
mount -t proc /proc /mnt/hdd/proc [PRESS ENTER]
chroot /mnt/hdd /bin/bash [PRESS ENTER]
If you have any errors here just give me a shout, you know where to reach me, post the error here and let met know...

Now to install the boot loader, GRUB:
Code:
grub [PRESS ENTER]
root (hd0,1)      [PRESS ENTER]     #This is the /dev/sda2 that has the Linux partition
setup (hd0) [PRESS ENTER]
quit [PRESS ENTER]

According to your fdisk output the above should work.

EDIT:
Did not see you posting the menu.lst file, so it should be fine.

That should do it, unless I made a typo....


Code:
shutdown -r now [PRESS ENTER]
This will reboot the machine and you will have the GRUB boot loader to choose you operating system with a 10 second delay according to your menu.lst file.

Shout if you're struggling.
There you have it.

/dev/sdax is the hd label, grub just uses a different numbering system than what you will be used to.

If there is need/want for this I'll post my complete grub tutorial that ranges from installation to creating your own grub bootsplash.

EDIT:
Sorry for the over simplification, the guy I tried to help out had never used Linux and did not even know when to [PRESS ENTER], so I had to do it like this...
 
Thanks for that, did something similar and all working. :D

Except for some reason I can't connect to the web. Something wrong with my network (Windoze reports it as "little or no connectivity") so I couldn't setup a connection with pppoeconf, which says it can't find a PPPOE access controller after scanning ethernet devices. Thankfully web connects in Windoze. I suspect it might be the network cable as another PC is connected fine to the router.

*edit*

There must be a way to connect in Ubuntu if I can connect in Windoze...
 
Last edited:
Thanks for that, did something similar and all working. :D

Except for some reason I can't connect to the web. Something wrong with my network (Windoze reports it as "little or no connectivity") so I couldn't setup a connection with pppoeconf, which says it can't find a PPPOE access controller after scanning ethernet devices. Thankfully web connects in Windoze. I suspect it might be the network cable as another PC is connected fine to the router.

*edit*

There must be a way to connect in Ubuntu if I can connect in Windoze...

What is your network setup and what is the current problem in linux?
 
What is your network setup and what is the current problem in linux?

The problem in Linux is when setting up a "dial-up" ADSL account in pppoeconf. Initially 2 ethernet devices are found, and after scanning, the problem is that pppoeconf cannot find any PPPOE access controllers.

Is there not some sort of way to set up the ADSL connection details in advance, like with Windoze's Create new connection?

ipconfig:

Windows IP Configuration

Host Name . . . . . . . . . . . . : xx
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek RTL8168/8111 PCI-E Gigabit E
thernet NIC
Physical Address. . . . . . . . . : 00-1D-7D-49-xx-xx
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Autoconfiguration IP Address. . . : 169.254.xxx.xxx
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . : 169.254.xxx.xxx

PPP adapter xx:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : WAN (PPP/SLIP) Interface
Physical Address. . . . . . . . . : 00-xx-xx-00-00-00
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 41.241.xx.xx
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 41.241.xx.xx
DNS Servers . . . . . . . . . . . : 196.43.xx.xx
196.43.xx.xx
NetBIOS over Tcpip. . . . . . . . : Disabled
 
Last edited:
Managed to get no connectivity light on router to disappear, so everything is fine on the router side.

I've set up my PC exactly the same as this PC which connects to the net fine with Ubuntu.

Still getting a "access concentrator" error when trying to set up pppoeconf. :(

Been searching www.ubuntuforums.org for quite some time.
 
Top
Sign up to the MyBroadband newsletter
X