Ubuntu

Bleep

Diamond Member
Oct 9, 1999
3,972
0
0
I decided to try Ubuntu so I loaded it onto a extra hard drive I had, I jumpered the drive to be master and disconnedted the windows drive from the machine. Got the Ubuntu up and running, 2 days of installing a lot of programs and got it just how I wanted it.
I then changed the jumper to slave, reinstalled the origonal drive as master and booted into windows ok then. rebooted and hit f9 to change the boot drive the now slave drive (ubuntu) will not load citing a grub error 16, any way to fix this without a complete reinstall? I booted the machine with the live CD but there is no repair option, I am really disgusted with myself for such a foolish act.
Help me!
Steeler
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Stop messing with your drive settings. If you had just left everything alone in the first place (Windows always master, Linux always slave, never disconnecting anything, never fiddling with the BIOS), everything would have "just worked". Linux is much, much smarter than Windows in its boot configuration. 99% of the time, it will do the right thing without your intervention. 99% of the time, you will bork it by "hiding" drives in order to be "safe".

So now you've got a mess because GRUB's disk labelling doesn't match the BIOS. The following might work. Or it might hose everything, or burn down your house.

1) Make sure everything is attached, Windows=master, Linux=slave. Set to boot CD-ROM, then the Windows drive, then the Linux drive.
2) Boot to the LiveCD

Figure out which disks have which labels - this depends on your machine and how you partitioned it. Look in the output of dmesg for some hints. What you need to know is the label for the Windows disk (probably /dev/hda for PATA or /dev/sda for SATA). And you need to know the label for your Ubuntu root partition (probably /dev/hdb1 or /dev/sdb1, but hdb2 or sdb2). Write them down and continue.

3) Open a terminal and get a root shell - sudo su
4) Make a mount point for the Ubuntu root partition and mount it:
mkdir /ubroot
mount /dev/hdb1 /ubroot

(The LiveCD may have already done this for you - check the output of a plain mount and see if it's listed there and, if so, what the mount point is.)
5) Chroot there: chroot /ubroot
6) Install GRUB to the MBR (substitute the label for your Windows disk):
grub-install /dev/hda
7) Update GRUB: update-grub
8) Exit the chroot: exit
9) Reboot

That may still not work. It may also not give you an option to boot to Windows, though that would be easy to add later. It may leave you with an incorrect fstab that you still need to fix.

The better solution would be reinstall Linux and not to mess with your disks.
 

Bleep

Diamond Member
Oct 9, 1999
3,972
0
0
Cleverhandel:
Thanks for the reply, I will have to read this a few times to digest what I need to do.
("from my first post" I am really disgusted with myself for such a foolish act.)
I know what I did caused the problem and believe me I will not do it again.
Bleep
 

Bleep

Diamond Member
Oct 9, 1999
3,972
0
0
mkdir /ubroot
I get "no such file or directory"
I have absolutly no understanding as to how this works, if I look at the Ubuntu install using the live CD all I see is the temp files that are put on by the live cd.
I hate to have this happen because of a little thing I have been doing for several years and that is build computers and give them away to native american schools. I Used windows 98 on all of them because I could get it for nothing from MS but they quit doing it.
Most do not have internet but those that do have dial up. I figured I could do up a hard drive and then do a copy to another drive and just go up to the reservation and put in the new drives but I guess I will have to figure another way. I tried Debian but found it a little buggy.

Bleep
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: Bleep
mkdir /ubroot
I get "no such file or directory"
Then you're misspelling or misspacing or something. Try again.
I have absolutly no understanding as to how this works...
No, I wasn't trying to explain how or why it works, just giving you instructions. If you want understanding, go read up on boot loaders in general, and grub's disk labelling in particular.
if I look at the Ubuntu install using the live CD all I see is the temp files that are put on by the live cd.
That's why you're going to mount the Ubuntu partition - so you can access your original files.
 

Bleep

Diamond Member
Oct 9, 1999
3,972
0
0
quote:
Originally posted by: Bleep

quote:
mkdir /ubroot


I get "no such file or directory"


Then you're misspelling or misspacing or something. Try again.

quote:
I have absolutly no understanding as to how this works...


