Grub need to install to root partition, NOT MBR only

Please reproduce your error on a second machine before posting, and check the error by running without saved changes or extra modules (See FAQ No. 13, "How to report a bug"). For unstable Porteus versions (alpha, beta, rc) please use the relevant thread in our "Development" section.
Post Reply
Lonely
White ninja
White ninja
Posts: 4
Joined: 11 May 2012, 20:14
Location: United States

Grub need to install to root partition, NOT MBR only

Post#1 by Lonely » 11 May 2012, 20:45

When using a boot manager for booting several Linux OS's, must have grub installed in root partition instead of MBR. I use BootitNG for managing my partitions, backup copying, and having more than 4 primary partitions and so Porteus needs the option of grub or lilo install to root partition / instead of MBR for supporting multi OS booting and in a manner to not re-write MBR (not like LinuxMint does). Competitors like PClinux, WattOS, Vector are compatible with boot managers.

User avatar
brokenman
Site Admin
Site Admin
Posts: 5542
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Grub need to install to root partition, NOT MBR only

Post#2 by brokenman » 12 May 2012, 00:20

Welcome to Porteus and thanks for your post.

The porteus installer offers the option of NOT writing to the MBR. This allows users to transfer the files to their target device and alter the grub menu.lst manually. This is the method i use to boot multiple Os's.

One would assume that if you have a linux multiboot system that you are familiar with how to edit the menu.lst. Can you give me an example of an installer that offers the option to install a bootloader to the root partition ... i'd like to check out the method and see if i can accommodate your request.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
pumbaa2
White ninja
White ninja
Posts: 29
Joined: 08 May 2012, 10:39
Distribution: Slackware 13.37
Location: Melbourne, FL
Contact:

Re: Grub need to install to root partition, NOT MBR only

Post#3 by pumbaa2 » 13 May 2012, 19:05

I know in LILO you can point boot to say /dev/sda1 instead of /dev/sda to boot from the "superblock" of that partition. Keep in mind that this is NOT recommended on XFS filesystems as XFS uses the superblock and may corrupt your filesystem. The "Slackware Installer" also presents the option during setup (if my memory services me correctly) and you may be able to pull the needed information out of their installer script. I also dug up a small article about it...

http://linuxdevcenter.com/pub/a/linux/2 ... imple.html

Anyhow, I hope this helps...

beny
Full of knowledge
Full of knowledge
Posts: 730
Joined: 02 Jan 2011, 11:33
Location: italy

Re: Grub need to install to root partition, NOT MBR only

Post#4 by beny » 13 May 2012, 20:17

if you use ext4 file system the old grub it is outdated,you need grub2

Lonely
White ninja
White ninja
Posts: 4
Joined: 11 May 2012, 20:14
Location: United States

Re: Grub need to install to root partition, NOT MBR only

Post#5 by Lonely » 15 May 2012, 09:49

Thank you for your replies. PClinuxOS and WattOS have installers that give the user the option of where to install grub. LinuxMint12 gives option but rewrites MBR problem. Vector7 provides Lilo to root option. When using a boot manager such as BootitNG, the user does not want grub installed in the MBR because the boot manager program is installed in the MBR of the first hard drive hda and grub or lilo needs to be installed in the root partition. Stages 1 and 2 need to be in the root partition for grub>setup or the Super Grub repair CD to work. I am not using grub to boot several disto's but a boot manager to control booting distro's so menu.lst does not need editing. Boot manager allows me unlimited partitions, easy partition compressed backup copying/restoring, making/deleting partitions and working with Windows. As users learn the advantages of a boot manager, users will not want grub in MBR. Likewise the file system used needs to be compatible with the boot manager. Ext3 works nicely. Thanks for the link to the Lilo/Grub article which I read. The problem is how to install grub in the root partition of Porteus so that a boot manager can boot Porteus.

User avatar
brokenman
Site Admin
Site Admin
Posts: 5542
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Grub need to install to root partition, NOT MBR only

Post#6 by brokenman » 16 May 2012, 02:22

Are you using legacy grub?

As root:

Code: Select all

grub
find /boot/grub/stage1
root (hd0,X)
setup (hd0,X)
quit
Remember grub counts first partition as hd0,0. This means if your Porteus is on sda6 then grub will see it as hd0,5
How do i become super user?
Wear your underpants on the outside and put on a cape.

Lonely
White ninja
White ninja
Posts: 4
Joined: 11 May 2012, 20:14
Location: United States

Re: Grub need to install to root partition, NOT MBR only

Post#7 by Lonely » 17 May 2012, 07:21

Thank you for trying to help. Since I did not and do not want any grub in the MBR, The Porteus live CD would not let me get to >grub prompt so I used Super Grub repair and got >grub command line and >find /boot/grub/stage1 found others but the Porteus installation partition was missing stage1 and setup for this partition would not work because of stage1 file missing (error 15 file not found). Then booted the Porteus live CD and tried Super User Mode terminal and got errors. I am not a programmer, but have used >grub command on other distros which worked if stage1 was in root partition. It is not a matter of which grub I am using because I am trying to make work what the Porteus CD installs into my Porteus partition to be booted by a universal non-grub boot manager program in MBR which I will not do without because of advantages.

User avatar
brokenman
Site Admin
Site Admin
Posts: 5542
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Grub need to install to root partition, NOT MBR only

Post#8 by brokenman » 17 May 2012, 11:46

Ok, so first you need to get the slackware grub package:

From porteus you can install grub like this:

Code: Select all

slackyd -u
slackyd -g grub-legacy-0.97-i486-4sl
installpkg /var/slackyd/grub*
Then you need to install grub to the Porteus partition:
http://www.linuxselfhelp.com/gnu/grub/h ... rub_3.html

Then you need to chainload your existing BING installation to grub.

See http://www.terabyteunlimited.com/downloads/bootitng.pdf for the BootIT NG manual.

Some other useful links:

http://www.terabyteunlimited.com/howto/index.htm(tutorials and videos)
http://www.terabyteunlimited.com/kb/category.php?id=8(FAQ)
http://www.terabyteunlimited.com/kb/category.php?id=52(problem solving)
http://www.terabyteunlimited.com/kb/category.php?id=47(general information)
http://www.terabyteunlimited.com/webnews.htm(newsgroup forums)

It should be noted that BING is now deprecated and has been replaced by a more up to date method.

For further clarification here is my current menu.lst file:

Code: Select all

title Porteus v1.2rc2
kernel (hd0,4)/os/porteus-v1.2rc2/boot/vmlinuz from_dev=/dev/sda5 from_dir=/os/porteus-v1.2rc2/porteus
initrd=(hd0,4)/os/porteus-v1.2rc2/boot/initrd.xz
boot
How do i become super user?
Wear your underpants on the outside and put on a cape.

Lonely
White ninja
White ninja
Posts: 4
Joined: 11 May 2012, 20:14
Location: United States

Re: Grub need to install to root partition, NOT MBR only

Post#9 by Lonely » 22 May 2012, 08:20

Thank you for all your help. I succeeded in getting Porteus booted using my boot manager Bootitng. Porteus boots up very quickly and has a smaller memory foot print than most distros. I like the combo KDE classic style and LXDE. But the package manager is confusing, how to update and add applications.

User avatar
brokenman
Site Admin
Site Admin
Posts: 5542
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Grub need to install to root partition, NOT MBR only

Post#10 by brokenman » 22 May 2012, 11:28

Glad you got it sorted.

Please watch the package manager preview video. It may help:
http://www.youtube.com/watch?v=1UbRVX_3nnY

More packages will be added to the repo after the next final release.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply