You are not logged in.

#1 2012-07-11 22:09:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

[solved] syslinux woes: the return of grub

I spoke too soon.

After a reboot I get

grub>

prompt.
grub is already removed and so is /boot/grub. What's going on?

When I tried to boot the kernel (vmlinuz-linux), with the grub prompt, I got

Kernel panic - not syncing: VFS: Unable to mount root to an unknown-block (0,0)

I've reinstalled syslinux, edited syslinux.cfg and run

# /usr/sbin/syslinux-install_update -iam
Syslinux install successful
Boot Flag Set - /dev/sda1
Installed MBR (/usr/lib/syslinux/mbr.bin) to /dev/sda

again.
Any idea what might have gone wrong? How am I supposed to get rid of grub? Google wasn't of much help.

Last edited by karol (2012-10-29 16:02:50)

Offline

#2 2012-07-11 22:44:31

fsckd
Forum Moderator
Registered: 2009-06-15
Posts: 3,498

Re: [solved] syslinux woes: the return of grub

if you installed syslinux correctly grub should be gone
do you have more than one disk and installed syslinux to the wrong one?
did you go through the steps olive gave above which are also on the wiki?
is your disk broken?

syslinux consists of three parts, (1) part that goes to the mbr (like grub stage 1), (2) part that goes to the partition's boot area (grub ignores this) - set this partition's boot flag, (3) stuff that goes in the filesystem of the same partition as (2)
check them, and redo them if necessary


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2012-07-11 22:59:31

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [solved] syslinux woes: the return of grub

I have one hard drive and it seems to be working OK. How can I make sure - smartctl?
I tried installing manually following the wiki and olive's post, but it still wouldn't work.

I have syslinux installed and the files are present in my /boot partition in /boot/syslinux.

$ pacman -Q grub syslinux
error: package 'grub' was not found
syslinux 4.05-4
$ ls /boot/syslinux/
SYSLINUX_AUTOUPDATE  hdt.c32	  menu.c32  poweroff.com  syslinux.cfg
chain.c32	     ldlinux.sys  pci.ids   reboot.c32	  vesamenu.c32

This partition is marked bootable

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1      208844      104422   83  Linux
/dev/sda2          208845      738989      265072+  82  Linux swap / Solaris
/dev/sda3          738990    16113194     7687102+  83  Linux
/dev/sda4        16113195    78156224    31021515   83  Linux
$ findmnt -l | grep boot
/boot    /dev/sda1 ext2   rw,relatime,errors=continue

Offline

#4 2012-07-12 07:29:06

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,054

Re: [solved] syslinux woes: the return of grub

This error seems to tell that you do not have installed the correct mbr or not in the good place. See my post 4. To verify that the mbr has been installed, just compare it with mbr.bin:

dd if=/dev/sda of=/dev/stdout bs=440 count=1 | diff -s /usr/lib/syslinux/mbr.bin -

Your partition layout seems strange. Normally you do not begin the first partition at sector 1 and this might confuse the bios (normally not but some bios seems to do something with the partition table).  What's the output of fdisk -u=sectors /dev/sda -l . I do not now about smartctl, but I would try a sync just before rebooting.

Last edited by olive (2012-07-12 07:39:55)

Offline

#5 2012-07-12 11:05:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [solved] syslinux woes: the return of grub

$ dd if=/dev/sda of=/dev/stdout bs=440 count=1 | diff -s /usr/lib/syslinux/mbr.bin -
1+0 records in
1+0 records out
440 bytes (440 B) copiedFiles /usr/lib/syslinux/mbr.bin and - are identical
, 0,00088629 s, 496 kB/s
$ fdisk -u=sectors /dev/sda -l

Disk /dev/sda: 40.0 GB, 40016019456 bytes
255 heads, 63 sectors/track, 4865 cylinders, total 78156288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x14efcecf

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1      208844      104422   83  Linux
/dev/sda2          208845      738989      265072+  82  Linux swap / Solaris
/dev/sda3          738990    16113194     7687102+  83  Linux
/dev/sda4        16113195    78156224    31021515   83  Linux

Offline

#6 2012-07-12 11:18:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [solved] syslinux woes: the return of grub

I've synced and rebooted and I still got the grub prompt.
I decided to try and copy back stuff to /boot/grub and now I have a functioning grub (so I can boot Arch) even though I don't have grub installed and the mbr seems to be from syslinux.

Offline

#7 2012-07-12 12:49:48

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,054

Re: [solved] syslinux woes: the return of grub

How have you partitioned your disk? Your layout is definitively strange. The first partition should begin at 63 or 2048. By the way, have you tried to install syslinux directly without syslinux-install_update. Run:

extlinux -i /boot/syslinux

If you run it from a boot CD, mention the directory syslinux as seen in the current OS, extlinux -i /mnt/my-arch-installation/boot/syslinux or so and post the output of that.
Use the install option (-i), not the update option.

Everything seems to tell that syslinux is not installed in partition 1. By the way in your case, grub have hard-coded the physical address of the files it needs, so it will work as long as the data is still present but ask for breakage in the future (removing a file does not physically remove the data).

Offline

#8 2012-07-12 13:12:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [solved] syslinux woes: the return of grub

IIRC I've installed Arch using the default settings - 256 MB swap, a separate /boot and /home partitions and a 7GB /.
I've tried 'extlinux -i /boot/syslinux' and  'extlinux -U /boot/syslinux'  too.

I think I'm just going to reinstall Arch in a month or two. I'm still using ext3 for /home and / and ext4 would be nice to have.
grub works for now and syslinux seems the way to go with the new install.

Offline

#9 2012-07-12 13:18:06

jjacky
Member
Registered: 2011-11-09
Posts: 321
Website

Re: [solved] syslinux woes: the return of grub

Do you have any other device/disk that could be the boot device, instead of sda? Because it looks like you installed the syslinux mbr in sda, yet you stil get grub instead of syslinux, so maybe the issue is that another device is used.

What happens if you reboot after clearing the mbr?

dd if=/dev/zero of=/dev/sda bs=440 count=1

If you still get grub, I'd say sda isn't used as boot device. If you get an error such as "device not bootable" or something, I have no idea why syslinux doesn't work when its mbr is installed...

Offline

#10 2012-07-12 15:11:04

fsckd
Forum Moderator
Registered: 2009-06-15
Posts: 3,498

Re: [solved] syslinux woes: the return of grub

moderator comment: Split from syslinux woes: "Missing operating system".


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#11 2012-07-12 16:20:37

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: [solved] syslinux woes: the return of grub

syslinux comes with a helper syslinux-install_update, which can be made to install the bootloader into mbr, set the bootable flag, and anything else that is needed to make syslinux work (you only have to adjust the config file in /boot/syslinux/syslinux.cfg to your needs).

Offline

#12 2012-07-12 20:31:00

Lennie
Member
From: Sweden
Registered: 2011-10-12
Posts: 146

Re: [solved] syslinux woes: the return of grub

You can run Boot Info Script and see what information it gives.

Offline

#13 2012-07-13 04:16:54

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,745

Re: [solved] syslinux woes: the return of grub

I followed wiki guide for automatic install and get same error [INT18 Boot Failure] trying to go over grub-legacy.

Do have a /boot partition so am a little confused as to the LINUX ../vmlinuz-linux line after reading this thread


Mr Green

Offline

#14 2012-07-13 07:53:40

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,054

Re: [solved] syslinux woes: the return of grub

Mr Green wrote:

I followed wiki guide for automatic install and get same error [INT18 Boot Failure] trying to go over grub-legacy.

Do have a /boot partition so am a little confused as to the LINUX ../vmlinuz-linux line after reading this thread

