ComSoc Community
Welcome, Guest. Please login or register.
October 23, 2014, 05:54:57 PM

Login with username, password and session length
Pages: [1]   Go Down
Print
Author Topic: Linux boot loader  (Read 4531 times)
Relic
Trustee
Newbie
*****

Karma: +2/-0
Offline Offline

Posts: 42


ComSoc is Great!


« on: March 13, 2008, 09:50:49 PM »

I need to change my kubuntu boot loader so windows will be default. What was that terminal command for editing the boot loader Huh??
Logged

Relic (aka Mike Burton)
edreese911
Guest
« Reply #1 on: March 14, 2008, 06:28:11 PM »

Hi Relic, First I would make a backup copy of the grub bootloader file so if it gets messed up you can just replace it.

I did a search for what you were looking for and found this link:

http://www.fedoraforum.org/forum/showthread.php?s=&threadid=996

It is for using Fedora but I think you should be able to fiddle with it enough to get to the point.
Logged
CrazyC
Website Administrator
Administrator
Jr. Poster
*****

Karma: +2/-1
Offline Offline

Posts: 93


I might be crazy, but I still have my sanity!


WWW
« Reply #2 on: March 15, 2008, 03:00:29 PM »

I guess I need to be reading this message board more often..  Roll Eyes

Anyway...  here's how to do it:

1.  From the desktop - press [Alt]-F2

2. When the run command dialog pops up... enter:  kdesu kate /boot/grub/menu.lst
then  press [enter] or click the run button
you will be asked for your password because the "kdesu" command is telling the system to run kate as the root user.

3.  As soon as kate opens, go to the "File" menu option and select "Save As"
in the Save File window, enter a filename like:  menu.lst.bu   or   menu.lst.copy
this will make a backup so you can restore your boot menu if you mess something up.

4.  Now to edit the menu so that Windows is the first item in the list..
Scroll all the way down to the bottom of the file.  Your Windows install should be the last entry and will look SIMILAR to this:
Code:
# 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
makeactive
chainloader +1

5.  You want to cut and paste the Windows boot entry so that it is the first item on the boot menu.
Move the Windows entry just above the entry that looks like this:
Code:
title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,1)
kernel /vmlinuz-2.6.22-14-generic root=/dev/sda2 ro splash
initrd /initrd.img-2.6.22-14-generic
quiet

6.  Once you've moved the Windows entry, use the "Save As" option again and save the file as menu.lst.  It will tell you that the file exists and ask if you want to overwrite it.  Provided you made the backup file previously, just answer yes to replace the file.

7.  Now that you have made the changes and saved the file, close Kate and reboot your system.  If you did everything correctly, Windows should now be the first entry in your boot menu and will boot automatically if you don't press any keys on the keyboard.


Refer to the example boot menu file below to see what the entries look like before and after editting.

Example... my boot menu looks like this:
Code:
title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,1)
kernel /vmlinuz-2.6.22-14-generic root=/dev/sda2 ro splash
initrd /initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,1)
kernel /vmlinuz-2.6.22-14-generic root=/dev/sda2 ro single
initrd /initrd.img-2.6.22-14-generic

title Ubuntu 7.10, memtest86+
root (hd0,1)
kernel /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
makeactive
chainloader +1


After making the changes listed above, it would look like this:
Code:
# 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
makeactive
chainloader +1

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,1)
kernel /vmlinuz-2.6.22-14-generic root=/dev/sda2 ro splash
initrd /initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,1)
kernel /vmlinuz-2.6.22-14-generic root=/dev/sda2 ro single
initrd /initrd.img-2.6.22-14-generic

title Ubuntu 7.10, memtest86+
root (hd0,1)
kernel /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



Logged

CrazyC!    (aka Chris Koepf)
edreese911
Guest
« Reply #3 on: March 15, 2008, 03:38:10 PM »

Hey thanks CrazyC, this looks a lot better than what I found and more accurate also.

At the Linux SIG last Tuesday we got Kubuntu installed on the laptop but no can get on the wireless connection boy do we need you there. We had fun doing it but it is more fun learning how to do it right.

cya l8r

oz,
Logged
Relic
Trustee
Newbie
*****

Karma: +2/-0
Offline Offline

Posts: 42


ComSoc is Great!


« Reply #4 on: March 15, 2008, 04:29:26 PM »

I already got to edit the file; found it thru the desktop. I did move the windows up the list but changed my mind and just changed the hd0,0 and hd0.1 (a mistake).  I copied the original file to the desktop. Can't load anything now; I can't get into the hd to swap the file. If it were windows no problem but linux I can't seem to find away in. I tried gparted and kubuntu livecd; I have no floppy drive and no way to read the laptop hd as a second drive in any other computer. It seems like I should just be able to boot up linux and read the drive Huh??
Logged

Relic (aka Mike Burton)
CrazyC
Website Administrator
Administrator
Jr. Poster
*****

Karma: +2/-1
Offline Offline

Posts: 93


I might be crazy, but I still have my sanity!


WWW
« Reply #5 on: March 16, 2008, 03:45:18 PM »

Ok, what you want to do is use the Kubuntu live cd to fix this problem.

First, boot up into the live desktop.

I don't know how you partitioned your drive, but I'm assuming you following my suggestion of creating 3 partitions for root, home and swap.
We can walk through this and if you don't know which partition is root, we'll have to go back and forth a little bit to figure it out.

Open a terminal window from the live desktop.

type:  cd /mnt
this will put you in the mnt directory.

now you need to create a directory to mount the root partition of your hard drive on.

type:  sudo mkdir root

then type:  ls
and make sure you can see the new directory called root.

I'm going to assume that the root partition of your hard drive is the FIRST partition created.  If it isn't, this is where we'll have to make some adjustments.

Now to mount your root partition (if it's the first one), type:  sudo mount /dev/hda1 /mnt/root

The above line makes a few assumptions.... one, that the hard drive you have problems with is the first hard drive in your system and that it is an ide hard drive.  Based on comments you've made in the past, the ide part is probably right, but if it's not your first hard drive, you may need to use hdb instead of hda.
The '1' part is the partition number.  If the root partition is the first partition of hard drive a, then the device is /dev/hda1 like we used above.  If the root partition is second, then it would be /dev/hda2 and so on.
You can use the Partiition editor to determine which partition your root partition is, if you don't already know.

Ok... now provided everything up until this point worked, you should be able to type:  cd /mnt/root
then:  ls
and you should see a directory similare to this:
Quote
bin   cdrom  etc   initrd      lib    lib64       media  opt   root  srv  tmp  var
boot  dev    home  initrd.img  lib32  lost+found  mnt    proc  sbin  sys  usr  vmlinuz

If you do, great!  Let's keep going to get this thing fixed.  If you don't, let me know and we'll figure it out.

Ok, so you have your root partition mounted and NOW we can edit the messed up boot menu.
Close the terminal window.

Press [Alt]-F2
then type:  kdesu kate /mnt/root/boot/grub/menu.lst

This will open kate with the CURRENT boot menu list, which is the one you said you made a mistake in.  If you know which line you changed from hd0,0 to hd0,1 then you can just fix it and save the file again.  If not, you could open your backup file, edit it according to my original directions and then resave it as menu.lst again.  Just be sure not to overwrite the menu.lst.bu file you made.

Hopefully this will help you out.  If you have any problems, let me know and we'll see what we can do to get it fixed.  Remember... you don't have to reinstall just because you have a problem booting.  You can ALMOST always fix it one way or another.  The hard part is just knowing where to look and the steps to fix things are a tad bit different than they are in Windows.   Wink
Logged

CrazyC!    (aka Chris Koepf)
Relic
Trustee
Newbie
*****

Karma: +2/-0
Offline Offline

Posts: 42


ComSoc is Great!


« Reply #6 on: March 16, 2008, 10:29:00 PM »

I ran gparted to find the boot partition I needed. I then found a linux distribution called slax and burned a cd. From slax I was able to find the partition I needed and edited the menu.lst file as from your previous email. But was unable to get it to work and couldn't find the backup file that I had saved to the desktop.  I gave up and reinstalled xp and will reinstall kubuntu and try again. It was worth it, I learned to work with gparted, kate, kwrite, and the terminal mode. The slax distribution is a live cd and seems to bootup fast and is easy to work with; size is 197 MB.

Added by ozrom1e = the link to slax

http://www.slax.org/
« Last Edit: March 25, 2008, 12:59:41 PM by ozrom1e » Logged

Relic (aka Mike Burton)
CrazyC
Website Administrator
Administrator
Jr. Poster
*****

Karma: +2/-1
Offline Offline

Posts: 93


I might be crazy, but I still have my sanity!


WWW
« Reply #7 on: March 17, 2008, 01:12:38 PM »

Ok, so it wasn't a total loss...   Roll Eyes    At least you're learning from all this.
Logged

CrazyC!    (aka Chris Koepf)
Pages: [1]   Go Up
Print
ComSoc Community  |  SIG Boards  |  Linux SIG  |  Topic: Linux boot loader
Jump to:  


Navigation
» News » Meeting Location » Links » FAQs

» Search Forums » Forum Help

Become a member of ComSoc today! Use our Online Membership Application.

Recent Topics

Users Online
7 Guests, 0 Users


[Site Statistics]

The WNY Computer Society
is a proud member of
apcug logo


O'Reilly Logo

Informit



Adobe Reader Get Firefox Get Thunderbird Get AVG Ubuntu Kubuntu


   

Registration Agreement

© 1998-2014, WNY Computer Society, All Rights Reserved
Site hosted, designed & custom programmed by CKN Energy Services Inc..
Email Spam Filtration by MX Guarddog.
Powered by Sphinx | Sphinx © 2005-2014, DynSCS
Forums: Powered by SMF 1.1.19 | SMF © 2006-20011, Simple Machines