No, I wasn't trying to explain how or why it works, just giving you instructions. If you want understanding, go read up on boot loaders in general
I understand that, it was just a statement that I made as to my understanding of the OS or any part of it.
I did not know that Linux was so fragile that it could not survive a change like I made.
It appears that there is no way to clone a install from one drive to another without being stuck in the position where the cloning took place. If I clone from master to slave the new drive is then forever stuck in as a slave, not a good thing.
I am not going to read up on bootloaders, you see I am 72 years old and just trying to find a way to keep the machines that I have built somewhat up to date without spending money on windows.

Thank you for your advice
Bleep
 

coolVariable

Diamond Member
May 18, 2001
3,724
0
76
Originally posted by: cleverhandle
Stop messing with your drive settings. If you had just left everything alone in the first place (Windows always master, Linux always slave, never disconnecting anything, never fiddling with the BIOS), everything would have "just worked". Linux is much, much smarter than Windows in its boot configuration. 99% of the time, it will do the right thing without your intervention. 99% of the time, you will bork it by "hiding" drives in order to be "safe".

So now you've got a mess because GRUB's disk labelling doesn't match the BIOS. The following might work. Or it might hose everything, or burn down your house.

1) Make sure everything is attached, Windows=master, Linux=slave. Set to boot CD-ROM, then the Windows drive, then the Linux drive.
2) Boot to the LiveCD

Figure out which disks have which labels - this depends on your machine and how you partitioned it. Look in the output of dmesg for some hints. What you need to know is the label for the Windows disk (probably /dev/hda for PATA or /dev/sda for SATA). And you need to know the label for your Ubuntu root partition (probably /dev/hdb1 or /dev/sdb1, but hdb2 or sdb2). Write them down and continue.

3) Open a terminal and get a root shell - sudo su
4) Make a mount point for the Ubuntu root partition and mount it:
mkdir /ubroot
mount /dev/hdb1 /ubroot

(The LiveCD may have already done this for you - check the output of a plain mount and see if it's listed there and, if so, what the mount point is.)
5) Chroot there: chroot /ubroot
6) Install GRUB to the MBR (substitute the label for your Windows disk):
grub-install /dev/hda
7) Update GRUB: update-grub
8) Exit the chroot: exit
9) Reboot

That may still not work. It may also not give you an option to boot to Windows, though that would be easy to add later. It may leave you with an incorrect fstab that you still need to fix.

The better solution would be reinstall Linux and not to mess with your disks.



Sorry, but the linux boot settings (and the installation of such) svcks! If you ask me the OP did the right thing, trying to protect his WinXP installation.

You should also make him aware that your instructions (if I understand them correctly) will mess with the MBR of his WinXP drive!!!!
If he uses XP for work he might not be willing to run that risk (I am not).
 

drag

Elite Member
Jul 4, 2002
8,708
0
0


It's better then any other operating system out there. Ever try installing Windows on a spare partition with another non-windows operating system installed on the computer? Dual booting is garrenteed not to work 100% of the time. You have ot go in an manually muck around with the Windows bootloader and it's a PITA.

Linux's bootloader stuff may suck, but it's vastly better then any other operating system anywere.

I understand that, it was just a statement that I made as to my understanding of the OS or any part of it.
I did not know that Linux was so fragile that it could not survive a change like I made.
It appears that there is no way to clone a install from one drive to another without being stuck in the position where the cloning took place. If I clone from master to slave the new drive is then forever stuck in as a slave, not a good thing.
I am not going to read up on bootloaders, you see I am 72 years old and just trying to find a way to keep the machines that I have built somewhat up to date without spending money on windows.

It did survive.

How it works during bootup:
1. System is powered.

2. System POSTS

3. System's BIOS kicks in, does some hardware mucking around.

4. The BIOS reads the first 512k of the harddrive disk and executes it. (the MBR) Out of that the first half of that 512k or so is the actual boot loader. If your using Grub then that is the 'first stage' of the bootloader
.
5. The grub first stage is to go and read the 'second stage' of Grub from your /boot partition (or /boot directory on your root partition if root and boot are one and the same)

6. The second stage reads the menu.lst configuration file from your harddrive and then usually provides you a selection of boot options. It also provides a rudimentary shell so you can manually specify boot options in case the configuration file gets corrupted or has a bug with it.

(also there is a 1.5 stage for grub, that I am not sure about.)

7. Grub times out or you select a option it will then load the Linux kernel, then load the initrd file. The initrd file is a compressed ram-based file system that is stored in your /boot directory. The initrd is designed to make it so that it can do additional driver and disk configuration stuff. Anything that needs to be done before the kernel can start using the boot device or network share or whatever your booting up with.

