LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-23-2013, 12:40 PM   #1
meridius10
Member
 
Registered: Jul 2010
Distribution: Ubuntu 9.10
Posts: 52

Rep: Reputation: 1
Xubuntu 8.04 - edit grub


I have an old version of Xubuntu on an old laptop with an old version of grub without an internet connection.

Now I would like to edit grub. So I tried:

Code:
sudo su
Code:
gedit /boot/grub/menu.lst
then
Code:
apt-get install gedit
When I try to do this it doesn't work, maybe as I have no internet connection.

I guess the final bit of terminal command is to:
Code:
update-grub
I have completely forgotten how to do this!

Nevertheless it takes me back to the good old days of 2008 when I first found Linux, then wanting to completely make a break from the Microsoft empire. Sadly I am still in prison, but hopefully in the not too distant future we will all be able to free ourselves from Darth Vader and his evil empire.
 
Old 04-23-2013, 12:52 PM   #2
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,387

Rep: Reputation: 173Reputation: 173
you need to check what kind of editor you have on old xubuntu, you surely can't install one without internet connection!
 
1 members found this post helpful.
Old 04-23-2013, 01:37 PM   #3
meridius10
Member
 
Registered: Jul 2010
Distribution: Ubuntu 9.10
Posts: 52

Original Poster
Rep: Reputation: 1
I am not sure what the editor is in 8.04; mousepad?!

Is there any way that I can download the right file or application from another computer to a usb and install it that way to get gedit or anything else that might work?
 
Old 04-23-2013, 01:43 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,144
Blog Entries: 2

Rep: Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846
On Xubuntu you should have Mousepad and Nano installed, possibly also Vi or Vim. Any of these should be sufficient to edit the menu.lst file.
Xubuntu 8.04 used Grub 0.97, so the update-grub command is not needed.
 
1 members found this post helpful.
Old 04-23-2013, 04:16 PM   #5
meridius10
Member
 
Registered: Jul 2010
Distribution: Ubuntu 9.10
Posts: 52

Original Poster
Rep: Reputation: 1
OK, so do you know what I should type into the terminal in terms of commands to edit grub?

N.B. I don't have an internet connection with this particular laptop.
 
Old 04-23-2013, 04:35 PM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,144
Blog Entries: 2

Rep: Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846Reputation: 4846
Sorry, I was mistaken, the default editor for Xubuntu is Leafpad, not Mousepad.
Try it with
Code:
sudo nano /boot/grub/menu.lst
or
Code:
sudo leafpad /boot/grub/menu.lst
The changes in the configuration are immediately active, you don't need to run other commands.

Last edited by TobiSGD; 04-23-2013 at 04:40 PM.
 
1 members found this post helpful.
Old 04-23-2013, 05:08 PM   #7
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
If you're able to boot your computer and use an editor, then I'm not sure why you want to edit the menu.lst

Debian-based distros have complicated menu.lst files so they can be automatically updated when you update the system and a new kernel is installed.
If you have no internet you can't update, so all the stuff at the beginning is of no use to you.
I suggest saving the old menu.lst for reference
Code:
cd /boot/grub
mv menu.lst old_menu.lst
and writing with mousepad or leafpad if it's indeed leafpad (disregard any error messages) or nano
Code:
sudo mousepad /boot/grub/menu.lst
a minimal one such as:

Code:
# menu.lst
default         0
timeout		5

color cyan/blue white/blue

title		Xubuntu 8.04, kernel 2.6.38-15-generic
kernel		/boot/vmlinuz-2.6.38-15-generic root=/dev/sda1 ro   
initrd		/boot/initrd.img-2.6.38-15-generic
NOTE:
1 I have assumed that Xubuntu is on partition sda1. If not, change accordingly.
2 Your kernel version will not be as above, and you will have to get the correct version from the /boot directory.
3 The initrd.img version must match the kernel version
4 If you have another distribution in sda2, you can add:

Code:
title		Ubuntu maverick or whatever kernel 2.6.35-22-generic
root		(hd0,1)
kernel		/boot/vmlinuz-2.6.35-22-generic root=/dev/sda2 ro
initrd		/boot/initrd.img-2.6.35-22-generic
Again change the version to suit.
Hope you'll be able to get a newer OS on a newer computer soon.

Last edited by impert; 04-23-2013 at 05:11 PM. Reason: leafpad
 
1 members found this post helpful.
Old 04-24-2013, 02:59 AM   #8
meridius10
Member
 
Registered: Jul 2010
Distribution: Ubuntu 9.10
Posts: 52

Original Poster
Rep: Reputation: 1
Many thanks for your advice. It was just a question of changing the text editor from gedit to mousepad:

Code:
sudo mousepad /boot/grub/menu.lst
I remember doing this in the past (2010) but didn't have any notes on it.

All I wanted to do is change the boot order so that XP comes up first on menu.lst followed by all the Xubuntu entries which I changed to place under 'Other Operating Systems' (normally for Windows XP). I don't know if this is the technically correct way to do it because of subsequent entries by grub itself, but my task has been completed.

This is only a spare laptop and will not contain any important information. I just want to go through an Ubuntu book and practice on the Xubuntu partition.

At the same time if I remember correctly grub is easier to amend contrasted with grub2.
 
Old 04-25-2013, 05:58 AM   #9
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
Quote:
All I wanted to do is change the boot order so that XP comes up first on menu.lst followed by all the Xubuntu entries which I changed to place under 'Other Operating Systems' (normally for Windows XP)
In that case all you have to do is to change the line:
Code:
default   0
(which makes the first listed distro boot as default), to read whatever number XP is, counting from zero; ie if it's the second entry, put default 1, if it's the third, default 2.
Or you can cut and paste the entries to get them in the order you want.
 
Old 04-25-2013, 06:22 AM   #10
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
Quote:
I changed to place under 'Other Operating Systems' (normally for Windows XP). I don't know if this is the technically correct way to do it
Well, no, it's not. I forgot to mention that everything between
Code:
## ## End Default Options ##
and
Code:
### END DEBIAN AUTOMAGIC KERNELS LIST
is updated by the Debian package installer when there is a new kernel. If you get onto the internet for an update and it installs a new kernel it may not react well when it finds your XP there. You'll still be able to edit it by hand.
 
Old 04-25-2013, 06:29 AM   #11
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 4,210

Rep: Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187
You are correct but:

Quote:
Originally Posted by impert View Post
is updated by the Debian package installer when there is a new kernel. If you get onto the internet for an update and it installs a new kernel it may not react well when it finds your XP there.
There is zero risk of this since 8.04 is unsupported for over a year and will never ever receive any future kernel updates.
 
Old 04-25-2013, 07:33 AM   #12
meridius10
Member
 
Registered: Jul 2010
Distribution: Ubuntu 9.10
Posts: 52

Original Poster
Rep: Reputation: 1
I don't think this partition will ever make it on to the internet. It is on a laptop that can take max. 160MB RAM! I don't understand the default as 0? Is XP now 0?

This is my current setup (I just copied and pasted grub onto a usb...):
Code:
# 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		30

## 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=2dc0e4c9-0c61-432c-a71b-fe0a23a128b1 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,4)

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

# 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		Microsoft Windows XP Professional
root		(hd0,0)
savedefault
makeactive
chainloader	+1

title		Other operating systems:
root

title		Ubuntu 8.04.1, kernel 2.6.24-19-generic
root		(hd0,4)
kernel		/boot/vmlinuz-2.6.24-19-generic root=UUID=2dc0e4c9-0c61-432c-a71b-fe0a23a128b1 ro quiet splash
initrd		/boot/initrd.img-2.6.24-19-generic
quiet

title		Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root		(hd0,4)
kernel		/boot/vmlinuz-2.6.24-19-generic root=UUID=2dc0e4c9-0c61-432c-a71b-fe0a23a128b1 ro single
initrd		/boot/initrd.img-2.6.24-19-generic

title		Ubuntu 8.04.1, memtest86+
root		(hd0,4)
kernel		/boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST
 
Old 04-26-2013, 04:26 AM   #13
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
Yes, that should work. Give it a try.

I'd get rid of the uncommented (no #) lines:
Code:
title		Other operating systems:
root
between the Windows entry and the Ubuntu entry. Something odd might happen if you click on that entry inadvertently.
 
Old 04-26-2013, 05:29 AM   #14
meridius10
Member
 
Registered: Jul 2010
Distribution: Ubuntu 9.10
Posts: 52

Original Poster
Rep: Reputation: 1
OK. Many thanks for all your help.

It's all working fine now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to edit the grub grub config file on Fedora 17? Not_Dead Linux - Software 1 08-30-2012 04:38 PM
[SOLVED] How come I can't edit /boot/grub/grub.conf or /boot/grub/menu.lst in Fedora 14? trien27 Fedora 4 01-22-2011 04:02 PM
[SOLVED] no grub/defaults/grub to edit on triole-boot system EDDY1 Linux - Software 21 10-31-2010 03:10 PM
edit right-click menu in xubuntu alphaniner Ubuntu 0 01-13-2009 07:38 PM
how to edit grub.conf from grub shell during booting pashaikh Linux - Security 1 06-27-2006 05:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:23 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration