LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 11-28-2006, 12:25 PM   #1
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 56

Rep: Reputation: 16
Moving /boot to separate partition and using 'grub' to boot


On a Linux OS ( Mepis 6.0 ) my /boot is not on a separate partition from the / partition. I have formatted a separate partition for it. I want to setup 'grub' ( I am knowledgable of how 'grub' refers to hard disk partitions' ) to boot directly into the new partition, not the MBR. What is the sequence of moving it to a separate partition ?

My understanding of the sequence is:

a) mount the separate partition
b) copy all the files and directories under the current /boot to the separate partition
c) run grub shell
1) specify correct 'root' command ( is this supposed to be the current /boot partition or the new /boot partition ? )
2) specify correct 'setup' command
3) exit grub shell
d) edit /etc/fstab and add an entry for /boot
e) edit the new /boot/grub/menu.lst and change the root command to point to the new partition.

Any help getting this sequence exactly right would be appreciated.
 
Old 11-28-2006, 03:28 PM   #2
psisquare
Member
 
Registered: Sep 2004
Location: Germany
Distribution: Gentoo
Posts: 164

Rep: Reputation: 31
Let me see.. I'm not exactly an expert on this, but using "info grub", I guess that

between b) and c) you have to "ln -s . /mountpoint/of/new/partition" (so that the new partition contains the file /boot/grub/stage1) and

in c.1) you have to specify the new /boot partition and

in e) you should leave root pointing to your / partition (not 100% sure of that, but you should double-check)

Also, stupid as that may sound, if you edit menu.lst in e), don't forget to mount /boot before. It' just one of those things one easily forgets.
 
Old 11-28-2006, 04:51 PM   #3
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 56

Original Poster
Rep: Reputation: 16
Corrected sequence

Quote:
Originally Posted by psisquare
Let me see.. I'm not exactly an expert on this, but using "info grub", I guess that

between b) and c) you have to "ln -s . /mountpoint/of/new/partition" (so that the new partition contains the file /boot/grub/stage1) and
I do not understand what that link command is supposed to do. You are telling me to create a symbolic link from the new partition mount to the current directory. How does this make the new partition contain '/boot/grub/stage1' ? Are you assuming that the current directory is the old /boot directory ?

Quote:
Originally Posted by psisquare
in c.1) you have to specify the new /boot partition and

in e) you should leave root pointing to your / partition (not 100% sure of that, but you should double-check)
I have never been able to determine exactly what 'root' in grub actually means, but I believe it means the partition in which grub is installed. Perhaps someone else knows for sure.

Quote:
Originally Posted by psisquare
Also, stupid as that may sound, if you edit menu.lst in e), don't forget to mount /boot before. It' just one of those things one easily forgets.
I think you mean that my new partition must be mounted and that I must modify the menu.lst in the new partition and not in the old /boot area. I think it is irrelevant whether or not the new partition is mounted as /boot or something else as long as I am changing the correct menu.lst.
 
Old 11-28-2006, 05:16 PM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
'root' will not change, only the location of the boot image and initrd will change (the new /boot partition).

Here is an example for /boot/grub/menu.lst:

title Linux
kernel (hd0,6)/vmlinuz root=/dev/hda4 vga=0x31a selinux=0 splash=verbose
initrd (hd0,6)/initrd

Notice that kernel and initrd are directed to one partition (new /boot in this example), and root=/dev/hda4 is the location (partition) of the root of the filesystem. Be careful to get the names correct for vmlinuz and initrd.

Edit /boot/grub/menu.lst to show the new location for /boot, then edit fstab to show the new partition.

Last edited by bigrigdriver; 11-28-2006 at 05:18 PM.
 
Old 11-28-2006, 09:01 PM   #5
psisquare
Member
 
Registered: Sep 2004
Location: Germany
Distribution: Gentoo
Posts: 164

Rep: Reputation: 31
Quote:
Originally Posted by eldiener
You are telling me to create a symbolic link from the new partition mount to the current directory.
Sorry, the correct command should be "ln -s . /mountpoint/of/new/partition/boot" (forgot the last /boot).

In either case, you are not creating a link to the current working directory, because soft links are always taken relative to their parent directory (here: /mountpoint/of/new/partition). The effect will be that your new partition contains the link "boot" pointing to the root directory of that same partition.
Because grub accesses the partition directly (instead of via Linux's virtual file system), this link will make sure it sees the "/boot/grub/*" files (imagine the new boot partition to be mounted as / if that helps you). Without the link, grub would only see "/grub/*", because it doesn't know that the partition will be mounted to /boot.

Quote:
Originally Posted by eldiener
I think it is irrelevant whether or not the new partition is mounted as /boot or something else as long as I am changing the correct menu.lst.
Yes, of course you are right.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Creating and booting from a separate /boot partition eldiener Linux - General 5 11-12-2006 07:13 PM
GRUB: How to boot WinXP (NTLDR, NTDETECT.COM & BOOT.INI) from boot partition (EXT2) ? Rayen16 Linux - Software 1 05-25-2006 01:09 PM
Grub/Dual boot - Windows partition restored via dd won't boot pazzport Ubuntu 1 01-06-2006 02:29 PM
Dual boot grub Mandriva WinXP separate drives McNider Linux - General 2 06-17-2005 05:49 AM
Moving contents of /var to separate partition TexasDex Linux - Software 2 03-01-2004 09:30 PM


All times are GMT -5. The time now is 07:22 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration