You are not logged in.

#1 2013-06-04 21:38:25

kekules_dream
Member
Registered: 2009-05-19
Posts: 102

[SOLVED] Installing syslinux to a partition boot sector

According to the grub wiki article,

Note: grub-bios does not encourage installation to a partition boot sector or a partitionless disk like GRUB Legacy or Syslinux does.

I have a system like this:

# sgdisk -p /dev/sda
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): <removed>
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 8-sector boundaries
Total free space is 6587 sectors (3.2 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          409640       764933463   364.6 GiB   AF00  MacOS
   3       764934975       967868054   96.8 GiB    0700  Linux
   4       967868055       976768064   4.2 GiB     8200  Linux-Swap

   
Refit comes up first and allows me to choose MacOS or Arch Linux.

I have had grub 0.97 on sda3 for years but now it has to go due to the intervention.
   
I think I need to install syslinux to the partition boot record on sda3 and according to line I quoted above it looks like that can be done.

But from the syslinux wiki article it is not clear to me how to do it.  Would it just be the following since /boot is on sda3?

# mkdir /boot/syslinux
# extlinux --install /boot/syslinux

Last edited by kekules_dream (2013-06-04 23:42:11)

Offline

#2 2013-06-04 21:54:24

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Installing syslinux to a partition boot sector

The "extlinux -i" command determines what filesystem/partition the given syslinux configuration directory resides on and installs itself to that partition.  Do for instance, if you had your / on /dev/sda3, but your /boot on /dev/sda2, then because sda2 would be mounted to /boot on sda3, you would do "extlinux -i /boot/syslinux" and it would determine that the syslinux directory was not on / (sda3) but on /boot (sda2).  Its kind of like magic...

But I think that your "solution" is going about things the wrong way here.  I see no reason why you shouldn't keep your system exactly the way it is if that is waht you want.  Grub-legacy was great, and it does not require the things in the filesystem (apart from the stuff on /boot) to work.  So you can actually safely uninstall the package if you please.  Then you can do the update.

The other alternative would be to move the conflicting files to /usr/bin and then change the paths in /var/lib/pacman/local/<grub package>/files to their new homes.  I can confirm that this worked for others (Trilby was successufly amongst others).

There is a third alternative, and that is to use the AUR package grub-legacy.  It has actually been updated to store everything in /usr/bin like it should.


Edit: FWIW, I actually use syslinux as my backup bootloader (I use UEFI), and it is actually pretty great.  But I think that a bootloader, as long as it functions, is one of those things that actually don't really need to be up to date.  It is not as though it poses a security risk, as once it loads the kernel (and initramfs) it is done, and control is handed over to the running operating system.  So I say you are going about it the wrong way in the sense that it sounds as though youkept grub legacy because you liked it.  And if you like it... keep it.

Last edited by WonderWoofy (2013-06-04 21:57:38)

Offline

#3 2013-06-04 23:37:51

kekules_dream
Member
Registered: 2009-05-19
Posts: 102

Re: [SOLVED] Installing syslinux to a partition boot sector

Thank you for your excellent advice.  I went with the third alternative and it worked.  I was slightly hesitant because until now I didn't need to enable multilib on this machine and I had to change out several of my compilers in order to make this change.  Seems like kind of a shame to enable another repo just for a bootloader.  But I certainly agree with you, a bootloader doesn't do much and if it works, well good enough.  That is why I kept the old grub 0.97 for so long.

Offline

#4 2013-06-04 23:56:32

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Installing syslinux to a partition boot sector

Well, you shouldn't need to update the grub-legacy package very often, so why don't you just reinsatll gcc gcc-libs and binutils then disable multilib again?  They are not runtime deps, but build deps, so it shouldn't have any negative effect.  Then in the event you need to update grub-legacy you can reenable the multilib repo again.  But this is unlikely to happen very often if at all since grub-legacy is deprecated and no longer being developed.

Offline

#5 2013-06-05 23:54:57

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: [SOLVED] Installing syslinux to a partition boot sector

I made a similar post recently and would prefer to just upgrade to syslinux. My situation is a bit weird in that I have an encrypted MBR due to Safeboot being installed since it's a work computer. I know this topic has steered away from actually upgrading to syslinux... but would someone care to comment on how one would install it to a place other than the MBR (sda), even if this isn't the route that's been taken?

Offline

#6 2013-06-06 01:33:01

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Installing syslinux to a partition boot sector

@jwhendy, if yu are asking about how to install syslinux (extlinux) to the partition boot record, then I already explained this above.  It is also on the Arch Wiki's syslinux page as well.  So I don't know what it is sepcifically you are asking.  Take a look at the wiki page and see if you come up with some specific questions.

Offline

#7 2013-06-06 15:30:35

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: [SOLVED] Installing syslinux to a partition boot sector

@WonderWoofy: I may not have been clear enough above, but my actual post, which I linked to, is quite specific and contains the steps you explained above. However, you explained how to install syslinux, but not about writing mbr.bin to somewhere other than /dev/sda, which is the only place the Arch wiki refers to in it's dd commands for manual installation.

Automatic installation:

The syslinux-install_update script will install Syslinux, copy/symlink *.c32 modules to /boot/syslinux, set the boot flag and install the boot code in the MBR. It can handle MBR and GPT disks along with software RAID.

Compare that to manual installation:

# mkdir /boot/syslinux
# extlinux --install /boot/syslinux 

Next you need to mark your boot partition active in your partition table... Intall the MBR:

# dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda

I'm clear on installing; I'm not clear on whether or not putting mbr.bin or altmbr.bin on /dev/sda2 instead of /dev/sda will work. Currently, it doesn't seem to be working. I'm trying to make sure the method is theoretically even possible; if it's not and someone can let me know that, I'll abandon trying to do it that way.

It may be best to just comment on my actual post. I didn't want to derail this one, but I hadn't gotten many views or any comments, so since this was quite related, I thought I'd at least mention it in the hopes someone might chime in on my situation. Thanks for the input.

Last edited by jwhendy (2013-06-06 15:31:55)

Offline

Board footer

Powered by FluxBB