Realative paths are relative to the directory containing syslinux.cfg. So ../vmlinuz-linux should be correct. If you jhave a boot partion you can also put /vmlinuz-linux. In case of problems, it may help to regenerate the boot sector completely (maybe it has not the boot signature). To do so (be careful, know what you are doing). Keep a bootable media at hand (it is always a good idea to have the system rescue CD at hand: http://www.sysresccd.org ).

1) Put the output of fdisk /dev/sda -u=sectors -l ; somewhere outsite of the disk (print it if you have a printer).
2) Erase the boot sector (this will erase the partition table, so do first the step 1): dd if=/dev/zero of=/dev/sda bs=512 count=1
3) Run fdisk -u=sectors /dev/sda (or fdisk -c=dos -u=sectors /dev/sda) and recreate the partition table as it was in 1). This assume that you had a "normal" partition table (the first partition should begin past sectors 63 with the -c=dos option or past sector 2048 otherwise, no overlapping partition or weirdness, fdisk refuses to create weird partition table, sfdisk can).
4) Reinstall syslinux

If you still had trouble, repost describing in detail what you were doing, the output of fdisk /dev/sda -l, your syslinux.cfg, etc... No just I have followed the wiki.

All of this assume you use DOS partition table. If you use GPT partition table, you have to adapt a little (use sgdisk instead of fdisk, use the gptmbr.bin instead of mbr.bin).

Last edited by olive (2012-07-13 08:00:20)

Offline

#15 2012-07-13 10:31:56

x33a
Forum Moderator
Registered: 2009-08-15
Posts: 3,205
Website

Re: [solved] syslinux woes: the return of grub

Lennie wrote:

You can run Boot Info Script and see what information it gives.

Thanks for that, really useful script.

ps: I found out using this, that even i had syslinux installed... as a dependency for unetbootin!

Last edited by x33a (2012-07-13 10:33:13)

Offline

#16 2012-07-13 10:55:34

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,745

Re: [solved] syslinux woes: the return of grub

fdisk -c=dos -u=sectors /dev/sda
Welcome to fdisk (util-linux 2.21.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xa2c6539d.

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (with command 'c').
 /usr/sbin/syslinux-install_update -iam
Syslinux install successful
Boot Flag Set - /dev/sda1
Installed MBR (/usr/lib/syslinux/mbr.bin) to /dev/sda

Am trying to get syslinux working on a virtual machine

Tried and this borks system so going to try manual method....

Manual method in wiki works, so not sure if script has problems [others will have to confirm]

At this stage I only have menu.c32 as well as syslinux.cfg... in /boot/syslinux

Apart from changing root device did not touch stock config

Last edited by Mr Green (2012-07-13 12:32:37)


Mr Green

Offline

#17 2012-07-13 22:37:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [solved] syslinux woes: the return of grub

tomegun wrote:

syslinux comes with a helper syslinux-install_update, which can be made to install the bootloader into mbr, set the bootable flag, and anything else that is needed to make syslinux work (you only have to adjust the config file in /boot/syslinux/syslinux.cfg to your needs).

Yup, I've tried both 'syslinux-install_update -iam' and the manual way outlined in the wiki. Neither one worked.

I think that the one time I though syslinux worked it was actually grub that booted properly (even though grub was removed from my system at that point). It stopped working once I removed /boot/grub.

Offline

#18 2012-07-13 22:51:41

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,117
Website

Re: [solved] syslinux woes: the return of grub

There is a SAY option that allows you to print a message to your console as Syslinux loads...

It's academic I know, but we never did get to see your syslinux.cfg, did we? Or did I miss it in one or the other of these threads?


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#19 2012-07-14 01:29:30

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [solved] syslinux woes: the return of grub

jasonwryan wrote:

It's academic I know, but we never did get to see your syslinux.cfg, did we? Or did I miss it in one or the other of these threads?

It's not academic, it's the right way :-)

# Config file for Syslinux -
# /boot/syslinux/syslinux.cfg
#
# Comboot modules:
#   * menu.c32 - provides a text menu
#   * vesamenu.c32 - provides a graphical menu
#   * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
#   * hdt.c32 - hardware detection tool
#   * reboot.c32 - reboots the system
#   * poweroff.com - shutdown the system
#
# To Use: Copy the respective files from /usr/lib/syslinux to /boot/syslinux.
# If /usr and /boot are on the same file system, symlink the files instead
# of copying them.
#
# If you do not use a menu, a 'boot:' prompt will be shown and the system
# will boot automatically after 5 seconds.
#
# Please review the wiki: https://wiki.archlinux.org/index.php/Syslinux
# The wiki provides further configuration examples

DEFAULT arch
PROMPT 0        # Set to 1 if you always want to display the boot: prompt 
TIMEOUT 50
# You can create syslinux keymaps with the keytab-lilo tool
#KBDMAP de.ktl

# Menu Configuration
# Either menu.c32 or vesamenu32.c32 must be copied to /boot/syslinux 
UI menu.c32
#UI vesamenu.c32

# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
MENU TITLE Arch Linux
MENU COLOR border       30;44   #40ffffff #a0000000 std
MENU COLOR title        1;36;44 #9033ccff #a0000000 std
MENU COLOR sel          7;37;40 #e0ffffff #20ffffff all
MENU COLOR unsel        37;44   #50ffffff #a0000000 std
MENU COLOR help         37;40   #c0ffffff #a0000000 std
MENU COLOR timeout_msg  37;40   #80ffffff #00000000 std
MENU COLOR timeout      1;37;40 #c0ffffff #00000000 std
MENU COLOR msg07        37;40   #90ffffff #a0000000 std
MENU COLOR tabmsg       31;40   #30ffffff #00000000 std

# boot sections follow
#
# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
#
#-*

LABEL arch
	MENU LABEL Arch Linux
	LINUX /vmlinuz-linux
	APPEND root=/dev/sda3 ro
    #APPEND root=UUID=bf1d191b-0f0d-4961-bd67-4d023a2e5873 ro
	INITRD /initramfs-linux.img

LABEL archfallback
	MENU LABEL Arch Linux Fallback
	LINUX /vmlinuz-linux
	APPEND root=/dev/sda3 ro
    #APPEND root=UUID=bf1d191b-0f0d-4961-bd67-4d023a2e5873 ro
	INITRD /initramfs-linux-fallback.img

LABEL hdt
        MENU LABEL HDT (Hardware Detection Tool)
        COM32 hdt.c32

LABEL memtest
        MENU LABEL Memtest86+
        LINUX /memtest86+/memtest.bin
 
LABEL reboot
        MENU LABEL Reboot
        COM32 reboot.c32
 
LABEL off
        MENU LABEL Power Off
        COMBOOT poweroff.com

Offline

#20 2012-07-14 04:38:36

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,117
Website

Re: [solved] syslinux woes: the return of grub

Going by your config, and the fact that you said /boot is its own partition (which means that the output of `ls /boot/` should include vmlinuz-linux and initramfs-linux.img), then you have the wrong paths in the cfg - they should point to the parent directory, like so:

LINUX ../vmlinuz-linux 
    APPEND root=/dev/sda3 ro
    INITRD ../initramfs-linux.img

I realize that, in the split part of this thread, you had tried it, but it is worth clarifying.

I would also debug by removing any of the {,vesa}menu options - just to narrow down potential fault points.


# edit: also, throw in a SAY line, just to be sure that syslinux is running:

    SAY Now booting Arch Linux with Syslinux...

Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#21 2012-07-14 06:00:05

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [solved] syslinux woes: the return of grub

My old (but still working) syslinux.cfg with separate boot partition:

# (0) Arch Linux
LABEL arch
    MENU LABEL Arch Linux
    LINUX ../vmlinuz-linux
    APPEND root=/dev/sda5 ro init=/bin/systemd elevator=deadline acpi_backlight=vendor i915.i915_enable_rc6=1
    INITRD ../initramfs-linux.img

So i think Jason's correct there. smile


ᶘ ᵒᴥᵒᶅ

Offline

#22 2012-07-14 07:23:35

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,054

Re: [solved] syslinux woes: the return of grub

In the case of karol both paths ( /vmlinuz-linux and ../vmlinuz-linux ) are correct. Relative paths are relative to the directory containing syslinux.cfg, absolute paths are absolute taking as root the root of the partition. Also the root=/dev/sda1 or root=UUID= or so can't be the problem. If it is wrong the kernel boot anyway by there is a complain from the initrd that it can't find its root and drop you in a rescue shell. That's not the case here.I think the config is OK. For some reason syslinux does not start. Be sure that /boot is mounted read-write when you run extlinux.

The only thing I see now is this weird partition table with the first partition begining at sector 1 (partitions are dual marked as C/H/S and relative and logical, maybe something wrong here). I would suggest to repartition the disk completely with fdisk. It is possible to do it without reinstalling but know what you do:

1) Copy the content (cp -a) on the first partition to a USB key.
2) put the output of fdisk /dev/sda -u=sectors -l on the key too
3) Boot from a rescue disk (for example the system rescue CD).
4) Void the first 63 sectors of your disk:
dd if=/dev/zero of=/dev/sda bs=32256 count=1
5) recrete a partition table with fdisk -c=dos -u=sectors. Put the first partition at sector 63 as suggested by fdisk and the other partition exactly where there were in 2)
6) Format the first partition (mkfs -t ext2 for example). You may use the -U option of mkfs to use the same UUID as the original /boot partition (the only reference to it are in syslinux.cffg and possibly /etc/fstab, you may take a new UUID and reajust these files. You can find the uuid of a partition with dumpe2fs /dev/sda1 | grep -i uuid).
7) mount this first partition and cp -a what was in 1)
8) reinstall syslinux (extlinux) in this new configuration.

Last edited by olive (2012-07-14 07:25:42)

Offline

#23 2012-07-14 11:28:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [solved] syslinux woes: the return of grub

olive wrote:

In the case of karol both paths ( /vmlinuz-linux and ../vmlinuz-linux ) are correct.

I actually figured that out myself yesterday just before I went to sleep and wanted to make sure before editing my post in the other thread.

This is currently my only working machine so I will postpone fiddling with partitions at least until I have access to another computer. I have your posts bookmarked and I will surely use them unless I decide to reinstall Arch from scratch.
Thanks again.


@jasonwryan
Should the SAY line be the first uncommented line in syslinux.cfg?

SAY Now booting Arch Linux with Syslinux...

DEFAULT arch
PROMPT 0        # Set to 1 if you always want to display the boot: prompt 
TIMEOUT 50

LABEL arch
	MENU LABEL Arch Linux
	LINUX /vmlinuz-linux
	APPEND root=/dev/sda3 ro
	INITRD /initramfs-linux.img

Should I enable the PROMPT when not using MENU? Should I remove MENU LABEL line too?

Offline

#24 2012-07-14 11:44:23

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,745

Re: [solved] syslinux woes: the return of grub

Testing stuff like this is one of the reasons I use virtualbox, got tired of breaking my own system.


Mr Green

Offline

#25 2012-07-14 19:46:11

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,117
Website

Re: [solved] syslinux woes: the return of grub

@karol - this is one of my configs:

# General settings
DEFAULT Arch
PROMPT 0
TIMEOUT 0

LABEL Arch
    MENU LABEL Arch Linux
    SAY Now booting Arch Linux with Syslinux...
    LINUX ../vmlinuz-linux 
    APPEND root=/dev/mapper/vgroup-lvroot cryptdevice=/dev/md1:vgroup ro
    INITRD ../initramfs-linux.img

LABEL Fallback
    MENU LABEL Arch Linux Fallback
    LINUX ../vmlinuz-linux 
    APPEND root=/dev/mapper/vgroup-lvroot cryptdevice=/dev/md1:vgroup ro
    INITRD ../initramfs-linux-fallback.img

LABEL Reboot
        MENU LABEL Reboot
        COM32 reboot.c32

LABEL Poweroff
        MENU LABEL Power Off
        COMBOOT poweroff.com

Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB