Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] [SOLVED] Install Grub In Partition Of Choice (not / or MBR)  (Read 23072 times)

JustDebian

  • Guest
After weeks of playing with the Siduction Razor-Qt live cd, I decided to install Siduction on my HP Dv7-4170us laptop.

All seemed to go pretty well until installing Grub.

The only options in the installer were to put Grub in the MBR or in the /root partition. So I opted not to install Grub thinking I could put it into the partition of choice later by some other method.

After spending hours going through the Siduction forums (even translating some posts on similar problems and the wiki articles on chroot and fixing Grub2 from German to English), using the Debian wiki, and Google-ing, I have yet to find a way to boot Siduction.

I use another boot loader for booting multiple OSes and want to put Grub into the third primary partition (/dev/sda4 - yes, that is what it is). I have used sux in the terminal from the Siduction live cd to try the various methods that I read about - with no luck.

At one point, I had the Grub terminal active but I could not figure out how to make use of it. Now, "GRUB" appears at the top left corner of the screen and the cursor just blinks. Fortunately, my boot loader is still working and my other OSes still boot normally.

dpkg-reconfigure grub-pc only offers the MBR or /, even though I mounted /dev/sda4 to /boot (the desired partition).

I am exhausted, confused, and frustrated at this point and would appreciate some clear guidance for setting up Grub to boot Siduction from my partition of choice.

Offline Bequimão

  • User
  • Posts: 121
How To Install Grub In Partition Of Choice (not / or MBR)
« Reply #1 on: 2013/04/04, 07:59:13 »
Code: [Select]
root@ebox:~# grub-install --force /dev/sdb2
    /usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition.  This is a BAD idea..
    /usr/sbin/grub-setup: warn: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
    Installation finished. No error reported.


Hi JustDebian,

Welcome to the siduction community! You may install grub to partition with the parameter --force. I do, however, use another installation with grub2 for boot. So it doesn't matter, if grub is installed to partition or not.

Best regards,
Bequimão
Bequimão (gesprochen: Be-ki-mãu) ist Manuel Beckmann,
brasilianischer Revolutionär in Maranhão (1630 - 1685).

Offline der_bud

  • User
  • Posts: 1.073
  • member
How To Install Grub In Partition Of Choice (not / or MBR)
« Reply #2 on: 2013/04/04, 08:53:43 »
Hi JustDebian, it's too bad that the installer did not offer you the options you wanted, probably you have seen from the several posts you have read that this sometimes happens under certain circumstances (should not, though).

To fix your grub i see two possible ways. The first is: you wrote about "another boot loader for booting multiple OSes". Is this loader somehow able to recognize siduction as bootable OS (the kernel image) without needing siduction grub in its partition? If your other bootloader is i.e grub from another distribution, booting that OS and executing "os-prober" and "update-grub" should find siduction.

The second way for (re)setting up grub to boot an already installed siduction is chrooting into the installed system from a live-medium. The steps are described in the manual: System Administration - Grub2 - Recovering Grub with chroot
Please pay attention, I am not sure if the given command with --reinstall will write perhaps to mbr without prompting. In the chapter above (Bootsector overwritten by Windows) is the command to rewrite installed grub to /dev/sda, should be useable if you enter /dev/sda4 instead.
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.

Gabriel_M

  • Guest
RE: How To Install Grub In Partition Of Choice (not / or MBR
« Reply #3 on: 2013/04/04, 16:23:56 »
The Grub necessarily must be installed in to / or /boot of Siduction.

Installed in to / or /boot of Sidution, must be recognized by your other boot loader.

Offline dieres

  • User
  • Posts: 786
[SOLVED] Install Grub In Partition Of Choice (not / or MBR)
« Reply #4 on: 2013/04/04, 17:48:49 »
If your siduction is installed in /dev/sda4 you may follow the steps in the link der_bud gave you to do the chroot Process.
Chande /dev/sda2 to your /dev/sda4. If you are in Chroot you should be able to install Grub with:
grub-install --force /dev/sda4.

After this your primary boot-loader must be configured to start grub in /dev/sda4.


What is your boot-loader?

Offline Bequimão

  • User
  • Posts: 121
[SOLVED] Install Grub In Partition Of Choice (not / or MBR)
« Reply #5 on: 2013/04/04, 18:22:07 »
Another hint: don't use the command # sux.
It is broken and not recovered until now
http://forum.siduction.org/index.php?topic=1976
« Last Edit: 2013/11/10, 02:52:50 by ayla »
Bequimão (gesprochen: Be-ki-mãu) ist Manuel Beckmann,
brasilianischer Revolutionär in Maranhão (1630 - 1685).

Offline devil

  • Administrator
  • User
  • *****
  • Posts: 4.845
[SOLVED] Install Grub In Partition Of Choice (not / or MBR)
« Reply #6 on: 2013/04/04, 18:35:19 »
a substitute for sux is suxterm. Get used to it, noone knows if sux will ever be fixed.

greetz
devil

JustDebian

  • Guest
Re: How To Install Grub In Partition Of Choice (not / or MBR
« Reply #7 on: 2013/04/05, 00:53:46 »
Quote from: "Bequimão"
Code: [Select]
root@ebox:~# grub-install --force /dev/sdb2
    /usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition.  This is a BAD idea..
    /usr/sbin/grub-setup: warn: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
    Installation finished. No error reported.


Hi JustDebian,

Welcome to the siduction community! You may install grub to partition with the parameter --force. I do, however, use another installation with grub2 for boot. So it doesn't matter, if grub is installed to partition or not.

Best regards,
Bequimão


Thank you for the welcome, Bequimão!

Yes, that is the message that was shown. The same thing happened when I installed Debian Wheezy. I ended up having to use GRUB from Squeeze. Since Kernel 3.2.x from Squeeze-backports and Wheezy had hardware errors, I sought other Debian-based distros. So far, Siduction has worked fine from the live-cd.

I did use the --force parameter, which caused the GRUB files to be installed where I wanted them. There was an error that I do not recall at the end of the process (silly me was hoping that it would somehow "fix" itself).

Unfortunately, the boot manager that I use cannot boot linux directly - I never expected to need that function until GRUB started having issues.

Thank you for the welcome and your insights into this.

JustDebian

  • Guest
Re: How To Install Grub In Partition Of Choice (not / or MBR
« Reply #8 on: 2013/04/05, 01:03:47 »
Quote from: "der_bud"
Hi JustDebian, it's too bad that the installer did not offer you the options you wanted, probably you have seen from the several posts you have read that this sometimes happens under certain circumstances (should not, though).


I was used to the Debian Installer offering free choice of GRUB location. Wheezy, however, would not install GRUB, either.

Quote
To fix your grub i see two possible ways. The first is: you wrote about "another boot loader for booting multiple OSes". Is this loader somehow able to recognize siduction as bootable OS (the kernel image) without needing siduction grub in its partition? If your other bootloader is i.e grub from another distribution, booting that OS and executing "os-prober" and "update-grub" should find siduction.


The boot loader that I use cannot boot linux.

Quote
The second way for (re)setting up grub to boot an already installed siduction is chrooting into the installed system from a live-medium. The steps are described in the manual: System Administration - Grub2 - Recovering Grub with chroot
Please pay attention, I am not sure if the given command with --reinstall will write perhaps to mbr without prompting. In the chapter above (Bootsector overwritten by Windows) is the command to rewrite installed grub to /dev/sda, should be useable if you enter /dev/sda4 instead.


I will study that more carefully and see if I can successfully chroot this time.

Thank you for your input.

ADDITION April 6, 2013:

Following the chroot instrucitons, I was able to chroot numerous times trying to get a good install. Good practice.  :)

Offline michaa7

  • User
  • Posts: 2.310
Re: How To Install Grub In Partition Of Choice (not / or MBR
« Reply #9 on: 2013/04/05, 01:29:57 »
EDIT://
i was wrong
Ok, you can't code, but you still might be able to write a bug report for Debian's sake

JustDebian

  • Guest
Re: RE: How To Install Grub In Partition Of Choice (not / or
« Reply #10 on: 2013/04/05, 01:39:22 »
Quote from: "Gabriel_M"
The Grub necessarily must be installed in to / or /boot of Siduction.

Installed in to / or /boot of Sidution, must be recognized by your other boot loader.


Revised April 6, 2013:

Having used the Debian Installer for each stable release since Sarge, I was used to having to specify the location for LILO/GRUB. With Siduction, that is not necessary.

I use the third primary hd partition for /boot with / having its own separate partition in the extended region. This is because LILO had required being installed in a bootable partition - GRUB has been OK with this arrangement too.

I had read, years ago, and still see the recommendation to put GRUB (or LILO) in a separate ext2 partition because the boot loader is static and journaling was unnecessary and/or could slow down hard drive response. The / partition could then be put anywhere else on the hard drive, even an extended partition, using an ext3 or ext4 file system.

With Siduction, that approach caused some problems. Also, I was not understanding clearly what the installer was doing.

PROBLEM ONE:

/usr/sbin/grub-bios-setup: Warning: File system 'ext2' doesn't support embedding. I am not quite sure what this means or if it only happens when / is installed in an ext4 partition (I have not used ext4 before and I never saw it when using ext3 with native Debian). I only used ext4 because it was recommended in the Siduction manual, even though I felt more comfortable with ext3 (I am trying to move forward with the technology).


PROBLEM TWO (ME):

The bigger problem was me not understanding the Siduction installer:

After confirming the partition layout, the installer asks to select the partition and file system type for the root file system. That is pretty straight forward. Again, I selected ext4 over ext3 because it was highly recommended in the manual.

Mount Point Definitions is where I got myself into trouble. Besides using a separate partition for /home, I used a separate primary partition for /boot. Because of my previous experience with the Debian Installer, I thought that I would later have to specify the device (i.e. /dev/sda4) where GRUB was to be installed.

What I finally figured out was that because the /boot partition (/dev/sda4, in this case) would be integrated into the / file tree, when it was time to choose the location for GRUB, in the next step, *Partition* was the correct choice. The Siduction installer would know to install GRUB into /boot (a.k.a. /dev/sda4) without any further instructions.

My preferred boot loader (Plop) is not a Linux loader but can recognize and chain load GRUB/LILO.

Had I understood this better for myself, I may have had a working Siduction system by now. Since I tend to learn the hard way (trial and lots of errors), I suppose the multiple chroot exercises and numerous re-installs are all part of the learning process.

JustDebian

  • Guest
[SOLVED] Install Grub In Partition Of Choice (not / or MBR)
« Reply #11 on: 2013/04/05, 01:51:01 »
Quote from: "dieres"
If your siduction is installed in /dev/sda4 you may follow the steps in the link der_bud gave you to do the chroot Process.
Change /dev/sda2 to your /dev/sda4. If you are in Chroot you should be able to install Grub with:
grub-install --force /dev/sda4.


Revised April 6, 2013:

Using --force is not necessary. As it turned out, I was not understanding how the installer worked. My impression was that it would install GRUB into / and not /boot if I selected the *Partition* option. After I figured out what the installer was doing and set the mount point partitions correctly, GRUB installed as it should.

Quote
After this your primary boot-loader must be configured to start grub in /dev/sda4.


Yes, it already is. I had Debian Squeeze installed exactly as I am I trying to install Siduction. I just need to get GRUB to complete installation.

Quote
What is your boot-loader?


I am using Plop Boot Manager. It is simple enough for me to use but has some powerful features for someone who has the knowledge to use them. The author does make it clear, though:
Quote
Warning Linux users: Install LILO or GRUB to the boot sector of your Linux instead of the Master Boot Record (MBR). The Plop Boot Manager is not a Linux loader and cannot start Linux without LILO, GRUB, Syslinux and similar!


Thank you for your guidance.

JustDebian

  • Guest
[SOLVED] Install Grub In Partition Of Choice (not / or MBR)
« Reply #12 on: 2013/04/05, 01:52:44 »
Quote from: Bequimão
Another hint: don't use the command # sux.
It is broken and not recovered until now
http://forum.siduction.org/index.php?topic=1976

Good to know. Thank you.
« Last Edit: 2013/11/10, 02:53:24 by ayla »

JustDebian

  • Guest
[SOLVED] Install Grub In Partition Of Choice (not / or MBR)
« Reply #13 on: 2013/04/05, 01:56:10 »
Quote from: "devil"
a substitute for sux is suxterm. Get used to it, noone knows if sux will ever be fixed.

greetz
devil


Thanks, devil. I tried suxterm from the live-cd but could not remember the root password. Old brains die fast. I will try it again after I re-read that part of the manual.

Update: April 6, 2013:

After re-reading how to set the live-cd root password (sudo passwd), suxterm worked nicely. Thanks, again, for that tip.  :)

Gabriel_M

  • Guest
[SOLVED] Install Grub In Partition Of Choice (not / or MBR)
« Reply #14 on: 2013/04/05, 02:09:19 »
To install Plop Boot Manager on a hard drive within a Grub2 distro takes a bit longer.

The Plop file that is used for hard drive installation is plpbt.bin, which must be placed in the /boot directory:

Then go to /etc/grub.d and open the 40_custom file with nano.

There is a sample file there that begins with #!/bin/sh and is followed by several lines of comments and instructions.
Below those instructions, add the following:

Code: [Select]
menuentry "Plop Boot Manager" {
   set root=(hd0,1)
   linux16 /boot/plpbt.bin
}


Then save the file and close nano.
This will establish a new 40_custom file as the final item in the boot menu for the distribution in which you were working.
To activate it, update the grub:

# update-grub

and reboot.

If your computer is multibooted, Plop Boot Manager will appear as the final boot option.
If you are running only one distro, depress the Shift key during boot to see the options.