Posts Tagged GRUB

Clean the boot partition of ubuntu OS

Every time you installed a new Linux kernel, it left a footprint in the grub_config, making the boot menu longer each time. Furthermore, it clogs the boot partition of the Ubuntu system. When the boot partition is full, you will get trouble to boot the machine properly. Does Ubuntu provide any easier way to clean them up or keep them from showing in the boot list?

The following information is from the internet and works for me perfectly.

Open terminal and check your current kernel:

uname -r 

DO NOT REMOVE THIS KERNEL!

Next, type the command below to view/list all installed kernels on your system.

dpkg --list | grep linux-image 

Find all the kernels that lower than your current kernel. When you know which kernel to remove, continue below to remove it. Run the commands below to remove the kernel you selected.

sudo apt-get purge linux-image-x.x.x.x-generic 

Finally, run the commands below to update grub2

sudo update-grub2 

Reboot your system.

Share

Tags: , , ,

How to modify the GRUB OS boot menu

After I installed Ubuntu 9.0.4 Desktop edition to my Windows machine, I have to manually select Windows system to boot into Windows. If I do not do that, the machine boots Ubuntu 9.0.4 in default. It bothers me a while because my young daughter (4 year old) will try to use the machine. However she does not know how to boot to Windows in which she can play online games and music.

After googling “GRUB Boot sequence” and I find some useful information at http://forums.techguy.org/unix-linux/157805-how-do-i-edit-bootloader.html. The thread is talking about dual booting RedHat and Windows XP. My situation is slightly different, it is dual booting Ubuntu 9.0.4 and Windows XP. At the beginning, I thought it should not matter too much because both RedHat and Ubuntu are linux system.

I checked my Windows partition and did not find anything useful. Then I boot to Ubuntu system and check /etc/grub/conf. I could not find anything like that. There is a directory called grub.d under etc. The directory does include a file called 20_memtest86+ which is a executable. I have to search other place to find the right that includes booting order information.

I browsed the boot directory. I found /boot/grub/menu.lst and opened it. It includes the booting information. It is the right file for my purpose. To edit it I have to have root power to modify the file. Use the following commands to get this done.

sudo nano /etc/grub/menu.lst
sudo grub-set-default 6

All I have to do is to change the “default 0” to “default 6” because in my system Windows XP is the 7th menu item. To be aware of that the number of menuitem starts at 0. That is why for the 7th item, we need use 6. You have to change the number based on your system.

Reference

Share

Tags: , , , , , , , ,

Hands-on Instruction for Installing Ubuntu Server Edition to EEE Box

Introduction

EEE Box (buy a new one with HDMI output only $219.99 at buy.com with this coupon) is a nice min desktop machine, quiet and fast enough for a home file and web server. Since there is a need to create a web server and mysql server, I bought a coupple of EEE Box recently. One has Windows XP as OS and the other with Linux as OS. I want to install Debian or Ubuntu Linux Server to the machines. First thing I did was to search how to install Ubuntu to the machines. After I read articles in several forums, I had rough idea how to do it. In one weekend, I started to follow information in one of the forum articles and ended up no success.

The first strange thing I found is the boot sequence of EEE box. I changed the sequence of bootable drives in “Boot Setup” -> “Boot Device Priority”. It did not have any effect when I rebooted the machine with a USB memory stick. Then I went back to the Boot Setup menu again. I saw there is one more choice – “Hard Disk Drivers”. In this menu, I could change the 1st drive to USB memory stick. Once the change was saved and the machine is rebooted, it actually used the USB memory stick to boot the machine. But there is no valid OS or boot information in the memory stick. I had to search internet again and to find more information to prepare USB memory stick. That ended up the following successful story, a hands-on step by step instruction to install Ubuntu Server Edition to EEE Box machines.

Prepare a USB memory stick

First things first, we need download UNetbootin. This is handy software working both in Windows and Linux envrionments. Here is its offical description: “UNetbootin you to create bootable Live USB drives for a variety of Linux distributions from Windows or Linux, without requiring you to burn a CD. You can either let it download one of the many distributions supported out-of-the-box for you, or supply your own Linux .iso file if you’ve already downloaded one or your preferred distribution isn’t on the list.” It can handle all kinds of Linux system, such as Ubuntu, Debian, Gento and so on. To visit the website to learn more about it.

Second, we need download Ubuntu Server Edition, the iso file for installation. Be sure to click the server edition icon in the page and download the right iso file. I personnally prefer to bring everything locally and mke sure the installation go flawlessly and smoothly.

Once you download both files to your computer, you can start UNetbootin program and select install from ISO file and choose your USB memory stick. Installing the system the memory stick is a piece of cake.

Handle BIOS setup

EEE Box boot setting is little bit different from other machines. Be sure to follow the instruction here to change the boot device priority correctly.

  1. Please insert the USB memory stick you prepared in the first step before you reboot your system
  2. Press [DEL] key after EEE Box splash screen, it brings you to BIOS setup program
  3. Use you cursor to navigate to “Boot” menu. “Boot Settings” is under this menu
  4. Select “Hard Disk Drivers” to progress to next screen, which lists all available “hard drivers” for selection
  5. Highlight “1st Drive” and change the selection to “USB:Kingston DataT” (in my situation, yours will be different)
  6. Press [Esc] key back to the parent menu and then press [F10] key to save the changes you just did and rebout the system

Install Ubuntu Server Edition to EEE BOX

After your system reboots from the USB memory stick, a menu will pop up. There are a number of choices available. Select “Install” in the startup menu to start install Ubuntu system to your hard drive. Here I will not expalin the detail installation. You should follow the screen prompts to choose appropriate options to install your server OS or refer to proper sections in Ubuntu website.

Install GRUB to hard drive

If your system had Windows XP running before you installed the Ubuntu system, you need complete the following stem, otherwise you will get error message during reboot. The stupid installation program did not know writing GRUB bootloader to the hard drive you were working with. In stead, it wrote GRUB to your USB memory stick and left your hard drive unbootable.

  1. Boot your system with the USB stick in one USB port
  2. Make your hard driver bootable by the following command# fdisk /dev/sda
    type “a” to change the first partition (1) to bootable
    type “w” to write change to hard drive
  3. Install GRUB to your hard drive# cd /usr/sbin/
    # ./grub-install /dev/sdc

“/dev/sdc” in the above command is your hard drive. You might need change it based on your machine. Once these steps are completed, you can reboot your computer without USB stick normally.

First reboot

If you did not choose installing GUI interface, you will see a lot of information in text mode, which tells you what devices are started correctly, what modules are started and so on. Shortly the log in prompt will show up. You can use the admin user and password you created during installation process to log in the brand new Ubuntu system. Congratulations!

Based on Ubuntu description, the root accout is disabled at default since the admin account has full power to work with the system. By any reason you want to enable root account, please following the simple step below to do it.

# sudo passwd root

Enter your admin user password
Enter new root password
Reenter new root password

Once you finish the above command successfully, your root account is enabled. To log in root account you can use the su command.

# su
Entry root password

Sweet. We are in root account. Remember that you have unlimited power to change anything in the system. So be careful when you do anything for the system. From now on, you can enjoy the robust Linux server serving for you quietly and efficiently. The can run months without any maintenance.

This page you are reading is served by the lovely machine with Ubuntu Server Edition OS.

Share

Tags: , , , , , , ,