You are not logged in.

#1 2013-11-08 19:23:55

fasza2mobile
Member
Registered: 2013-11-03
Posts: 29

[Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

Hi I am using MBR partition table and trying to install Arch on a btrfs root. I have installed the base system(+mkinitcpio-btrfs) successfully following the updated wiki, although adding btrfs-advanced to HOOKS failed for some reason. I've tried to install both grub and syslinux, but none seems to work out of the box for me. I get this error upon trying to boot with syslinux: "failed to load ldlinux.c32"

I've done some search and the most relevant infos that I found were these from archwiki:

"Execute ldlinux.sys. The VBR will execute (ldlinux.sys). Therefore, if the location of ldlinux.sys changes, Syslinux will no longer boot. (In the case of Btrfs, the above method will not work since files move around resulting in the sector location of ldlinux.sys changing. Therefore, the entire Syslinux code needs to be stored outside the filesystem. The code is stored in the sectors following the VBR.)"
    https://wiki.archlinux.org/index.php/sy … ot_process

"Warning: If you want true non-volatile rollback support you MUST NOT create a separate /boot partition, as this will prevent rollback of your kernel."
    https://wiki.archlinux.org/index.php/Mkinitcpio-btrfs

"Note: Having boot on a different partition in not supported with mkinitcpio-btrfs >= 0.4. This is because, kexec is used to reload the kernel from your root partition to make sure it is rolled back too. If you want, you can put it on a subvolume within your __active subvolume. Btrfs will automatically mount subvolume included in the currently mounted one."
    https://wiki.archlinux.org/index.php/Mkinitcpio-btrfs


To the best of my knowledge ldlinux.sys is now ldlinux.c32 what I didn't find in the wiki is how to move the "Syslinux code" after the VBR (presumably with dd) and what "Syslinux code" should actually go there as there are a few .c32 files that could qualify(this I could probably figure out after about a week study of Syslinux' wiki as I am new to Syslinux, but I hope to finish the installation a bit quicker and study Syslinux later). The reason why I want btrfs is for its rollback feature, I have been using it on Mint for about a year and I came to rely on it. For me the ability to roll back to a known good state after an unforunate pacman -Syu is a must if I am to use Arch as my regular distro.

Any help would be appreciated.

UPDATE:
I managed to get it working by moving my entire /boot onto an ext2 partition. It is a suboptimal solution to what I have wanted as the initram image won't get rolled back, but it is something I can live with.

Last edited by fasza2mobile (2013-11-22 20:15:31)

Offline

#2 2013-11-08 22:19:50

Hydranix
Member
Registered: 2013-02-10
Posts: 55

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

You dont need mkinitcpio-btrfs unless you truly feel that you need rollback support in initramfs.

There are other ways to do it which i feel are better.


Anyway, you ran "syslinux-install_update -iam" in chroot yes?

Are you using "compress=lzo" as a mount option? Don't if /boot is under that mount point.

Offline

#3 2013-11-09 01:24:09

GermanyChris
Member
From: Southern Germany
Registered: 2013-10-14
Posts: 60

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

and after that you still have to edit the syslinux config to direct it to the butter root


Don't scab for the bosses Don't listen to their lies Poor folks ain't got a chance Unless they organize --Florence Reece

Offline

#4 2013-11-09 08:11:44

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

fasza2mobile wrote:

To the best of my knowledge ldlinux.sys is now ldlinux.c32 what I didn't find in the wiki is how to move the "Syslinux code" after the VBR (presumably with dd) and what "Syslinux code" should actually go there as there are a few .c32 files that could qualify(this I could probably figure out after about a week study of Syslinux' wiki as I am new to Syslinux, but I hope to finish the installation a bit quicker and study Syslinux later).

I have clarified the boot process of Syslinux BIOS at https://wiki.archlinux.org/index.php/Sy … ot_process . Basically ldlinux.c32 is not same as ldlinux.sys. ldlinux.sys loads ldlinux.c32 (and lib*.c32) and both are required for syslinux to boot properly. I haven't tried btrfs so can't help you there though.

Offline

#5 2013-11-09 12:32:20

fasza2mobile
Member
Registered: 2013-11-03
Posts: 29

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

Hydranix wrote:

You dont need mkinitcpio-btrfs unless you truly feel that you need rollback support in initramfs.
There are other ways to do it which i feel are better.
Anyway, you ran "syslinux-install_update -iam" in chroot yes?
Are you using "compress=lzo" as a mount option? Don't if /boot is under that mount point.


I did run syslinux-install_update -iam in chroot, yes. No I don't use compression at all and /boot is not under any mount point as it is on the same partition as root. I do need rollback support, but I'd be open for other ways.

Offline

#6 2013-11-09 12:37:08

fasza2mobile
Member
Registered: 2013-11-03
Posts: 29

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

GermanyChris wrote:

and after that you still have to edit the syslinux config to direct it to the butter root

That has been done, but unfortunately syslinux didn't look at the .cfg file as it didn't find the ldlinux.c32 file which to my current understanding is supposed to parse the .cfg file; Thus if the problem was with my .cfg file I'd probably get a command prompt at least.

Offline

#7 2013-11-09 12:55:39

fasza2mobile
Member
Registered: 2013-11-03
Posts: 29

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

the.ridikulus.rat wrote:

I have clarified the boot process of Syslinux BIOS at https://wiki.archlinux.org/index.php/Sy … ot_process . Basically ldlinux.c32 is not same as ldlinux.sys. ldlinux.sys loads ldlinux.c32 (and lib*.c32) and both are required for syslinux to boot properly. I haven't tried btrfs so can't help you there though.

Thanks for the clarification, that means I have syslinux.sys installed properly by "syslinux-install_update -iam", but for some reason it doesn't find my ldlinux.c32 file even though I have it under "/boot/syslinux/". When does syslinux load the code necessary to access diferent filesystems? Is it done by ldlinux.sys?

Offline

#8 2013-11-09 18:04:01

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

fasza2mobile wrote:

When does syslinux load the code necessary to access diferent filesystems? Is it done by ldlinux.sys?

I think so, but better to ask in irc #syslinux . I primarily use Gummiboot and GRUB.

Offline

#9 2013-11-09 21:58:56

fasza2mobile
Member
Registered: 2013-11-03
Posts: 29

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

the.ridikulus.rat wrote:

I think so, but better to ask in irc #syslinux . I primarily use Gummiboot and GRUB.

Thank you very much, I will do so.

Last edited by fasza2mobile (2013-11-09 21:59:24)

Offline

#10 2013-11-22 19:50:50

Tjuh
Member
Registered: 2013-11-14
Posts: 18

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

I'm having this very same problem, so the solution is to just switch to GRUB2?

Offline

#11 2013-11-22 20:06:03

fasza2mobile
Member
Registered: 2013-11-03
Posts: 29

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

Tjuh wrote:

I'm having this very same problem, so the solution is to just switch to GRUB2?

Do you use MBR with no separate boot partition?

I had troubles with grub2 as well. I had to use an ext2 /boot partition to get it working.  I've spent a lot of time researching, even asked the folks on IRC. I even installed syslinux on my mint install to boot arch, but had the same error until I moved /boot onto an ext2 partition.
You can try grub2 see if it works for you though.

Offline

#12 2013-11-22 23:29:32

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

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

I use grub2 with btrfs, and the /etc/grub.d scripts do indeed provide a proper grub.cfg. (It just makes me cringe to have to have that silly 2MB EF02 partition...)

Offline

#13 2013-11-23 00:07:05

fasza2mobile
Member
Registered: 2013-11-03
Posts: 29

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

WonderWoofy wrote:

I use grub2 with btrfs, and the /etc/grub.d scripts do indeed provide a proper grub.cfg. (It just makes me cringe to have to have that silly 2MB EF02 partition...)

It is silly, isn't it? I wonder when/if that requirement ever goes away, also wonder when btrfs is going to be finalized...

Offline

#14 2013-11-23 00:18:33

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

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

btrfs is pretty stable for normal users.  I have been happily using it for a bit now, and problems are minimal.

If you use a btrfs full disk partition (make it on /dev/sda instead of /dev/sda1), then you can actually use grub2 without an ef02 partition.  This is because the btrfs filesystem doesn't start until after the first superblock, which is located 64k into the disk.  The reason you need this silly partition in the first place is because grub2 has become so bloated feature filled, that it uses not only the MBR and supporting files in /boot/grub, but also the space between the MBR and the first partition.  If you use GPT, you have a protective MBR still, but the GPT lives right were grub wants to stick its extra fat features.

What confuses me is that there should be more than ample room between the GPT and where the default first partition now sits (2048) to put the extra crap features.  But grub2 is insistent that it wants to use the part that is precisely where the GPT lives.  So theoretically it should be possible to make this requirement go away, but I don't know that it will ever be done.

Offline

#15 2013-11-23 01:03:29

fasza2mobile
Member
Registered: 2013-11-03
Posts: 29

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

It is funny that on an MBR partitioned disk, that 2MB is enough to store its core.img and doesn't need any extra space(apart from that) to boot a btrfs partition. So I guess it would be very possible to remove the need to have an extra partition on GPT disk as well.(Maybe it's just part of the PR that GPT can have more primary partitions tongue)
   I have been using btrfs for a few years as well and yes, it is mostly stable, but some tool are(or were when I needed) still missing such as undelete file. Once I managed to delete a bunch of files that I have worked on for a whole day, thankfully they were source files so I could get them back with strings, but that's when I found out I can't/couldn't use testdisk to undelete them... Lesson learned, my /home is now on ext4. There are also a few features not quite ready yet, but all in all it is usable and reliable enough for my needs.
  Anyway, I was always a grub user I tried syslinux now the first time and despite failing to accomplish exactly what I wanted I like syslinux much better then I ever did grub. The documentation is superb on both syslinux's site and arch's and the folks at #syslinux are very friendly and helpful just like people here.

Offline

#16 2013-11-23 01:11:26

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

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

fasza2mobile wrote:

<snip>
There are also a few features not quite ready yet, but all in all it is usable and reliable enough for my needs.
<snip>

Yeah, don't use raid5/6 or qgroups for sure.  Hopefully at some point we'll be able to see subvol mountable with different btrfs mount options too (you can certainly mount with different standard options already, like one atime, and one noatime for example).

(Maybe it's just part of the PR that GPT can have more primary partitions )

This could very well be why it is the way it is.  But I would have thought that grub2 is so anti-DIY (much more "let us do it for you!") that it would seem like something that they would want to automagically detect for you and make Just Work™.

Offline

#17 2013-11-25 11:38:40

Tjuh
Member
Registered: 2013-11-14
Posts: 18

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

I managed to get this working by switching to grub and also had to remove fschk and add btrfs hook to mkinicpio.conf.

Offline

#18 2013-11-25 16:48:07

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

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

The fsck hook is totally wrong to use with a btrfs root simply because there is no fsck.btrfs.  On the btrfs wiki it does say that if you distribution is intent on including a fsck tool, you can create a fsck.btrfs symlink to /bin/true.

If you read the mkinitcpio -H output for the btrfs hook, you will see that it is only for multi-device btrfs filesystems. Not only that, but it simply loads the btrfs binary (and supporting files) and then just does a btrfs scan.  Assembly of a multi-device btrfs filesystem happens automagically as long as you have either udev or systemd in your initramfs.  I can't even begin to tell you how many people I have talked to who unnecessarily have that hook in their initramfs, on a single device btrfs filesystem and don't quite believe me that it is unnecessary.

Oh, and if you want to go with no initramfs (by building your own kernel), you can actually use a multi-device btrfs filesystem by actually passing each device to the root= on the kernel command line.  It is not pretty, but it works.

Offline

#19 2013-11-25 17:11:29

Tjuh
Member
Registered: 2013-11-14
Posts: 18

Re: [Solved sort of] syslinux on btrfs/ Error: failed to load ldlinux.c32

You were right, I removed the btrfs hook and did a new mkinitcpio -p linux and it's working just fine now, still weird that it didn't work with syslinux though. Thank you.

Offline

Board footer

Powered by FluxBB