LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 08-15-2007, 06:47 PM   #1
ankit4u1
Member
 
Registered: Apr 2006
Distribution: Red Hat, Fedora
Posts: 97

Rep: Reputation: 15
How to move boot partition to the front ?


Hi,

When I try to boot my HDD, it shows me an grub error 18. I googled and figured out that, this error is displayed when the disk is larger than than what BIOS can handle.

The solution to this is to either update the BIOS or move the boot partition to the front. I cannot update the BIOS because this is a proprietary BIOS. The best option for me is to move the boot partition to the front. But I am pretty new to linux in this matter. Can anyone please explain me from the scratch on how to do move the boot partition to the front?

I found this link useful:

http://www.linuxforums.org/forum/ins...rror-18-a.html

I am using RHEL 5 and the grub.conf has two kernels in it.

What does it mean by moving the boot partition to the front ?

I would appreciate your help. Thanks in advance.
 
Old 08-15-2007, 07:07 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,799

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
It ain't that easy - especially without any info. Post the output (say from a liveCD) from "/sbin/fdisk -l" (that's a lower case ell, as in list)
You might need to be root.

Last edited by syg00; 08-15-2007 at 07:45 PM. Reason: Typo in command
 
Old 08-15-2007, 07:08 PM   #3
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Back up the data and re-create the partition, so the partition that stores /boot is in the front or is created first. Then restore the data from the back ups. You could use gpartd, but it is not safe and not predictable. If you are using Windows, GRUB can be install in the root of C in its own directory of course.

Every motherboard uses proprietary BIOS unless the motherboard manufacture is part of OpenBIOS.
 
Old 08-15-2007, 07:21 PM   #4
ankit4u1
Member
 
Registered: Apr 2006
Distribution: Red Hat, Fedora
Posts: 97

Original Poster
Rep: Reputation: 15
Hey, thanks for the super fast replies...Actually, I don't have the disk with me. As soon as I get it, I'll post the output of disk -l and post it !!! But I have a query here...

The HDD boots perfectly on P4 and 915 motherboard. So, is it ok if i boot the HDD on that motherboard and then post the output of disk -l ?

Btw..I have not installed Windows on the disk. I only have RHEL 5 on my HDD.
 
Old 08-15-2007, 07:47 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,799

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
D'oh - command was wrong; amended above.
Get the list however you can - any machine is fine so long as we know which disk.

Is this LVM by any chance ???.
 
Old 08-15-2007, 08:01 PM   #6
ankit4u1
Member
 
Registered: Apr 2006
Distribution: Red Hat, Fedora
Posts: 97

Original Poster
Rep: Reputation: 15
yea, I was wondering, if it was disk or fdisk !!

Quote:
Is this LVM by any chance ???.
nopes, actually its manual partitioning..disk druid !

I think, in order to move boot to the front

1) I need to back up the HDD
2) Delete everything
3) Create partitions
4) Copy some files to the desired partition

If I am right, I would like to know which files and folders to copy and to which partition, after deleting all the partitions on that disk and creating the partitions again !!

Actually, one of the guys is already doing it here as he knows that !! But I want to do that myself.

I would like to try it on my notebook. I have windows XP on my notebook. I have installed VMWare on the machine. Now, I want to freshly install Linux OS on it and make sure that the boot partition is in the front !!

How do I do that ?
 
Old 08-17-2007, 05:38 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,799

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
What I do is create a primary partition for /boot first, after that its just a matter of taste.
Most (all ???) distros will build /boot properly if you mount it during install - if not, just copy the entire /boot over and update fstab to point to the new partition.
 
Old 08-22-2007, 12:44 PM   #8
ankit4u1
Member
 
Registered: Apr 2006
Distribution: Red Hat, Fedora
Posts: 97

Original Poster
Rep: Reputation: 15
Hey syg00, Thanks for the reply...

I actually did that but that also din't help me either..Initially, The disk I was using was 160 gigs. And I created two partitions: /boot and swap

I kept only 10 gigs for /boot and 1 gigs for swap. I kept rest of the space free....But I got the same error 18.

Then, I took an 80 gb disk and then installed RHEL 5 with two partitions: / and swap and it worked fine for me.

Now, in order to run one application and configure it, I needed to recompile the kernel. So, I recompiled the kernel an built it again (make modules, make bzImage, make modules_install and make install)

When I rebooted my computer and selected the newly built kernel, it said that the selected cylinder exceeds the maximum supported by BIOS(error 18)..This is again the same grub error I mentioned in my first post.

But if I boot the old kernel(default one, which comes with distro), then it boots fine....

What can I do to run the newly built kernel ? Do I need to delete some files ? I think the size seems to be a problem...I have few softwares and stuff in /home directory. Will it help if I delete these files so that the image of newly built kernel comes under the newly supported cylinders of BIOS ?

Please help..Thanks

Ankit
 
Old 08-22-2007, 04:27 PM   #9
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Creating a 10 GB partition for /boot is a waste. I create a /boot partition that is between 16 to 40 MB. Even with 16 MB, I could store several kernel and initrd files.

To minimize any problems, try to stay under 1024 cylinder mark for the partition that will store /boot. If you are going over, you may have to upgrade grub and/or include lba32 in /boot/grube/menu.lst file.

In the BIOS, it is best to set the hard drive geometry to LBA, but only set this when valuable data is not stored on the hard drive.
 
Old 08-22-2007, 05:52 PM   #10
ankit4u1
Member
 
Registered: Apr 2006
Distribution: Red Hat, Fedora
Posts: 97

Original Poster
Rep: Reputation: 15
Smile

Oh....I am a little bit new to this stuff....I am expecting a detail explanation...I hope you dont mind...So, here is what I understand from your reply:

There are two possibilities to bring the boot partition to the front
1) while installing the OS at the very beginning
2) After you have installed the OS without /boot partition

1) When installing the OS, make three partitions:
a) /boot (about 20 mbs)
b) / (about 10 gigs)
c) swap (around twice the RAM size..in my case 1 gigs as I have 512 RAM on my system)

If the above partitions are correct, then would the initrd, vmlinuz and grub files be put automatically to /boot partition or do I need to do that manually after OS is installed and ready ?

2)
Quote:
If you are going over, you may have to upgrade grub and/or include lba32 in /boot/grube/menu.lst file.

In the BIOS, it is best to set the hard drive geometry to LBA, but only set this when valuable data is not stored on the hard drive.
I need to do the above quoted steps, if I already have installed OS with only / and swap partitions(no /boot partition) ....is that right ? If it is, then I have few questions:

1) how do I include lba32 in menu.lst file ? Its the same as grub.conf file
2) How do I set the HDD geometry to LBA...

I don't have anything important on my HDD, but its a pain to reinstall the OS and recompile the kernel...takes so much time...anyways, I would do that if there is no way out...or whatever you think is the best solution...

Thanks..waiting for the reply..
 
Old 08-22-2007, 06:43 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,799

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
I think you should re-install. You really need that separate /boot partition, and you need to allocate it first to be sure.
The Fedora install will simply put everything it needs in /boot. Make sure you select the separate partition for the /boot mountpoint during the install, and everything will be fine. If you are going to use a partition that small for /boot, format it as ext2.

LBA is set in the BIOS, and may not help. If you are doing a full re-install, set it if it is an option in the BIOS. As for grub, the version that ships with RHEL5 should be fine - personally I'd leave it alone.
 
Old 08-23-2007, 12:45 AM   #12
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
To redo the partitions when Linux is already installed and setup properly.
1) Use another hard drive that is equal or larger than the present drive.
2) Use a LIVE Linux CD/DVD distribution such as Knoppix
3) In Knoppix go to run level 3 (skips GUI)
4) Mount each partition the same way the present installation does. Look in to /etc/fstab file for the present installation for hints, but not knppix's /etc/fstab file.
5) Mount the second hard drive. Of course the second hard drive have to be format to some filesystem like EXT3, JFS, or XFS.
6) Use the cp -a command to copy from the source to the destination.
7) After copying is done, use cfdisk to delete all partitions and create them.
8) Use hdparm -z to re-scan the partition table
9) Format each partition.
10) Mount the partitions and create the directories to represent the new setup.
11) Copy files from the second hard drive to the first hard drive.

There are a lot of steps, but it is good practice.


A re-installation of Linux can be done. In Redhat or other GUI installers, make sure you pick expert mode so you can create the desire partitions in the front, any size, and any filesystem. I recommend do not pick ReiserFS as the filesytem because it is not reliable and stable. XFS and JFS are better alternatives than EXT3, but should not be used when the computer has memory less than 512 MB.

Yes, /boot/grub/menu.lst is grub.conf. /boot/grub/grub.conf is just a symbolic link that points to menu.lst which is the correct file.


The journal for EXT2 does not take a lot of up space. I use EXT3 for 16 MB. I recommend stick with journal filesystems unless the mediums are removable. Journal filesystems saves a lot of grief when something goes wrong.

I suggest go to http://rute.2038bug.com/.
 
Old 08-23-2007, 01:37 AM   #13
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,799

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
Quote:
Originally Posted by Electro View Post
Journal filesystems saves a lot of grief when something goes wrong.
Generally I would agree, but not /boot.
How many files get updated on /boot that would benefit from a journal ???.
menu.lst ... maybe ... How often ???.

I've always preferred to have the space - I'm surprised by your comment about the 16 Meg partition.
Quick test on a 32 Meg partition showed about a Meg difference immediately after the formats (ext2/3).
Maybe you're right - not worth worrying about.

@ankit4u1 - use journalled filesystems everywhere (ext3 in this case).
 
Old 08-23-2007, 03:42 PM   #14
ankit4u1
Member
 
Registered: Apr 2006
Distribution: Red Hat, Fedora
Posts: 97

Original Poster
Rep: Reputation: 15
So, should I keep 16 or 32 Megs /boot partition ?

I actually changed the BIOS chip with the new version and it is booting the larger HDD(160 gb). I, then tried making three partitions:

1) /boot (I actually tried with 100 mb)
2) / (About 155 gigs)
3) swap (about 4.9 gigs, although I don't need that much)

But this gave me one error. It said that, not enough space in / partition...What does that mean? The root has 155 gigs.....I din't try out all the probabilities and combinations....like /boot = 16 megs /boot=32 megs...etc...I finally kept two partitions /root= 156 gigs and swap=4 gigs approx

I have another HDD, on which I need to install RHEL 5. After I get your reply, I would try the /boot partition.

Quote:
XFS and JFS are better alternatives than EXT3, but should not be used when the computer has memory less than 512 MB.
I have 256 MB on a new machine...So, which partition type should I use for /boot and / ? EXT3? I think, EXT3 works fine in all..am i right ?
 
Old 08-24-2007, 10:18 PM   #15
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
The maximum size per swap partition is around 2 GB. If you want 4 GB of swap, you have to make either four swap partitions that are 1 GB or two 2 GB swap partitions.

Be careful, / and /root may seem to the same to you but they are two different directories. The / is for all directories under it. For /root, it is for the user 'root' or the administrator account.

Creating a 155 GB partition for / that is formated as EXT3 will lose about 5% for root related services, so you will actually get 147 GB for yourself.

Again I use EXT3 for /boot. Then I use XFS for / and /home on systems with 512 MB of RAM or more. The speed advantage of XFS versus EXT3 is about five times. Though for a novice user, stick with EXT3 because it is very reliable and stable. If you see ReiserFS, avoid it like the plague.

Partition type for EXT3 is 0x83 or 83. This is for other Linux filesystems unless stated by the filesystem developer. Partition type 82 is for Linux swap partitions. In Disk Druid, the type of partition is already done behind the scenes, but it does ask you if want to create primary partition. Usually /boot partitions are primary.
 
  


Reply

Tags
boot, error, move, partition


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I add a Partition to the front of / partition? glennph93 Linux - General 4 04-08-2006 04:24 PM
Move boot partition/Backup hazmatt20 Linux - General 5 01-09-2006 02:16 AM
Front End to Partition Tools kornerr Linux - Newbie 3 12-27-2005 01:07 PM
resize or move /boot partition breenbaron Linux - General 3 04-07-2004 11:13 AM


All times are GMT -5. The time now is 10:57 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration