[SOLVED] Moving /boot to separate partition and using 'grub' to boot
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
'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 04:18 PM.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.