This is done because you may want to setup LVM, EVMS, DMraid, and/or MD software raid and other special configurations for your root device. Also it allows distros to create generic kernels that run on the most amount of hardware possible. Initrd is generally generated at install time or when you update your kernel and will hold any drivers you need to setup your hardware for booting the system.

8. The kernel executes the init file or whatever is being used and the initrd is used to setup everything. After it's finished with it's scripts it'll mount your partition or whatnot and setup /dev directories, and mount any other virtual file systems you may need (sysfs, proc) and performs a 'pivot root' to switch to the harddrive.

9. The init program then begins to read the /etc/inittab file and begins executing scripts in the various runlevels. Thos scripts are designed it to finish setting up your hardware, start up any services you need, and sets up networking. And eventually it will provide you with a login prompt.

10. AFter it's finished running the init scripts then your system should be fully functional and you can log in and use it.

With your system grub stage 2 or 1.5 was successfully loaded, but the drive numbering changed or something like that.. which would cause error 16. Obviously you undid your change and got it working.


Usually you can fix something like this by booting up a live linux cdrom like Knoppix and manually using a chroot environment to reinstall the bootloader. Some distros (like Fedora) will provide a rescue cdrom to help you do that.

If you google around for it you can find examples on how to use knoppix (or other live cd) to reinstall a Linux bootloader from a chroot environment. However if your not comfortable with that and there is no real data you want to save on your system then a reinstall may be faster.


edit:

If a Linux install goes sour and your using XP or Win2k then you can usually use the Windows cdrom to access the 'recovery console' and perform the 'fixmbr' command from there.
http://www.microsoft.com/resources/docu...cs/en-us/bootcons_fixmbr.mspx?mfr=true
http://support.microsoft.com/kb/314058/

It's not a 100% given though and you need to make sure that you can get into recovery console beforehand. Not all OEM disks will support that sort of thing (or most won't. I don't know).
 

Bleep

Diamond Member
Oct 9, 1999
3,972
0
0
Thanks for all the advice guys I appriciate it very much.
I did not want to put any part of the linux bootloader on my primary drive.
Hoseing my install is not a chance I am willing to take.
I dug out a old machine and put in some more memory made a new install of Ubuntu and am now mucking around getting it where I want it. I wanted to use easy ubuntu but the server is down.
Thanks again
Bleep
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Peronsally I've always hated dual booting, especially for new users.

There is a lot of things that can go wrong and while the majority of the time it's possible to recover from them it just makes things difficult.
 
Dec 29, 2005
89
0
0
i usually use gentoo linux, but i wanted to try out ubuntu recently and here is what i did which is very similar to what i assume the OP wanted to do:

from my original setup, my windows disk was the primary/only drive

i disconnected the drive w/ windows and plugged in another drive, so it was the only drive

installed ubuntu on that drive

plugged both drives in with the ubuntu drive first/primary windows second/slave

then i just had to add a menu entry for the windows boot

bleep: i am not sure if this will work for you, but can you plug in only the drive with ubuntu and boot up using that? if so you can put your drives in the same configuration which i have mine and it will work (you only have to edit the /boot/grub/menu.lst file). if you cannot boot from that disk then it might be easiest to reinstall the exact same way i did (that way you don't have to fix the mbr of any disks).

i forget exactly what i had to add, but there is a post on ubuntuforms about it, just do a search for dual boot; it is something like this

title windows xp
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd0,1)
chainloader +1
boot

edit: forgot to add, if you are worried about data integrity on your windows drive, this does not affect the mbr of your windows drive. and it allows you to use the grub boot loader as opposed to the windows one (which pretty much sucks at dual boot).
oh, and if you do it this way you will manually have to mount your windows drive if you want to access any files there (there are instructions on how to do that at ubuntu forums too).
 

Bleep

Diamond Member
Oct 9, 1999
3,972
0
0
shader:
Thanks for the post. I still have the windows drive that I removed from the machine that I now have Ubuntu on I will plug it in as master on the second IDE port and see what happens.
This has been a refreshing series of posts for me because when I tried to use linux a few years ago and asked for advice all I got was RTFM, I have tried Red Hat, Mandrake + Mandrake 10, SUSE and Debian this is the first Linux distro that I have been really impressed with, I have not found any problems with getting anything to install or run.

Bleep
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |