https://wiki.archlinux.org/api.php?action=feedcontributions&user=Spaceone&feedformat=atomArchWiki - User contributions [en]2024-03-29T14:55:59ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=I3&diff=545337I32018-09-30T18:22:04Z<p>Spaceone: i3 source code link now points to the official repository.</p>
<hr />
<div>{{DISPLAYTITLE:i3}}<br />
[[Category:Tiling WMs]]<br />
[[Category:Dynamic WMs]]<br />
[[hu:I3]]<br />
[[ja:i3]]<br />
[[ko:I3]]<br />
[[ru:I3]]<br />
[[zh-hans:I3]]<br />
{{Related articles start}}<br />
{{Related|Comparison of tiling window managers}}<br />
{{Related|Window manager}}<br />
{{Related articles end}}<br />
[http://i3wm.org/ i3] is a dynamic [[Wikipedia:Tiling window manager|tiling window manager]] inspired by [[wmii]] that is primarily targeted at developers and advanced users.<br />
<br />
The stated goals for i3 include clear documentation, proper multi-monitor support, a tree structure for windows, and different modes like in [[vim]].<br />
<br />
== Installation ==<br />
<br />
i3 can be installed with the {{Pkg|i3-wm}} package.<br />
<br />
An {{Grp|i3}} [[package group]] is also available. It includes the window manager, a screen locker and two programs which write a status line to i3bar through [[Wikipedia:Standard streams#Standard output (stdout)|stdout]].<br />
<br />
{{Note|{{Pkg|i3-wm}} conflicts with {{Pkg|i3-gaps}} and by default {{Pkg|i3-gaps}} (a fork of i3 with gaps and other features) will be installed.}}<br />
<br />
Additional packages are available in the [[Arch User Repository]]. See [[#Patches]] for examples.<br />
<br />
== Starting ==<br />
<br />
=== From tty ===<br />
<br />
To start i3 with ''startx'', add {{ic|exec i3}} to {{ic|~/.xinitrc}}. See [[xinit]].<br />
<br />
=== Display manager ===<br />
<br />
{{Pkg|i3-wm}} includes {{ic|i3.desktop}} as [[Xsession]] which starts the window manager. {{ic|i3-with-shmlog.desktop}} enables logs (useful for debugging). {{AUR|i3-gnome}}/{{AUR|i3-gnome-git}} integrates {{ic|i3}} into [[GNOME]].<br />
<br />
== Usage ==<br />
<br />
See the [http://i3wm.org/docs official documentation] for more information, namely the [http://i3wm.org/docs/userguide.html i3 User’s Guide].<br />
<br />
=== Keybindings ===<br />
<br />
In i3, commands are invoked with a modifier key, referred to as {{ic|$mod}}. This is {{ic|Alt}} (Mod1) by default, with {{ic|Super}} (Mod4) being a popular alternative. Super is the key usually represented on a keyboard as a Windows icon, or on an Apple keyboard as a Command key.<br />
<br />
See the [http://i3wm.org/docs/refcard.html i3 reference card] and [http://i3wm.org/docs/userguide.html#_using_i3 Using i3] for the defaults. See [http://i3wm.org/docs/userguide.html#keybindings Keyboard bindings] to add new shortcuts.<br />
<br />
Users of non-Qwerty keyboard layouts may wish to circumvent the "configuration wizard" as [[#Configuration wizard and alternative keyboard layouts|described below]].<br />
<br />
=== Containers ===<br />
<br />
i3 manages windows in a tree structure, with containers as building blocks. This structure branches with horizontal or vertical splits. Containers are tiled by default, but can be set to tabbed or stacked layouts, as well as made floating (such as for dialog windows). Floating windows are always on top.<br />
<br />
See [http://i3wm.org/docs/userguide.html#_tree i3 Tree] and [http://www.youtube.com/watch?v=AWA8Pl57UBY Containers and the tree data structure] for details.<br />
<br />
=== Application launcher ===<br />
<br />
i3 uses [[dmenu]] as an application launcher, which is bound by default to {{ic|$mod+d}}. As it is an optional dependency {{Pkg|dmenu}} must first be installed before this functionality can be used.<br />
<br />
{{Pkg|i3-wm}} contains ''i3-dmenu-desktop'', a [[Wikipedia:Perl|Perl]] wrapper for ''dmenu'' which uses [[desktop entries]] to create a list of all installed applications. Alternatively, the package {{AUR|j4-dmenu-desktop-git}} can be used.<br />
<br />
== Configuration ==<br />
<br />
See [http://i3wm.org/docs/userguide.html#configuring Configuring i3] for details. The rest of this article assumes the ''i3'' configuration file to be in the folder {{ic|~/.config}}.<br />
<br />
=== Configuration wizard and alternative keyboard layouts ===<br />
<br />
When ''i3'' is first started, it offers to run the configuration wizard ''i3-config-wizard''. This tool creates {{ic|~/.config/i3/config}} by rewriting a template configuration file in {{ic|/etc/i3/config.keycodes}}. It makes two modifications to the default template: <br />
<br />
# It asks the user to choose a default modifier key, which it adds to the template as a single line, like {{ic|set $mod Mod1}}; and <br />
# it replaces all ''bindcode'' lines with ''bindsym'' lines corresponding to the user's current keyboard layout.<br />
<br />
Step 2 is designed to ensure that the four navigation shortcuts, {{ic|j}}, {{ic|k}}, {{ic|l}} and "semicolon" on a Qwerty keyboard, will be mapped to keysyms which have the same location, e.g. {{ic|h}}, {{ic|t}}, {{ic|n}}, {{ic|s}} on a [[Dvorak]] keyboard. The side-effect of this magic is that up to fifteen other keysyms may be remapped in ways which break the mnemonics - so that, for a Dvorak user, "restart" is bound to {{ic|$mod1+p}} instead of {{ic|$mod1+r}}, "split horizontally" is bound to {{ic|$mod1+d}} instead of {{ic|$mod1+h}}, and so on.<br />
<br />
Therefore, users of alternate keyboard layouts who want straightforward key bindings, which match the bindings given in tutorials, may prefer to circumvent the "config wizard". This can be done by just copying {{ic|/etc/i3/config}} into {{ic|~/.config/i3/config}} (or {{ic|~/.i3/config}}), and editing that file.<br />
<br />
Note that a keycode-based configuration is also possible, e.g. for users who often switch between keyboard layouts, but want the i3 bindings to stay the same.<br />
<br />
=== Colorschemes ===<br />
<br />
The configuration file allows for customization of window decoration colors, but the syntax makes it impractical to create or share themes. There are several projects which make this easier and include a variety of user-contributed themes.<br />
<br />
* {{App|j4-make-config|Merge your config with a collection of themes or personal config parts, for example host-specific configuration, allowing quick changing of the theme and flexible, dynamic customization of the configuration|https://github.com/okraits/j4-make-config|{{Aur|j4-make-config-git}}}}<br />
<br />
=== i3bar ===<br />
<br />
In addition to showing workspace information, i3bar can act as an input for i3status or an alternative, such as those mentioned in the next section. For example:<br />
<br />
{{hc|~/.config/i3/config|2=<br />
bar {<br />
output LVDS1<br />
status_command i3status<br />
position top<br />
mode hide<br />
workspace_buttons yes<br />
tray_output none<br />
<br />
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1<br />
<br />
colors {<br />
background #000000<br />
statusline #ffffff<br />
<br />
focused_workspace #ffffff #285577<br />
active_workspace #ffffff #333333<br />
inactive_workspace #888888 #222222<br />
urgent_workspace #ffffff #900000<br />
}<br />
}<br />
}}<br />
<br />
See the [http://i3wm.org/docs/userguide.html#_configuring_i3bar Configuring i3bar] for details.<br />
<br />
==== i3bar alternatives ====<br />
<br />
Some users may prefer panels such as those provided by conventional [[Desktop environment|Desktop Environments]]. This can be achieved within i3 by launching the panel application of choice during startup.<br />
<br />
For example, to use the [[Xfce]] panel ({{Pkg|xfce4-panel}}), add the following line anywhere in {{ic|~/.config/i3/config}}:<br />
<br />
exec --no-startup-id xfce4-panel --disable-wm-check<br />
<br />
i3bar can be disabled by commenting the {{ic|<nowiki>bar{ }</nowiki>}} section of {{ic|~/.config/i3/config}}, or defining a keybind to toggle the bar:<br />
<br />
{{hc|~/.config/i3/config|<br />
# bar toggle, hide or show <br />
bindsym $mod+m bar mode toggle<br />
}}<br />
<br />
=== i3status ===<br />
<br />
Copy over the default configuration files to the home directory:<br />
<br />
$ cp /etc/i3status.conf ~/.config/i3status/config<br />
<br />
Not all plugins are defined in the default configuration and some configuration values may be invalid for your system, so the need to be updated accordingly. See {{man|1|i3status}} for details.<br />
<br />
==== i3status replacements ====<br />
* {{App|[[conky]]| Highly extensible system monitor. For usage with i3bar see [http://i3wm.org/docs/user-contributed/conky-i3bar.html this tutorial] |https://github.com/brndnmtthws/conky|{{Pkg|conky}}}}<br />
* {{App|i3blocks|Extensible via shell scripts. It can handle click events, interrupts, and defining of refresh intervals on a per-block basis.|https://github.com/vivien/i3blocks|{{Pkg|i3blocks}}, {{AUR|i3blocks-git}} }}<br />
* {{App|i3pystatus|Extensible Python 3 status bar with many plugins and configuration options by default.|https://github.com/enkore/i3pystatus i3pystatus|{{AUR|i3pystatus-git}}}}<br />
* {{App|i3situation|Another Python 3 status bar generator.|https://github.com/HarveyHunt/i3situation|{{Aur|i3situation-git}}}}<br />
* {{App|j4status|Provides a statusline, configurable via plugins, and written in C. Extra plugins are provided by {{Aur|j4status-plugins-git}}.|http://j4status.j4tools.org/|{{Aur|j4status-git}}}}<br />
* {{App|goi3bar|i3status replacement written in Go. Configuration-file driven with several plugins, concurrency options, and rich plugin support.|https://github.com/denbeigh2000/goi3bar/|{{Aur|goi3bar-git}}}}<br />
* {{App|goblocks|Fast, lightweight i3status replacement written in Go.|https://github.com/davidscholberg/goblocks|{{Aur|goblocks}}}}<br />
* {{App|bumblebee-status|Theme-able Python status bar generator.|https://github.com/tobi-wan-kenobi/bumblebee-status|{{Aur|bumblebee-status}} {{Aur|bumblebee-status-git}}}}<br />
* {{App|ty3status|i3status replacement written in Typescript. Built with first class support for javascript blocks.|https://github.com/mrkmg/ty3status|{{Aur|ty3status-git}}}}<br />
* {{App|i3status-rust|Highly efficient and feature-rich replacement written in Rust. Can handle push updates, individual update intervals, theming and click events|https://github.com/greshake/i3status-rust|{{Aur|i3status-rust-git}}}}<br />
* {{App|polybar|A fast and easy-to-use tool for creating status bars.|https://github.com/jaagr/polybar|{{Aur|polybar}}}}<br />
* {{App|excalibar|Lightweight yet customizable status bar written in C.|https://github.com/cylgom/excalibar|{{Aur|excalibar-git}}}}<br />
<br />
==== i3status wrappers ====<br />
<br />
* {{App|i3cat|A [[go]] based wrapper which can concatenate inputs from multiple external sources. It can handle click events and forwarding user specified signals to its subprocesses.|http://vincent-petithory.github.io/i3cat/|{{AUR|i3cat-git}}}}<br />
* {{App|py3status|An extensible i3status wrapper written in Python.|https://github.com/ultrabug/py3status|{{Pkg|py3status}}}}<br />
* {{App|YaGoStatus|Yet Another i3status replacement written in Go.|https://github.com/burik666/yagostatus|{{Aur|yagostatus-git}}}}<br />
<br />
==== Iconic fonts in the status bar ====<br />
<br />
''i3bar'' can be [[#Patches|patched]] for XBM icon support, but you can use iconic font sets instead.<br />
<br />
* {{App|ttf-font-awesome|Scalable vector icons that can be customized with CSS. A [http://fortawesome.github.io/Font-Awesome/cheatsheet/ cheatsheet] shows the Unicode point for each glyph.|http://fortawesome.github.io/Font-Awesome/|{{Pkg|ttf-font-awesome}}}}<br />
* {{App|ttf-font-icons|Non-overlapping and consistently sized mix of Awesome and Ionicons. This also avoids minor overlapping between DejaVu Sans and Awesome.|http://kageurufu.net/icons.pdf|{{AUR|ttf-font-icons}}}}.<br />
* {{App|ttf-ionicons|The premium icon font for Ionic Framework.|https://ionicframework.com/docs/ionicons/|{{Pkg|ttf-ionicons}}}}.<br />
<br />
To combine fonts, define a font fallback sequence in your configuration file, separating fonts with {{ic|,}} like so:<br />
{{hc|~/.config/i3/config|2=<br />
bar {<br />
...<br />
font pango:DejaVu Sans Mono, Icons 8<br />
...<br />
}<br />
}}<br />
<br />
In accordance with [https://developer.gnome.org/pango/stable/pango-Fonts.html#pango-font-description-from-string pango syntax], font size is specified only once, at the end of the comma-separated list of font families. Setting a size for each font would cause all but the last font to be ignored.<br />
<br />
Add icons to the format strings in {{ic|~/.config/i3status/config}} using the unicode numbers given in the cheatsheets linked above. The input method will vary between text editors. For instance, to insert the "heart" icon (unicode number f004):<br />
<br />
{{Merge|Internationalization|Should be described in one place; see also [[ArchWiki:Requests#Input methods]].}}<br />
<br />
* in various gui text editors (e.g. [[gedit]], Leafpad) and terminals (e.g. GNOME Terminal, xfce4-terminal): {{ic|ctrl+shift+u}}, {{ic|f004}}, {{ic|Enter}}<br />
* in [[Emacs]]: {{ic|C-x}}, {{ic|8}}, {{ic|RET}}, {{ic|f004}}, {{ic|RET}}<br />
* in [[Vim]] (while in insert mode): {{ic|Ctrl+v}}, {{ic|uf004}}<br />
* in [[urxvt]]: while holding {{ic|Ctrl+Shift}}, type {{ic|f004}}<br />
<br />
=== Terminal emulator ===<br />
<br />
By default when pressing {{ic|$mod+Return}} it launches the {{ic|i3-sensible-terminal}} which is a script that invokes a terminal. See {{man|1|i3-sensible-terminal}} for the order terminals are invoked in.<br />
<br />
To instead launch a terminal of choice, modify this line in {{ic|~/.config/i3/config}}:<br />
<br />
bindsym $mod+Return exec i3-sensible-terminal<br />
<br />
Alternatively, set the {{ic|$TERMINAL}} [[environment variable]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Jump to open window ===<br />
<br />
*{{App|quickswitch-i3|Python utility to quickly change to and locate windows in i3|https://github.com/OliverUv/quickswitch-for-i3/|{{Aur|quickswitch-i3}}}}<br />
*{{App|i3-wm-scripts|search for and jump to windows with particular names matching regexp|https://github.com/yiuin/i3-wm-scripts||}}<br />
*{{App|winmenupy|Launches dmenu with a list of clients, sorted after workspaces. Selecting a client jumps to that window.|https://github.com/ziberna/i3-py/blob/master/examples/winmenu.py||}}<br />
*{{App|[[rofi]]|Search and jump to open and scratchpad window|https://davedavenport.github.io/rofi/|{{Pkg|rofi}}}}<br />
*{{App|i3-easyfocus|Focus and select windows in i3|https://github.com/cornerman/i3-easyfocus|{{Aur|i3-easyfocus-git}}}}<br />
*{{App|wmfocus|Focus and select windows in i3 and other window managers|https://github.com/svenstaro/wmfocus|{{Aur|wmfocus}}}}<br />
<br />
=== Jump to urgent window ===<br />
<br />
Add to {{ic|.i3/config}}: [https://faq.i3wm.org/question/853/how-to-jump-to-urgent-workspace/]<br />
<br />
bindsym $mod+x [urgent=latest] focus<br />
<br />
=== Save and restore the window layout ===<br />
<br />
From version 4.8, and onward ''i3'' can save and restore workspace layouts. To do this, the following packages are needed: {{Pkg|perl-anyevent-i3}} and {{Pkg|perl-json-xs}} from the [[official repositories]].<br />
<br />
{{note| This section only provides quick tutorial on how to save the current window layout of a single workspace and how to restore it for later use. Refer to the [http://i3wm.org/docs/layout-saving.html official documentation] for more details}}<br />
<br />
==== Save the current window layout of a single workspace ====<br />
<br />
To save the current window layout, follow these steps:<br />
<br />
# First, execute various commands to open windows in a preferred workspace and resize them if needed. Make sure to write down each executed command for each window.<br />
# Now, in a new workspace, open a terminal and run the following: {{bc|i3-save-tree --workspace N > ~/.i3/workspace_N.json}} where N is the number of the preferred workspace. This will save the current layout of workspace N to the file {{ic|~/.i3/workspace_N.json}}.<br />
# The newly created file needs to be edited, however this may be done with the following commands: {{bc|<nowiki>tail -n +2 ~/.i3/workspace_N.json | fgrep -v '// splitv' | sed 's|//||g' > ~/.i3/workspace_N.json</nowiki>}}<br />
<br />
==== Restore the window layout of the workspace ====<br />
<br />
There are two ways to restore the layout of the workspace: by writing a script, or by editing {{ic|~/.i3/config}} to automatically load the layout. In this section only the first case will be considered, refer to the [http://i3wm.org/docs/layout-saving.html#_restoring_the_layout official documentation] for the second case.<br />
<br />
To restore the saved layout in the previous section, write a file named {{ic|load_layout.sh}} with the following contents:<br />
<br />
* The starting lines:<br />
<br />
{{hc|head=~/load_layout.sh|output=<br />
#!/bin/bash<br />
i3-msg "workspace M; append_layout ~/.i3/workspace_N.json"<br />
}}<br />
<br />
where M is the number of the workspace in which you would like to load the previously saved layout and N is the number of workspace saved in the previous section.<br />
* And the commands used in the previous section to get the preferred windows, but enclosed in parentheses and with an ampersand appended before the last parentheses.<br />
<br />
For example, if the saved layout contained three {{ic|uxterm}} windows:<br />
<br />
{{hc|head=~/load_layout.sh|output=<br />
#!/bin/bash<br />
<br />
# First we append the saved layout of worspace N to workspace M<br />
i3-msg "workspace M; append_layout ~/.i3/workspace_N.json"<br />
<br />
# And finally we fill the containers with the programs they had<br />
(uxterm &)<br />
(uxterm &)<br />
(uxterm &)<br />
}}<br />
<br />
Then set the file as executable:<br />
<br />
chmod u+x ~/load_layout.sh<br />
<br />
And finally, the layout of worskpace N can be loaded onto to workspace M by running:<br />
<br />
~/load_layout.sh<br />
<br />
{{tip|Adding {{ic|bindsym $mod+g exec ~/load_layout.sh}} to {{ic|~/.i3/config}} and restarting i3 will bind Mod+g to run the above script.}}<br />
<br />
{{note|If the above script does not work properly, refer to the [http://i3wm.org/docs/layout-saving.html#_editing_layout_files official documentation]. The ''swallows'' sections of {{ic|~/.i3/workspace_N.json}} needs to be manually edited.}}<br />
<br />
=== Scratchpad containers ===<br />
<br />
By default, [http://i3wm.org/docs/userguide.html#_scratchpad scratchpads] only contain a single window. However, containers can also be made a scratchpad.<br />
<br />
Create a new container (for example, {{ic|Mod+Enter}}), split it ({{ic|Mod+v}}) and create another container. Focus the parent ({{ic|Mod+a}}), split in the opposite direction ({{ic|Mod+h}}), and create again. <br />
<br />
Focus the first container (with focus parent as needed), make the window floating ({{ic|Mod+Shift+Space}}), and move it to the scratchpad ({{ic|Mod+Shift+-}}). You can now split containers to preference.<br />
<br />
{{Note|Containers cannot be resized individually in floating windows. Resize the containers before making windows floating.}}<br />
{{Tip|When only using terminal applications, consider a multiplexer such as [[tmux]] instead.}}<br />
<br />
See also [https://faq.i3wm.org/question/138/multiple-scratchpad/i3] for multiple scratchpads.<br />
<br />
=== Screensaver and power management ===<br />
<br />
With [[Power management#xss-lock]] you can register a screenlocker for your i3 session. The {{ic|-time}} option with ''xautolock'' locks the screen after a given time period:<br />
<br />
xautolock -time 10 -locker "i3lock -i 'background_image.png'" &<br />
<br />
A [[systemd]] service file can be used to lock the screen before the system is being sent to sleep or hibernation state. See [[Power management#Suspend/resume service files]]. Note that i3lock requires the type of the service to be {{ic|forking}}.<br />
<br />
See also [[DPMS]].<br />
<br />
=== Shutdown, reboot, lock screen ===<br />
<br />
Key combinations for shutdown, reboot and screenlock can be added to {{ic|~/.config/i3/config}}. The below example assumes you have {{Pkg|polkit}} installed to allow unprivileged users to run [[systemd#Power_management|power management]] commands.<br />
<br />
{{bc|<br />
set $Locker i3lock && sleep 1<br />
<br />
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown<br />
mode "$mode_system" {<br />
bindsym l exec --no-startup-id $Locker, mode "default"<br />
bindsym e exec --no-startup-id i3-msg exit, mode "default"<br />
bindsym s exec --no-startup-id $Locker && systemctl suspend, mode "default"<br />
bindsym h exec --no-startup-id $Locker && systemctl hibernate, mode "default"<br />
bindsym r exec --no-startup-id systemctl reboot, mode "default"<br />
bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default" <br />
<br />
# back to normal: Enter or Escape<br />
bindsym Return mode "default"<br />
bindsym Escape mode "default"<br />
}<br />
<br />
bindsym $mod+Pause mode "$mode_system"<br />
}}<br />
<br />
Once completed, you will be presented with a prompt whenever you press {{ic|$mod+pause}}. For more complex behaviour, use a separate script, and refer to it in the mode. [https://gist.github.com/anonymous/c8cd0a59bf4acb273068]<br />
<br />
{{Note|1=<br><br />
* {{ic|sleep 1}} adds a small delay to prevent possible race conditions with suspend [https://bugs.launchpad.net/ubuntu/+source/unity-2d/+bug/830348]<br />
* The {{ic|-i}} argument for {{ic|systemctl poweroff}} causes a shutdown even if other users are logged-in (this requires {{Pkg|polkit}}), or when ''logind'' (wrongly) assumes so. [https://bugs.freedesktop.org/show_bug.cgi?id=62676]<br />
}}<br />
<br />
For a list of alternative screen lockers, see [[List of applications/Security#Screen lockers]].<br />
<br />
===External displays manual management===<br />
<br />
Thanks to [[xrandr]] there are many ways to easily manage systems displays. The below example integrates it in the i3 config file, and behave as the Power Management section above.<br />
<br />
Here a laptop with both VGA and HDMI outputs will use a menu selection to switch them On/Off:<br />
<br />
## Manual management of external displays<br />
# Set the shortcuts and what they do<br />
set $mode_display Ext Screen (v) VGA ON, (h) HDMI ON, (x) VGA OFF, (y) HDMI OFF<br />
mode "$mode_display" {<br />
bindsym v exec --no-startup-id xrandr --output VGA1 --auto --right-of LVDS1, mode "default"<br />
bindsym h exec --no-startup-id xrandr --output HDMI1 --auto --right-of LVDS1, mode "default"<br />
bindsym x exec --no-startup-id xrandr --output VGA1 --auto --off, mode "default"<br />
bindsym y exec --no-startup-id xrandr --output HDMI1 --auto --off, mode "default"<br />
<br />
# back to normal: Enter or Escape<br />
bindsym Return mode "default"<br />
bindsym Escape mode "default"<br />
}<br />
# Declare here the shortcut to bring the display selection menu<br />
bindsym $mod+x mode "$mode_display"<br />
<br />
Any window that is still open in a switched Off display will automatically come back to the remaining active display.<br />
<br />
The simplest way to determine names of your devices is to plug the device you wish to use and run:<br />
<br />
$ xrandr --query<br />
<br />
which will output the available, recognized devices and their in-system names to set your config file appropriately. <br />
<br />
Refer to the [[xrandr]] page or man page for the complete list of available options, the [http://i3wm.org/docs/userguide.html i3 userguide] and/or the [https://www.reddit.com/r/i3wm i3 FAQ on reddit] for more info.<br />
<br />
=== Tabbed or stacked web-browsing ===<br />
<br />
Some web-browsers intentionally do not implement tabs, since managing tabs is considered to be the task of the window manager, not the task of the browser.<br />
<br />
To let i3 manage your tab-less web-browser, in this example for [[uzbl]], add the following line to your {{ic|~/.config/i3/config}}<br />
<br />
for_window [class="Uzbl-core"] focus child, layout stacking, focus<br />
<br />
This is for stacked web browsing, meaning that the windows will be shown vertically. The advantage over tabbed browsing is that the window-titles are fully visible, even if a lot of browser windows are open.<br />
<br />
If you prefer tabbed browsing, with windows in horizontal direction ('tabs'), use<br />
<br />
for_window [class="Uzbl-core"] focus child, layout tabbed, focus<br />
<br />
=== Workspace variables ===<br />
<br />
As workspaces are defined multiple times in i3, assigning workspace variables can be helpful. For example:<br />
<br />
set $WS1 term<br />
set $WS2 web<br />
set $WS3 misc<br />
set $WS4 media<br />
set $WS5 code<br />
<br />
Then replace workspace names with their matching variables:<br />
<br />
bindsym $mod+1 workspace $WS1<br />
...<br />
bindsym $mod+Shift+1 move container to workspace $WS1<br />
<br />
See [http://i3wm.org/docs/userguide.html#_changing_named_workspaces_moving_to_workspaces Changing named workspaces] for more information.<br />
<br />
=== Correct handling of floating dialogs ===<br />
<br />
While dialogs should open in floating mode by default [http://i3wm.org/docs/userguide.html#_floating], many still open in tiling mode. To change this behaviour, check the dialog's {{ic|WM_WINDOW_ROLE}} with {{pkg|xorg-xprop}} and add the correct rules to {{ic|~/.i3/config}} (using [http://www.pcre.org/ pcre] syntax):<br />
<br />
for_window [window_role="pop-up"] floating enable<br />
for_window [window_role="task_dialog"] floating enable<br />
<br />
You can also use title rules and regular expressions:<br />
<br />
for_window [title="Preferences$"] floating enable<br />
<br />
or {{ic|WM_CLASS}}:<br />
<br />
for_window [class="(?i)mplayer"] floating enable<br />
<br />
=== Network Download/Upload speed in statusbar ===<br />
<br />
You might adapt this upstream [http://code.stapelberg.de/git/i3status/tree/contrib/net-speed.sh script]. For that,<br />
<br />
* rename both network cards according to your system (use {{ic|ip addr}})<br />
* find them on {{ic|/sys/devices}} then replace them appropriately:<br />
$ find /sys/devices -name ''network_interface''<br />
<br />
{{Tip|Use {{ic|/sys/class/net/''interface''/statistics/}} to not depend on PCI location.}}<br />
<br />
Now, just save the script in a suitable place (for example {{ic|~/.config/i3}}) and point your status program to it.<br />
<br />
== Patches ==<br />
<br />
{{Merge|#Installation|One package does not warrant a separate section}}<br />
<br />
Packages with patches not merged upstream are available in the [[AUR]]:<br />
<br />
* {{App|i3-wm-iconpatch|Titlebar icon support|https://github.com/ashinkarov/i3-extras|{{AUR|i3-wm-iconpatch}}}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== General ===<br />
<br />
In many cases, bugs are fixed in the development versions {{AUR|i3-git}} and {{AUR|i3status-git}}, and upstream will ask to reproduce any errors with this version. [http://i3wm.org/docs/debugging.html] See also [[Debug - Getting Traces#General]].<br />
<br />
=== Buttons in the i3 message bar do not work ===<br />
<br />
Buttons such as "Edit config" in {{ic|i3-nagbar}} call {{ic|i3-sensible-terminal}}, so make sure your [[#Terminal_emulator|Terminal emulator]] is recognized by i3.<br />
<br />
=== Faulty line wraps in tiled terminals ===<br />
<br />
i3 v4.3 and higher ignore size increment hints for tiled windows [https://www.mail-archive.com/i3-discuss@i3.zekjur.net/msg00709.html]. This may cause terminals to wrap lines prematurely, amongst other issues. As a workaround, make the offending window floating, before tiling it again.<br />
<br />
=== Mouse cursor remains in waiting mode ===<br />
<br />
When starting a script or application which does not support startup notifications, the mouse cursor will remain in busy/watch/clock mode for 60 seconds.<br />
<br />
To solve this for a particlar application, use the {{ic|--no-startup-id}} parameter, for example:<br />
exec --no-startup-id ~/script<br />
bindsym $mod+d exec --no-startup-id dmenu_run<br />
<br />
To disable this animation globally, see [[Cursor themes#Create links to missing cursors]].<br />
<br />
=== Unresponsive key bindings ===<br />
<br />
Some tools such as [[Taking_a_screenshot#scrot|scrot]] may not work when used with a regular key binding (executed after key press). In those cases, execute commands after key release with the {{ic|--release}} argument [http://i3wm.org/docs/userguide.html#keybindings]:<br />
<br />
bindsym --release Print exec --no-startup-id scrot<br />
bindsym --release Shift+Print exec --no-startup-id scrot -s<br />
<br />
=== Tearing ===<br />
<br />
i3 does [https://github.com/i3/i3/issues/661 not properly implement double buffering] hence tearing or flickering may occur. To prevent this, install and configure [[compton]]. [https://faq.i3wm.org/question/3279/do-i-need-a-composite-manager-compton.1#post-id-3282]<br />
<br />
=== Tray icons not visible ===<br />
<br />
The {{ic|tray_output primary}} directive may require setting a primary output with ''xrandr'', specifying the output explicitly or simply removing this directive. [https://github.com/i3/i3/issues/1144] See [[Xrandr]] for details. The default configuration created by i3-config-wizard no longer adds this directive to the configuration from i3 4.12.<br />
<br />
=== Default workspace for Spotify ===<br />
To assign a default workspace for spotify windows one cannot use the standard route with {{ic|assign}} and should rather use a {{ic|for_window}} command, such as<br />
{{hc|~/.config/i3/config|2=<br />
...<br />
for_window [class="Spotify"] move to workspace $ws10<br />
}}<br />
<br />
== See also ==<br />
<br />
* [http://i3wm.org Official website]<br />
* [http://www.funtoo.org/I3_Tiling_Window_Manager funtoo Wiki]<br />
* [https://github.com/i3/i3 i3 Source code]<br />
* [https://github.com/ashinkarov/i3-extras i3-extras] - Collection of scripts and patches<br />
* [https://github.com/acrisci/i3ipc-glib i3ipc-glib] - A library for i3 extensions<br />
* [https://github.com/veelenga/i3ipc-ruby i3ipc-ruby] - An improved library for i3 extensions in Ruby<br />
* [https://j4tools.github.io/ j4tools] - non-official tools designed to work with i3<br />
<br />
'''Arch Linux Forums'''<br />
* [https://bbs.archlinux.org/viewtopic.php?id=99064 The i3 thread] - A general discussion about i3<br />
* [https://bbs.archlinux.org/viewtopic.php?id=103369 i3 desktop screenshots and config sharing]<br />
<br />
'''Screencasts'''<br />
* [http://www.youtube.com/watch?v=Wx0eNaGzAZU i3 window manager v4.1 screencast]<br />
* [https://www.youtube.com/watch?v=j1I63wGcvU4&index=1&list=PL5ze0DjYv5DbCv9vNEzFmP6sU7ZmkGzcf i3 window manager v4.1X screencasts]</div>Spaceonehttps://wiki.archlinux.org/index.php?title=Syslinux&diff=432255Syslinux2016-04-23T01:03:46Z<p>Spaceone: /* Keyboard layout */ Fix path</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[es:Syslinux]]<br />
[[fr:Syslinux]]<br />
[[it:Syslinux]]<br />
[[ja:Syslinux]]<br />
[[ru:Syslinux]]<br />
[[tr:Syslinux]]<br />
[[zh-CN:Syslinux]]<br />
{{Related articles start}}<br />
{{Related|Arch boot process}}<br />
{{Related|Boot loaders}}<br />
{{Related articles end}}<br />
<br />
[[Wikipedia:SYSLINUX|Syslinux]] is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the [[Wikipedia:File Allocation Table|FAT]], [[Wikipedia:ext2|ext2]], [[ext3]], [[ext4]], and [[Btrfs]] [[file systems]].<br />
<br />
{{Note|Syslinux cannot access files from partitions other than its own. For an alternative bootloader with the multifs feature see [[GRUB]].}}<br />
<br />
== BIOS Systems ==<br />
<br />
=== Boot process overview ===<br />
<br />
# '''Stage 1 : Part 1''' - '''Load MBR''' - At boot, the BIOS loads the 440 byte [[MBR]] boot code at the start of the disk ({{ic|/usr/lib/syslinux/bios/mbr.bin}} or {{ic|/usr/lib/syslinux/bios/gptmbr.bin}}). <br />
# '''Stage 1 : Part 2''' - '''Search active partition'''. The '''Stage 1 MBR boot code''' looks for the partition that is marked as active (boot flag in MBR disks). Let us assume this is the {{ic|/boot}} partition for example.<br />
# '''Stage 2 : Part 1''' - '''Execute volume boot record''' - The '''Stage 1 MBR boot code''' executes the Volume Boot Record (VBR) of the {{ic|/boot}} partition. In the case of Syslinux, the VBR boot code is the starting sector of {{ic|/boot/syslinux/ldlinux.sys}} which is created by the {{ic|extlinux --install}} command. Note {{ic|ldlinux.sys}} is not same as {{ic|ldlinux.c32}}.<br />
# '''Stage 2 : Part 2''' - '''Execute {{ic|/boot/syslinux/ldlinux.sys}}''' - The VBR will load the rest of {{ic|/boot/syslinux/ldlinux.sys}}. The sector location of {{ic|/boot/syslinux/ldlinux.sys}} should not change, otherwise syslinux will not boot. {{Note|In the case of [[Btrfs]], the above method will not work since files move around resulting in changing of the sector location of {{ic|ldlinux.sys}}. Therefore, in BTRFS the entire {{ic|ldlinux.sys}} code is embedded in the space following the VBR and is not installed at {{ic|/boot/syslinux/ldlinux.sys}} unlike the case of other filesystems.}}<br />
# '''Stage 3''' - '''Load {{ic|/boot/syslinux/ldlinux.c32}}''' - The {{ic|/boot/syslinux/ldlinux.sys}} will load the {{ic|/boot/syslinux/ldlinux.c32}} (core module) that contains the rest of the '''core''' part of syslinux that could not be fit into {{ic|ldlinux.sys}} (due to file-size constraints). The {{ic|ldlinux.c32}} file should be present in every Syslinux installation and should match the version of {{ic|ldlinux.sys}} installed in the partition. Otherwise Syslinux will fail to boot. See http://bugzilla.syslinux.org/show_bug.cgi?id=7 for more info.<br />
# '''Stage 4''' - '''Search and Load configuration file''' - Once Syslinux is fully loaded, it looks for {{ic|/boot/syslinux/syslinux.cfg}} (or {{ic|/boot/syslinux/extlinux.conf}} in some cases) and loads it if it is found. If no configuration file is found, you will be dropped to a Syslinux {{ic|boot:}} prompt. This step and the rest of '''non-core''' parts of Syslinux ({{ic|/boot/syslinux/*.c32}} modules, excluding {{ic|lib*.c32}} and {{ic|ldlinux.c32}}) require {{ic|/boot/syslinux/lib*.c32}} (library) modules to be present (http://www.syslinux.org/wiki/index.php/Common_Problems#ELF). The {{ic|lib*.c32}} library modules and non-core {{ic|*.c32}} modules should match the version of {{ic|ldlinux.sys}} installed in the partition.<br />
<br />
=== Installation on BIOS ===<br />
<br />
[[Install]] the {{Pkg|syslinux}} package.<br />
<br />
{{Note|<br />
* {{Pkg|gptfdisk}} is required for [[wikipedia:GUID_Partition_Table|GPT]] support using the automated script.<br />
* If your boot partition is FAT, you will also need {{Pkg|mtools}}.<br />
}}<br />
<br />
Installing the package is not the same as installing the bootloader. After installing the relevant package(s), the bootloader code itself needs to be installed (to the adequate area, usually the VBR) so to be able to boot the system; the following sections provide alternative instructions depending on the characteristics of your particular system.<br />
<br />
==== Automatic Install ====<br />
<br />
{{Note|The {{ic|syslinux-install_update}} script is Arch specific, and is not provided/supported by Syslinux upstream. Please direct any bug reports specific to the script to the Arch Bug Tracker and not upstream.<br />
}}<br />
<br />
* After executing the {{ic|syslinux-install_update}} script, do not forget to edit {{ic|/boot/syslinux/syslinux.cfg}} by following [[#Configuration]] and [[#Kernel parameters]].<br />
<br />
{{Warning|The {{ic|syslinux-install_update}} script sets a default root partition that possibly will not match your particular system. It is important to point Syslinux to the correct root partition by editing {{ic|/boot/syslinux/syslinux.cfg}}, or the OS will fail to boot. See [[#Kernel parameters]].}}<br />
<br />
The {{ic|syslinux-install_update}} script will install Syslinux, copy {{ic|*.c32}} modules to {{ic|/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:<br />
<br />
If you use a separate boot partition make sure that it is mounted. Check with {{ic|lsblk}}; if you do not see a {{ic|/boot}} mountpoint, mount it before you go any further.<br />
<br />
* Run {{ic|syslinux-install_update}} with flags: {{ic|-i}} (install the files), {{ic|-a}} (mark the partition ''active'' with the ''boot'' flag), {{ic|-m}} (install the ''MBR'' boot code): {{bc|# syslinux-install_update -i -a -m}} If this command fails with ''Syslinux BIOS install failed'', the problem is likely that the {{ic|extlinux}} binary could not find the partition containing {{ic|/boot}}: <br />
<br />
{{hc|# extlinux --install /boot/syslinux/|<br />
extlinux: cannot find device for path /boot/syslinux<br />
extlinux: cannot open device (null)<br />
}} <br />
<br />
This can happen for example when upgrading from [[LILO]] which, while booting a current custom kernel, turned a kernel command line parameter of say {{ic|1=root=/dev/sda1}} into its numeric equivalent {{ic|1=root=801}}, as evidenced by {{ic|/proc/cmdline}} and the output of the {{ic|mount}} command. Remedy the situation by either continuing with the manual install described below while specifying {{ic|1=--device=/dev/sda1}} to {{ic|extlinux}}, or simply by first rebooting into a stock Arch Linux kernel; its use of an initramfs avoids the problem.<br />
<br />
{{Note|<br />
* When you reboot your system now, you will have a Syslinux prompt. To automatically boot your system or get a boot menu, you still need to create a configuration file.<br />
* If you are on another root directory (e.g. from an install disk) install SYSLINUX by directing to the chroot:<br />
# syslinux-install_update -i -a -m -c /mnt/<br />
}}<br />
<br />
* Now is the time to edit {{ic|/boot/syslinux/syslinux.cfg}} by following [[#Configuration]] and [[#Kernel parameters]].<br />
<br />
==== Manual install ====<br />
<br />
{{Note|<br />
* If you are unsure of which partition table you are using (MBR or GPT), you can check using the following command<br />
# blkid -s PTTYPE -o value /dev/sda<br />
gpt<br />
<br />
* If you are trying to rescue an installed system with a live CD, be sure to [[chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not {{ic|/dev/}} paths) with the mount point.<br />
}}<br />
<br />
Your boot partition, on which you plan to install Syslinux, must contain a FAT, ext2, ext3, ext4, or Btrfs file system. You should install it on a mounted directory—not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}}. You can install Syslinux in the {{ic|syslinux}} directory:<br />
<br />
# mkdir /boot/syslinux<br />
# cp -r /usr/lib/syslinux/bios/*.c32 /boot/syslinux/ ## copy ALL the *.c32 files from /usr/lib/syslinux/bios/, DO NOT SYMLINK<br />
# extlinux --install /boot/syslinux/<br />
<br />
After this, proceed to install the Syslinux boot code ({{ic|mbr.bin}} or {{ic|gptmbr.bin}}) to the Master Boot Record 440-byte boot code region (not to be confused with MBR aka msdos partition table) of the disk, as described in the next sections, respectively.<br />
<br />
{{Note|For a partitionless install, there is no need to install the Syslinux boot code to the MBR. See [https://unix.stackexchange.com/questions/103501/boot-partiotionless-disk-with-syslinux].}}<br />
<br />
===== MBR partition table =====<br />
<br />
See the main article: [[Master Boot Record]].<br />
<br />
Next you need to mark your boot partition as "active" in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|parted/gparted}} ("boot" flag). It should look like this:<br />
{{hc|# fdisk -l /dev/sda|<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
}}<br />
<br />
Install the MBR:<br />
# dd bs=440 count=1 if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sda<br />
<br />
An alternative MBR which Syslinux provides is: {{ic|altmbr.bin}}. This MBR does ''not'' scan for bootable partitions; instead, the last byte of the MBR is set to a value indicating which partition to boot from. Here is an example of how {{ic|altmbr.bin}} can be copied into position:<br />
# printf '\x5' | cat /usr/lib/syslinux/bios/altmbr.bin - | dd bs=440 count=1 iflag=fullblock of=/dev/sda<br />
<br />
In this case, a single byte of value 5 (hexadecimal) is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device {{ic|sda}}. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.<br />
<br />
===== GUID partition table =====<br />
<br />
See the main article: [[GUID Partition Table]].<br />
<br />
Bit 2 of the attributes ("legacy_boot" attribute) needs to be set for the {{ic|/boot}} partition:.<br />
# sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute ''legacy BIOS bootable'' on partition 1. To check:<br />
{{hc|<nowiki># sgdisk /dev/sda --attributes=1:show</nowiki>|<br />
1:2:1 (legacy BIOS bootable)<br />
}}<br />
<br />
Install the MBR:<br />
# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/bios/gptmbr.bin of=/dev/sda<br />
<br />
If this does not work you can also try:<br />
# syslinux-install_update -i -m<br />
<br />
== UEFI Systems ==<br />
<br />
{{Note|<br />
*{{ic|$esp}} is the mountpoint of the [[ESP]] (EFI System Partition) in the below commands.<br />
<br />
* {{ic|efi64}} denotes x86_64 UEFI systems, for IA32 (32-bit) EFI replace {{ic|efi64}} with {{ic|efi32}} in the below commands.<br />
<br />
* For Syslinux, the kernel and initramfs files need to be in the ESP, as Syslinux does not (currently) have the ability to access files outside its own partition (i.e. outside ESP in this case). For this reason, it is recommended to mount ESP at {{ic|/boot}}.<br />
<br />
* The automatic install script {{ic|/usr/bin/syslinux-install_update}} does not support UEFI install.<br />
<br />
* The configuration syntax of {{ic|syslinux.cfg}} for UEFI is same as that of BIOS.<br />
}}<br />
<br />
=== Limitations of UEFI Syslinux ===<br />
<br />
* UEFI Syslinux application {{ic|syslinux.efi}} cannot be signed by {{ic|sbsign}} (from sbsigntool) for UEFI Secure Boot. Bug report - http://bugzilla.syslinux.org/show_bug.cgi?id=8<br />
<br />
* Using TAB to edit kernel parameters in UEFI Syslinux menu might lead to garbaged display (text on top of one-another). Bug report - http://bugzilla.syslinux.org/show_bug.cgi?id=9<br />
<br />
* UEFI Syslinux does not support chainloading other EFI applications like {{ic|UEFI Shell}} or {{ic|Windows Boot Manager}}. Enhancement request - http://bugzilla.syslinux.org/show_bug.cgi?id=17<br />
<br />
* In some cases, UEFI Syslinux might not boot in some Virtual Machines like QEMU/OVMF or VirtualBox or some VMware products/versions and in some UEFI emulation environments like DUET. A Syslinux contributor has confirmed no such issues present on VMware Workstation 10.0.2 and Syslinux-6.02 or later. Bug reports - http://bugzilla.syslinux.org/show_bug.cgi?id=21 and http://bugzilla.syslinux.org/show_bug.cgi?id=23<br />
<br />
* Memdisk is not available for UEFI. Enhancement request - http://bugzilla.syslinux.org/show_bug.cgi?id=30<br />
<br />
=== Installation on UEFI ===<br />
<br />
* Install the {{Pkg|syslinux}} and {{Pkg|efibootmgr}} packages from the [[official repositories]]. Then setup Syslinux in the EFI System Partition (ESP) as follows:<br />
<br />
* Copy Syslinux files to ESP (replace {{ic|$esp}} by the mount point of the ESP, usually {{ic|/boot}}):<br />
<br />
# mkdir -p $esp/EFI/syslinux<br />
# cp -r /usr/lib/syslinux/efi64/* $esp/EFI/syslinux/<br />
<br />
* Setup boot entry for Syslinux using [[Unified Extensible Firmware Interface#efibootmgr|efibootmgr]]:<br />
<br />
# efibootmgr -c -d /dev/sdX -p Y -l /EFI/syslinux/syslinux.efi -L "Syslinux"<br />
<br />
where {{ic|/dev/sdXY}} is the partition containing the bootloader.<br />
<br />
* Create or edit {{ic|$esp/EFI/syslinux/syslinux.cfg}} by following [[#Configuration]].<br />
<br />
{{Note|The config file for UEFI is {{ic|$esp/EFI/syslinux/syslinux.cfg}}, not {{ic|/boot/syslinux/syslinux.cfg}}. Files in {{ic|/boot/syslinux/}} are BIOS specific and not related to UEFI Syslinux.}}<br />
<br />
== Configuration ==<br />
<br />
The Syslinux configuration file, {{ic|syslinux.cfg}}, should be created in the same directory where you installed Syslinux. In our case, {{ic|/boot/syslinux/}} for BIOS systems and {{ic|$esp/EFI/syslinux/}} for UEFI systems.<br />
<br />
The bootloader will look for either {{ic|syslinux.cfg}} (preferred) or {{ic|extlinux.conf}}<br />
<br />
{{Tip|<br />
* Instead of {{ic|LINUX}}, the keyword {{ic|KERNEL}} can also be used. {{ic|KERNEL}} tries to detect the type of the file, while {{ic|LINUX}} always expects a Linux kernel. <br />
* {{ic|TIMEOUT}} value is in units of '''0.1 seconds'''.<br />
}}<br />
<br />
=== Examples ===<br />
<br />
{{Note|<br />
* Any configuration file found in the examples needs to be edited to set the proper kernel parameters. See section [[#Kernel parameters]].<br />
* Please, pay close attention to the paths. The examples may not be suitable for your installation, especially when using UEFI.<br />
}}<br />
<br />
==== Boot prompt ====<br />
This is a simple configuration file that will show a {{ic|boot:}} prompt and automatically boot after 5 seconds. If you want to boot directly without seeing a prompt, set {{ic|PROMPT}} to {{ic|0}}.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
==== Text boot menu ====<br />
<br />
Syslinux also allows you to use a boot menu. To use it, copy the {{ic|menu}} module to your Syslinux directory:<br />
# cp /usr/lib/syslinux/bios/menu.c32 /boot/syslinux/<br />
<br />
Copying additional {{ic|lib*.c32}} library modules might be needed too.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
For more details about the menu system, see [http://www.syslinux.org/wiki/index.php/Menu the Syslinux wiki].<br />
<br />
==== Graphical boot menu ====<br />
<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the {{ic|vesamenu}} COM32 module to your Syslinux folder:<br />
# cp /usr/lib/syslinux/bios/vesamenu.c32 /boot/syslinux/<br />
<br />
Copying additional {{ic|lib*.c32}} library modules might be needed too.<br />
<br />
{{Note| If you are using [[UEFI]] make sure to copy from {{ic|/usr/lib/syslinux/efi64/}} ({{ic|efi32}} for i686 systems), otherwise you will be presented with a black screen. In that case, boot from a live medium and use [[chroot]] to make the appropriate changes.}}<br />
<br />
This configuration uses the same menu design as the Arch Install CD, its config can be found at [https://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux projects.archlinux.org]. The [https://projects.archlinux.org/archiso.git/plain/configs/releng/syslinux/splash.png Arch Linux background image] can be downloaded from there, too. Copy the image to {{ic|/boot/syslinux/splash.png}}.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
Since Syslinux 3.84, {{ic|vesamenu.c32}} supports the {{ic|MENU RESOLUTION $WIDTH $HEIGHT}} directive.<br />
To use it, insert {{ic|MENU RESOLUTION 1440 900}} into your config for a 1440x900 resolution.<br />
However, the background picture has to have exactly the right resolution, as Syslinux will otherwise refuse to load the menu.<br />
<br />
To center the menu and adjust resolution, use {{ic|MENU RESOLUTION}}, {{ic|MENU HSHIFT $N}} and {{ic|MENU VSHIFT $N}} where {{ic|$N}} is a positive number. The default values are both {{ic|0}} which is the upper-left hand corner of your monitor. Conversely, a negative number starts from the opposite end of the screen (e.g. {{ic|VHSHIFT -4}} would be 4 rows from the bottom of the screen).<br />
<br />
To move the menu to the center, add or edit these values:<br />
<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
MENU RESOLUTION 800 600 # or whatever your screen resolution is<br />
MENU WIDTH 78 # width of the menu also required to bring the menu box to size<br />
MENU VSHIFT 10 # moves menu down<br />
MENU HSHIFT 10 # moves menu right<br />
</nowiki><br />
}}<br />
<br />
VESA standards are commonly a maximum of 25 rows and 80 columns, so going higher than those values might move the menu off the screen, potentially requiring editing from a rescue CD.<br />
<br />
=== Kernel parameters ===<br />
<br />
The [[kernel parameters]] are set using the {{ic|APPEND}} line in {{ic|syslinux.cfg}}. It is recommended to make the following changes for the fallback entry as well.<br />
<br />
'''In the simplest case''', the partition name in the {{ic|root}} parameter needs to be replaced. Change {{ic|/dev/sda2}} to point to the correct root partition.<br />
<br />
APPEND root=/dev/sda2<br />
<br />
'''If you want to use [[UUID]]''' for [[persistent block device naming]] change the {{ic|APPEND}} line as follows, substituting {{ic|1234}} with the {{ic|UUID}} of your root partition:<br />
<br />
APPEND root=UUID=''1234'' rw<br />
<br />
'''If you use encryption''' [[LUKS]] change the {{ic|APPEND}} line to use your encrypted volume:<br />
<br />
APPEND root=/dev/mapper/''group''-''name'' cryptdevice=/dev/sda2:''name'' rw<br />
<br />
'''If you are using software''' [[Wikipedia:RAID|RAID]] using [http://neil.brown.name/blog/mdadm mdadm], change the {{ic|APPEND}} line to accommodate your RAID arrays. As an example the following accommodates three RAID 1 arrays and sets the appropriate one as root:<br />
<br />
APPEND root=/dev/md1 rw md=0,/dev/sda2,/dev/sdb2 md=1,/dev/sda3,/dev/sdb3 md=2,/dev/sda4,/dev/sdb4<br />
<br />
If booting from a software raid partition fails using the kernel device node method above an alternative, a more reliable, way is to use partition labels:<br />
<br />
APPEND root=LABEL=THEROOTPARTITIONLABEL rw<br />
<br />
'''If booting a [[btrfs]] subvolume''', amend the {{ic|APPEND}} line with {{ic|rootflags<nowiki>=</nowiki>subvol<nowiki>=</nowiki><root subvolume>}}. For example, where {{ic|/dev/sda2}} has been mounted as a btrfs subvolume called 'ROOT' (e.g. {{ic|mount -o noatime,subvol<nowiki>=</nowiki>ROOT /dev/sda2 /mnt}}), then the {{ic|APPEND}} line would need to be modified as follows:<br />
APPEND root=/dev/sda2 rw rootflags=subvol=ROOT<br />
<br />
A failure to do so will otherwise result in the following error message: {{ic|ERROR: Root device mounted successfully, but /sbin/init does not exist.}}<br />
<br />
=== Auto boot ===<br />
<br />
If you do not want to see the Syslinux menu at all, use the [[#Boot prompt]], and set {{ic|PROMPT}} to {{ic|0}} and comment out any {{ic|UI}} menu entries. Setting the {{ic|TIMEOUT}} variable to {{ic|0}} might also be a good idea. Make sure there is a {{ic|DEFAULT}} set in your {{ic|syslinux.cfg}}.<br />
<br />
=== Security ===<br />
<br />
Syslinux has two levels of bootloader security: a menu master password, and a per-menu-item password. In {{ic|syslinux.cfg}}, use<br />
{{bc|<br />
MENU MASTER PASSWD passwd <br />
}}<br />
to set a master bootloader password, and<br />
{{bc|<br />
MENU PASSWD passwd <br />
}}<br />
within a {{ic|LABEL}} block to password-protect individual boot items.<br />
<br />
The passwd can be either a cleartext password or hashed: [http://www.syslinux.org/wiki/index.php/Comboot/menu.c32 see official documentation].<br />
<br />
=== Chainloading ===<br />
<br />
{{Note|Syslinux BIOS cannot directly chainload files from other partitions; however, {{ic|chain.c32}} can boot a partition boot sector (VBR).}}<br />
<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy the {{ic|chain.c32}} module to the Syslinux directory (additional {{ic|lib*.c32}} library modules might be needed too; for details, see the instructions in the previous section). Then create a section in the configuration file:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
...<br />
}}<br />
<br />
{{ic|hd0 3}} is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. <br />
<br />
{{note|For Windows, this skips the system's own boot manager ({{ic|bootmgr}}), which is required for a few important updates ([http://support.microsoft.com/kb/2883200 eg.]) to complete. In such cases it may be advisable to temporarily set the MBR boot flag to the Windows partition (eg. with [[GParted]]), let the update finish installing, and then reset the flag to the Syslinux partition (eg. with Windows's own [http://www.online-tech-tips.com/computer-tips/set-active-partition-vista-xp DiskPart]).}}<br />
<br />
If you are unsure about which drive your BIOS thinks is "first", you can instead use the MBR identifier, or if you are using GPT, the filesystem labels. To use the MBR identifier, run the command<br />
{{hc|# fdisk -l /dev/sdb|<nowiki><br />
Disk /dev/sdb: 128.0 GB, 128035676160 bytes <br />
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0xf00f1fd3<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sdb1 2048 4196351 2097152 7 HPFS/NTFS/exFAT<br />
/dev/sdb2 4196352 250066943 122935296 7 HPFS/NTFS/exFAT</nowiki><br />
}}<br />
<br />
replacing {{ic|/dev/sdb}} with the drive you wish to chainload. Using the hexadecimal number under Disk identifier: {{ic|0xf00f1fd3}} in this case, the syntax in {{ic|syslinux.cfg}} is<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xf00f1fd3<br />
...<br />
}}<br />
<br />
For more details about chainloading, see [http://www.syslinux.org/wiki/index.php/Comboot/chain.c32 the Syslinux wiki].<br />
<br />
If you have [[GRUB]] installed on the same partition, you can chainload it by using: <br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
...<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
...</nowiki><br />
}}<br />
Alternatively, it is also possible to load [[GRUB]] as a linux kernel by prepending {{ic|lnxboot.img}} to {{ic|core.img}}. The file {{ic|lnxboot.img}} is part of {{ic|core/grub}} and can be found in {{ic|/usr/lib/grub/i386-pc}}.<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
...<br />
LABEL grub2lnx<br />
MENU LABEL Grub2 (lnxboot)<br />
LINUX ../grub/i386-pc/lnxboot.img<br />
INITRD ../grub/i386-pc/core.img<br />
...</nowiki><br />
}}<br />
This may be required for booting from ISO images.<br />
<br />
=== Chainloading other Linux systems ===<br />
{{Accuracy|Among other inaccuracies... 1_ There is no obligation to install yet another boot loader if you already have one related to the other partition/OS (e.g. GRUB2 installed in the MBR or in the VBR of the partition being chainloaded to). 2_ Syslinux (in any of its derivatives) is never "installed to the MBR", so mentioning the MBR in this section without any explanation of what it is being meant or how to do it in practical terms is just adding confusion. 3_ Typos and misspelling. 4_No need to explain (yet again) how to install some (other) bootloader to some (other) partition / OS; just how to chainload from Syslinux to that other partition / bootloader / OS.}}<br />
Chainloading another bootloader such as Windows' is pretty obvious, as there is a definite bootloader to chain to. But with Syslinux, it is only able to load files residing on the same partition as the configuration file. Thus, if you have another version of Linux on a separate partition, without a shared {{ic|/boot}}, it becomes ''necessary'' to employ EXTLINUX rather than the other OS's default bootloader (eg. GRUB2). Essentially, EXTLINUX can be installed on the partition superblock/[[wikipedia:Volume_boot_record|VBR]] and be called as a ''separate bootloader'' right from the MBR installed by Syslinux. EXTLINUX is part of The Syslinux Project and is included with the {{Pkg|syslinux}} package.<br />
<br />
The following instructions assume you have Syslinux installed already. These instructions will also assume that the typical Arch Linux configuration path of {{ic|/boot/syslinux}} is being used and the chainloaded system's {{ic|/}} is on {{ic|/dev/sda3}}. <br />
<br />
From a booted Linux (likely the partition that Syslinux is set up to boot), mount the other system's root partition to your desired mount point. In this example this will be {{ic|/mnt}}. Also, if a separate {{ic|/boot}} partition is used on the second operating system, that will also need to be mounted. The example assumes this is {{ic|/dev/sda2}}.<br />
# mount /dev/sda3 /mnt<br />
# mount /dev/sda2 /mnt/boot (only necessary for separate /boot)<br />
Install EXTLINUX to the partition VBR, and copy necessary {{ic|*.c32}} files<br />
# extlinux -i /mnt/boot/syslinux/ (first create the directory if necessary)<br />
# cp /usr/lib/syslinux/bios/*.c32 /mnt/boot/syslinux<br />
<br />
Create {{ic|/mnt/boot/syslinux/syslinux.cfg}}. You can use the other Linux's bootloader menu file for reference. Below is an example:<br />
{{hc|/boot/syslinux/syslinux.cfg '''on /dev/sda3'''|<nowiki><br />
timeout 10<br />
<br />
ui menu.c32<br />
<br />
label Other Linux<br />
linux /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
append root=/dev/sda3 rw quiet<br />
<br />
label MAIN<br />
com32 chain.c32<br />
append hd0 0</nowiki><br />
}}<br />
<br />
taken from [[User:Djgera|Djgera's user wiki page]].<br />
<br />
Note that the other Linux entry in {{ic|<other-OS>/boot/syslinux/syslinux.cfg}} will need to be edited each time you update this OS's kernel. Since we are booting the kernel directly and not chainloading the other-OS's default bootloader.<br />
<br />
=== Using memtest ===<br />
<br />
Install {{Pkg|memtest86+}} from the [[official repositories]].<br />
<br />
Use this {{ic|LABEL}} section to launch [[Wikipedia:Memtest86|memtest]]:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
...<br />
}}<br />
''<br />
{{Note|If you are using PXELINUX, change the name from ''memtest.bin'' to ''memtest'' since PXELINUX treats the file with .bin extension as a boot sector and loads only 2KB of it.}}<br />
<br />
=== HDT ===<br />
<br />
[http://hdt-project.org/ HDT (Hardware Detection Tool)] displays hardware information. Like before, the {{ic|.c32}} file has to be copied from {{ic|/boot/syslinux/}}. Additional {{ic|lib*.c32}} library modules might be needed too.<br />
For PCI info, copy {{ic|/usr/share/hwdata/pci.ids}} to {{ic|/boot/syslinux/pci.ids}} and add the following to your configuration file:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
}}<br />
<br />
=== Reboot and power off ===<br />
<br />
{{Note|As of Syslinux 6.03, {{ic|poweroff.c32}} only works with APM and not with ACPI. For a possible solution, see [http://www.syslinux.org/archives/2012-March/017661.html this thread] .}}<br />
<br />
Use the following sections to reboot or power off your machine:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COM32 poweroff.c32<br />
}}<br />
<br />
=== Clear menu ===<br />
<br />
To clear the screen when exiting the menu, add the following line:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
MENU CLEAR<br />
}}<br />
<br />
=== Keyboard layout ===<br />
<br />
If you often have to edit your boot command with diverse parameters in the Syslinux boot prompt, then you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keyboard.<br />
<br />
{{note|keytab-lilo is a perl script invoking the "loadkeys" program.}}<br />
<br />
To create a compatible keymap (e.g. a german one) run:<br />
# keytab-lilo /usr/share/kbd/keymaps/i386/qwerty/us.kmap.gz /usr/share/kbd/keymaps/i386/qwertz/de.kmap.gz > /boot/syslinux/de.ktl<br />
<br />
Now edit {{ic|syslinux.cfg}} and add:<br />
<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
KBDMAP de.ktl<br />
}}<br />
<br />
See the [http://www.syslinux.org/wiki/index.php/Directives/kbdmap Syslinux wiki] for more details.<br />
<br />
=== Hiding the menu ===<br />
<br />
Use the option:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
MENU HIDDEN<br />
}}<br />
to hide the menu while displaying only the timeout. Press any key to bring up the menu.<br />
<br />
=== Pxelinux ===<br />
<br />
{{Note|For UEFI, Syslinux uses the same binary for disk booting and network booting. Loading files from TFTP or other network protocols will require network booting Syslinux. }}<br />
<br />
[[Syslinux|PXELINUX]] is provided by the {{Pkg|syslinux}} package.<br />
<br />
For BIOS clients, copy the {{ic|<nowiki>{l,}pxelinux.0</nowiki>}} bootloader to the boot directory of the client. For version 5.00 and newer, also copy {{ic|ldlinux.c32}} from the same package:<br />
<br />
# cp /usr/lib/syslinux/bios/pxelinux.0 "$root/boot"<br />
# cp /usr/lib/syslinux/bios/ldlinux.c32 "$root/boot"<br />
# mkdir "$root/boot/pxelinux.cfg"<br />
<br />
We also created the {{ic|pxelinux.cfg}} directory, which is where PXELINUX searches for configuration files by default. Because we do not want to discriminate between different host MACs, we then create the {{ic|default}} configuration.<br />
<br />
{{hc|# vim "$root/boot/pxelinux.cfg/default"|<nowiki><br />
default linux<br />
<br />
label linux<br />
kernel vmlinuz-linux<br />
append initrd=initramfs-linux.img quiet ip=:::::eth0:dhcp nfsroot=10.0.0.1:/arch<br />
</nowiki>}}<br />
<br />
Or if you are using NBD, use the following append line:<br />
<br />
{{bc|<nowiki>append ro initrd=initramfs-linux.img ip=:::::eth0:dhcp nbd_host=10.0.0.1 nbd_name=arch root=/dev/nbd0</nowiki>}}<br />
<br />
{{Note|You will need to change {{ic|nbd_host}} and/or {{ic|nfsroot}}, respectively, to match your network configuration (the address of the NFS/NBD server)}}<br />
<br />
PXELINUX uses the same configuration syntax as SYSLINUX; refer to the upstream documentation for more information.<br />
<br />
The kernel and initramfs will be transferred via TFTP, so the paths to those are going to be relative to the TFTP root. Otherwise, the root filesystem is going to be the NFS mount itself, so those are relative to the root of the NFS server.<br />
<br />
To actually load PXELINUX, replace {{ic|filename "/grub/i386-pc/core.0";}} in {{ic|/etc/dhcpd.conf}} with {{ic|filename "/pxelinux.0"}} (or with {{ic|filename "/lpxelinux.0"}}).<br />
<br />
=== Booting ISO9660 image files with memdisk ===<br />
<br />
Syslinux supports booting from ISO images directly using the [http://www.syslinux.org/wiki/index.php/MEMDISK memdisk] module, see [[Multiboot USB drive#Using Syslinux and memdisk]] for examples.<br />
<br />
=== Serial console ===<br />
<br />
{{Merge|Working with the serial console|General page about topic not specific to Syslinux, already provides examples for GRUB.}}<br />
<br />
To enable Serial Console add the {{ic|SERIAL port [baudrate]}} to the top of {{ic|syslinux.cfg}} file. "port" is a number (0 for {{ic|/dev/ttyS0}}), if "baudrate" is omitted, the baud rate default is 9600 bps. The serial parameters are hardcoded to 8 bits, no parity and 1 stop bit.[http://www.syslinux.org/wiki/index.php/SYSLINUX#SERIAL_port_.5Bbaudrate_.5Bflowcontrol.5D.5D]<br />
<br />
{{hc|syslinux.cfg|<br />
SERIAL 0 115200<br />
}}<br />
<br />
Enable Serial Console in the kernel at boot by adding {{ic|1=console=tty0 console=ttyS0,115200n8}} to the {{ic|APPEND}} option.[http://www.mjmwired.net/kernel/Documentation/kernel-parameters.txt#681]<br />
<br />
{{hc|syslinux.cfg|2=<br />
APPEND root=UUID=126ca36d-c853-4f3a-9f46-cdd49d034ce4 rw console=tty0 console=ttyS0,115200n8<br />
}}<br />
<br />
How to do this with GRUB: [[Working with the serial console#GRUB2 and systemd]]<br />
<br />
== Troubleshooting ==<br />
<br />
=== Using the Syslinux prompt===<br />
<br />
You can type in the {{ic|LABEL}} name of the entry that you want to boot (as per your {{ic|syslinux.cfg}}). If you used the example configurations, just type:<br />
boot: arch<br />
<br />
If you get an error that the configuration file could not be loaded, you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 rw initrd=../initramfs-linux.img<br />
<br />
If you do not have access to {{ic|boot:}} in [[Ramdisk|ramfs]], and therefore temporarily unable to boot the kernel again,<br />
:1. Create a temporary directory, in order to mount your root partition (if it does not exist already):<br />
# mkdir -p /new_root<br />
:2. Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):<br />
{{Note|Busybox cannot mount {{ic|/boot}} if it is on its own ext2 partition.}}<br />
# mount /dev/sd[a-z][1-9] /new_root<br />
<br />
:3. Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.<br />
:4. Reboot.<br />
<br />
=== Fsck fails on root partition ===<br />
<br />
In the case of a badly corrupted root partition (in which the journal is damaged), in the ramfs emergency shell, mount the root file system:<br />
<br />
# mount /dev/''root partition'' /new_root<br />
And grab the tune2fs binary from the root partition (it is not included in Syslinux):<br />
# cp /new_root/sbin/tune2fs /sbin/<br />
<br />
Follow the instructions at [[Fsck#ext2fs_:_no_external_journal|ext2fs: no external journal]] to create a new journal for the root partition.<br />
<br />
=== No Default or UI found on some computers ===<br />
<br />
Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted USB drive may boot on a more recent computer, some computers may hang if the boot partition containing the ''kernel'' and ''initrd'' are not on a FAT16 partition. To prevent an older machine from loading {{ic|ldlinux}} and failing to read {{ic|syslinux.cfg}}, use {{ic|cfdisk}} to create a FAT16 partition (<=2GB) and format using {{Pkg|dosfstools}}:<br />
# mkfs.msdos -F 16 /dev/sda1<br />
<br />
then install and configure Syslinux.<br />
<br />
=== Missing operating system ===<br />
<br />
* Check that you have installed {{ic|gptmbr.bin}} for GPT and {{ic|mbr.bin}} for msdos partition table. A "Missing operating system" message comes from {{ic|mbr.bin}} while {{ic|gptmbr.bin}} would show a "Missing OS" message.<br />
<br />
* Check whether the partition that contains {{ic|/boot}} has the "boot" flag enabled.<br />
<br />
* Check whether the first partition at the boot device starts at sector 1 rather than sector 63 or 2048. Check this with {{ic|fdisk -l}}. If it starts at sector 1, you can move the partition(s) with {{ic|gparted}} from a rescue disk. Or, if you have a separate boot partition, you can back up {{ic|/boot}} with <br />
# cp -a /boot /boot.bak<br />
and then boot up with the Arch install disk. Next, use {{ic|cfdisk}} to delete the {{ic|/boot}} partition, and recreate it. This time it should begin at the proper sector, '''63'''. Now mount your partitions and {{ic|chroot}} into your mounted system, as described in the beginners guide. Restore {{ic|/boot}} with the command<br />
# cp -a /boot.bak/* /boot<br />
Check if {{ic|/etc/fstab}} is correct, run:<br />
# syslinux-install_update -iam<br />
and reboot.<br />
<br />
You will also get this error if you are trying to boot from a md [[RAID]] 1 array and created the array with a too new version of the metadata that Syslinux does not understand. As of August 2013 by default mdadm will create an array with version 1.2 metadata, but Syslinux does not understand metadata newer than 1.0. If this is the case you will need to recreate your [[RAID]] array using the {{ic|1=--metadata=1.0}} flag to mdadm.<br />
<br />
=== Windows boots up, ignoring Syslinux ===<br />
<br />
'''Solution:''' Make sure the partition that contains {{ic|/boot}} has the boot flag enabled. Also, make sure the boot flag is not enabled on the Windows partition. See the installation section above.<br />
<br />
The MBR that comes with Syslinux looks for the first active partition that has the boot flag set. The Windows partition was likely found first and had the boot flag set. If you wanted, you could use the MBR that Windows or MS-DOS {{ic|fdisk}} provides.<br />
<br />
=== Menu entries do nothing ===<br />
<br />
You select a menu entry and it does nothing, it just ''"refreshes"'' the menu. This usually means that you have an error in your {{ic|syslinux.cfg}} file. Hit {{ic|Tab}} to edit your boot parameters. Alternatively, press {{ic|Esc}} and type in the {{ic|LABEL}} of your boot entry (e.g. ''arch''). Another cause could be that you do not have a kernel installed. Find a way to access your file system (through live CD, etc) and make sure that {{ic|/mount/vmlinuz-linux}} exists and does not have a size of 0. If this is the case, [[Kernel_Panics#Option_2:_Reinstall_kernel|reinstall your kernel]].<br />
<br />
=== Cannot remove ldlinux.sys ===<br />
<br />
The {{ic|ldlinux.sys}} file has the immutable attribute set, which prevents it from being deleted or overwritten. This is because the sector location of the file must not change or else Syslinux has to be reinstalled. To remove it, run:<br />
# chattr -i /boot/syslinux/ldlinux.sys<br />
# rm /boot/syslinux/ldlinux.sys<br />
<br />
=== White block in upper left corner when using vesamenu ===<br />
<br />
Problem:<br />
''As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my Intel, when having Syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in Syslinux (the white block is actually an attempt to keep the Syslinux menu, but the driver fails to capture the picture from vesa graphics mode).''<br />
<br />
If you have a custom resolution and a {{ic|vesamenu}} with early modesetting, try to append the following in {{ic|syslinux.cfg}} to remove the white block and continue in graphics mode:<br />
APPEND root=/dev/sda6 rw 5 '''vga=current''' quiet splash<br />
<br />
=== Chainloading Windows does not work, when it is installed on another drive ===<br />
<br />
If Windows is installed on a different drive than Arch and you have trouble chainloading it, try the following configuration:<br />
<br />
LABEL Windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xdfc1ba9e swap<br />
<br />
Replace the mbr code with the one your Windows drive has (details [[#Chainloading|above]]), and append {{ic|swap}} to the options.<br />
<br />
=== Read bootloader log ===<br />
<br />
In some cases (e.g. bootloader unable to boot kernel) it is highly desirable to get more information from the boot process. ''Syslinux'' prints error messages to screen but the boot menu quickly overwrites the text. To avoid losing the log information, disable {{ic|UI menu}} in {{ic|syslinux.cfg}} and use the default "command-line" prompt. It means:<br />
<br />
* avoid the UI directive<br />
* avoid ONTIMEOUT<br />
* avoid ONERROR<br />
* avoid MENU CLEAR<br />
* use a higher TIMEOUT<br />
* use PROMPT 1<br />
* use DEFAULT <problematic_label><br />
<br />
To get more detailed debug log, recompile the {{Pkg|syslinux}} package with additional CFLAGS:<br />
<br />
-DDEBUG_STDIO=1 -DCORE_DEBUG=1<br />
<br />
=== Btrfs compression ===<br />
<br />
Booting from btrfs with compression is not supported.[http://www.syslinux.org/wiki/index.php/Syslinux_4_Changelog#Changes_in_4.02]<br />
This error will show:<br />
btrfs: found compressed data, cannot continue!<br />
invalid or corrupt kernel image.<br />
[[GRUB]] supports btrfs with compression.<br />
<br />
== See also ==<br />
<br />
* [http://www.syslinux.org Official website]<br />
* [http://www.josephn.net/scrapbook/pxelinux_stuff PXELinux configuration]<br />
* [http://blog.jak.me/2013/01/03/creating-a-multiboot-usb-stick-using-syslinux/ Multiboot USB using Syslinux]{{Dead link|2015|05|15}}</div>Spaceonehttps://wiki.archlinux.org/index.php?title=Syslinux&diff=432157Syslinux2016-04-22T04:10:55Z<p>Spaceone: /* Keyboard layout */ Remove unnecessary steps</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[es:Syslinux]]<br />
[[fr:Syslinux]]<br />
[[it:Syslinux]]<br />
[[ja:Syslinux]]<br />
[[ru:Syslinux]]<br />
[[tr:Syslinux]]<br />
[[zh-CN:Syslinux]]<br />
{{Related articles start}}<br />
{{Related|Arch boot process}}<br />
{{Related|Boot loaders}}<br />
{{Related articles end}}<br />
<br />
[[Wikipedia:SYSLINUX|Syslinux]] is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the [[Wikipedia:File Allocation Table|FAT]], [[Wikipedia:ext2|ext2]], [[ext3]], [[ext4]], and [[Btrfs]] [[file systems]].<br />
<br />
{{Note|Syslinux cannot access files from partitions other than its own. For an alternative bootloader with the multifs feature see [[GRUB]].}}<br />
<br />
== BIOS Systems ==<br />
<br />
=== Boot process overview ===<br />
<br />
# '''Stage 1 : Part 1''' - '''Load MBR''' - At boot, the BIOS loads the 440 byte [[MBR]] boot code at the start of the disk ({{ic|/usr/lib/syslinux/bios/mbr.bin}} or {{ic|/usr/lib/syslinux/bios/gptmbr.bin}}). <br />
# '''Stage 1 : Part 2''' - '''Search active partition'''. The '''Stage 1 MBR boot code''' looks for the partition that is marked as active (boot flag in MBR disks). Let us assume this is the {{ic|/boot}} partition for example.<br />
# '''Stage 2 : Part 1''' - '''Execute volume boot record''' - The '''Stage 1 MBR boot code''' executes the Volume Boot Record (VBR) of the {{ic|/boot}} partition. In the case of Syslinux, the VBR boot code is the starting sector of {{ic|/boot/syslinux/ldlinux.sys}} which is created by the {{ic|extlinux --install}} command. Note {{ic|ldlinux.sys}} is not same as {{ic|ldlinux.c32}}.<br />
# '''Stage 2 : Part 2''' - '''Execute {{ic|/boot/syslinux/ldlinux.sys}}''' - The VBR will load the rest of {{ic|/boot/syslinux/ldlinux.sys}}. The sector location of {{ic|/boot/syslinux/ldlinux.sys}} should not change, otherwise syslinux will not boot. {{Note|In the case of [[Btrfs]], the above method will not work since files move around resulting in changing of the sector location of {{ic|ldlinux.sys}}. Therefore, in BTRFS the entire {{ic|ldlinux.sys}} code is embedded in the space following the VBR and is not installed at {{ic|/boot/syslinux/ldlinux.sys}} unlike the case of other filesystems.}}<br />
# '''Stage 3''' - '''Load {{ic|/boot/syslinux/ldlinux.c32}}''' - The {{ic|/boot/syslinux/ldlinux.sys}} will load the {{ic|/boot/syslinux/ldlinux.c32}} (core module) that contains the rest of the '''core''' part of syslinux that could not be fit into {{ic|ldlinux.sys}} (due to file-size constraints). The {{ic|ldlinux.c32}} file should be present in every Syslinux installation and should match the version of {{ic|ldlinux.sys}} installed in the partition. Otherwise Syslinux will fail to boot. See http://bugzilla.syslinux.org/show_bug.cgi?id=7 for more info.<br />
# '''Stage 4''' - '''Search and Load configuration file''' - Once Syslinux is fully loaded, it looks for {{ic|/boot/syslinux/syslinux.cfg}} (or {{ic|/boot/syslinux/extlinux.conf}} in some cases) and loads it if it is found. If no configuration file is found, you will be dropped to a Syslinux {{ic|boot:}} prompt. This step and the rest of '''non-core''' parts of Syslinux ({{ic|/boot/syslinux/*.c32}} modules, excluding {{ic|lib*.c32}} and {{ic|ldlinux.c32}}) require {{ic|/boot/syslinux/lib*.c32}} (library) modules to be present (http://www.syslinux.org/wiki/index.php/Common_Problems#ELF). The {{ic|lib*.c32}} library modules and non-core {{ic|*.c32}} modules should match the version of {{ic|ldlinux.sys}} installed in the partition.<br />
<br />
=== Installation on BIOS ===<br />
<br />
[[Install]] the {{Pkg|syslinux}} package.<br />
<br />
{{Note|<br />
* {{Pkg|gptfdisk}} is required for [[wikipedia:GUID_Partition_Table|GPT]] support using the automated script.<br />
* If your boot partition is FAT, you will also need {{Pkg|mtools}}.<br />
}}<br />
<br />
Installing the package is not the same as installing the bootloader. After installing the relevant package(s), the bootloader code itself needs to be installed (to the adequate area, usually the VBR) so to be able to boot the system; the following sections provide alternative instructions depending on the characteristics of your particular system.<br />
<br />
==== Automatic Install ====<br />
<br />
{{Note|The {{ic|syslinux-install_update}} script is Arch specific, and is not provided/supported by Syslinux upstream. Please direct any bug reports specific to the script to the Arch Bug Tracker and not upstream.<br />
}}<br />
<br />
* After executing the {{ic|syslinux-install_update}} script, do not forget to edit {{ic|/boot/syslinux/syslinux.cfg}} by following [[#Configuration]] and [[#Kernel parameters]].<br />
<br />
{{Warning|The {{ic|syslinux-install_update}} script sets a default root partition that possibly will not match your particular system. It is important to point Syslinux to the correct root partition by editing {{ic|/boot/syslinux/syslinux.cfg}}, or the OS will fail to boot. See [[#Kernel parameters]].}}<br />
<br />
The {{ic|syslinux-install_update}} script will install Syslinux, copy {{ic|*.c32}} modules to {{ic|/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:<br />
<br />
If you use a separate boot partition make sure that it is mounted. Check with {{ic|lsblk}}; if you do not see a {{ic|/boot}} mountpoint, mount it before you go any further.<br />
<br />
* Run {{ic|syslinux-install_update}} with flags: {{ic|-i}} (install the files), {{ic|-a}} (mark the partition ''active'' with the ''boot'' flag), {{ic|-m}} (install the ''MBR'' boot code): {{bc|# syslinux-install_update -i -a -m}} If this command fails with ''Syslinux BIOS install failed'', the problem is likely that the {{ic|extlinux}} binary could not find the partition containing {{ic|/boot}}: <br />
<br />
{{hc|# extlinux --install /boot/syslinux/|<br />
extlinux: cannot find device for path /boot/syslinux<br />
extlinux: cannot open device (null)<br />
}} <br />
<br />
This can happen for example when upgrading from [[LILO]] which, while booting a current custom kernel, turned a kernel command line parameter of say {{ic|1=root=/dev/sda1}} into its numeric equivalent {{ic|1=root=801}}, as evidenced by {{ic|/proc/cmdline}} and the output of the {{ic|mount}} command. Remedy the situation by either continuing with the manual install described below while specifying {{ic|1=--device=/dev/sda1}} to {{ic|extlinux}}, or simply by first rebooting into a stock Arch Linux kernel; its use of an initramfs avoids the problem.<br />
<br />
{{Note|<br />
* When you reboot your system now, you will have a Syslinux prompt. To automatically boot your system or get a boot menu, you still need to create a configuration file.<br />
* If you are on another root directory (e.g. from an install disk) install SYSLINUX by directing to the chroot:<br />
# syslinux-install_update -i -a -m -c /mnt/<br />
}}<br />
<br />
* Now is the time to edit {{ic|/boot/syslinux/syslinux.cfg}} by following [[#Configuration]] and [[#Kernel parameters]].<br />
<br />
==== Manual install ====<br />
<br />
{{Note|<br />
* If you are unsure of which partition table you are using (MBR or GPT), you can check using the following command<br />
# blkid -s PTTYPE -o value /dev/sda<br />
gpt<br />
<br />
* If you are trying to rescue an installed system with a live CD, be sure to [[chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not {{ic|/dev/}} paths) with the mount point.<br />
}}<br />
<br />
Your boot partition, on which you plan to install Syslinux, must contain a FAT, ext2, ext3, ext4, or Btrfs file system. You should install it on a mounted directory—not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}}. You can install Syslinux in the {{ic|syslinux}} directory:<br />
<br />
# mkdir /boot/syslinux<br />
# cp -r /usr/lib/syslinux/bios/*.c32 /boot/syslinux/ ## copy ALL the *.c32 files from /usr/lib/syslinux/bios/, DO NOT SYMLINK<br />
# extlinux --install /boot/syslinux/<br />
<br />
After this, proceed to install the Syslinux boot code ({{ic|mbr.bin}} or {{ic|gptmbr.bin}}) to the Master Boot Record 440-byte boot code region (not to be confused with MBR aka msdos partition table) of the disk, as described in the next sections, respectively.<br />
<br />
{{Note|For a partitionless install, there is no need to install the Syslinux boot code to the MBR. See [https://unix.stackexchange.com/questions/103501/boot-partiotionless-disk-with-syslinux].}}<br />
<br />
===== MBR partition table =====<br />
<br />
See the main article: [[Master Boot Record]].<br />
<br />
Next you need to mark your boot partition as "active" in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|parted/gparted}} ("boot" flag). It should look like this:<br />
{{hc|# fdisk -l /dev/sda|<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
}}<br />
<br />
Install the MBR:<br />
# dd bs=440 count=1 if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sda<br />
<br />
An alternative MBR which Syslinux provides is: {{ic|altmbr.bin}}. This MBR does ''not'' scan for bootable partitions; instead, the last byte of the MBR is set to a value indicating which partition to boot from. Here is an example of how {{ic|altmbr.bin}} can be copied into position:<br />
# printf '\x5' | cat /usr/lib/syslinux/bios/altmbr.bin - | dd bs=440 count=1 iflag=fullblock of=/dev/sda<br />
<br />
In this case, a single byte of value 5 (hexadecimal) is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device {{ic|sda}}. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.<br />
<br />
===== GUID partition table =====<br />
<br />
See the main article: [[GUID Partition Table]].<br />
<br />
Bit 2 of the attributes ("legacy_boot" attribute) needs to be set for the {{ic|/boot}} partition:.<br />
# sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute ''legacy BIOS bootable'' on partition 1. To check:<br />
{{hc|<nowiki># sgdisk /dev/sda --attributes=1:show</nowiki>|<br />
1:2:1 (legacy BIOS bootable)<br />
}}<br />
<br />
Install the MBR:<br />
# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/bios/gptmbr.bin of=/dev/sda<br />
<br />
If this does not work you can also try:<br />
# syslinux-install_update -i -m<br />
<br />
== UEFI Systems ==<br />
<br />
{{Note|<br />
*{{ic|$esp}} is the mountpoint of the [[ESP]] (EFI System Partition) in the below commands.<br />
<br />
* {{ic|efi64}} denotes x86_64 UEFI systems, for IA32 (32-bit) EFI replace {{ic|efi64}} with {{ic|efi32}} in the below commands.<br />
<br />
* For Syslinux, the kernel and initramfs files need to be in the ESP, as Syslinux does not (currently) have the ability to access files outside its own partition (i.e. outside ESP in this case). For this reason, it is recommended to mount ESP at {{ic|/boot}}.<br />
<br />
* The automatic install script {{ic|/usr/bin/syslinux-install_update}} does not support UEFI install.<br />
<br />
* The configuration syntax of {{ic|syslinux.cfg}} for UEFI is same as that of BIOS.<br />
}}<br />
<br />
=== Limitations of UEFI Syslinux ===<br />
<br />
* UEFI Syslinux application {{ic|syslinux.efi}} cannot be signed by {{ic|sbsign}} (from sbsigntool) for UEFI Secure Boot. Bug report - http://bugzilla.syslinux.org/show_bug.cgi?id=8<br />
<br />
* Using TAB to edit kernel parameters in UEFI Syslinux menu might lead to garbaged display (text on top of one-another). Bug report - http://bugzilla.syslinux.org/show_bug.cgi?id=9<br />
<br />
* UEFI Syslinux does not support chainloading other EFI applications like {{ic|UEFI Shell}} or {{ic|Windows Boot Manager}}. Enhancement request - http://bugzilla.syslinux.org/show_bug.cgi?id=17<br />
<br />
* In some cases, UEFI Syslinux might not boot in some Virtual Machines like QEMU/OVMF or VirtualBox or some VMware products/versions and in some UEFI emulation environments like DUET. A Syslinux contributor has confirmed no such issues present on VMware Workstation 10.0.2 and Syslinux-6.02 or later. Bug reports - http://bugzilla.syslinux.org/show_bug.cgi?id=21 and http://bugzilla.syslinux.org/show_bug.cgi?id=23<br />
<br />
* Memdisk is not available for UEFI. Enhancement request - http://bugzilla.syslinux.org/show_bug.cgi?id=30<br />
<br />
=== Installation on UEFI ===<br />
<br />
* Install the {{Pkg|syslinux}} and {{Pkg|efibootmgr}} packages from the [[official repositories]]. Then setup Syslinux in the EFI System Partition (ESP) as follows:<br />
<br />
* Copy Syslinux files to ESP (replace {{ic|$esp}} by the mount point of the ESP, usually {{ic|/boot}}):<br />
<br />
# mkdir -p $esp/EFI/syslinux<br />
# cp -r /usr/lib/syslinux/efi64/* $esp/EFI/syslinux/<br />
<br />
* Setup boot entry for Syslinux using [[Unified Extensible Firmware Interface#efibootmgr|efibootmgr]]:<br />
<br />
# efibootmgr -c -d /dev/sdX -p Y -l /EFI/syslinux/syslinux.efi -L "Syslinux"<br />
<br />
where {{ic|/dev/sdXY}} is the partition containing the bootloader.<br />
<br />
* Create or edit {{ic|$esp/EFI/syslinux/syslinux.cfg}} by following [[#Configuration]].<br />
<br />
{{Note|The config file for UEFI is {{ic|$esp/EFI/syslinux/syslinux.cfg}}, not {{ic|/boot/syslinux/syslinux.cfg}}. Files in {{ic|/boot/syslinux/}} are BIOS specific and not related to UEFI Syslinux.}}<br />
<br />
== Configuration ==<br />
<br />
The Syslinux configuration file, {{ic|syslinux.cfg}}, should be created in the same directory where you installed Syslinux. In our case, {{ic|/boot/syslinux/}} for BIOS systems and {{ic|$esp/EFI/syslinux/}} for UEFI systems.<br />
<br />
The bootloader will look for either {{ic|syslinux.cfg}} (preferred) or {{ic|extlinux.conf}}<br />
<br />
{{Tip|<br />
* Instead of {{ic|LINUX}}, the keyword {{ic|KERNEL}} can also be used. {{ic|KERNEL}} tries to detect the type of the file, while {{ic|LINUX}} always expects a Linux kernel. <br />
* {{ic|TIMEOUT}} value is in units of '''0.1 seconds'''.<br />
}}<br />
<br />
=== Examples ===<br />
<br />
{{Note|<br />
* Any configuration file found in the examples needs to be edited to set the proper kernel parameters. See section [[#Kernel parameters]].<br />
* Please, pay close attention to the paths. The examples may not be suitable for your installation, especially when using UEFI.<br />
}}<br />
<br />
==== Boot prompt ====<br />
This is a simple configuration file that will show a {{ic|boot:}} prompt and automatically boot after 5 seconds. If you want to boot directly without seeing a prompt, set {{ic|PROMPT}} to {{ic|0}}.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
==== Text boot menu ====<br />
<br />
Syslinux also allows you to use a boot menu. To use it, copy the {{ic|menu}} module to your Syslinux directory:<br />
# cp /usr/lib/syslinux/bios/menu.c32 /boot/syslinux/<br />
<br />
Copying additional {{ic|lib*.c32}} library modules might be needed too.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
For more details about the menu system, see [http://www.syslinux.org/wiki/index.php/Menu the Syslinux wiki].<br />
<br />
==== Graphical boot menu ====<br />
<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the {{ic|vesamenu}} COM32 module to your Syslinux folder:<br />
# cp /usr/lib/syslinux/bios/vesamenu.c32 /boot/syslinux/<br />
<br />
Copying additional {{ic|lib*.c32}} library modules might be needed too.<br />
<br />
{{Note| If you are using [[UEFI]] make sure to copy from {{ic|/usr/lib/syslinux/efi64/}} ({{ic|efi32}} for i686 systems), otherwise you will be presented with a black screen. In that case, boot from a live medium and use [[chroot]] to make the appropriate changes.}}<br />
<br />
This configuration uses the same menu design as the Arch Install CD, its config can be found at [https://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux projects.archlinux.org]. The [https://projects.archlinux.org/archiso.git/plain/configs/releng/syslinux/splash.png Arch Linux background image] can be downloaded from there, too. Copy the image to {{ic|/boot/syslinux/splash.png}}.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
Since Syslinux 3.84, {{ic|vesamenu.c32}} supports the {{ic|MENU RESOLUTION $WIDTH $HEIGHT}} directive.<br />
To use it, insert {{ic|MENU RESOLUTION 1440 900}} into your config for a 1440x900 resolution.<br />
However, the background picture has to have exactly the right resolution, as Syslinux will otherwise refuse to load the menu.<br />
<br />
To center the menu and adjust resolution, use {{ic|MENU RESOLUTION}}, {{ic|MENU HSHIFT $N}} and {{ic|MENU VSHIFT $N}} where {{ic|$N}} is a positive number. The default values are both {{ic|0}} which is the upper-left hand corner of your monitor. Conversely, a negative number starts from the opposite end of the screen (e.g. {{ic|VHSHIFT -4}} would be 4 rows from the bottom of the screen).<br />
<br />
To move the menu to the center, add or edit these values:<br />
<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
MENU RESOLUTION 800 600 # or whatever your screen resolution is<br />
MENU WIDTH 78 # width of the menu also required to bring the menu box to size<br />
MENU VSHIFT 10 # moves menu down<br />
MENU HSHIFT 10 # moves menu right<br />
</nowiki><br />
}}<br />
<br />
VESA standards are commonly a maximum of 25 rows and 80 columns, so going higher than those values might move the menu off the screen, potentially requiring editing from a rescue CD.<br />
<br />
=== Kernel parameters ===<br />
<br />
The [[kernel parameters]] are set using the {{ic|APPEND}} line in {{ic|syslinux.cfg}}. It is recommended to make the following changes for the fallback entry as well.<br />
<br />
'''In the simplest case''', the partition name in the {{ic|root}} parameter needs to be replaced. Change {{ic|/dev/sda2}} to point to the correct root partition.<br />
<br />
APPEND root=/dev/sda2<br />
<br />
'''If you want to use [[UUID]]''' for [[persistent block device naming]] change the {{ic|APPEND}} line as follows, substituting {{ic|1234}} with the {{ic|UUID}} of your root partition:<br />
<br />
APPEND root=UUID=''1234'' rw<br />
<br />
'''If you use encryption''' [[LUKS]] change the {{ic|APPEND}} line to use your encrypted volume:<br />
<br />
APPEND root=/dev/mapper/''group''-''name'' cryptdevice=/dev/sda2:''name'' rw<br />
<br />
'''If you are using software''' [[Wikipedia:RAID|RAID]] using [http://neil.brown.name/blog/mdadm mdadm], change the {{ic|APPEND}} line to accommodate your RAID arrays. As an example the following accommodates three RAID 1 arrays and sets the appropriate one as root:<br />
<br />
APPEND root=/dev/md1 rw md=0,/dev/sda2,/dev/sdb2 md=1,/dev/sda3,/dev/sdb3 md=2,/dev/sda4,/dev/sdb4<br />
<br />
If booting from a software raid partition fails using the kernel device node method above an alternative, a more reliable, way is to use partition labels:<br />
<br />
APPEND root=LABEL=THEROOTPARTITIONLABEL rw<br />
<br />
'''If booting a [[btrfs]] subvolume''', amend the {{ic|APPEND}} line with {{ic|rootflags<nowiki>=</nowiki>subvol<nowiki>=</nowiki><root subvolume>}}. For example, where {{ic|/dev/sda2}} has been mounted as a btrfs subvolume called 'ROOT' (e.g. {{ic|mount -o noatime,subvol<nowiki>=</nowiki>ROOT /dev/sda2 /mnt}}), then the {{ic|APPEND}} line would need to be modified as follows:<br />
APPEND root=/dev/sda2 rw rootflags=subvol=ROOT<br />
<br />
A failure to do so will otherwise result in the following error message: {{ic|ERROR: Root device mounted successfully, but /sbin/init does not exist.}}<br />
<br />
=== Auto boot ===<br />
<br />
If you do not want to see the Syslinux menu at all, use the [[#Boot prompt]], and set {{ic|PROMPT}} to {{ic|0}} and comment out any {{ic|UI}} menu entries. Setting the {{ic|TIMEOUT}} variable to {{ic|0}} might also be a good idea. Make sure there is a {{ic|DEFAULT}} set in your {{ic|syslinux.cfg}}.<br />
<br />
=== Security ===<br />
<br />
Syslinux has two levels of bootloader security: a menu master password, and a per-menu-item password. In {{ic|syslinux.cfg}}, use<br />
{{bc|<br />
MENU MASTER PASSWD passwd <br />
}}<br />
to set a master bootloader password, and<br />
{{bc|<br />
MENU PASSWD passwd <br />
}}<br />
within a {{ic|LABEL}} block to password-protect individual boot items.<br />
<br />
The passwd can be either a cleartext password or hashed: [http://www.syslinux.org/wiki/index.php/Comboot/menu.c32 see official documentation].<br />
<br />
=== Chainloading ===<br />
<br />
{{Note|Syslinux BIOS cannot directly chainload files from other partitions; however, {{ic|chain.c32}} can boot a partition boot sector (VBR).}}<br />
<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy the {{ic|chain.c32}} module to the Syslinux directory (additional {{ic|lib*.c32}} library modules might be needed too; for details, see the instructions in the previous section). Then create a section in the configuration file:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
...<br />
}}<br />
<br />
{{ic|hd0 3}} is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. <br />
<br />
{{note|For Windows, this skips the system's own boot manager ({{ic|bootmgr}}), which is required for a few important updates ([http://support.microsoft.com/kb/2883200 eg.]) to complete. In such cases it may be advisable to temporarily set the MBR boot flag to the Windows partition (eg. with [[GParted]]), let the update finish installing, and then reset the flag to the Syslinux partition (eg. with Windows's own [http://www.online-tech-tips.com/computer-tips/set-active-partition-vista-xp DiskPart]).}}<br />
<br />
If you are unsure about which drive your BIOS thinks is "first", you can instead use the MBR identifier, or if you are using GPT, the filesystem labels. To use the MBR identifier, run the command<br />
{{hc|# fdisk -l /dev/sdb|<nowiki><br />
Disk /dev/sdb: 128.0 GB, 128035676160 bytes <br />
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0xf00f1fd3<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sdb1 2048 4196351 2097152 7 HPFS/NTFS/exFAT<br />
/dev/sdb2 4196352 250066943 122935296 7 HPFS/NTFS/exFAT</nowiki><br />
}}<br />
<br />
replacing {{ic|/dev/sdb}} with the drive you wish to chainload. Using the hexadecimal number under Disk identifier: {{ic|0xf00f1fd3}} in this case, the syntax in {{ic|syslinux.cfg}} is<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xf00f1fd3<br />
...<br />
}}<br />
<br />
For more details about chainloading, see [http://www.syslinux.org/wiki/index.php/Comboot/chain.c32 the Syslinux wiki].<br />
<br />
If you have [[GRUB]] installed on the same partition, you can chainload it by using: <br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
...<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
...</nowiki><br />
}}<br />
Alternatively, it is also possible to load [[GRUB]] as a linux kernel by prepending {{ic|lnxboot.img}} to {{ic|core.img}}. The file {{ic|lnxboot.img}} is part of {{ic|core/grub}} and can be found in {{ic|/usr/lib/grub/i386-pc}}.<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
...<br />
LABEL grub2lnx<br />
MENU LABEL Grub2 (lnxboot)<br />
LINUX ../grub/i386-pc/lnxboot.img<br />
INITRD ../grub/i386-pc/core.img<br />
...</nowiki><br />
}}<br />
This may be required for booting from ISO images.<br />
<br />
=== Chainloading other Linux systems ===<br />
{{Accuracy|Among other inaccuracies... 1_ There is no obligation to install yet another boot loader if you already have one related to the other partition/OS (e.g. GRUB2 installed in the MBR or in the VBR of the partition being chainloaded to). 2_ Syslinux (in any of its derivatives) is never "installed to the MBR", so mentioning the MBR in this section without any explanation of what it is being meant or how to do it in practical terms is just adding confusion. 3_ Typos and misspelling. 4_No need to explain (yet again) how to install some (other) bootloader to some (other) partition / OS; just how to chainload from Syslinux to that other partition / bootloader / OS.}}<br />
Chainloading another bootloader such as Windows' is pretty obvious, as there is a definite bootloader to chain to. But with Syslinux, it is only able to load files residing on the same partition as the configuration file. Thus, if you have another version of Linux on a separate partition, without a shared {{ic|/boot}}, it becomes ''necessary'' to employ EXTLINUX rather than the other OS's default bootloader (eg. GRUB2). Essentially, EXTLINUX can be installed on the partition superblock/[[wikipedia:Volume_boot_record|VBR]] and be called as a ''separate bootloader'' right from the MBR installed by Syslinux. EXTLINUX is part of The Syslinux Project and is included with the {{Pkg|syslinux}} package.<br />
<br />
The following instructions assume you have Syslinux installed already. These instructions will also assume that the typical Arch Linux configuration path of {{ic|/boot/syslinux}} is being used and the chainloaded system's {{ic|/}} is on {{ic|/dev/sda3}}. <br />
<br />
From a booted Linux (likely the partition that Syslinux is set up to boot), mount the other system's root partition to your desired mount point. In this example this will be {{ic|/mnt}}. Also, if a separate {{ic|/boot}} partition is used on the second operating system, that will also need to be mounted. The example assumes this is {{ic|/dev/sda2}}.<br />
# mount /dev/sda3 /mnt<br />
# mount /dev/sda2 /mnt/boot (only necessary for separate /boot)<br />
Install EXTLINUX to the partition VBR, and copy necessary {{ic|*.c32}} files<br />
# extlinux -i /mnt/boot/syslinux/ (first create the directory if necessary)<br />
# cp /usr/lib/syslinux/bios/*.c32 /mnt/boot/syslinux<br />
<br />
Create {{ic|/mnt/boot/syslinux/syslinux.cfg}}. You can use the other Linux's bootloader menu file for reference. Below is an example:<br />
{{hc|/boot/syslinux/syslinux.cfg '''on /dev/sda3'''|<nowiki><br />
timeout 10<br />
<br />
ui menu.c32<br />
<br />
label Other Linux<br />
linux /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
append root=/dev/sda3 rw quiet<br />
<br />
label MAIN<br />
com32 chain.c32<br />
append hd0 0</nowiki><br />
}}<br />
<br />
taken from [[User:Djgera|Djgera's user wiki page]].<br />
<br />
Note that the other Linux entry in {{ic|<other-OS>/boot/syslinux/syslinux.cfg}} will need to be edited each time you update this OS's kernel. Since we are booting the kernel directly and not chainloading the other-OS's default bootloader.<br />
<br />
=== Using memtest ===<br />
<br />
Install {{Pkg|memtest86+}} from the [[official repositories]].<br />
<br />
Use this {{ic|LABEL}} section to launch [[Wikipedia:Memtest86|memtest]]:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
...<br />
}}<br />
''<br />
{{Note|If you are using PXELINUX, change the name from ''memtest.bin'' to ''memtest'' since PXELINUX treats the file with .bin extension as a boot sector and loads only 2KB of it.}}<br />
<br />
=== HDT ===<br />
<br />
[http://hdt-project.org/ HDT (Hardware Detection Tool)] displays hardware information. Like before, the {{ic|.c32}} file has to be copied from {{ic|/boot/syslinux/}}. Additional {{ic|lib*.c32}} library modules might be needed too.<br />
For PCI info, copy {{ic|/usr/share/hwdata/pci.ids}} to {{ic|/boot/syslinux/pci.ids}} and add the following to your configuration file:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
}}<br />
<br />
=== Reboot and power off ===<br />
<br />
{{Note|As of Syslinux 6.03, {{ic|poweroff.c32}} only works with APM and not with ACPI. For a possible solution, see [http://www.syslinux.org/archives/2012-March/017661.html this thread] .}}<br />
<br />
Use the following sections to reboot or power off your machine:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COM32 poweroff.c32<br />
}}<br />
<br />
=== Clear menu ===<br />
<br />
To clear the screen when exiting the menu, add the following line:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
MENU CLEAR<br />
}}<br />
<br />
=== Keyboard layout ===<br />
<br />
If you often have to edit your boot command with diverse parameters in the Syslinux boot prompt, then you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keyboard.<br />
<br />
{{note|keytab-lilo is a perl script invoking the "loadkeys" program.}}<br />
<br />
To create a compatible keymap (e.g. a german one) run:<br />
# keytab-lilo /usr/share/kbd/keymaps/i386/qwerty/us.kmap.gz /usr/share/kbd/i386/qwertz/de.kmap.gz > /boot/syslinux/de.ktl<br />
<br />
Now edit {{ic|syslinux.cfg}} and add:<br />
<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
KBDMAP de.ktl<br />
}}<br />
<br />
See the [http://www.syslinux.org/wiki/index.php/Directives/kbdmap Syslinux wiki] for more details.<br />
<br />
=== Hiding the menu ===<br />
<br />
Use the option:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
MENU HIDDEN<br />
}}<br />
to hide the menu while displaying only the timeout. Press any key to bring up the menu.<br />
<br />
=== Pxelinux ===<br />
<br />
{{Note|For UEFI, Syslinux uses the same binary for disk booting and network booting. Loading files from TFTP or other network protocols will require network booting Syslinux. }}<br />
<br />
[[Syslinux|PXELINUX]] is provided by the {{Pkg|syslinux}} package.<br />
<br />
For BIOS clients, copy the {{ic|<nowiki>{l,}pxelinux.0</nowiki>}} bootloader to the boot directory of the client. For version 5.00 and newer, also copy {{ic|ldlinux.c32}} from the same package:<br />
<br />
# cp /usr/lib/syslinux/bios/pxelinux.0 "$root/boot"<br />
# cp /usr/lib/syslinux/bios/ldlinux.c32 "$root/boot"<br />
# mkdir "$root/boot/pxelinux.cfg"<br />
<br />
We also created the {{ic|pxelinux.cfg}} directory, which is where PXELINUX searches for configuration files by default. Because we do not want to discriminate between different host MACs, we then create the {{ic|default}} configuration.<br />
<br />
{{hc|# vim "$root/boot/pxelinux.cfg/default"|<nowiki><br />
default linux<br />
<br />
label linux<br />
kernel vmlinuz-linux<br />
append initrd=initramfs-linux.img quiet ip=:::::eth0:dhcp nfsroot=10.0.0.1:/arch<br />
</nowiki>}}<br />
<br />
Or if you are using NBD, use the following append line:<br />
<br />
{{bc|<nowiki>append ro initrd=initramfs-linux.img ip=:::::eth0:dhcp nbd_host=10.0.0.1 nbd_name=arch root=/dev/nbd0</nowiki>}}<br />
<br />
{{Note|You will need to change {{ic|nbd_host}} and/or {{ic|nfsroot}}, respectively, to match your network configuration (the address of the NFS/NBD server)}}<br />
<br />
PXELINUX uses the same configuration syntax as SYSLINUX; refer to the upstream documentation for more information.<br />
<br />
The kernel and initramfs will be transferred via TFTP, so the paths to those are going to be relative to the TFTP root. Otherwise, the root filesystem is going to be the NFS mount itself, so those are relative to the root of the NFS server.<br />
<br />
To actually load PXELINUX, replace {{ic|filename "/grub/i386-pc/core.0";}} in {{ic|/etc/dhcpd.conf}} with {{ic|filename "/pxelinux.0"}} (or with {{ic|filename "/lpxelinux.0"}}).<br />
<br />
=== Booting ISO9660 image files with memdisk ===<br />
<br />
Syslinux supports booting from ISO images directly using the [http://www.syslinux.org/wiki/index.php/MEMDISK memdisk] module, see [[Multiboot USB drive#Using Syslinux and memdisk]] for examples.<br />
<br />
=== Serial console ===<br />
<br />
{{Merge|Working with the serial console|General page about topic not specific to Syslinux, already provides examples for GRUB.}}<br />
<br />
To enable Serial Console add the {{ic|SERIAL port [baudrate]}} to the top of {{ic|syslinux.cfg}} file. "port" is a number (0 for {{ic|/dev/ttyS0}}), if "baudrate" is omitted, the baud rate default is 9600 bps. The serial parameters are hardcoded to 8 bits, no parity and 1 stop bit.[http://www.syslinux.org/wiki/index.php/SYSLINUX#SERIAL_port_.5Bbaudrate_.5Bflowcontrol.5D.5D]<br />
<br />
{{hc|syslinux.cfg|<br />
SERIAL 0 115200<br />
}}<br />
<br />
Enable Serial Console in the kernel at boot by adding {{ic|1=console=tty0 console=ttyS0,115200n8}} to the {{ic|APPEND}} option.[http://www.mjmwired.net/kernel/Documentation/kernel-parameters.txt#681]<br />
<br />
{{hc|syslinux.cfg|2=<br />
APPEND root=UUID=126ca36d-c853-4f3a-9f46-cdd49d034ce4 rw console=tty0 console=ttyS0,115200n8<br />
}}<br />
<br />
How to do this with GRUB: [[Working with the serial console#GRUB2 and systemd]]<br />
<br />
== Troubleshooting ==<br />
<br />
=== Using the Syslinux prompt===<br />
<br />
You can type in the {{ic|LABEL}} name of the entry that you want to boot (as per your {{ic|syslinux.cfg}}). If you used the example configurations, just type:<br />
boot: arch<br />
<br />
If you get an error that the configuration file could not be loaded, you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 rw initrd=../initramfs-linux.img<br />
<br />
If you do not have access to {{ic|boot:}} in [[Ramdisk|ramfs]], and therefore temporarily unable to boot the kernel again,<br />
:1. Create a temporary directory, in order to mount your root partition (if it does not exist already):<br />
# mkdir -p /new_root<br />
:2. Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):<br />
{{Note|Busybox cannot mount {{ic|/boot}} if it is on its own ext2 partition.}}<br />
# mount /dev/sd[a-z][1-9] /new_root<br />
<br />
:3. Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.<br />
:4. Reboot.<br />
<br />
=== Fsck fails on root partition ===<br />
<br />
In the case of a badly corrupted root partition (in which the journal is damaged), in the ramfs emergency shell, mount the root file system:<br />
<br />
# mount /dev/''root partition'' /new_root<br />
And grab the tune2fs binary from the root partition (it is not included in Syslinux):<br />
# cp /new_root/sbin/tune2fs /sbin/<br />
<br />
Follow the instructions at [[Fsck#ext2fs_:_no_external_journal|ext2fs: no external journal]] to create a new journal for the root partition.<br />
<br />
=== No Default or UI found on some computers ===<br />
<br />
Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted USB drive may boot on a more recent computer, some computers may hang if the boot partition containing the ''kernel'' and ''initrd'' are not on a FAT16 partition. To prevent an older machine from loading {{ic|ldlinux}} and failing to read {{ic|syslinux.cfg}}, use {{ic|cfdisk}} to create a FAT16 partition (<=2GB) and format using {{Pkg|dosfstools}}:<br />
# mkfs.msdos -F 16 /dev/sda1<br />
<br />
then install and configure Syslinux.<br />
<br />
=== Missing operating system ===<br />
<br />
* Check that you have installed {{ic|gptmbr.bin}} for GPT and {{ic|mbr.bin}} for msdos partition table. A "Missing operating system" message comes from {{ic|mbr.bin}} while {{ic|gptmbr.bin}} would show a "Missing OS" message.<br />
<br />
* Check whether the partition that contains {{ic|/boot}} has the "boot" flag enabled.<br />
<br />
* Check whether the first partition at the boot device starts at sector 1 rather than sector 63 or 2048. Check this with {{ic|fdisk -l}}. If it starts at sector 1, you can move the partition(s) with {{ic|gparted}} from a rescue disk. Or, if you have a separate boot partition, you can back up {{ic|/boot}} with <br />
# cp -a /boot /boot.bak<br />
and then boot up with the Arch install disk. Next, use {{ic|cfdisk}} to delete the {{ic|/boot}} partition, and recreate it. This time it should begin at the proper sector, '''63'''. Now mount your partitions and {{ic|chroot}} into your mounted system, as described in the beginners guide. Restore {{ic|/boot}} with the command<br />
# cp -a /boot.bak/* /boot<br />
Check if {{ic|/etc/fstab}} is correct, run:<br />
# syslinux-install_update -iam<br />
and reboot.<br />
<br />
You will also get this error if you are trying to boot from a md [[RAID]] 1 array and created the array with a too new version of the metadata that Syslinux does not understand. As of August 2013 by default mdadm will create an array with version 1.2 metadata, but Syslinux does not understand metadata newer than 1.0. If this is the case you will need to recreate your [[RAID]] array using the {{ic|1=--metadata=1.0}} flag to mdadm.<br />
<br />
=== Windows boots up, ignoring Syslinux ===<br />
<br />
'''Solution:''' Make sure the partition that contains {{ic|/boot}} has the boot flag enabled. Also, make sure the boot flag is not enabled on the Windows partition. See the installation section above.<br />
<br />
The MBR that comes with Syslinux looks for the first active partition that has the boot flag set. The Windows partition was likely found first and had the boot flag set. If you wanted, you could use the MBR that Windows or MS-DOS {{ic|fdisk}} provides.<br />
<br />
=== Menu entries do nothing ===<br />
<br />
You select a menu entry and it does nothing, it just ''"refreshes"'' the menu. This usually means that you have an error in your {{ic|syslinux.cfg}} file. Hit {{ic|Tab}} to edit your boot parameters. Alternatively, press {{ic|Esc}} and type in the {{ic|LABEL}} of your boot entry (e.g. ''arch''). Another cause could be that you do not have a kernel installed. Find a way to access your file system (through live CD, etc) and make sure that {{ic|/mount/vmlinuz-linux}} exists and does not have a size of 0. If this is the case, [[Kernel_Panics#Option_2:_Reinstall_kernel|reinstall your kernel]].<br />
<br />
=== Cannot remove ldlinux.sys ===<br />
<br />
The {{ic|ldlinux.sys}} file has the immutable attribute set, which prevents it from being deleted or overwritten. This is because the sector location of the file must not change or else Syslinux has to be reinstalled. To remove it, run:<br />
# chattr -i /boot/syslinux/ldlinux.sys<br />
# rm /boot/syslinux/ldlinux.sys<br />
<br />
=== White block in upper left corner when using vesamenu ===<br />
<br />
Problem:<br />
''As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my Intel, when having Syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in Syslinux (the white block is actually an attempt to keep the Syslinux menu, but the driver fails to capture the picture from vesa graphics mode).''<br />
<br />
If you have a custom resolution and a {{ic|vesamenu}} with early modesetting, try to append the following in {{ic|syslinux.cfg}} to remove the white block and continue in graphics mode:<br />
APPEND root=/dev/sda6 rw 5 '''vga=current''' quiet splash<br />
<br />
=== Chainloading Windows does not work, when it is installed on another drive ===<br />
<br />
If Windows is installed on a different drive than Arch and you have trouble chainloading it, try the following configuration:<br />
<br />
LABEL Windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xdfc1ba9e swap<br />
<br />
Replace the mbr code with the one your Windows drive has (details [[#Chainloading|above]]), and append {{ic|swap}} to the options.<br />
<br />
=== Read bootloader log ===<br />
<br />
In some cases (e.g. bootloader unable to boot kernel) it is highly desirable to get more information from the boot process. ''Syslinux'' prints error messages to screen but the boot menu quickly overwrites the text. To avoid losing the log information, disable {{ic|UI menu}} in {{ic|syslinux.cfg}} and use the default "command-line" prompt. It means:<br />
<br />
* avoid the UI directive<br />
* avoid ONTIMEOUT<br />
* avoid ONERROR<br />
* avoid MENU CLEAR<br />
* use a higher TIMEOUT<br />
* use PROMPT 1<br />
* use DEFAULT <problematic_label><br />
<br />
To get more detailed debug log, recompile the {{Pkg|syslinux}} package with additional CFLAGS:<br />
<br />
-DDEBUG_STDIO=1 -DCORE_DEBUG=1<br />
<br />
=== Btrfs compression ===<br />
<br />
Booting from btrfs with compression is not supported.[http://www.syslinux.org/wiki/index.php/Syslinux_4_Changelog#Changes_in_4.02]<br />
This error will show:<br />
btrfs: found compressed data, cannot continue!<br />
invalid or corrupt kernel image.<br />
[[GRUB]] supports btrfs with compression.<br />
<br />
== See also ==<br />
<br />
* [http://www.syslinux.org Official website]<br />
* [http://www.josephn.net/scrapbook/pxelinux_stuff PXELinux configuration]<br />
* [http://blog.jak.me/2013/01/03/creating-a-multiboot-usb-stick-using-syslinux/ Multiboot USB using Syslinux]{{Dead link|2015|05|15}}</div>Spaceonehttps://wiki.archlinux.org/index.php?title=Syslinux&diff=432156Syslinux2016-04-22T03:59:39Z<p>Spaceone: /* Keyboard layout */ Name of the script is 'keytab-lilo'</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[es:Syslinux]]<br />
[[fr:Syslinux]]<br />
[[it:Syslinux]]<br />
[[ja:Syslinux]]<br />
[[ru:Syslinux]]<br />
[[tr:Syslinux]]<br />
[[zh-CN:Syslinux]]<br />
{{Related articles start}}<br />
{{Related|Arch boot process}}<br />
{{Related|Boot loaders}}<br />
{{Related articles end}}<br />
<br />
[[Wikipedia:SYSLINUX|Syslinux]] is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the [[Wikipedia:File Allocation Table|FAT]], [[Wikipedia:ext2|ext2]], [[ext3]], [[ext4]], and [[Btrfs]] [[file systems]].<br />
<br />
{{Note|Syslinux cannot access files from partitions other than its own. For an alternative bootloader with the multifs feature see [[GRUB]].}}<br />
<br />
== BIOS Systems ==<br />
<br />
=== Boot process overview ===<br />
<br />
# '''Stage 1 : Part 1''' - '''Load MBR''' - At boot, the BIOS loads the 440 byte [[MBR]] boot code at the start of the disk ({{ic|/usr/lib/syslinux/bios/mbr.bin}} or {{ic|/usr/lib/syslinux/bios/gptmbr.bin}}). <br />
# '''Stage 1 : Part 2''' - '''Search active partition'''. The '''Stage 1 MBR boot code''' looks for the partition that is marked as active (boot flag in MBR disks). Let us assume this is the {{ic|/boot}} partition for example.<br />
# '''Stage 2 : Part 1''' - '''Execute volume boot record''' - The '''Stage 1 MBR boot code''' executes the Volume Boot Record (VBR) of the {{ic|/boot}} partition. In the case of Syslinux, the VBR boot code is the starting sector of {{ic|/boot/syslinux/ldlinux.sys}} which is created by the {{ic|extlinux --install}} command. Note {{ic|ldlinux.sys}} is not same as {{ic|ldlinux.c32}}.<br />
# '''Stage 2 : Part 2''' - '''Execute {{ic|/boot/syslinux/ldlinux.sys}}''' - The VBR will load the rest of {{ic|/boot/syslinux/ldlinux.sys}}. The sector location of {{ic|/boot/syslinux/ldlinux.sys}} should not change, otherwise syslinux will not boot. {{Note|In the case of [[Btrfs]], the above method will not work since files move around resulting in changing of the sector location of {{ic|ldlinux.sys}}. Therefore, in BTRFS the entire {{ic|ldlinux.sys}} code is embedded in the space following the VBR and is not installed at {{ic|/boot/syslinux/ldlinux.sys}} unlike the case of other filesystems.}}<br />
# '''Stage 3''' - '''Load {{ic|/boot/syslinux/ldlinux.c32}}''' - The {{ic|/boot/syslinux/ldlinux.sys}} will load the {{ic|/boot/syslinux/ldlinux.c32}} (core module) that contains the rest of the '''core''' part of syslinux that could not be fit into {{ic|ldlinux.sys}} (due to file-size constraints). The {{ic|ldlinux.c32}} file should be present in every Syslinux installation and should match the version of {{ic|ldlinux.sys}} installed in the partition. Otherwise Syslinux will fail to boot. See http://bugzilla.syslinux.org/show_bug.cgi?id=7 for more info.<br />
# '''Stage 4''' - '''Search and Load configuration file''' - Once Syslinux is fully loaded, it looks for {{ic|/boot/syslinux/syslinux.cfg}} (or {{ic|/boot/syslinux/extlinux.conf}} in some cases) and loads it if it is found. If no configuration file is found, you will be dropped to a Syslinux {{ic|boot:}} prompt. This step and the rest of '''non-core''' parts of Syslinux ({{ic|/boot/syslinux/*.c32}} modules, excluding {{ic|lib*.c32}} and {{ic|ldlinux.c32}}) require {{ic|/boot/syslinux/lib*.c32}} (library) modules to be present (http://www.syslinux.org/wiki/index.php/Common_Problems#ELF). The {{ic|lib*.c32}} library modules and non-core {{ic|*.c32}} modules should match the version of {{ic|ldlinux.sys}} installed in the partition.<br />
<br />
=== Installation on BIOS ===<br />
<br />
[[Install]] the {{Pkg|syslinux}} package.<br />
<br />
{{Note|<br />
* {{Pkg|gptfdisk}} is required for [[wikipedia:GUID_Partition_Table|GPT]] support using the automated script.<br />
* If your boot partition is FAT, you will also need {{Pkg|mtools}}.<br />
}}<br />
<br />
Installing the package is not the same as installing the bootloader. After installing the relevant package(s), the bootloader code itself needs to be installed (to the adequate area, usually the VBR) so to be able to boot the system; the following sections provide alternative instructions depending on the characteristics of your particular system.<br />
<br />
==== Automatic Install ====<br />
<br />
{{Note|The {{ic|syslinux-install_update}} script is Arch specific, and is not provided/supported by Syslinux upstream. Please direct any bug reports specific to the script to the Arch Bug Tracker and not upstream.<br />
}}<br />
<br />
* After executing the {{ic|syslinux-install_update}} script, do not forget to edit {{ic|/boot/syslinux/syslinux.cfg}} by following [[#Configuration]] and [[#Kernel parameters]].<br />
<br />
{{Warning|The {{ic|syslinux-install_update}} script sets a default root partition that possibly will not match your particular system. It is important to point Syslinux to the correct root partition by editing {{ic|/boot/syslinux/syslinux.cfg}}, or the OS will fail to boot. See [[#Kernel parameters]].}}<br />
<br />
The {{ic|syslinux-install_update}} script will install Syslinux, copy {{ic|*.c32}} modules to {{ic|/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:<br />
<br />
If you use a separate boot partition make sure that it is mounted. Check with {{ic|lsblk}}; if you do not see a {{ic|/boot}} mountpoint, mount it before you go any further.<br />
<br />
* Run {{ic|syslinux-install_update}} with flags: {{ic|-i}} (install the files), {{ic|-a}} (mark the partition ''active'' with the ''boot'' flag), {{ic|-m}} (install the ''MBR'' boot code): {{bc|# syslinux-install_update -i -a -m}} If this command fails with ''Syslinux BIOS install failed'', the problem is likely that the {{ic|extlinux}} binary could not find the partition containing {{ic|/boot}}: <br />
<br />
{{hc|# extlinux --install /boot/syslinux/|<br />
extlinux: cannot find device for path /boot/syslinux<br />
extlinux: cannot open device (null)<br />
}} <br />
<br />
This can happen for example when upgrading from [[LILO]] which, while booting a current custom kernel, turned a kernel command line parameter of say {{ic|1=root=/dev/sda1}} into its numeric equivalent {{ic|1=root=801}}, as evidenced by {{ic|/proc/cmdline}} and the output of the {{ic|mount}} command. Remedy the situation by either continuing with the manual install described below while specifying {{ic|1=--device=/dev/sda1}} to {{ic|extlinux}}, or simply by first rebooting into a stock Arch Linux kernel; its use of an initramfs avoids the problem.<br />
<br />
{{Note|<br />
* When you reboot your system now, you will have a Syslinux prompt. To automatically boot your system or get a boot menu, you still need to create a configuration file.<br />
* If you are on another root directory (e.g. from an install disk) install SYSLINUX by directing to the chroot:<br />
# syslinux-install_update -i -a -m -c /mnt/<br />
}}<br />
<br />
* Now is the time to edit {{ic|/boot/syslinux/syslinux.cfg}} by following [[#Configuration]] and [[#Kernel parameters]].<br />
<br />
==== Manual install ====<br />
<br />
{{Note|<br />
* If you are unsure of which partition table you are using (MBR or GPT), you can check using the following command<br />
# blkid -s PTTYPE -o value /dev/sda<br />
gpt<br />
<br />
* If you are trying to rescue an installed system with a live CD, be sure to [[chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not {{ic|/dev/}} paths) with the mount point.<br />
}}<br />
<br />
Your boot partition, on which you plan to install Syslinux, must contain a FAT, ext2, ext3, ext4, or Btrfs file system. You should install it on a mounted directory—not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}}. You can install Syslinux in the {{ic|syslinux}} directory:<br />
<br />
# mkdir /boot/syslinux<br />
# cp -r /usr/lib/syslinux/bios/*.c32 /boot/syslinux/ ## copy ALL the *.c32 files from /usr/lib/syslinux/bios/, DO NOT SYMLINK<br />
# extlinux --install /boot/syslinux/<br />
<br />
After this, proceed to install the Syslinux boot code ({{ic|mbr.bin}} or {{ic|gptmbr.bin}}) to the Master Boot Record 440-byte boot code region (not to be confused with MBR aka msdos partition table) of the disk, as described in the next sections, respectively.<br />
<br />
{{Note|For a partitionless install, there is no need to install the Syslinux boot code to the MBR. See [https://unix.stackexchange.com/questions/103501/boot-partiotionless-disk-with-syslinux].}}<br />
<br />
===== MBR partition table =====<br />
<br />
See the main article: [[Master Boot Record]].<br />
<br />
Next you need to mark your boot partition as "active" in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|parted/gparted}} ("boot" flag). It should look like this:<br />
{{hc|# fdisk -l /dev/sda|<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
}}<br />
<br />
Install the MBR:<br />
# dd bs=440 count=1 if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sda<br />
<br />
An alternative MBR which Syslinux provides is: {{ic|altmbr.bin}}. This MBR does ''not'' scan for bootable partitions; instead, the last byte of the MBR is set to a value indicating which partition to boot from. Here is an example of how {{ic|altmbr.bin}} can be copied into position:<br />
# printf '\x5' | cat /usr/lib/syslinux/bios/altmbr.bin - | dd bs=440 count=1 iflag=fullblock of=/dev/sda<br />
<br />
In this case, a single byte of value 5 (hexadecimal) is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device {{ic|sda}}. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.<br />
<br />
===== GUID partition table =====<br />
<br />
See the main article: [[GUID Partition Table]].<br />
<br />
Bit 2 of the attributes ("legacy_boot" attribute) needs to be set for the {{ic|/boot}} partition:.<br />
# sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute ''legacy BIOS bootable'' on partition 1. To check:<br />
{{hc|<nowiki># sgdisk /dev/sda --attributes=1:show</nowiki>|<br />
1:2:1 (legacy BIOS bootable)<br />
}}<br />
<br />
Install the MBR:<br />
# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/bios/gptmbr.bin of=/dev/sda<br />
<br />
If this does not work you can also try:<br />
# syslinux-install_update -i -m<br />
<br />
== UEFI Systems ==<br />
<br />
{{Note|<br />
*{{ic|$esp}} is the mountpoint of the [[ESP]] (EFI System Partition) in the below commands.<br />
<br />
* {{ic|efi64}} denotes x86_64 UEFI systems, for IA32 (32-bit) EFI replace {{ic|efi64}} with {{ic|efi32}} in the below commands.<br />
<br />
* For Syslinux, the kernel and initramfs files need to be in the ESP, as Syslinux does not (currently) have the ability to access files outside its own partition (i.e. outside ESP in this case). For this reason, it is recommended to mount ESP at {{ic|/boot}}.<br />
<br />
* The automatic install script {{ic|/usr/bin/syslinux-install_update}} does not support UEFI install.<br />
<br />
* The configuration syntax of {{ic|syslinux.cfg}} for UEFI is same as that of BIOS.<br />
}}<br />
<br />
=== Limitations of UEFI Syslinux ===<br />
<br />
* UEFI Syslinux application {{ic|syslinux.efi}} cannot be signed by {{ic|sbsign}} (from sbsigntool) for UEFI Secure Boot. Bug report - http://bugzilla.syslinux.org/show_bug.cgi?id=8<br />
<br />
* Using TAB to edit kernel parameters in UEFI Syslinux menu might lead to garbaged display (text on top of one-another). Bug report - http://bugzilla.syslinux.org/show_bug.cgi?id=9<br />
<br />
* UEFI Syslinux does not support chainloading other EFI applications like {{ic|UEFI Shell}} or {{ic|Windows Boot Manager}}. Enhancement request - http://bugzilla.syslinux.org/show_bug.cgi?id=17<br />
<br />
* In some cases, UEFI Syslinux might not boot in some Virtual Machines like QEMU/OVMF or VirtualBox or some VMware products/versions and in some UEFI emulation environments like DUET. A Syslinux contributor has confirmed no such issues present on VMware Workstation 10.0.2 and Syslinux-6.02 or later. Bug reports - http://bugzilla.syslinux.org/show_bug.cgi?id=21 and http://bugzilla.syslinux.org/show_bug.cgi?id=23<br />
<br />
* Memdisk is not available for UEFI. Enhancement request - http://bugzilla.syslinux.org/show_bug.cgi?id=30<br />
<br />
=== Installation on UEFI ===<br />
<br />
* Install the {{Pkg|syslinux}} and {{Pkg|efibootmgr}} packages from the [[official repositories]]. Then setup Syslinux in the EFI System Partition (ESP) as follows:<br />
<br />
* Copy Syslinux files to ESP (replace {{ic|$esp}} by the mount point of the ESP, usually {{ic|/boot}}):<br />
<br />
# mkdir -p $esp/EFI/syslinux<br />
# cp -r /usr/lib/syslinux/efi64/* $esp/EFI/syslinux/<br />
<br />
* Setup boot entry for Syslinux using [[Unified Extensible Firmware Interface#efibootmgr|efibootmgr]]:<br />
<br />
# efibootmgr -c -d /dev/sdX -p Y -l /EFI/syslinux/syslinux.efi -L "Syslinux"<br />
<br />
where {{ic|/dev/sdXY}} is the partition containing the bootloader.<br />
<br />
* Create or edit {{ic|$esp/EFI/syslinux/syslinux.cfg}} by following [[#Configuration]].<br />
<br />
{{Note|The config file for UEFI is {{ic|$esp/EFI/syslinux/syslinux.cfg}}, not {{ic|/boot/syslinux/syslinux.cfg}}. Files in {{ic|/boot/syslinux/}} are BIOS specific and not related to UEFI Syslinux.}}<br />
<br />
== Configuration ==<br />
<br />
The Syslinux configuration file, {{ic|syslinux.cfg}}, should be created in the same directory where you installed Syslinux. In our case, {{ic|/boot/syslinux/}} for BIOS systems and {{ic|$esp/EFI/syslinux/}} for UEFI systems.<br />
<br />
The bootloader will look for either {{ic|syslinux.cfg}} (preferred) or {{ic|extlinux.conf}}<br />
<br />
{{Tip|<br />
* Instead of {{ic|LINUX}}, the keyword {{ic|KERNEL}} can also be used. {{ic|KERNEL}} tries to detect the type of the file, while {{ic|LINUX}} always expects a Linux kernel. <br />
* {{ic|TIMEOUT}} value is in units of '''0.1 seconds'''.<br />
}}<br />
<br />
=== Examples ===<br />
<br />
{{Note|<br />
* Any configuration file found in the examples needs to be edited to set the proper kernel parameters. See section [[#Kernel parameters]].<br />
* Please, pay close attention to the paths. The examples may not be suitable for your installation, especially when using UEFI.<br />
}}<br />
<br />
==== Boot prompt ====<br />
This is a simple configuration file that will show a {{ic|boot:}} prompt and automatically boot after 5 seconds. If you want to boot directly without seeing a prompt, set {{ic|PROMPT}} to {{ic|0}}.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
==== Text boot menu ====<br />
<br />
Syslinux also allows you to use a boot menu. To use it, copy the {{ic|menu}} module to your Syslinux directory:<br />
# cp /usr/lib/syslinux/bios/menu.c32 /boot/syslinux/<br />
<br />
Copying additional {{ic|lib*.c32}} library modules might be needed too.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
For more details about the menu system, see [http://www.syslinux.org/wiki/index.php/Menu the Syslinux wiki].<br />
<br />
==== Graphical boot menu ====<br />
<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the {{ic|vesamenu}} COM32 module to your Syslinux folder:<br />
# cp /usr/lib/syslinux/bios/vesamenu.c32 /boot/syslinux/<br />
<br />
Copying additional {{ic|lib*.c32}} library modules might be needed too.<br />
<br />
{{Note| If you are using [[UEFI]] make sure to copy from {{ic|/usr/lib/syslinux/efi64/}} ({{ic|efi32}} for i686 systems), otherwise you will be presented with a black screen. In that case, boot from a live medium and use [[chroot]] to make the appropriate changes.}}<br />
<br />
This configuration uses the same menu design as the Arch Install CD, its config can be found at [https://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux projects.archlinux.org]. The [https://projects.archlinux.org/archiso.git/plain/configs/releng/syslinux/splash.png Arch Linux background image] can be downloaded from there, too. Copy the image to {{ic|/boot/syslinux/splash.png}}.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
Since Syslinux 3.84, {{ic|vesamenu.c32}} supports the {{ic|MENU RESOLUTION $WIDTH $HEIGHT}} directive.<br />
To use it, insert {{ic|MENU RESOLUTION 1440 900}} into your config for a 1440x900 resolution.<br />
However, the background picture has to have exactly the right resolution, as Syslinux will otherwise refuse to load the menu.<br />
<br />
To center the menu and adjust resolution, use {{ic|MENU RESOLUTION}}, {{ic|MENU HSHIFT $N}} and {{ic|MENU VSHIFT $N}} where {{ic|$N}} is a positive number. The default values are both {{ic|0}} which is the upper-left hand corner of your monitor. Conversely, a negative number starts from the opposite end of the screen (e.g. {{ic|VHSHIFT -4}} would be 4 rows from the bottom of the screen).<br />
<br />
To move the menu to the center, add or edit these values:<br />
<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
MENU RESOLUTION 800 600 # or whatever your screen resolution is<br />
MENU WIDTH 78 # width of the menu also required to bring the menu box to size<br />
MENU VSHIFT 10 # moves menu down<br />
MENU HSHIFT 10 # moves menu right<br />
</nowiki><br />
}}<br />
<br />
VESA standards are commonly a maximum of 25 rows and 80 columns, so going higher than those values might move the menu off the screen, potentially requiring editing from a rescue CD.<br />
<br />
=== Kernel parameters ===<br />
<br />
The [[kernel parameters]] are set using the {{ic|APPEND}} line in {{ic|syslinux.cfg}}. It is recommended to make the following changes for the fallback entry as well.<br />
<br />
'''In the simplest case''', the partition name in the {{ic|root}} parameter needs to be replaced. Change {{ic|/dev/sda2}} to point to the correct root partition.<br />
<br />
APPEND root=/dev/sda2<br />
<br />
'''If you want to use [[UUID]]''' for [[persistent block device naming]] change the {{ic|APPEND}} line as follows, substituting {{ic|1234}} with the {{ic|UUID}} of your root partition:<br />
<br />
APPEND root=UUID=''1234'' rw<br />
<br />
'''If you use encryption''' [[LUKS]] change the {{ic|APPEND}} line to use your encrypted volume:<br />
<br />
APPEND root=/dev/mapper/''group''-''name'' cryptdevice=/dev/sda2:''name'' rw<br />
<br />
'''If you are using software''' [[Wikipedia:RAID|RAID]] using [http://neil.brown.name/blog/mdadm mdadm], change the {{ic|APPEND}} line to accommodate your RAID arrays. As an example the following accommodates three RAID 1 arrays and sets the appropriate one as root:<br />
<br />
APPEND root=/dev/md1 rw md=0,/dev/sda2,/dev/sdb2 md=1,/dev/sda3,/dev/sdb3 md=2,/dev/sda4,/dev/sdb4<br />
<br />
If booting from a software raid partition fails using the kernel device node method above an alternative, a more reliable, way is to use partition labels:<br />
<br />
APPEND root=LABEL=THEROOTPARTITIONLABEL rw<br />
<br />
'''If booting a [[btrfs]] subvolume''', amend the {{ic|APPEND}} line with {{ic|rootflags<nowiki>=</nowiki>subvol<nowiki>=</nowiki><root subvolume>}}. For example, where {{ic|/dev/sda2}} has been mounted as a btrfs subvolume called 'ROOT' (e.g. {{ic|mount -o noatime,subvol<nowiki>=</nowiki>ROOT /dev/sda2 /mnt}}), then the {{ic|APPEND}} line would need to be modified as follows:<br />
APPEND root=/dev/sda2 rw rootflags=subvol=ROOT<br />
<br />
A failure to do so will otherwise result in the following error message: {{ic|ERROR: Root device mounted successfully, but /sbin/init does not exist.}}<br />
<br />
=== Auto boot ===<br />
<br />
If you do not want to see the Syslinux menu at all, use the [[#Boot prompt]], and set {{ic|PROMPT}} to {{ic|0}} and comment out any {{ic|UI}} menu entries. Setting the {{ic|TIMEOUT}} variable to {{ic|0}} might also be a good idea. Make sure there is a {{ic|DEFAULT}} set in your {{ic|syslinux.cfg}}.<br />
<br />
=== Security ===<br />
<br />
Syslinux has two levels of bootloader security: a menu master password, and a per-menu-item password. In {{ic|syslinux.cfg}}, use<br />
{{bc|<br />
MENU MASTER PASSWD passwd <br />
}}<br />
to set a master bootloader password, and<br />
{{bc|<br />
MENU PASSWD passwd <br />
}}<br />
within a {{ic|LABEL}} block to password-protect individual boot items.<br />
<br />
The passwd can be either a cleartext password or hashed: [http://www.syslinux.org/wiki/index.php/Comboot/menu.c32 see official documentation].<br />
<br />
=== Chainloading ===<br />
<br />
{{Note|Syslinux BIOS cannot directly chainload files from other partitions; however, {{ic|chain.c32}} can boot a partition boot sector (VBR).}}<br />
<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy the {{ic|chain.c32}} module to the Syslinux directory (additional {{ic|lib*.c32}} library modules might be needed too; for details, see the instructions in the previous section). Then create a section in the configuration file:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
...<br />
}}<br />
<br />
{{ic|hd0 3}} is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. <br />
<br />
{{note|For Windows, this skips the system's own boot manager ({{ic|bootmgr}}), which is required for a few important updates ([http://support.microsoft.com/kb/2883200 eg.]) to complete. In such cases it may be advisable to temporarily set the MBR boot flag to the Windows partition (eg. with [[GParted]]), let the update finish installing, and then reset the flag to the Syslinux partition (eg. with Windows's own [http://www.online-tech-tips.com/computer-tips/set-active-partition-vista-xp DiskPart]).}}<br />
<br />
If you are unsure about which drive your BIOS thinks is "first", you can instead use the MBR identifier, or if you are using GPT, the filesystem labels. To use the MBR identifier, run the command<br />
{{hc|# fdisk -l /dev/sdb|<nowiki><br />
Disk /dev/sdb: 128.0 GB, 128035676160 bytes <br />
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0xf00f1fd3<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sdb1 2048 4196351 2097152 7 HPFS/NTFS/exFAT<br />
/dev/sdb2 4196352 250066943 122935296 7 HPFS/NTFS/exFAT</nowiki><br />
}}<br />
<br />
replacing {{ic|/dev/sdb}} with the drive you wish to chainload. Using the hexadecimal number under Disk identifier: {{ic|0xf00f1fd3}} in this case, the syntax in {{ic|syslinux.cfg}} is<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xf00f1fd3<br />
...<br />
}}<br />
<br />
For more details about chainloading, see [http://www.syslinux.org/wiki/index.php/Comboot/chain.c32 the Syslinux wiki].<br />
<br />
If you have [[GRUB]] installed on the same partition, you can chainload it by using: <br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
...<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
...</nowiki><br />
}}<br />
Alternatively, it is also possible to load [[GRUB]] as a linux kernel by prepending {{ic|lnxboot.img}} to {{ic|core.img}}. The file {{ic|lnxboot.img}} is part of {{ic|core/grub}} and can be found in {{ic|/usr/lib/grub/i386-pc}}.<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
...<br />
LABEL grub2lnx<br />
MENU LABEL Grub2 (lnxboot)<br />
LINUX ../grub/i386-pc/lnxboot.img<br />
INITRD ../grub/i386-pc/core.img<br />
...</nowiki><br />
}}<br />
This may be required for booting from ISO images.<br />
<br />
=== Chainloading other Linux systems ===<br />
{{Accuracy|Among other inaccuracies... 1_ There is no obligation to install yet another boot loader if you already have one related to the other partition/OS (e.g. GRUB2 installed in the MBR or in the VBR of the partition being chainloaded to). 2_ Syslinux (in any of its derivatives) is never "installed to the MBR", so mentioning the MBR in this section without any explanation of what it is being meant or how to do it in practical terms is just adding confusion. 3_ Typos and misspelling. 4_No need to explain (yet again) how to install some (other) bootloader to some (other) partition / OS; just how to chainload from Syslinux to that other partition / bootloader / OS.}}<br />
Chainloading another bootloader such as Windows' is pretty obvious, as there is a definite bootloader to chain to. But with Syslinux, it is only able to load files residing on the same partition as the configuration file. Thus, if you have another version of Linux on a separate partition, without a shared {{ic|/boot}}, it becomes ''necessary'' to employ EXTLINUX rather than the other OS's default bootloader (eg. GRUB2). Essentially, EXTLINUX can be installed on the partition superblock/[[wikipedia:Volume_boot_record|VBR]] and be called as a ''separate bootloader'' right from the MBR installed by Syslinux. EXTLINUX is part of The Syslinux Project and is included with the {{Pkg|syslinux}} package.<br />
<br />
The following instructions assume you have Syslinux installed already. These instructions will also assume that the typical Arch Linux configuration path of {{ic|/boot/syslinux}} is being used and the chainloaded system's {{ic|/}} is on {{ic|/dev/sda3}}. <br />
<br />
From a booted Linux (likely the partition that Syslinux is set up to boot), mount the other system's root partition to your desired mount point. In this example this will be {{ic|/mnt}}. Also, if a separate {{ic|/boot}} partition is used on the second operating system, that will also need to be mounted. The example assumes this is {{ic|/dev/sda2}}.<br />
# mount /dev/sda3 /mnt<br />
# mount /dev/sda2 /mnt/boot (only necessary for separate /boot)<br />
Install EXTLINUX to the partition VBR, and copy necessary {{ic|*.c32}} files<br />
# extlinux -i /mnt/boot/syslinux/ (first create the directory if necessary)<br />
# cp /usr/lib/syslinux/bios/*.c32 /mnt/boot/syslinux<br />
<br />
Create {{ic|/mnt/boot/syslinux/syslinux.cfg}}. You can use the other Linux's bootloader menu file for reference. Below is an example:<br />
{{hc|/boot/syslinux/syslinux.cfg '''on /dev/sda3'''|<nowiki><br />
timeout 10<br />
<br />
ui menu.c32<br />
<br />
label Other Linux<br />
linux /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
append root=/dev/sda3 rw quiet<br />
<br />
label MAIN<br />
com32 chain.c32<br />
append hd0 0</nowiki><br />
}}<br />
<br />
taken from [[User:Djgera|Djgera's user wiki page]].<br />
<br />
Note that the other Linux entry in {{ic|<other-OS>/boot/syslinux/syslinux.cfg}} will need to be edited each time you update this OS's kernel. Since we are booting the kernel directly and not chainloading the other-OS's default bootloader.<br />
<br />
=== Using memtest ===<br />
<br />
Install {{Pkg|memtest86+}} from the [[official repositories]].<br />
<br />
Use this {{ic|LABEL}} section to launch [[Wikipedia:Memtest86|memtest]]:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
...<br />
}}<br />
''<br />
{{Note|If you are using PXELINUX, change the name from ''memtest.bin'' to ''memtest'' since PXELINUX treats the file with .bin extension as a boot sector and loads only 2KB of it.}}<br />
<br />
=== HDT ===<br />
<br />
[http://hdt-project.org/ HDT (Hardware Detection Tool)] displays hardware information. Like before, the {{ic|.c32}} file has to be copied from {{ic|/boot/syslinux/}}. Additional {{ic|lib*.c32}} library modules might be needed too.<br />
For PCI info, copy {{ic|/usr/share/hwdata/pci.ids}} to {{ic|/boot/syslinux/pci.ids}} and add the following to your configuration file:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
}}<br />
<br />
=== Reboot and power off ===<br />
<br />
{{Note|As of Syslinux 6.03, {{ic|poweroff.c32}} only works with APM and not with ACPI. For a possible solution, see [http://www.syslinux.org/archives/2012-March/017661.html this thread] .}}<br />
<br />
Use the following sections to reboot or power off your machine:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COM32 poweroff.c32<br />
}}<br />
<br />
=== Clear menu ===<br />
<br />
To clear the screen when exiting the menu, add the following line:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
MENU CLEAR<br />
}}<br />
<br />
=== Keyboard layout ===<br />
<br />
If you often have to edit your boot command with diverse parameters in the Syslinux boot prompt, then you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keyboard.<br />
<br />
{{note|keytab-lilo is a perl script invoking the "loadkeys" program.}}<br />
<br />
First you have to create a compatible keymap, in this example German:<br />
{{Note|{{ic|us.kmap}} needs to be created or the following will not work.}}<br />
$ cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz .<br />
$ cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz .<br />
$ gunzip de.map.gz<br />
$ gunzip us.map.gz<br />
$ mv de.map de.kmap<br />
$ mv us.map us.kmap<br />
# keytab-lilo de > de.ktl<br />
<br />
Copy {{ic|de.ktl}} as root to {{ic|/boot/syslinux/}} and set ownership to root:<br />
<br />
# chown root:root /boot/syslinux/de.ktl<br />
<br />
A generic example:<br />
# keytab-lilo ''/path/to/''us.kmap.gz ''/path/to/''dvorak.kmap.gz > ''/path/to/''dvorak.ktl<br />
<br />
Now edit {{ic|syslinux.cfg}} and add:<br />
<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
KBDMAP de.ktl<br />
}}<br />
<br />
See the [http://www.syslinux.org/wiki/index.php/Directives/kbdmap Syslinux wiki] for more details.<br />
<br />
=== Hiding the menu ===<br />
<br />
Use the option:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
MENU HIDDEN<br />
}}<br />
to hide the menu while displaying only the timeout. Press any key to bring up the menu.<br />
<br />
=== Pxelinux ===<br />
<br />
{{Note|For UEFI, Syslinux uses the same binary for disk booting and network booting. Loading files from TFTP or other network protocols will require network booting Syslinux. }}<br />
<br />
[[Syslinux|PXELINUX]] is provided by the {{Pkg|syslinux}} package.<br />
<br />
For BIOS clients, copy the {{ic|<nowiki>{l,}pxelinux.0</nowiki>}} bootloader to the boot directory of the client. For version 5.00 and newer, also copy {{ic|ldlinux.c32}} from the same package:<br />
<br />
# cp /usr/lib/syslinux/bios/pxelinux.0 "$root/boot"<br />
# cp /usr/lib/syslinux/bios/ldlinux.c32 "$root/boot"<br />
# mkdir "$root/boot/pxelinux.cfg"<br />
<br />
We also created the {{ic|pxelinux.cfg}} directory, which is where PXELINUX searches for configuration files by default. Because we do not want to discriminate between different host MACs, we then create the {{ic|default}} configuration.<br />
<br />
{{hc|# vim "$root/boot/pxelinux.cfg/default"|<nowiki><br />
default linux<br />
<br />
label linux<br />
kernel vmlinuz-linux<br />
append initrd=initramfs-linux.img quiet ip=:::::eth0:dhcp nfsroot=10.0.0.1:/arch<br />
</nowiki>}}<br />
<br />
Or if you are using NBD, use the following append line:<br />
<br />
{{bc|<nowiki>append ro initrd=initramfs-linux.img ip=:::::eth0:dhcp nbd_host=10.0.0.1 nbd_name=arch root=/dev/nbd0</nowiki>}}<br />
<br />
{{Note|You will need to change {{ic|nbd_host}} and/or {{ic|nfsroot}}, respectively, to match your network configuration (the address of the NFS/NBD server)}}<br />
<br />
PXELINUX uses the same configuration syntax as SYSLINUX; refer to the upstream documentation for more information.<br />
<br />
The kernel and initramfs will be transferred via TFTP, so the paths to those are going to be relative to the TFTP root. Otherwise, the root filesystem is going to be the NFS mount itself, so those are relative to the root of the NFS server.<br />
<br />
To actually load PXELINUX, replace {{ic|filename "/grub/i386-pc/core.0";}} in {{ic|/etc/dhcpd.conf}} with {{ic|filename "/pxelinux.0"}} (or with {{ic|filename "/lpxelinux.0"}}).<br />
<br />
=== Booting ISO9660 image files with memdisk ===<br />
<br />
Syslinux supports booting from ISO images directly using the [http://www.syslinux.org/wiki/index.php/MEMDISK memdisk] module, see [[Multiboot USB drive#Using Syslinux and memdisk]] for examples.<br />
<br />
=== Serial console ===<br />
<br />
{{Merge|Working with the serial console|General page about topic not specific to Syslinux, already provides examples for GRUB.}}<br />
<br />
To enable Serial Console add the {{ic|SERIAL port [baudrate]}} to the top of {{ic|syslinux.cfg}} file. "port" is a number (0 for {{ic|/dev/ttyS0}}), if "baudrate" is omitted, the baud rate default is 9600 bps. The serial parameters are hardcoded to 8 bits, no parity and 1 stop bit.[http://www.syslinux.org/wiki/index.php/SYSLINUX#SERIAL_port_.5Bbaudrate_.5Bflowcontrol.5D.5D]<br />
<br />
{{hc|syslinux.cfg|<br />
SERIAL 0 115200<br />
}}<br />
<br />
Enable Serial Console in the kernel at boot by adding {{ic|1=console=tty0 console=ttyS0,115200n8}} to the {{ic|APPEND}} option.[http://www.mjmwired.net/kernel/Documentation/kernel-parameters.txt#681]<br />
<br />
{{hc|syslinux.cfg|2=<br />
APPEND root=UUID=126ca36d-c853-4f3a-9f46-cdd49d034ce4 rw console=tty0 console=ttyS0,115200n8<br />
}}<br />
<br />
How to do this with GRUB: [[Working with the serial console#GRUB2 and systemd]]<br />
<br />
== Troubleshooting ==<br />
<br />
=== Using the Syslinux prompt===<br />
<br />
You can type in the {{ic|LABEL}} name of the entry that you want to boot (as per your {{ic|syslinux.cfg}}). If you used the example configurations, just type:<br />
boot: arch<br />
<br />
If you get an error that the configuration file could not be loaded, you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 rw initrd=../initramfs-linux.img<br />
<br />
If you do not have access to {{ic|boot:}} in [[Ramdisk|ramfs]], and therefore temporarily unable to boot the kernel again,<br />
:1. Create a temporary directory, in order to mount your root partition (if it does not exist already):<br />
# mkdir -p /new_root<br />
:2. Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):<br />
{{Note|Busybox cannot mount {{ic|/boot}} if it is on its own ext2 partition.}}<br />
# mount /dev/sd[a-z][1-9] /new_root<br />
<br />
:3. Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.<br />
:4. Reboot.<br />
<br />
=== Fsck fails on root partition ===<br />
<br />
In the case of a badly corrupted root partition (in which the journal is damaged), in the ramfs emergency shell, mount the root file system:<br />
<br />
# mount /dev/''root partition'' /new_root<br />
And grab the tune2fs binary from the root partition (it is not included in Syslinux):<br />
# cp /new_root/sbin/tune2fs /sbin/<br />
<br />
Follow the instructions at [[Fsck#ext2fs_:_no_external_journal|ext2fs: no external journal]] to create a new journal for the root partition.<br />
<br />
=== No Default or UI found on some computers ===<br />
<br />
Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted USB drive may boot on a more recent computer, some computers may hang if the boot partition containing the ''kernel'' and ''initrd'' are not on a FAT16 partition. To prevent an older machine from loading {{ic|ldlinux}} and failing to read {{ic|syslinux.cfg}}, use {{ic|cfdisk}} to create a FAT16 partition (<=2GB) and format using {{Pkg|dosfstools}}:<br />
# mkfs.msdos -F 16 /dev/sda1<br />
<br />
then install and configure Syslinux.<br />
<br />
=== Missing operating system ===<br />
<br />
* Check that you have installed {{ic|gptmbr.bin}} for GPT and {{ic|mbr.bin}} for msdos partition table. A "Missing operating system" message comes from {{ic|mbr.bin}} while {{ic|gptmbr.bin}} would show a "Missing OS" message.<br />
<br />
* Check whether the partition that contains {{ic|/boot}} has the "boot" flag enabled.<br />
<br />
* Check whether the first partition at the boot device starts at sector 1 rather than sector 63 or 2048. Check this with {{ic|fdisk -l}}. If it starts at sector 1, you can move the partition(s) with {{ic|gparted}} from a rescue disk. Or, if you have a separate boot partition, you can back up {{ic|/boot}} with <br />
# cp -a /boot /boot.bak<br />
and then boot up with the Arch install disk. Next, use {{ic|cfdisk}} to delete the {{ic|/boot}} partition, and recreate it. This time it should begin at the proper sector, '''63'''. Now mount your partitions and {{ic|chroot}} into your mounted system, as described in the beginners guide. Restore {{ic|/boot}} with the command<br />
# cp -a /boot.bak/* /boot<br />
Check if {{ic|/etc/fstab}} is correct, run:<br />
# syslinux-install_update -iam<br />
and reboot.<br />
<br />
You will also get this error if you are trying to boot from a md [[RAID]] 1 array and created the array with a too new version of the metadata that Syslinux does not understand. As of August 2013 by default mdadm will create an array with version 1.2 metadata, but Syslinux does not understand metadata newer than 1.0. If this is the case you will need to recreate your [[RAID]] array using the {{ic|1=--metadata=1.0}} flag to mdadm.<br />
<br />
=== Windows boots up, ignoring Syslinux ===<br />
<br />
'''Solution:''' Make sure the partition that contains {{ic|/boot}} has the boot flag enabled. Also, make sure the boot flag is not enabled on the Windows partition. See the installation section above.<br />
<br />
The MBR that comes with Syslinux looks for the first active partition that has the boot flag set. The Windows partition was likely found first and had the boot flag set. If you wanted, you could use the MBR that Windows or MS-DOS {{ic|fdisk}} provides.<br />
<br />
=== Menu entries do nothing ===<br />
<br />
You select a menu entry and it does nothing, it just ''"refreshes"'' the menu. This usually means that you have an error in your {{ic|syslinux.cfg}} file. Hit {{ic|Tab}} to edit your boot parameters. Alternatively, press {{ic|Esc}} and type in the {{ic|LABEL}} of your boot entry (e.g. ''arch''). Another cause could be that you do not have a kernel installed. Find a way to access your file system (through live CD, etc) and make sure that {{ic|/mount/vmlinuz-linux}} exists and does not have a size of 0. If this is the case, [[Kernel_Panics#Option_2:_Reinstall_kernel|reinstall your kernel]].<br />
<br />
=== Cannot remove ldlinux.sys ===<br />
<br />
The {{ic|ldlinux.sys}} file has the immutable attribute set, which prevents it from being deleted or overwritten. This is because the sector location of the file must not change or else Syslinux has to be reinstalled. To remove it, run:<br />
# chattr -i /boot/syslinux/ldlinux.sys<br />
# rm /boot/syslinux/ldlinux.sys<br />
<br />
=== White block in upper left corner when using vesamenu ===<br />
<br />
Problem:<br />
''As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my Intel, when having Syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in Syslinux (the white block is actually an attempt to keep the Syslinux menu, but the driver fails to capture the picture from vesa graphics mode).''<br />
<br />
If you have a custom resolution and a {{ic|vesamenu}} with early modesetting, try to append the following in {{ic|syslinux.cfg}} to remove the white block and continue in graphics mode:<br />
APPEND root=/dev/sda6 rw 5 '''vga=current''' quiet splash<br />
<br />
=== Chainloading Windows does not work, when it is installed on another drive ===<br />
<br />
If Windows is installed on a different drive than Arch and you have trouble chainloading it, try the following configuration:<br />
<br />
LABEL Windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xdfc1ba9e swap<br />
<br />
Replace the mbr code with the one your Windows drive has (details [[#Chainloading|above]]), and append {{ic|swap}} to the options.<br />
<br />
=== Read bootloader log ===<br />
<br />
In some cases (e.g. bootloader unable to boot kernel) it is highly desirable to get more information from the boot process. ''Syslinux'' prints error messages to screen but the boot menu quickly overwrites the text. To avoid losing the log information, disable {{ic|UI menu}} in {{ic|syslinux.cfg}} and use the default "command-line" prompt. It means:<br />
<br />
* avoid the UI directive<br />
* avoid ONTIMEOUT<br />
* avoid ONERROR<br />
* avoid MENU CLEAR<br />
* use a higher TIMEOUT<br />
* use PROMPT 1<br />
* use DEFAULT <problematic_label><br />
<br />
To get more detailed debug log, recompile the {{Pkg|syslinux}} package with additional CFLAGS:<br />
<br />
-DDEBUG_STDIO=1 -DCORE_DEBUG=1<br />
<br />
=== Btrfs compression ===<br />
<br />
Booting from btrfs with compression is not supported.[http://www.syslinux.org/wiki/index.php/Syslinux_4_Changelog#Changes_in_4.02]<br />
This error will show:<br />
btrfs: found compressed data, cannot continue!<br />
invalid or corrupt kernel image.<br />
[[GRUB]] supports btrfs with compression.<br />
<br />
== See also ==<br />
<br />
* [http://www.syslinux.org Official website]<br />
* [http://www.josephn.net/scrapbook/pxelinux_stuff PXELinux configuration]<br />
* [http://blog.jak.me/2013/01/03/creating-a-multiboot-usb-stick-using-syslinux/ Multiboot USB using Syslinux]{{Dead link|2015|05|15}}</div>Spaceonehttps://wiki.archlinux.org/index.php?title=CUPS/Printer-specific_problems&diff=356064CUPS/Printer-specific problems2015-01-10T00:30:16Z<p>Spaceone: /* Printer is not detected by CUPS */ Fix filename</p>
<hr />
<div>[[Category:Printers]]<br />
{{out of date|Mentions packages that don't exist anymore, like foomatic-db-ppd.}}<br />
{{Related articles start}}<br />
{{Related|CUPS}}<br />
{{Related articles end}}<br />
<br />
Printer-specific problems and their solutions.<br />
<br />
==Brother==<br />
<br />
===DCP 7020===<br />
See: [[Brother DCP-7020]]<br />
===Other Brother Printers===<br />
<br />
It appears that newer versions of the "file" package break the ability of many Brother printers to print from GUI applications. The solution seems to be to ensure that the "a2ps" package is installed.<br />
<br />
==Canon==<br />
===MF 4150===<br />
This is required as some Canon printers apparently do not declare their specification correctly for kernel and libusb to recognize them<br />
<br />
* Do NOT blacklist usblp module.<br />
<br />
* Connect the printer<br />
<br />
The printer should now be recognized by the CUPS Add printer dialog. If still having problems, try restarting CUPS.<br />
<br />
* Install UFRII driver {{AUR|cndrvcups-lb}} from the [[AUR]] and complete the printer installation.<br />
<br />
===Pixma MP540===<br />
To get the printer working you need to:<br />
<br />
* Blacklist '''usblp''' module and reboot.<br />
<br />
* Install {{AUR|cnijfilter-common}} and {{AUR|cnijfilter-mp540}} (or whichever package corresponds to your MP5** model) from the [[AUR]].<br />
<br />
If it's still not working execute the following command as root:<br />
# ln -s /usr/bin/cifmp540 /usr/local/bin/cifmp540<br />
<br />
===Pixma MP560===<br />
The only additional package needed is {{AUR|cups-bjnp}}. Other than that follow the instructions on the [[CUPS]] page.<br />
<br />
==Epson==<br />
<br />
===Utility functions===<br />
====escputil====<br />
This section explains how to perform some of the utility functions (such as nozzle cleaning) on Epson printers, by using the escputil utility, part of the gutenprint package.<br />
<br />
With newer printers (like the CX3600/CX3650 or D88) you must first "modprobe usblp" to get escputil working. This creates the "/dev/usb/lp0" node (see the "--raw-device" flag below). Afterwards you have to "rmmod usblp", else the printer won't be recognized by CUPS (version 1.4.x). More here: https://bbs.archlinux.org/viewtopic.php?pid=682455#p682455<br />
<br />
There is a escputil's man-page provides basic information, but it does not touch on how to identify the printer. There are two parameters that can be used to do so:<br />
<br />
* One is {{Ic|--printer}}: it expects the name used to identify the printer when is was configured.<br />
<br />
* The other is {{Ic|--raw-device}}: this option expects a path beginning with "/dev". If the printer is the only serial printer on the system, "/dev/lp0" should be its device node. For USB printers, it is "/dev/usb/lp0". If having more than one printer, they will have names ending in "lp1", "lp2", etc.<br />
<br />
On to the maintenance options:<br />
* To clean the printer heads:<br />
$ escputil -u --clean-head<br />
<br />
* To print the nozzle-check pattern (allows verifying that the previous head cleaning worked, and determining the heads need cleaning):<br />
$ escputil -u --nozzle-check<br />
<br />
If wanting to perform an operation that requires two-way communication with a printer, use the "--raw-device" specification and the user must be root or be a member of the group "lp".<br />
<br />
* The following is an example of getting the printer's internal identification:<br />
$ sudo escputil --raw-device=/dev/usb/lp0 --identify<br />
<br />
* To print out the ink levels of the printer:<br />
$ sudo escputil --raw-device=/dev/usb/lp0 --ink-level<br />
<br />
====mtink====<br />
This is a printer status monitor which enables to get the remaining ink quantity, to print test patterns, to reset printer and to clean nozzle. It use an intuitive graphical user interface. Package can be downloaded from [https://aur.archlinux.org/packages.php?do_Details=1&ID=476&O=0&L=0&C=0&K=mtink&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
<br />
====Stylus-toolbox====<br />
This is a GUI using escputil and cups drivers. It supports nearly all USB printer of Epson and displays ink quantity, can clean and align print heads and print test patterns. It can be downloaded from [https://aur.archlinux.org/packages.php?ID=30319 AUR]<br />
<br />
===AcuLaser CX11(NF)===<br />
Install [https://aur.archlinux.org/packages.php?ID=30424 Epson-ALCX11-filter] from the AUR. Restart CUPS and add the printer using the driver "EPSON AL-CX11, ESC/PageS Filter".<br />
<br />
Both connections, USB and network, should work as expected.<br />
<br />
===Stylus SX125===<br />
Simply install gutenprint, <br />
$ sudo pacman -S gutenprint<br />
restart cups,<br />
& sudo /etc/rc.d/cupsd restart<br />
add the printer via the cups-webinterface and select the <br />
'''Epson Stylus SX115 Foomatic/gutenprint-ijs.5.2''' driver. This should work fine.<br />
<br />
===LP-S5000===<br />
{{Warning|This section involves installing packages without [[pacman]]. These directions should ideally be automated with a [[PKGBUILD]].}}<br />
"Source" code of the driver is available on [http://www.avasys.jp/lx-bin2/linux/laser/DL2.do avasys website], in Japanese, however it includes a 32 bit binary which will cause problem on 64 bit system.<br />
To install the printer:<br />
<br />
*Install the libstdc++5 ,on 32bit system, or the lib32-listdc++5 package (available in the multilib repository), on 64bit.<br />
# pacman -S libstdc++5<br />
or<br />
# pacman -S lib32-libstdc++5<br />
<br />
*Install some dependencies <br />
# pacman -S psutils bc<br />
<br />
*Download the source code of the driver (tar.gz) from [http://www.avasys.jp/lx-bin2/linux/laser/DL2.do avasys website] and unpack it.<br />
* Compile and install the driver. <br />
<br />
$ ./configure --prefix=/usr<br />
$ make<br />
# make install<br />
<br />
*Edit the path of pstops in /usr/bin/pstolps5000.sh according to this:<br />
<br />
$ diff pstolps5000.sh.orig /usr/bin/pstolps5000.sh <br />
212c212<br />
< rotator="" && test "$useRotator" = "on" && rotator="| pstops -q $pstops1 $pstops2"<br />
---<br />
> rotator="" && test "$useRotator" = "on" && rotator="| /usr/bin/pstops -q $pstops1 $pstops2"<br />
<br />
*Restart cups<br />
<br />
# /etc/rc.d/cupsd restart<br />
<br />
* Install the printer through cups web interface, the printer was detected as a socket://XXX.XXX.XXX.XXX<br />
<br />
* Select the Esc Pages driver LP-S5000 (the one installed).<br />
<br />
* Print test page: OK<br />
<br />
If you have any problems on a 64 system, some other lib32 libraries may be required. These instruction may be useful for other printer working with driver from avasys website.<br />
<br />
==FX==<br />
=== C1110 (not model B)===<br />
Keep in mind that these directions assume that the printer is connected and listening on the network.<br />
<br />
*Install cpio and rpmunpack to later unpack the package:<br />
# pacman -S cpio rpmunpack cups ghostscript gsfonts<br />
<br />
*Get the FX GNU/Linux driver [http://www.fujixeroxprinters.com/downloads/uploaded/Drivers/DocuPrint%20C1110%20C1110B/linux/fxlinuxprint-1.0.1-1.i386.zip here].<br />
<br />
*Unzip {{ic|fxlinuxprint-1.0.1-1.i386.zip}} to /var/tmp (the directory is not important):<br />
$ unzip fxlinuxprint-1.0.1-1.i386.zip -d /var/tmp<br />
<br />
*Continue extracting the file:<br />
$ cd /var/tmp<br />
$ rpmunpack fxlinuxprint-1.0.1-1.i386.rpm<br />
$ gunzip fxlinuxprint-1.0.1-1.cpio.gz<br />
<br />
*Move the cpio DST file (for convenience):<br />
$ mkdir /var/tmp/DST<br />
$ mv fxlinuxprint-1.0.1-1.cpio /var/tmp/DST<br />
<br />
*Extract it:<br />
$ cd /var/tmp/DST<br />
$ cpio -id < fxlinuxprint-1.0.1-1.cpio<br />
<br />
*Filter the relevant files:<br />
$ cd /var/tmp<br />
$ find /var/tmp/DST -type f |cat -n<br />
1 /var/tmp/DST/etc/cups/mimefx.convs<br />
2 /var/tmp/DST/etc/cups/mimefx.types<br />
3 /var/tmp/DST/usr/lib/cups/filter/pdftopjlfx<br />
4 /var/tmp/DST/usr/lib/cups/filter/pstopdffx<br />
5 /var/tmp/DST/usr/lib/cups/filter/pdftopdffx<br />
6 /var/tmp/DST/usr/share/cups/model/FujiXerox/en/fxlinuxprint.ppd<br />
<br />
*Copy the files found in the previous step to /<br />
{{Note|For the PPD use {{ic|/usr/share/cups/model/fxlinuxprint.ppd}}}}<br />
<br />
*Access http://localhost:631/ and add the lpd://f.q.d.n/queue printer, aunthenticating as root.<br />
<br />
*Go through "Manage Printer" and "Set Printer Options".<br />
<br />
*Print a test page (substitue color103 with the assigned printer name):<br />
$ lpq -P color103<br />
color103 is ready<br />
no entries<br />
<br />
==HP==<br />
===Deskjet 700 Series===<br />
====Printing does not work====<br />
The solution is to install the [[Arch User Repository|AUR]] package {{AUR|pnm2ppa}}, which provides a printer filter of the same name for the HP Deskjet 700 series. Without this, the print jobs will be aborted by the system.<br />
<br />
=== HP LaserJet 1010 ===<br />
A solution to make LaserJet 1010 work with CUPS may be to compile a newer version of GhostScript:<br />
{{bc|<br />
$ pacman -Qs cups a2ps psutils foo ghost<br />
local/cups 1.1.23-3<br />
The CUPS Printing System<br />
local/a2ps 4.13b-3<br />
a2ps is an Any to PostScript filter<br />
local/psutils p17-3<br />
A set of postscript utilities.<br />
local/foomatic-db 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-db-engine 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-db-ppd 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-filters 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/espgs 8.15.1-1<br />
ESP Ghostscript<br />
}}<br />
<br />
Setting {{ic|LogLevel}} may also need to be set in {{ic|/etc/cups/cupsd.conf}} to {{ic|debug2}}, this way the logs will show how to circumvent minor issues, such as missing fonts. Search Google for [http://www.google.com/search?q=n019003l+filetype%3Apfb n019003l filetype:pfb]<br />
<br />
The debug solution might work if getting errors similar to 'Unsupport PCL', etc. See: [http://linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1010 OpenPrinting database - Printer: HP LaserJet 1010]<br />
<br />
===LaserJet 1020===<br />
====Installation from AUR====<br />
Install the package {{AUR|foo2zjs}} from the [[Arch User Repository|AUR]] and modify the [[PKGBUILD]]. Change the line:<br />
./getweb all<br />
to<br />
./getweb 1020<br />
<br />
If getting errors with incorrect md5sums, the md5sum of {{ic|foo2zjs.tar.gz}} in the PKGBUILD should be changed to match the downloaded driver.<br />
<br />
As a last step, add and configure the printer in the CUPS manager. The printer should be recognized automatically, and function for both root and regular users.<br />
<br />
====Manual installation====<br />
This section details the setup of the HP Laserjet 1020 by manually downloading and compiling the '''foo2zjs''' driver.<br />
{{Warning|This section involves installing packages without [[pacman]]. These directions should ideally be automated with a [[PKGBUILD]].}}<br />
=====Packages=====<br />
Only {{Pkg|cups}} and {{Pkg|ghostscript}} are needed to set up the HP Laserjet 1020.<br />
# pacman -S cups ghostscript<br />
The [http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1020 OpenPrinting database - Printer: HP LaserJet 1020] page outlines the support for this printer.<br />
<br />
The '''foo2zjs''' driver will be installed as outlined on the project page: [http://foo2zjs.rkkda.com/ foo2zjs: a linux printer driver for ZjStream protocol].<br />
<br />
Firstly, download the driver:<br />
$ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz<br />
And unpack it:<br />
$ tar zxf foo2zjs.tar.gz<br />
$ cd foo2zjs<br />
The driver is now compiled:<br />
$ make<br />
$ ./getweb 1020<br />
# make install<br />
# make install-hotplug<br />
# make cups<br />
<br />
=====Configuration=====<br />
The '''usblp''' module is needed to upload the firmware to the printer, but the module must then be removed to allow printing or adding the printer to the system.<br />
<br />
Ensure that the CUPS daemon is running and added to the {{ic|/etc/rc.conf}} file:<br />
# /etc/rc.d/cupsd start<br />
{{hc|/etc/rc.conf|2=DAEMONS=(... '''cupsd''' crond ...)}}<br />
<br />
Now plug in the USB printer and turn it on. The printer will whirl, pause, then whirl once more as the firmware is uploaded. Now remove the '''usblp''' module:<br />
# rmmod usblp<br />
The printer can be added to the system with CUPS http://localhost:631/<br />
{{Note|The '''usblp''' module must be removed '''after''' the firmware is loaded to the printer, and '''before''' any printing job is submitted.}}<br />
The reason for this has been [https://bbs.archlinux.org/viewtopic.php?pid=639930#p639930 explained on the forum].<br />
<br />
===Firmware for HPLIP===<br />
Some printers may appear to have been correctly installed by CUPS, but fail to print. It may be that the necessary firmware needs to be downloaded by running:<br />
# hp-setup -i<br />
as root. This situation has been encountered with the LaserJet 1000 and LaserJet 1005.<br />
<br />
==Samsung==<br />
===Samsung SCX-4200 Series===<br />
====Printer is not detected by CUPS====<br />
The most likely reason is a conflict with {{Pkg|sane}}. To fix this create the following file:<br />
{{hc|/etc/udev/rules.d/99-printer.rules|output=# idProduct needs to match your printer<br />
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="341b", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"}}<br />
<br />
==Printer connected to an Airport Express Station==<br />
The first step is to scan the Airport Express station. It seems that there are different addresses depending on the model:<br />
{{bc|<br />
[root@somostation somos]# nmap 192.168.0.4<br />
<br />
Starting Nmap 4.20 ( http://insecure.org ) at 2007-06-26 00:50 CEST<br />
Interesting ports on 192.168.0.4:<br />
Not shown: 1694 closed ports<br />
PORT STATE SERVICE<br />
5000/tcp open UPnP<br />
9100/tcp open jetdirect<br />
10000/tcp open snet-sensor-mgmt<br />
MAC Address: 00:14:51:70:D5:66 (Apple Computer)<br />
<br />
Nmap finished: 1 IP address (1 host up) scanned in 25.815 seconds<br />
}}<br />
<br />
The Airport station is accessed like an HP JetDirect printer. Note the port of the '''jetdirect''' service, and edit {{ic|printer.conf}}. The '''DeviceURI''' entry should be '''socket://''', followed by your station IP address, a colon, and the '''jetdirect''' port number.<br />
{{hc|/etc/cups/printer.conf|# Printer configuration file for CUPS v1.2.11<br />
# Written by cupsd on 2007-06-26 00:44<br />
<Printer LaserSim><br />
Info SAMSUNG ML-1510 gdi<br />
Location SomoStation<br />
DeviceURI socket://192.168.0.4:9100<br />
State Idle<br />
StateTime 1182811465<br />
Accepting Yes<br />
Shared Yes<br />
JobSheets none none<br />
QuotaPeriod 0<br />
PageLimit 0<br />
KLimit 0<br />
OpPolicy default<br />
ErrorPolicy stop-printer<br />
</Printer>}}<br />
Problems may be resolved by removing foomatic and installing foomatic-db, foomatic-db-engine, foomatic-db-ppd instead.</div>Spaceonehttps://wiki.archlinux.org/index.php?title=CUPS/Printer-specific_problems&diff=356063CUPS/Printer-specific problems2015-01-10T00:24:26Z<p>Spaceone: Add workaround for problem with Samsung SCX-4200 series and sane</p>
<hr />
<div>[[Category:Printers]]<br />
{{out of date|Mentions packages that don't exist anymore, like foomatic-db-ppd.}}<br />
{{Related articles start}}<br />
{{Related|CUPS}}<br />
{{Related articles end}}<br />
<br />
Printer-specific problems and their solutions.<br />
<br />
==Brother==<br />
<br />
===DCP 7020===<br />
See: [[Brother DCP-7020]]<br />
===Other Brother Printers===<br />
<br />
It appears that newer versions of the "file" package break the ability of many Brother printers to print from GUI applications. The solution seems to be to ensure that the "a2ps" package is installed.<br />
<br />
==Canon==<br />
===MF 4150===<br />
This is required as some Canon printers apparently do not declare their specification correctly for kernel and libusb to recognize them<br />
<br />
* Do NOT blacklist usblp module.<br />
<br />
* Connect the printer<br />
<br />
The printer should now be recognized by the CUPS Add printer dialog. If still having problems, try restarting CUPS.<br />
<br />
* Install UFRII driver {{AUR|cndrvcups-lb}} from the [[AUR]] and complete the printer installation.<br />
<br />
===Pixma MP540===<br />
To get the printer working you need to:<br />
<br />
* Blacklist '''usblp''' module and reboot.<br />
<br />
* Install {{AUR|cnijfilter-common}} and {{AUR|cnijfilter-mp540}} (or whichever package corresponds to your MP5** model) from the [[AUR]].<br />
<br />
If it's still not working execute the following command as root:<br />
# ln -s /usr/bin/cifmp540 /usr/local/bin/cifmp540<br />
<br />
===Pixma MP560===<br />
The only additional package needed is {{AUR|cups-bjnp}}. Other than that follow the instructions on the [[CUPS]] page.<br />
<br />
==Epson==<br />
<br />
===Utility functions===<br />
====escputil====<br />
This section explains how to perform some of the utility functions (such as nozzle cleaning) on Epson printers, by using the escputil utility, part of the gutenprint package.<br />
<br />
With newer printers (like the CX3600/CX3650 or D88) you must first "modprobe usblp" to get escputil working. This creates the "/dev/usb/lp0" node (see the "--raw-device" flag below). Afterwards you have to "rmmod usblp", else the printer won't be recognized by CUPS (version 1.4.x). More here: https://bbs.archlinux.org/viewtopic.php?pid=682455#p682455<br />
<br />
There is a escputil's man-page provides basic information, but it does not touch on how to identify the printer. There are two parameters that can be used to do so:<br />
<br />
* One is {{Ic|--printer}}: it expects the name used to identify the printer when is was configured.<br />
<br />
* The other is {{Ic|--raw-device}}: this option expects a path beginning with "/dev". If the printer is the only serial printer on the system, "/dev/lp0" should be its device node. For USB printers, it is "/dev/usb/lp0". If having more than one printer, they will have names ending in "lp1", "lp2", etc.<br />
<br />
On to the maintenance options:<br />
* To clean the printer heads:<br />
$ escputil -u --clean-head<br />
<br />
* To print the nozzle-check pattern (allows verifying that the previous head cleaning worked, and determining the heads need cleaning):<br />
$ escputil -u --nozzle-check<br />
<br />
If wanting to perform an operation that requires two-way communication with a printer, use the "--raw-device" specification and the user must be root or be a member of the group "lp".<br />
<br />
* The following is an example of getting the printer's internal identification:<br />
$ sudo escputil --raw-device=/dev/usb/lp0 --identify<br />
<br />
* To print out the ink levels of the printer:<br />
$ sudo escputil --raw-device=/dev/usb/lp0 --ink-level<br />
<br />
====mtink====<br />
This is a printer status monitor which enables to get the remaining ink quantity, to print test patterns, to reset printer and to clean nozzle. It use an intuitive graphical user interface. Package can be downloaded from [https://aur.archlinux.org/packages.php?do_Details=1&ID=476&O=0&L=0&C=0&K=mtink&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR].<br />
<br />
====Stylus-toolbox====<br />
This is a GUI using escputil and cups drivers. It supports nearly all USB printer of Epson and displays ink quantity, can clean and align print heads and print test patterns. It can be downloaded from [https://aur.archlinux.org/packages.php?ID=30319 AUR]<br />
<br />
===AcuLaser CX11(NF)===<br />
Install [https://aur.archlinux.org/packages.php?ID=30424 Epson-ALCX11-filter] from the AUR. Restart CUPS and add the printer using the driver "EPSON AL-CX11, ESC/PageS Filter".<br />
<br />
Both connections, USB and network, should work as expected.<br />
<br />
===Stylus SX125===<br />
Simply install gutenprint, <br />
$ sudo pacman -S gutenprint<br />
restart cups,<br />
& sudo /etc/rc.d/cupsd restart<br />
add the printer via the cups-webinterface and select the <br />
'''Epson Stylus SX115 Foomatic/gutenprint-ijs.5.2''' driver. This should work fine.<br />
<br />
===LP-S5000===<br />
{{Warning|This section involves installing packages without [[pacman]]. These directions should ideally be automated with a [[PKGBUILD]].}}<br />
"Source" code of the driver is available on [http://www.avasys.jp/lx-bin2/linux/laser/DL2.do avasys website], in Japanese, however it includes a 32 bit binary which will cause problem on 64 bit system.<br />
To install the printer:<br />
<br />
*Install the libstdc++5 ,on 32bit system, or the lib32-listdc++5 package (available in the multilib repository), on 64bit.<br />
# pacman -S libstdc++5<br />
or<br />
# pacman -S lib32-libstdc++5<br />
<br />
*Install some dependencies <br />
# pacman -S psutils bc<br />
<br />
*Download the source code of the driver (tar.gz) from [http://www.avasys.jp/lx-bin2/linux/laser/DL2.do avasys website] and unpack it.<br />
* Compile and install the driver. <br />
<br />
$ ./configure --prefix=/usr<br />
$ make<br />
# make install<br />
<br />
*Edit the path of pstops in /usr/bin/pstolps5000.sh according to this:<br />
<br />
$ diff pstolps5000.sh.orig /usr/bin/pstolps5000.sh <br />
212c212<br />
< rotator="" && test "$useRotator" = "on" && rotator="| pstops -q $pstops1 $pstops2"<br />
---<br />
> rotator="" && test "$useRotator" = "on" && rotator="| /usr/bin/pstops -q $pstops1 $pstops2"<br />
<br />
*Restart cups<br />
<br />
# /etc/rc.d/cupsd restart<br />
<br />
* Install the printer through cups web interface, the printer was detected as a socket://XXX.XXX.XXX.XXX<br />
<br />
* Select the Esc Pages driver LP-S5000 (the one installed).<br />
<br />
* Print test page: OK<br />
<br />
If you have any problems on a 64 system, some other lib32 libraries may be required. These instruction may be useful for other printer working with driver from avasys website.<br />
<br />
==FX==<br />
=== C1110 (not model B)===<br />
Keep in mind that these directions assume that the printer is connected and listening on the network.<br />
<br />
*Install cpio and rpmunpack to later unpack the package:<br />
# pacman -S cpio rpmunpack cups ghostscript gsfonts<br />
<br />
*Get the FX GNU/Linux driver [http://www.fujixeroxprinters.com/downloads/uploaded/Drivers/DocuPrint%20C1110%20C1110B/linux/fxlinuxprint-1.0.1-1.i386.zip here].<br />
<br />
*Unzip {{ic|fxlinuxprint-1.0.1-1.i386.zip}} to /var/tmp (the directory is not important):<br />
$ unzip fxlinuxprint-1.0.1-1.i386.zip -d /var/tmp<br />
<br />
*Continue extracting the file:<br />
$ cd /var/tmp<br />
$ rpmunpack fxlinuxprint-1.0.1-1.i386.rpm<br />
$ gunzip fxlinuxprint-1.0.1-1.cpio.gz<br />
<br />
*Move the cpio DST file (for convenience):<br />
$ mkdir /var/tmp/DST<br />
$ mv fxlinuxprint-1.0.1-1.cpio /var/tmp/DST<br />
<br />
*Extract it:<br />
$ cd /var/tmp/DST<br />
$ cpio -id < fxlinuxprint-1.0.1-1.cpio<br />
<br />
*Filter the relevant files:<br />
$ cd /var/tmp<br />
$ find /var/tmp/DST -type f |cat -n<br />
1 /var/tmp/DST/etc/cups/mimefx.convs<br />
2 /var/tmp/DST/etc/cups/mimefx.types<br />
3 /var/tmp/DST/usr/lib/cups/filter/pdftopjlfx<br />
4 /var/tmp/DST/usr/lib/cups/filter/pstopdffx<br />
5 /var/tmp/DST/usr/lib/cups/filter/pdftopdffx<br />
6 /var/tmp/DST/usr/share/cups/model/FujiXerox/en/fxlinuxprint.ppd<br />
<br />
*Copy the files found in the previous step to /<br />
{{Note|For the PPD use {{ic|/usr/share/cups/model/fxlinuxprint.ppd}}}}<br />
<br />
*Access http://localhost:631/ and add the lpd://f.q.d.n/queue printer, aunthenticating as root.<br />
<br />
*Go through "Manage Printer" and "Set Printer Options".<br />
<br />
*Print a test page (substitue color103 with the assigned printer name):<br />
$ lpq -P color103<br />
color103 is ready<br />
no entries<br />
<br />
==HP==<br />
===Deskjet 700 Series===<br />
====Printing does not work====<br />
The solution is to install the [[Arch User Repository|AUR]] package {{AUR|pnm2ppa}}, which provides a printer filter of the same name for the HP Deskjet 700 series. Without this, the print jobs will be aborted by the system.<br />
<br />
=== HP LaserJet 1010 ===<br />
A solution to make LaserJet 1010 work with CUPS may be to compile a newer version of GhostScript:<br />
{{bc|<br />
$ pacman -Qs cups a2ps psutils foo ghost<br />
local/cups 1.1.23-3<br />
The CUPS Printing System<br />
local/a2ps 4.13b-3<br />
a2ps is an Any to PostScript filter<br />
local/psutils p17-3<br />
A set of postscript utilities.<br />
local/foomatic-db 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-db-engine 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-db-ppd 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/foomatic-filters 3.0.2-1<br />
Foomatic is a system for using free software printer drivers with common<br />
spoolers on Unix<br />
local/espgs 8.15.1-1<br />
ESP Ghostscript<br />
}}<br />
<br />
Setting {{ic|LogLevel}} may also need to be set in {{ic|/etc/cups/cupsd.conf}} to {{ic|debug2}}, this way the logs will show how to circumvent minor issues, such as missing fonts. Search Google for [http://www.google.com/search?q=n019003l+filetype%3Apfb n019003l filetype:pfb]<br />
<br />
The debug solution might work if getting errors similar to 'Unsupport PCL', etc. See: [http://linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1010 OpenPrinting database - Printer: HP LaserJet 1010]<br />
<br />
===LaserJet 1020===<br />
====Installation from AUR====<br />
Install the package {{AUR|foo2zjs}} from the [[Arch User Repository|AUR]] and modify the [[PKGBUILD]]. Change the line:<br />
./getweb all<br />
to<br />
./getweb 1020<br />
<br />
If getting errors with incorrect md5sums, the md5sum of {{ic|foo2zjs.tar.gz}} in the PKGBUILD should be changed to match the downloaded driver.<br />
<br />
As a last step, add and configure the printer in the CUPS manager. The printer should be recognized automatically, and function for both root and regular users.<br />
<br />
====Manual installation====<br />
This section details the setup of the HP Laserjet 1020 by manually downloading and compiling the '''foo2zjs''' driver.<br />
{{Warning|This section involves installing packages without [[pacman]]. These directions should ideally be automated with a [[PKGBUILD]].}}<br />
=====Packages=====<br />
Only {{Pkg|cups}} and {{Pkg|ghostscript}} are needed to set up the HP Laserjet 1020.<br />
# pacman -S cups ghostscript<br />
The [http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1020 OpenPrinting database - Printer: HP LaserJet 1020] page outlines the support for this printer.<br />
<br />
The '''foo2zjs''' driver will be installed as outlined on the project page: [http://foo2zjs.rkkda.com/ foo2zjs: a linux printer driver for ZjStream protocol].<br />
<br />
Firstly, download the driver:<br />
$ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz<br />
And unpack it:<br />
$ tar zxf foo2zjs.tar.gz<br />
$ cd foo2zjs<br />
The driver is now compiled:<br />
$ make<br />
$ ./getweb 1020<br />
# make install<br />
# make install-hotplug<br />
# make cups<br />
<br />
=====Configuration=====<br />
The '''usblp''' module is needed to upload the firmware to the printer, but the module must then be removed to allow printing or adding the printer to the system.<br />
<br />
Ensure that the CUPS daemon is running and added to the {{ic|/etc/rc.conf}} file:<br />
# /etc/rc.d/cupsd start<br />
{{hc|/etc/rc.conf|2=DAEMONS=(... '''cupsd''' crond ...)}}<br />
<br />
Now plug in the USB printer and turn it on. The printer will whirl, pause, then whirl once more as the firmware is uploaded. Now remove the '''usblp''' module:<br />
# rmmod usblp<br />
The printer can be added to the system with CUPS http://localhost:631/<br />
{{Note|The '''usblp''' module must be removed '''after''' the firmware is loaded to the printer, and '''before''' any printing job is submitted.}}<br />
The reason for this has been [https://bbs.archlinux.org/viewtopic.php?pid=639930#p639930 explained on the forum].<br />
<br />
===Firmware for HPLIP===<br />
Some printers may appear to have been correctly installed by CUPS, but fail to print. It may be that the necessary firmware needs to be downloaded by running:<br />
# hp-setup -i<br />
as root. This situation has been encountered with the LaserJet 1000 and LaserJet 1005.<br />
<br />
==Samsung==<br />
===Samsung SCX-4200 Series===<br />
====Printer is not detected by CUPS====<br />
The most likely reason is a conflict with {{Pkg|sane}}. To fix this create the following file:<br />
{{hc|/etc/uded/rules.d/99-printer.rules|output=# idProduct needs to match your printer<br />
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="341b", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"}}<br />
<br />
==Printer connected to an Airport Express Station==<br />
The first step is to scan the Airport Express station. It seems that there are different addresses depending on the model:<br />
{{bc|<br />
[root@somostation somos]# nmap 192.168.0.4<br />
<br />
Starting Nmap 4.20 ( http://insecure.org ) at 2007-06-26 00:50 CEST<br />
Interesting ports on 192.168.0.4:<br />
Not shown: 1694 closed ports<br />
PORT STATE SERVICE<br />
5000/tcp open UPnP<br />
9100/tcp open jetdirect<br />
10000/tcp open snet-sensor-mgmt<br />
MAC Address: 00:14:51:70:D5:66 (Apple Computer)<br />
<br />
Nmap finished: 1 IP address (1 host up) scanned in 25.815 seconds<br />
}}<br />
<br />
The Airport station is accessed like an HP JetDirect printer. Note the port of the '''jetdirect''' service, and edit {{ic|printer.conf}}. The '''DeviceURI''' entry should be '''socket://''', followed by your station IP address, a colon, and the '''jetdirect''' port number.<br />
{{hc|/etc/cups/printer.conf|# Printer configuration file for CUPS v1.2.11<br />
# Written by cupsd on 2007-06-26 00:44<br />
<Printer LaserSim><br />
Info SAMSUNG ML-1510 gdi<br />
Location SomoStation<br />
DeviceURI socket://192.168.0.4:9100<br />
State Idle<br />
StateTime 1182811465<br />
Accepting Yes<br />
Shared Yes<br />
JobSheets none none<br />
QuotaPeriod 0<br />
PageLimit 0<br />
KLimit 0<br />
OpPolicy default<br />
ErrorPolicy stop-printer<br />
</Printer>}}<br />
Problems may be resolved by removing foomatic and installing foomatic-db, foomatic-db-engine, foomatic-db-ppd instead.</div>Spaceonehttps://wiki.archlinux.org/index.php?title=Syslinux&diff=331924Syslinux2014-08-22T21:04:01Z<p>Spaceone: Keyboard layout: You _absolutely_ need us.kmap or this won't work!</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[es:Syslinux]]<br />
[[fr:Syslinux]]<br />
[[it:Syslinux]]<br />
[[ja:Syslinux]]<br />
[[ru:Syslinux]]<br />
[[tr:Syslinux]]<br />
[[zh-CN:Syslinux]]<br />
{{Related articles start}}<br />
{{Related|Arch boot process}}<br />
{{Related|Boot loaders}}<br />
{{Related articles end}}<br />
<br />
[[Wikipedia:SYSLINUX|Syslinux]] is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the [[Wikipedia:File Allocation Table|FAT]], [[Wikipedia:ext2|ext2]], [[Ext3|ext3]], [[Ext4|ext4]], and [[Btrfs]] [[file systems]].<br />
<br />
{{Warning|Using Syslinux 6.02 on BTRFS volumes corrupts the superblock. Noted in the [http://www.syslinux.org/wiki/index.php/Syslinux_6_Changelog Syslinux changelog].}}<br />
<br />
{{Note|Installing Syslinux on BTRFS is fixed in 6.03pre13-1 or newer.}}<br />
<br />
{{Note|Syslinux cannot access files from partitions other than its own. For an alternative bootloader with the multi-fs feature see [[GRUB]].}}<br />
<br />
== BIOS Systems ==<br />
<br />
=== Syslinux boot process ===<br />
<br />
# '''Stage 1 : Part 1''' - '''Load MBR''' - At boot, the BIOS loads the 440 byte [[MBR]] boot code at the start of the disk ({{ic|/usr/lib/syslinux/bios/mbr.bin}} or {{ic|/usr/lib/syslinux/bios/gptmbr.bin}}). <br />
# '''Stage 1 : Part 2''' - '''Search active partition'''. The '''Stage 1 MBR boot code''' looks for the partition that is marked as active (boot flag in MBR disks). Let us assume this is the {{ic|/boot}} partition for example.<br />
# '''Stage 2 : Part 1''' - '''Execute volume boot record''' - The '''Stage 1 MBR boot code''' executes the Volume Boot Record (VBR) of the {{ic|/boot}} partition. In the case of syslinux, the VBR boot code is the starting sector of {{ic|/boot/syslinux/ldlinux.sys}} which created by {{ic|extlinux --install}} command. Note {{ic|ldlinux.sys}} is not same as {{ic|ldlinux.c32}}.<br />
# '''Stage 2 : Part 2''' - '''Execute {{ic|/boot/syslinux/ldlinux.sys}}''' - The VBR will load rest of {{ic|/boot/syslinux/ldlinux.sys}}. The sector location of {{ic|/boot/syslinux/ldlinux.sys}} should not change, otherwise syslinux will not boot. {{Note|In the case of [[Btrfs]], the above method will not work since files move around resulting in changing of the sector location of {{ic|ldlinux.sys}}. Therefore, in BTRFS the entire {{ic|ldlinux.sys}} code is embedded in the space following the VBR and is not installed at {{ic|/boot/syslinux/ldlinux.sys}} unlike the case of other filesystems.}}<br />
# '''Stage 3''' - '''Load {{ic|/boot/syslinux/ldlinux.c32}}''' - The {{ic|/boot/syslinux/ldlinux.sys}} will load the {{ic|/boot/syslinux/ldlinux.c32}} (core module) that contains the rest of '''core''' part of syslinux that could not be fit into {{ic|ldlinux.sys}} (due to file-size constraints). The {{ic|ldlinux.c32}} should be present in every syslinux/extlinux installation and should match the version of {{ic|ldlinux.sys}} installed in the partition. Otherwise syslinux will fail to boot. See http://bugzilla.syslinux.org/show_bug.cgi?id=7 for more info.<br />
# '''Stage 4''' - '''Search and Load configuration file''' - Once Syslinux is fully loaded, it looks for {{ic|/boot/syslinux/syslinux.cfg}} (or {{ic|/boot/syslinux/extlinux.conf}} in some cases) and loads it if it is found. If no configuration file is found, you will be dropped to a syslinux {{ic|boot:}} prompt. This step and rest of '''non-core''' part of syslinux ({{ic|/boot/syslinux/*.c32}} modules, excluding {{ic|lib*.c32}} and {{ic|ldlinux.c32}}) require {{ic|/boot/syslinux/lib*.c32}} (library) modules to be present (http://www.syslinux.org/wiki/index.php/Common_Problems#ELF). The {{ic|lib*.c32}} library modules and non-core {{ic|*.c32}} modules should match the version of {{ic|ldlinux.sys}} installed in the partition.<br />
<br />
=== Installation ===<br />
<br />
Install the {{Pkg|syslinux}} package from the [[official repositories]]. <br />
<br />
{{Note|<br />
* Since Syslinux 4, Extlinux and Syslinux are the same thing.<br />
* {{Pkg|gptfdisk}} is required for [[wikipedia:GUID_Partition_Table|GPT]] support using the automated script.<br />
* If your boot partition is FAT, you will also need {{Pkg|mtools}}.<br />
}}<br />
<br />
==== Automatic Install ====<br />
<br />
{{Note|<br />
* The {{ic|syslinux-install_update}} script is Arch specific, and is not provided/supported by Syslinux upstream. Please direct any bug reports specific to the script to the Arch Bug Tracker and not upstream.<br />
* If you are upgrading from Syslinux 4.xx (or 5.xx) to 6.xx version, please re-install (not update) Syslinux BIOS manually (not using the install script) once by following [[#Manual install]]. The install script may not properly upgrade Syslinux to 6.xx version.}}<br />
<br />
The {{ic|syslinux-install_update}} script will install Syslinux, copy {{ic|*.c32}} modules to {{ic|/boot/syslinux}}, set the boot flag and install the boot code in the MBR. It can handle [[Master Boot Record|MBR]] and [[GUID Partition Table|GPT]] disks along with software RAID:<br />
<br />
# If you use a separate boot partition make sure that it is mounted. Check with {{ic|lsblk}}; if you do not see a {{ic|/boot}} mountpoint, mount it before you go any further.<br />
# Run {{ic|syslinux-install_update}} with flags: {{ic|-i}} (install the files), {{ic|-a}} (mark the partition ''active'' with the ''boot'' flag), {{ic|-m}} (install the ''MBR'' boot code): {{bc|# syslinux-install_update -i -a -m}} If this command fails with ''Syslinux BIOS install failed'', the problem is likely that the {{ic|extlinux}} binary could not find the partition containing {{ic|/boot}}: {{bc|<nowiki><br />
# extlinux --install /boot/syslinux<br />
extlinux: cannot find device for path /boot/syslinux<br />
extlinux: cannot open device (null)<br />
</nowiki>}} This can happen for example when upgrading from [[LILO]] which, while booting a current custom kernel, turned a kernel command line parameter of say {{ic|1=root=/dev/sda1}} into its numeric equivalent {{ic|1=root=801}}, as evidenced by {{ic|/proc/cmdline}} and the output of the {{ic|mount}} command. Remedy the situation by either continuing with the manual install described below while specifying {{ic|1=--device=/dev/sda1}} to {{ic|extlinux}}, or simply by first rebooting into a stock Arch Linux kernel; its use of an initramfs avoids the problem.<br />
# Create or Edit {{ic|/boot/syslinux/syslinux.cfg}} by following [[#Configuration]].<br />
<br />
{{Note|<br />
* When you reboot your system now, you will have a Syslinux prompt. To automatically boot your system or get a boot menu, you still need to create a configuration file.<br />
* If you have just cloned your disk to say {{ic|/mnt/clone}}, install syslinux by issuing from the Arch installation medium:<br />
# syslinux-install_update.sh -i -a -m -c /mnt/clone<br />
}}<br />
<br />
==== Manual install ====<br />
<br />
{{Note|<br />
* If you are unsure of which partition table you are using (MBR or GPT), you can check using the following command<br />
# blkid -s PTTYPE -o value /dev/sda<br />
gpt<br />
<br />
* If you are trying to rescue an installed system with a live CD, be sure to [[Change_Root|chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not {{ic|/dev/}} paths) with the mount point.<br />
}}<br />
<br />
Your boot partition, on which you plan to install Syslinux, must contain a FAT, ext2, ext3, ext4, or Btrfs file system. You should install it on a mounted directory—not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}}. You can install Syslinux in the {{ic|syslinux}} directory:<br />
<br />
# mkdir /boot/syslinux<br />
# cp -r /usr/lib/syslinux/bios/*.c32 /boot/syslinux/ ## copy ALL the *.c32 files from /usr/lib/syslinux/bios/, DO NOT SYMLINK<br />
# extlinux --install /boot/syslinux<br />
<br />
After this, proceed to install the Syslinux boot code ({{ic|mbr.bin}} or {{ic|gptmbr.bin}}) to Master Boot Record 440-byte boot code region (not to be confused with MBR aka msdos partition table) of the disk, as described in the next section.<br />
<br />
===== MBR partition table =====<br />
<br />
See the main article: [[Master Boot Record]].<br />
<br />
Next you need to mark your boot partition active in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|parted/gparted}} ("boot" flag). It should look like this:<br />
{{hc|# fdisk -l /dev/sda|<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
}}<br />
<br />
Install the MBR:<br />
# dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sda<br />
<br />
An alternate MBR which Syslinux provides is: {{ic|altmbr.bin}}. This MBR does ''not'' scan for bootable partitions; instead, the last byte of the MBR is set to a value indicating which partition to boot from. Here is an example of how {{ic|altmbr.bin}} can be copied into position:<br />
# printf '\x5' | cat /usr/lib/syslinux/bios/altmbr.bin - | \<br />
dd bs=440 count=1 iflag=fullblock conv=notrunc of=/dev/sda<br />
<br />
In this case, a single byte of value 5 is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device {{ic|sda}}. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.<br />
<br />
===== GUID partition table =====<br />
<br />
See the main article: [[GUID Partition Table]].<br />
<br />
Bit 2 of the attributes ("legacy_boot" attribute) needs to be set for the {{ic|/boot}} partition:.<br />
# sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute ''legacy BIOS bootable'' on partition 1. To check:<br />
{{hc|<nowiki># sgdisk /dev/sda --attributes=1:show</nowiki>|<br />
1:2:1 (legacy BIOS bootable)<br />
}}<br />
<br />
Install the MBR:<br />
# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/bios/gptmbr.bin of=/dev/sda<br />
<br />
If this does not work you can also try:<br />
# syslinux-install_update -i -m<br />
<br />
== UEFI Systems ==<br />
<br />
{{Note|<br />
* UEFI support is available only from Syslinux 6.xx onwards.<br />
<br />
*{{ic|$esp}} is the mountpoint of the ESP (EFI System Partition) in the below commands.<br />
<br />
* {{ic|efi64}} denotes x86_64 UEFI systems, for IA32 (32-bit) EFI replace {{ic|efi64}} with {{ic|efi32}} in the below commands.<br />
<br />
* For syslinux, kernel and initramfs files need to be in the ESP, as syslinux does not (currently) have the ability to access files outside its own partition (i.e. outside ESP in this case). For this reason, it is recommended to mount ESP at {{ic|/boot}}.<br />
<br />
* The automatic install script {{ic|/usr/bin/syslinux-install_update}} does not support UEFI install.<br />
<br />
* The configuration syntax of {{ic|syslinux.cfg}} for UEFI is same as that of BIOS.<br />
}}<br />
<br />
=== Limitations of UEFI Syslinux ===<br />
<br />
* UEFI Syslinux application {{ic|syslinux.efi}} cannot be signed by {{ic|sbsign}} (from sbsigntool) for UEFI Secure Boot. Bug report - http://bugzilla.syslinux.org/show_bug.cgi?id=8<br />
<br />
* Using TAB to edit kernel parameters in UEFI Syslinux menu lead to garbaged display (text on top of one-another). Bug report - http://bugzilla.syslinux.org/show_bug.cgi?id=9<br />
<br />
* UEFI Syslinux does not support chainloading other EFI applications like {{ic|UEFI Shell}} or {{ic|Windows Boot Manager}}. Bug report - http://bugzilla.syslinux.org/show_bug.cgi?id=17<br />
<br />
* UEFI Syslinux does not boot in Virtual Machines like QEMU/OVMF or VirtualBox or VMware and in some UEFI emulation environments like DUET. Bug reports - http://bugzilla.syslinux.org/show_bug.cgi?id=21 and http://bugzilla.syslinux.org/show_bug.cgi?id=23<br />
<br />
* Memdisk is not available for UEFI. Bug report - http://bugzilla.syslinux.org/show_bug.cgi?id=30<br />
<br />
=== Installation ===<br />
<br />
* Install the {{Pkg|syslinux}} and {{Pkg|efibootmgr}} packages from the [[official repositories]]. Then setup syslinux in the EFI System Partition (ESP) as follows:<br />
<br />
* Copy syslinux files to ESP<br />
<br />
# mkdir -p $esp/EFI/syslinux<br />
# cp -r /usr/lib/syslinux/efi64/* $esp/EFI/syslinux<br />
<br />
* Setup boot entry for Syslinux using [[#Unified_Extensible_Firmware_Interface#efibootmgr|efibootmgr]]:<br />
<br />
# mount -t efivarfs efivarfs /sys/firmware/efi/efivars<br />
# efibootmgr -c -d /dev/sdX -p 1 -l /EFI/syslinux/syslinux.efi -L "Syslinux"<br />
<br />
* Create or edit {{ic|$esp/EFI/syslinux/syslinux.cfg}} by following [[#Configuration]].<br />
<br />
{{Note|The config file for UEFI is {{ic|$esp/EFI/syslinux/syslinux.cfg}}, not {{ic|/boot/syslinux/syslinux.cfg}}. Files in {{ic|/boot/syslinux/}} are BIOS specific and not related to UEFI syslinux.}}<br />
<br />
== Configuration ==<br />
<br />
The Syslinux configuration file, {{ic|syslinux.cfg}}, should be created in the same directory where you installed Syslinux. In our case, {{ic|/boot/syslinux/}} for BIOS systems and {{ic|$esp/EFI/syslinux/}} for UEFI systems.<br />
<br />
The bootloader will look for either {{ic|syslinux.cfg}} (preferred) or {{ic|extlinux.conf}}<br />
<br />
{{Tip|<br />
* Instead of {{ic|LINUX}}, the keyword {{ic|KERNEL}} can also be used. {{ic|KERNEL}} tries to detect the type of the file, while {{ic|LINUX}} always expects a Linux kernel. <br />
* {{ic|TIMEOUT}} value is in units of '''1/10''' of a second.<br />
}}<br />
<br />
=== Examples ===<br />
<br />
{{Note|Any configuration file found in the examples needs to be edited to set the proper kernel parameters. See section [[#Kernel parameters]].}}<br />
<br />
==== Boot prompt ====<br />
This is a simple configuration file that will show a {{ic|boot:}} prompt and automatically boot after 5 seconds. If you want to boot directly without seeing a prompt, set {{ic|PROMPT}} to {{ic|0}}.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
==== Text boot menu ====<br />
<br />
Syslinux also allows you to use a boot menu. To use it, copy the {{ic|menu}} module to your Syslinux directory:<br />
# cp /usr/lib/syslinux/bios/menu.c32 /boot/syslinux/<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
For more details about the menu system, see [http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob;f=doc/menu.txt the Syslinux documentation].<br />
<br />
==== Graphical boot menu ====<br />
<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the {{ic|vesamenu}} COM32 module to your Syslinux folder:<br />
# cp /usr/lib/syslinux/bios/vesamenu.c32 /boot/syslinux/<br />
<br />
{{Note| If you are using [[UEFI]] make sure to copy from {{ic|/usr/lib/syslinux/efi64/}} ({{ic|efi32}} for i686 systems), otherwise you will be presented with a black screen. In that case, boot from a live medium and use [[chroot]] to make the appropriate changes.}}<br />
<br />
This config uses the same menu design as the Arch Install CD, its config can be found at [https://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux projects.archlinux.org]. The [https://projects.archlinux.org/archiso.git/plain/configs/releng/syslinux/splash.png Arch Linux background image] can be downloaded from there, too. Copy the image to {{ic|/boot/syslinux/splash.png}}.<br />
<br />
Configuration:<br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 rw<br />
INITRD ../initramfs-linux-fallback.img</nowiki><br />
}}<br />
<br />
Since Syslinux 3.84, {{ic|vesamenu.c32}} supports the {{ic|MENU RESOLUTION $WIDTH $HEIGHT}} directive.<br />
To use it, insert {{ic|MENU RESOLUTION 1440 900}} into your config for a 1440x900 resolution.<br />
The background picture has to have exactly the right resolution, however, as Syslinux will otherwise refuse to load the menu.<br />
<br />
=== Kernel parameters ===<br />
<br />
The [[kernel parameters]] are set using the {{ic|APPEND}} line in {{ic|syslinux.cfg}}. It is recommended to make the following changes for the fallback entry as well.<br />
<br />
In the simplest case, the partition name in the {{ic|root}} parameter needs to be replaced. Change {{ic|/dev/sda2}} to point to the correct root partition.<br />
<br />
APPEND root=/dev/sda2<br />
<br />
If you want to use [[UUID]] for [[persistent block device naming]] change the {{ic|APPEND}} line as follows, substituting {{ic|1234}} with the {{ic|UUID}} of your root partition:<br />
<br />
APPEND root=UUID=''1234'' rw<br />
<br />
If you use encryption [[LUKS]] change the {{ic|APPEND}} line to use your encrypted volume:<br />
<br />
APPEND root=/dev/mapper/''group''-''name'' cryptdevice=/dev/sda2:''name'' rw<br />
<br />
If you are using software [[Wikipedia:RAID|RAID]] using [http://neil.brown.name/blog/mdadm mdadm], change the {{ic|APPEND}} line to accommodate your RAID arrays. As an example the following accommodates three RAID 1 arrays and sets the appropriate one as root:<br />
<br />
APPEND root=/dev/md1 rw md=0,/dev/sda2,/dev/sdb2 md=1,/dev/sda3,/dev/sdb3 md=2,/dev/sda4,/dev/sdb4<br />
<br />
If booting from a software raid partition fails using the kernel device node method above an alternative, a more reliable, way is to use partition labels:<br />
<br />
APPEND root=LABEL=THEROOTPARTITIONLABEL rw<br />
<br />
=== Auto boot ===<br />
<br />
If you do not want to see the Syslinux menu at all, use the [[#Boot prompt]], and set {{ic|PROMPT}} to {{ic|0}}. Make sure there is a {{ic|DEFAULT}} set in your {{ic|syslinux.cfg}}.<br />
<br />
=== Security ===<br />
<br />
Syslinux has two levels of bootloader security: a menu master password, and a per-menu-item password. In {{ic|syslinux.cfg}}, use<br />
{{bc|<br />
MENU MASTER PASSWD passwd <br />
}}<br />
to set a master bootloader password, and<br />
{{bc|<br />
MENU PASSWD passwd <br />
}}<br />
within a {{ic|LABEL}} block to password-protect individual boot items.<br />
<br />
=== Chainloading ===<br />
<br />
{{Note|Syslinux BIOS cannot directly chainload files from other partitions, however {{ic|chain.c32}} can boot partition boot sector (VBR).}}<br />
<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy the {{ic|chain.c32}} module to the Syslinux directory (for details, see the instructions in the previous section). Then create a section in the configuration file:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
...<br />
}}<br />
<br />
{{ic|hd0 3}} is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. <br />
<br />
{{note|For Windows, this skips the system's own boot manager ({{ic|bootmgr}}), which is required for a few important updates ([http://support.microsoft.com/kb/2883200 eg.]) to complete. In such cases it may be advisable to temporarily set the MBR boot flag to the Windows partition (eg. with [[GParted]]), let the update finish installing, and then reset the flag to the syslinux partition (eg. with Windows's own [http://www.online-tech-tips.com/computer-tips/set-active-partition-vista-xp DiskPart]).}}<br />
<br />
If you are unsure about which drive your BIOS thinks is "first", you can instead use the MBR identifier, or if you are using GPT, the filesystem labels. To use the MBR identifier, run the command<br />
{{hc|# fdisk -l /dev/sdb|<nowiki><br />
Disk /dev/sdb: 128.0 GB, 128035676160 bytes <br />
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors<br />
Units = sectors of 1 * 512 = 512 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes<br />
I/O size (minimum/optimal): 512 bytes / 512 bytes<br />
Disk identifier: 0xf00f1fd3<br />
<br />
Device Boot Start End Blocks Id System<br />
/dev/sdb1 2048 4196351 2097152 7 HPFS/NTFS/exFAT<br />
/dev/sdb2 4196352 250066943 122935296 7 HPFS/NTFS/exFAT</nowiki><br />
}}<br />
<br />
replacing {{ic|/dev/sdb}} with the drive you wish to chainload. Using the hexadecimal number under Disk identifier: {{ic|0xf00f1fd3}} in this case, the syntax in {{ic|syslinux.cfg}} is<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xf00f1fd3<br />
...<br />
}}<br />
<br />
For more details about chainloading, see [http://www.syslinux.org/wiki/index.php/Comboot/chain.c32 the Syslinux wiki].<br />
<br />
If you have [[GRUB]] installed on the same partition, you can chainload it by using: <br />
{{hc|/boot/syslinux/syslinux.cfg|<nowiki><br />
...<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
...</nowiki><br />
}}<br />
<br />
This may be required for booting from ISO images.<br />
<br />
=== Chainloading other Linux systems ===<br />
<br />
Chainloading another bootloader such as Windows' is pretty obvious, as there is a definite bootloader to chain to. But with Syslinux, it is only able to load files residing on the same partition as the configuration file. Thus, if you have another version of Linux on a separate partition, without a shared {{ic|/boot}}, it becomes necessary to employ Extlinux. Essentially, Extlinux can be installed on the partition superblock and be called as a separate bootloader from the MBR installed by Syslinux. Extlinux is part of the Syslinux project and is included with the {{Pkg|syslinux}} package.<br />
<br />
The following instructions assume you have Syslinux installed already. These instructions will also assume that the typical Arch Linux configuration path of {{ic|/boot/syslinux}} is being used and the chainloaded {{ic|/}} is on {{ic|/dev/sda3}}. <br />
<br />
From a booted Linux (likely the partition that Syslinux is set up to boot), mount the other root partition to your desired mount point. In this example this will be {{ic|/mnt}}. Also, if a separate {{ic|/boot}} partition is used on the second operating system, that will also need to be mounted. The example assumes this is {{ic|/dev/sda2}}.<br />
# mount /dev/sda3 /mnt<br />
# mount /dev/sda2 /mnt/boot (only necessary for separate /boot)<br />
Install Extlinux and copy necessary {{ic|*.c32}} files<br />
# extlinux -i /mnt/boot/syslinux<br />
# cp /usr/lib/syslinux/bios/*.c32 /mnt/boot/syslinux<br />
<br />
Create {{ic|/mnt/boot/syslinux/syslinux.cfg}}. Below is an example:<br />
{{hc|/boot/syslinux/syslinux.cfg '''on /dev/sda3'''|<nowiki><br />
timeout 10<br />
<br />
ui menu.c32<br />
<br />
label Other Linux<br />
linux /boot/vmlinuz-linux<br />
initrd /boot/initramfs-linux.img<br />
append root=/dev/sda3 rw quiet<br />
<br />
label MAIN<br />
com32 chain.c32<br />
append hd0 0</nowiki><br />
}}<br />
<br />
taken from [[User:Djgera|Djgera's user wiki page]].<br />
<br />
=== Using memtest ===<br />
<br />
Install {{Pkg|memtest86+}} from the [[official repositories]].<br />
<br />
Use this {{ic|LABEL}} section to launch [[Wikipedia:Memtest86|memtest]]:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
...<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
...<br />
}}<br />
''<br />
{{Note|If you are using pxelinux, change name from ''memtest.bin'' to ''memtest'' since pxelinux treats the file with .bin extension as a boot sector and loads only 2KB of it.}}<br />
<br />
=== HDT ===<br />
<br />
[http://hdt-project.org/ HDT (Hardware Detection Tool)] displays hardware information. Like before, the {{ic|.c32}} file has to be copied from {{ic|/boot/syslinux/}}.<br />
For PCI info, copy {{ic|/usr/share/hwdata/pci.ids}} to {{ic|/boot/syslinux/pci.ids}} and add the following to your configuration file:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
}}<br />
<br />
=== Reboot and power off ===<br />
<br />
Use the following sections to reboot or power off your machine:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COM32 poweroff.c32<br />
}}<br />
<br />
=== Clear menu ===<br />
<br />
To clear the screen when exiting the menu, add the following line:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
MENU CLEAR<br />
}}<br />
<br />
=== Keyboard layout ===<br />
<br />
If you often have to edit your boot parameters, you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keyboard.<br />
<br />
First you have to create a compatible keymap, in this example German:<br />
{{Note|{{ic|us.kmap}} needs to be created or the following won't work.}}<br />
$ cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz .<br />
$ cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz .<br />
$ gunzip de.map.gz<br />
$ gunzip us.map.gz<br />
$ mv de.map de.kmap<br />
$ mv us.map us.kmap<br />
# keytab-lilo de > de.ktl<br />
<br />
Copy {{ic|de.ktl}} as root to {{ic|/boot/syslinux/}} and set ownership to root:<br />
<br />
# chown root:root /boot/syslinux/de.ktl<br />
<br />
Now edit {{ic|syslinux.conf}} and add:<br />
<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
KBDMAP de.ktl<br />
}}<br />
<br />
=== Hiding the menu ===<br />
<br />
Use the option:<br />
{{hc|/boot/syslinux/syslinux.cfg|<br />
MENU HIDDEN<br />
}}<br />
to hide the menu while displaying only the timeout. Press any key to bring up the menu.<br />
<br />
=== Pxelinux===<br />
{{Note|Syslinux at present has no UEFI networking stack, so you will be unable to tftp your kernel and initramfs; pxelinux still works fine for legacy PXE booting}}<br />
<br />
[[Syslinux|Pxelinux]] is provided by {{Pkg|syslinux}}.<br />
<br />
Copy the pxelinux bootloader (provided by the syslinux package) to the boot directory of the client.<br />
<br />
# cp /usr/lib/syslinux/bios/pxelinux.0 "$root/boot"<br />
# mkdir "$root/boot/pxelinux.cfg"<br />
<br />
We also created the {{ic|pxelinux.cfg}} directory, which is where pxelinux searches for configuration files by default. Because we do not want to discriminate between different host MACs, we then create the {{ic|default}} configuration.<br />
<br />
{{hc|# vim "$root/boot/pxelinux.cfg/default"|<nowiki><br />
default linux<br />
<br />
label linux<br />
kernel vmlinuz-linux<br />
append initrd=initramfs-linux.img quiet ip=:::::eth0:dhcp nfsroot=10.0.0.1:/arch<br />
</nowiki>}}<br />
<br />
Or if you are using NBD, use the following append line:<br />
<br />
{{bc|<nowiki>append ro initrd=initramfs-linux.img ip=:::::eth0:dhcp nbd_host=10.0.0.1 nbd_name=arch root=/dev/nbd0</nowiki>}}<br />
<br />
{{Note|You will need to change {{ic|nbd_host}} and/or {{ic|nfsroot}}, respectively, to match your network configuration (the address of the NFS/NBD server)}}<br />
<br />
The pxelinux configuration syntax identical to syslinux; refer to the upstream documentation for more information.<br />
<br />
The kernel and initramfs will be transferred via TFTP, so the paths to those are going to be relative to the TFTP root. Otherwise, the root filesystem is going to be the NFS mount itself, so those are relative to the root of the NFS server.<br />
<br />
To actually load pxelinux, replace {{ic|filename "/grub/i386-pc/core.0";}} in {{ic|/etc/dhcpd.conf}} with {{ic|filename "/pxelinux.0"}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Using the Syslinux prompt===<br />
<br />
You can type in the {{ic|LABEL}} name of the entry that you want to boot (as per your {{ic|syslinux.cfg}}). If you used the example configurations, just type:<br />
boot: arch<br />
<br />
If you get an error that the configuration file could not be loaded, you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 rw initrd=../initramfs-linux.img<br />
<br />
If you do not have access to {{ic|boot:}} in [[Ramdisk|ramfs]], and therefore temporarily unable to boot kernel again,<br />
:1. Create a temporary directory, in order to mount your root partition (if it does not exist already):<br />
# mkdir -p /new_root<br />
:2. Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):<br />
{{Note|Busybox cannot mount {{ic|/boot}} if it is on its own ext2 partition.}}<br />
# mount /dev/sd[a-z][1-9] /new_root<br />
<br />
:3. Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.<br />
:4. Reboot.<br />
<br />
=== Fsck fails on root partition ===<br />
<br />
In the case of a badly corrupted root partition (in which the journal is damaged), in the ramfs emergency shell, mount the root file system:<br />
<br />
# mount /dev/''root partition'' /new_root<br />
And grab the tune2fs binary from the root partition (it is not included in Syslinux):<br />
# cp /new_root/sbin/tune2fs /sbin/<br />
<br />
Follow the instructions at [[Fsck#ext2fs_:_no_external_journal|ext2fs: no external journal]] to create a new journal for the root partition.<br />
<br />
=== No Default or UI found on some computers ===<br />
<br />
Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted USB drive may boot on a more recent computer, some computers may hang if the boot partition containing the ''kernel'' and ''initrd'' are not on a FAT16 partition. To prevent an older machine from loading {{ic|ldlinux}} and failing to read {{ic|syslinux.cfg}}, use {{ic|cfdisk}} to create a FAT16 partition (<=2GB) and format using {{Pkg|dosfstools}}:<br />
# mkfs.msdos -F 16 /dev/sda1<br />
<br />
then install and configure Syslinux.<br />
<br />
=== Missing operating system ===<br />
<br />
If you get this message, check if the partition that contains {{ic|/boot}} has the boot flag enabled. If the flag is enabled, then perhaps this partition starts at sector 1 rather than sector 63 or 2048. Check this with {{ic|fdisk -l}}. If it starts at sector 1, you can move the partition(s) with {{ic|gparted}} from a rescue disk. Or, if you have a separate boot partition, you can back up {{ic|/boot}} with <br />
# cp -a /boot /boot.bak<br />
and then boot up with the Arch install disk. Next, use {{ic|cfdisk}} to delete the {{ic|/boot}} partition, and recreate it. This time it should begin at the proper sector, '''63'''. Now mount your partitions and {{ic|chroot}} into your mounted system, as described in the beginners guide. Restore {{ic|/boot}} with the command<br />
# cp -a /boot.bak/* /boot<br />
Check if {{ic|/etc/fstab}} is correct, run:<br />
# syslinux-install_update -iam<br />
and reboot.<br />
<br />
You will also get this error if you are trying to boot from a md [[RAID]] 1 array and created the array with a too new version of the metadata that Syslinux does not understand. As of August 2013 by default mdadm will create an array with version 1.2 metadata, but Syslinux does not understand metadata newer than 1.0. If this is the case you will need to recreate your [[RAID]] array using the {{ic|1=--metadata=1.0}} flag to mdadm.<br />
<br />
=== Windows boots up, ignoring Syslinux ===<br />
<br />
'''Solution:''' Make sure the partition that contains {{ic|/boot}} has the boot flag enabled. Also, make sure the boot flag is not enabled on the Windows partition. See the installation section above.<br />
<br />
The MBR that comes with Syslinux looks for the first active partition that has the boot flag set. The Windows partition was likely found first and had the boot flag set. If you wanted, you could use the MBR that Windows or MS-DOS {{ic|fdisk}} provides.<br />
<br />
=== Menu entries do nothing ===<br />
<br />
You select a menu entry and it does nothing, it just ''"refreshes"'' the menu. This usually means that you have an error in your {{ic|syslinux.cfg}} file. Hit {{ic|Tab}} to edit your boot parameters. Alternatively, press {{ic|Esc}} and type in the {{ic|LABEL}} of your boot entry (e.g. ''arch''). Another cause could be that you don't have a kernel installed. Find a way to access your file system (through live CD, etc) and make sure that {{ic|/mount/vmlinuz-linux}} exists and doesn't have a size of 0. If this is the case, [[Kernel_Panics#Option_2:_Reinstall_kernel|reinstall your kernel]].<br />
<br />
=== Cannot remove ldlinux.sys ===<br />
<br />
The {{ic|ldlinux.sys}} file has the immutable attribute set, which prevents it from being deleted or overwritten. This is because the sector location of the file must not change or else Syslinux has to be reinstalled. To remove it, run:<br />
# chattr -i /boot/syslinux/ldlinux.sys<br />
# rm /boot/syslinux/ldlinux.sys<br />
<br />
=== White block in upper left corner when using vesamenu ===<br />
<br />
Problem:<br />
''As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my Intel, when having Syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in Syslinux (the white block is actually an attempt to keep the Syslinux menu, but the driver fails to capture the picture from vesa graphics mode).''<br />
<br />
If you have a custom resolution and a {{ic|vesamenu}} with early modesetting, try to append the following in {{ic|syslinux.cfg}} to remove the white block and continue in graphics mode:<br />
APPEND root=/dev/sda6 rw 5 '''vga=current''' quiet splash<br />
<br />
=== Chainloading Windows does not work, when it is installed on another drive ===<br />
<br />
If Windows is installed on a different drive than Arch and you have trouble chainloading it, try the following configuration:<br />
<br />
LABEL Windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND mbr:0xdfc1ba9e swap<br />
<br />
replace the mbr code with the one your windows drive has (details [[#Chainloading|above]]), and append {{ic|swap}} to the options.<br />
<br />
=== Read bootloader log ===<br />
<br />
In some cases, e.g. bootloader unable to boot kernel, it is highly desirable to get more information from the boot process. ''Syslinux'' prints error messages to screen but menu quickly overwrites the text. To avoid losing the log information one needs to disable {{ic|menu UI}} in {{ic|syslinux.cfg}} and use the default "command-line" prompt. It means:<br />
<br />
* avoid the UI directive<br />
* avoid ONTIMEOUT<br />
* avoid ONERROR<br />
* avoid MENU CLEAR<br />
* use a higher TIMEOUT<br />
* use PROMPT 1<br />
* use DEFAULT <problematic_label><br />
<br />
To get more detailed debug log one needs to recompile {{Pkg|syslinux}} package with additional CFLAGS:<br />
<br />
-DDEBUG_STDIO=1 -DCORE_DEBUG=1<br />
<br />
== See also ==<br />
<br />
* [http://www.syslinux.org Official website]<br />
* [http://www.josephn.net/scrapbook/pxelinux_stuff PXELinux configuration]<br />
* [http://blog.jak.me/2013/01/03/creating-a-multiboot-usb-stick-using-syslinux/ Multiboot USB using Syslinux]</div>Spaceonehttps://wiki.archlinux.org/index.php?title=Nouveau&diff=263960Nouveau2013-06-23T13:32:00Z<p>Spaceone: nvidia-libgl needs to be removed. The correct libgl will be installed as a dependency</p>
<hr />
<div>[[Category:Graphics]]<br />
[[Category:X Server]]<br />
[[es:Nouveau]]<br />
[[it:Nouveau]]<br />
[[ru:Nouveau]]<br />
[[zh-CN:Nouveau]]<br />
{{Article summary start}}<br />
{{Article summary text|This article details the installation of the Nouveau Open Source 3D acceleration graphics driver for NVIDIA cards. The name of the project refers to the fact that "nouveau" means "new" in French.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NVIDIA}}<br />
{{Article summary wiki|Xorg}}<br />
{{Article summary end}}<br />
<br />
This article covers installing and configuring the [http://nouveau.freedesktop.org/ Nouveau] open source driver for NVIDIA graphic cards. For information about the official proprietary driver, see [[NVIDIA]].<br />
<br />
== Coming from the proprietary NVIDIA driver ==<br />
{{Note|This section is only for people who have the proprietary [[NVIDIA]] driver installed. It can be skipped by all other users.}}<br />
<br />
{{Tip|If you want to keep Nvidia driver installed, it [[#Keep NVIDIA driver installed|requires some configuration]] to load the Nouveau driver instead of Nvidia.}}<br />
If you already installed the proprietary Nvidia driver, then remove it first: <br />
<br />
# pacman -Rdds nvidia nvidia-utils nvidia-libgl<br />
<br />
Be sure to also delete the {{ic|/etc/X11/xorg.conf}} file that the Nvidia driver created (or undo the changes), or else X will fail to properly load the Nouveau driver.<br />
<br />
== Installation ==<br />
<br />
Before proceeding, figure out your card's [http://nouveau.freedesktop.org/wiki/CodeNames codename] (a more detailed list is available on [[Wikipedia:Comparison of Nvidia Graphics Processing Units|Wikipedia]]) and have a look at the [http://nouveau.freedesktop.org/wiki/FeatureMatrix/ feature matrix] to see what features are supported for your graphics card. Also make sure you have [[Xorg]] properly installed.<br />
<br />
[[pacman|Install]] the DDX driver with the {{Pkg|xf86-video-nouveau}} package, which is available in the [[Official Repositories|official repositories]]. It pulls in {{Pkg|nouveau-dri}} as a dependency, providing the DRI driver for 3D acceleration.<br />
<br />
For 32-bit 3D support on x86_64, install {{Pkg|lib32-nouveau-dri}} from the [[multilib]] repository.<br />
<br />
{{Note|See the [http://nouveau.freedesktop.org/wiki/MesaDrivers Nouveau MesaDrivers page] before reporting bugs with the 3D drivers.}}<br />
<br />
== Loading ==<br />
<br />
The Nouveau kernel module should load fine automatically on system boot.<br />
<br />
If it does not happen, then:<br />
<br />
* Make sure you do '''not''' have {{ic|nomodeset}} or {{ic|1=vga=}} as a [[Kernel parameters|kernel parameter]], since Nouveau needs kernel mode-setting in order to run successfully (see below).<br />
* Also, check that you have not disabled Nouveau by using any modprobe blacklisting within {{ic|/etc/modprobe.d/}}.<br />
<br />
=== KMS ===<br />
<br />
{{Tip|If you have problems with the resolution, check [[Kernel Mode Setting#Forcing modes and EDID]].}}<br />
<br />
[[Kernel Mode Setting]] (KMS) is required by the Nouveau driver. As the system boots, the resolution will likely change when KMS initializes the display driver. Simply installing the Nouveau driver should be enough to get the system to recognize and initialize it in "Late start" mode (see below). See the [http://nouveau.freedesktop.org/wiki/KernelModeSetting Nouveau KernelModeSetting page] for more details.<br />
<br />
{{Note|Users may prefer the early start method as it does not cause the annoying resolution change part way through the boot process.}}<br />
<br />
==== Late start ====<br />
<br />
This method will start the KMS after the other kernel modules are loaded. You will see the text "Loading modules" and the size of the text may change, possibly with an undesirable flicker.<br />
<br />
==== Early start ====<br />
<br />
This method will start the KMS as early as possible in the boot process, when the [[initramfs]] is loaded. <br />
<br />
To do this, add {{ic|nouveau}} to the {{ic|MODULES}} array in {{ic|/etc/mkinitcpio.conf}}: <br />
<br />
MODULES="... nouveau ..."<br />
<br />
If you are using a custom EDID file, you should embed it into initramfs as well:<br />
<br />
{{hc|/etc/mkinitcpio.conf|<br />
2=FILES="/lib/firmware/edid/your_edid.bin"}}<br />
<br />
Re-generate the initial ramdisk image:<br />
<br />
# mkinitcpio -p <kernel preset; e.g. ''linux''><br />
<br />
If you're experiencing troubles with Nouveau leading to rebuild nouveau-drm several times for testing purposes, do not add {{ic|nouveau}} to the initramfs. It is too easy to forget to rebuild the initramfs and it will just make any testing harder. Just use "Late start" until you are confident the system is stable. There might be additional problems with initramfs if you need a custom firmware (generally not advised).<br />
<br />
== Tips and tricks ==<br />
<br />
=== Keep NVIDIA driver installed ===<br />
<br />
If you want to keep the proprietary NVIDIA driver installed, but want to use the Nouveau driver, comment out nouveau blacklisting in {{ic|/etc/modprobe.d/nouveau_blacklist.conf}} modifying it as follows:<br />
<br />
#blacklist nouveau<br />
<br />
And tell Xorg to load nouveau instead of nvidia by creating the file {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}} with the following content:<br />
<br />
Section "Device"<br />
Identifier "Nvidia card"<br />
Driver "nouveau"<br />
EndSection<br />
<br />
{{Tip|You can use [[NVIDIA#Switching_between_nvidia_and_nouveau_drivers|these scripts]] if you are switching between open and closed drivers often.}}<br />
<br />
If you already used the NVIDIA driver, and want to test Nouveau without reboot, make sure the 'nvidia' module is no longer loaded:<br />
<br />
# rmmod nvidia<br />
<br />
Then load the 'nouveau' module: <br />
<br />
# modprobe nouveau<br />
<br />
And check that it loaded fine by looking at kernel messages: <br />
<br />
$ dmesg<br />
<br />
=== Installing the latest development packages ===<br />
<br />
You may install the latest -git packages, through AUR:<br />
<br />
* You can use {{AUR|mesa-git}} which will allow the installation of the latest Mesa (including the latest DRI driver).<br />
* You can use {{AUR|xf86-video-nouveau-git}} which will allow the installation of the latest DDX driver.<br />
* You can also try installing a newer kernel version, through packages like {{AUR|linux-mainline}} in which the Nouveau DRM code would allow better performance.<br />
* To get the latest Nouveau improvements, you should use the {{AUR|linux-git}} package from the AUR, edit the PKGBUILD and use Nouveau's own kernel repository, which is currently located at git://anongit.freedesktop.org/git/nouveau/xf86-video-nouveau.<br />
<br />
Upsteam driver sources can be found at the [http://nouveau.freedesktop.org/wiki/Source Nouveau Source page].<br />
<br />
=== Tear-free compositing ===<br />
<br />
Edit your {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}}, and add the following to the {{ic|Device}} section:<br />
<br />
Section "Device"<br />
Identifier "nvidia card"<br />
Driver "nouveau"<br />
Option "GLXVBlank" "true"<br />
EndSection<br />
<br />
=== Dual Head ===<br />
<br />
Nouveau supports the xrandr extension for modesetting and multiple monitors. See the [[RandR12]] page for tutorials.<br />
<br />
Here is a full sample {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}} above for running 2 monitors in dual head mode. You may prefer to use a graphical tool to configure monitors like GNOME Control Center's Display panel ({{ic|gnome-control-center display}}).<br />
<br />
{{bc|<br />
# the right one<br />
Section "Monitor"<br />
Identifier "NEC"<br />
Option "PreferredMode" "1280x1024_60.00"<br />
EndSection<br />
<br />
# the left one<br />
Section "Monitor"<br />
Identifier "FUS"<br />
Option "PreferredMode" "1280x1024_60.00"<br />
Option "LeftOf" "NEC"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia card"<br />
Driver "nouveau"<br />
Option "Monitor-DVI-I-1" "NEC"<br />
Option "Monitor-DVI-I-2" "FUS"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Monitor "NEC"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
Virtual 2560 2048<br />
EndSubSection<br />
Device "nvidia card"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "layout1"<br />
Screen "screen1"<br />
EndSection}}<br />
<br />
=== Setting console resolution ===<br />
<br />
Use the {{Pkg|fbset}} tool to adjust console resolution.<br />
<br />
You can also pass the resolution to nouveau with the video= kernel line option (see [[KMS]]).<br />
<br />
=== Power Management ===<br />
<br />
GPU Scaling is in various stages of readiness depending on the GPU. See the [http://nouveau.freedesktop.org/wiki/PowerManagement Nouveau PowerManagement page] for more details.<br />
<br />
=== Enable MSI (Message Signaled Interrupts) ===<br />
<br />
This may provide a slight performance advantage. It is only supported on NV50+ and is disabled by default.<br />
<br />
{{Warning|This may cause instability with some motherboard / GPU combinations.}}<br />
<br />
Place the following in {{ic|/etc/modprobe.d/nouveau.conf}}: <br />
<br />
options nouveau msi=1<br />
<br />
If using [[#Early_start|early start]], add the line {{ic|1= FILES="/etc/modprobe.d/nouveau.conf"}} to {{ic|/etc/mkinitcpio.conf}}, then re-generate kernel image: <br />
<br />
# mkinitcpio -p <kernel preset; e.g. ''linux''><br />
<br />
Reboot the system for the changes to take effect.<br />
<br />
== Troubleshooting ==<br />
Add the following to your kernel command line (if using grub hit {{keypress|e}} at the boot menu to edit) to turn on video debugging:<br />
drm.debug=14 log_buf_len=16M<br />
<br />
Create verbose Xorg log:<br />
startx -- -logverbose 9 -verbose 9<br />
<br />
View loaded video module parameters and values:<br />
modinfo -p video</div>Spaceonehttps://wiki.archlinux.org/index.php?title=Syslinux&diff=213873Syslinux2012-07-21T16:28:16Z<p>Spaceone: /* Keyboard remapping */</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[tr:Syslinux]]<br />
[[zh-CN:Syslinux]]<br />
{{Article summary start}}<br />
{{Article summary text|Describes installing and configuring Syslinux, a collection of bootloaders.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary end}}<br />
<br />
Syslinux is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the fat, ext2, ext3, ext4, and btrfs file systems.<br />
<br />
{{Note|Since Syslinux 4, Extlinux and Syslinux are the same thing.}} <br />
<br />
{{Note|Syslinux does not support [[UEFI]] as on May 2012. According to upstream, UEFI support will be eventually added to Syslinux, but there is no time-frame as to when it will be functional.}}<br />
<br />
== Syslinux Boot Process ==<br />
At boot, the computer loads the [[MBR]] ({{ic|/usr/lib/syslinux/mbr.bin}}). Then the MBR looks for the partition that is marked as active (boot flag). Once found, the volume boot record (VBR) will be executed. In the case of ext2/3/4 and fat12/16/32, the starting sector of {{ic|ldlinux.sys}} is hard-coded into the VBR. The VBR will execute ({{ic|ldlinux.sys}}). Therefore, if the location of {{ic|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 {{ic|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.) Once Syslinux is fully loaded, it looks for a configuration file, either {{ic|extlinux.conf}} or {{ic|syslinux.cfg}}. If one is found, the configuration file is loaded. If no configuration file is found, you will be given a syslinux prompt.<br />
<br />
==Installation==<br />
===Automatic Install - syslinux===<br />
The syslinux-install_update script will install Syslinux, copy COM32 modules to {{ic|/boot/syslinux}}, set the boot flag, and install the MBR. It can handle MBR and GPT disks along with softraid.<br />
<br />
1. Install {{Pkg|syslinux}}:<br />
pacman -S syslinux<br />
2. Make sure {{ic|/boot}} is mounted<br/><br />
3. Run {{ic|syslinux-install_update script}} {{ic|-i}} (install) {{ic|-a}} (set boot flag) {{ic|-m}} (install mbr)<br />
/usr/sbin/syslinux-install_update -iam<br />
4. Edit {{ic|/boot/syslinux/syslinux.cfg}}<br />
<br />
===Manual Install - syslinux===<br />
{{Note| If you are unsure of which partition table you are using (MBR or GPT), you are likely using the MBR partition table. Most of the time GPT will create a special MBR-style partition (type 0xEE) using the whole disk which will be displayed with the following command:<br />
fdisk -l /dev/sda<br />
<br />
or alternatively:<br />
sgdisk -l /dev/sda<br />
<br />
will show "GPT: not present" if it is not a GPT disk.<br />
}}<br />
<br />
{{Note| If you are trying to rescue an installed system with a live CD, be sure to [[Change_Root|chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not {{ic|/dev/}} paths) with the mount point.}}<br />
<br />
Make sure you have the {{Pkg|syslinux}} package installed. Then install Syslinux onto your boot partition, which must contain a fat, ext2, ext3, ext4, or btrfs file system.<br />
You should install it on a mounted directory, not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}} you can install syslinux in the syslinux directory:<br />
mkdir /boot/syslinux<br />
extlinux --install /boot/syslinux <br />
<br />
====MBR Partition Table====<br />
Next you need mark your boot partition active in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|(g)parted}}. It should look like this:<br />
fdisk -l /dev/sda<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
<br />
Install the master boot record:<br />
dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda<br />
<!-- conv=notrunc helps if {{ic|/dev/sda}} is actually a file not a block device --><br />
<br />
An alternate MBR which Syslinux provides is: altmbr.bin. This MBR does ''not'' scan for bootable partitions; instead, the last byte of the MBR is set to a value indicating which partition to boot from. Here is an example of how {{ic|altmbr.bin}} can be copied into position:<br />
<br />
printf '\x5' | cat /usr/lib/syslinux/altmbr.bin - | dd bs=440 count=1 conv=notrunc of=/dev/sda<br />
<br />
In this case, a single byte of value 5 is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device sda. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.<br />
<br />
====GUID Partition Table aka GPT====<br />
Main article [[GUID Partition Table]].<br />
<br />
Bit 2 of the attributes for the {{ic|/boot}} partition need to be set.<br />
<br />
sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute legacy BIOS bootable on partition 1.<br />
<br />
Verify:<br />
sgdisk /dev/sda --attributes=1:show<br />
1:2:1 (legacy BIOS bootable)<br />
<br />
Install the master boot record:<br />
dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda<br />
<br />
====Rebooting====<br />
When you reboot your system now, you will have a syslinux prompt. To automatically boot your system or get a boot menu, you still need to create a configuration file.<br />
<br />
== Configuring syslinux ==<br />
The syslinux configuration file, {{ic|syslinux.cfg}}, should be created in the same directory where you installed syslinux. In our case, {{ic|/boot/syslinux/}}.<br />
<br />
The bootloader will look for either {{ic|syslinux.cfg}} (preferred) or {{ic| extlinux.conf}}<br />
<br />
'''Tips''':<br />
*Instead of {{ic|LINUX}}, the keyword {{ic|KERNEL}} can also be used. {{ic|KERNEL}} tries to detect the type of the file, while {{ic|LINUX}} always expects a Linux kernel. <br />
*{{ic|TIMEOUT}} value is in units of 1/10 of a second.<br />
<br />
=== Examples ===<br />
==== Basic Syslinux Config ====<br />
This is a simple configuration file that will show a boot: prompt and automatically boot after 5 seconds.<br />
<br />
Config:<br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
If you want to boot directly without seeing a prompt, set {{ic|PROMPT}} to {{ic|0}}.<br />
<br />
If you want to use [[UUID]] for persistent device naming instead of device names, change:<br />
APPEND root=/dev/sda2 ro<br />
<br />
to:<br />
APPEND root=UUID=<uuid here> ro<br />
<br />
==== Text Boot menu ====<br />
Syslinux also allows you to use a boot menu. To use it, copy the menu COM32 module to your syslinux directory:<br />
# cp /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is in the same partition as {{ic|/usr}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
Config:<br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
For more details about the menu system, see http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob;f=doc/menu.txt.<br />
<br />
==== Graphical Boot menu ====<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the vesamenu COM32 module to your syslinux folder:<br />
# cp /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is the same partition as {{ic|/}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
[http://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux This config] uses the same menu design as the Arch Install CD. The background file can be found there too.<br />
<br />
Config:<br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
Since Syslinux 3.84, {{ic|vesamenu.c32}} supports the {{ic|MENU RESOLUTION $WIDTH $HEIGHT}} directive.<br />
To use it, insert {{ic|MENU RESOLUTION 1440 900}} into your config for a 1440x900 resolution.<br />
The background picture has to have exactly the right resolution, however, as syslinux will otherwise refuse to load the menu.<br />
<br />
=== Chainloading ===<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy (or symlink) the {{ic|chain.c32}} module to the syslinux directory (for details, see the instructions in the previous section). Then create a section in the configuration file:<br />
<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
<br />
{{ic|hd0 3}} is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. For more details about chainloading, see [http://syslinux.zytor.com/wiki/index.php/Comboot/chain.c32].<br />
<br />
If you have [[grub2]] installed in your boot partition, you can chainload it by using: <br />
<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
<br />
This may be required for booting from ISO images.<br />
<br />
=== Using memtest ===<br />
Use this {{ic|LABEL}} section to launch memtest (install the {{Pkg|memtest86+}} package):<br />
<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
<br />
=== HDT ===<br />
HDT (Hardware Detection Tool) displays hardware information. Like before, the {{ic|.c32}} file has to be copied or symlinked from {{ic|/boot/syslinux/}}.<br />
For PCI info, either copy or symlink {{ic|/usr/share/hwdata/pci.ids}} to {{ic|/boot/syslinux/pci.ids}}<br />
<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
<br />
=== Reboot and power off ===<br />
Use the following sections to reboot or power off your machine:<br />
<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COMBOOT poweroff.com<br />
<br />
=== Clear Menu ===<br />
To clear the screen when exiting the menu, add the following line:<br />
MENU CLEAR<br />
<br />
=== Keyboard remapping ===<br />
If you often have to edit your boot parameters, you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keyboard.<br />
<br />
First you have to create a compatible keymap (for example a german one):<br />
cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz ./<br />
cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz ./<br />
gunzip {de,us}.map.gz<br />
mv de.{,k}map<br />
mv us.{,k}map<br />
keytab-lilo de > de.ktl<br />
<br />
Copy {{ic|de.ktl}} as root to {{ic|/boot/syslinux/}} and set ownership to root:<br />
chown root:root /boot/syslinux/de.ktl<br />
<br />
Now edit {{ic|syslinux.conf}} and add<br />
KBDMAP de.ktl<br />
<br />
==Troubleshooting==<br />
===I have a Syslinux Prompt - Yikes!===<br />
You can type in the {{ic|LABEL}} name of the entry that you want to boot (as per your {{ic|syslinux.cfg}}). If you used the example configs, just type:<br />
boot: arch<br />
<br />
If you get an error that the config file could not be loaded, you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 ro initrd=../initramfs-linux.img<br />
<br />
If you do not have access to {{ic|boot:}} in ramfs, and therefore temporarily unable to boot kernel again,<br />
<br />
1) Create temp directory, in order to mount your root partition (if it does not exist already):<br />
<br />
mkdir -p /new_root<br />
<br />
2) Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):<br />
{{Note|If {{ic|/boot}} is on its own ext2 partition then busybox cannot mount it.}}<br />
<br />
mount /dev/sd[a-z][1-9] /new_root<br />
<br />
3) Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.<br />
<br />
4) Reboot.<br />
<br />
===No Default or UI found on some computers===<br />
Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted USB drive may boot on a more recent computer, some computers may hang if the boot partition containing the kernel and initrd are not on a fat16 partition. To prevent an older machine from loading ldlinux and failing to read {{ic|syslinux.cfg}}, use cfdisk to create a fat16 partition (<=2GB) and format with <br />
pacman -S dosfstools<br />
mkfs.msdos -F 16 /dev/sda1<br />
<br />
then install and configure syslinux.<br />
<br />
===Windows boots up! No Syslinux!===<br />
'''Solution:''' Make sure the partition that contains {{ic|/boot}} has the boot flag enabled. Also, make sure the boot flag is not enabled on the Windows partition. See the installation section above.<br />
<br />
The MBR that comes with syslinux looks for the first active partition that has the boot flag set. The Windows partition was likely found first and had the boot flag set. If you wanted, you could use the MBR that Windows or MS-DOS fdisk provides.<br />
<br />
===Menu entries do nothing===<br />
You select a menu entry and it does nothing. It "refreshes" the menu.<br/><br />
This usually means that you have an error in your configuration. Hit {{Keypress|TAB}} to edit your boot parameters. Alternatively, press {{Keypress|Esc}} and type in the LABEL of your boot entry (Example: arch)<br />
<br />
===Cannot remove ldlinux.sys===<br />
ldlinux.sys has the immutable attribute set which prevents the file from being deleted or overwritten. This is because the sector location of the file must not change or else syslinux has to be reinstalled.<br />
To remove: <br />
chattr -i /boot/syslinux/ldlinux.sys<br />
rm /boot/syslinux/ldlinux.sys<br />
<br />
===A white block on the upper left corner appears when a kernel is loaded with modesetting on in early stage and when using vesamenu===<br />
'''Brain0''' said:<br />
''As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my Intel, when having syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in syslinux (the white block is actually an attempt to keep the syslinux menu, but the driver fails to capture the picture from vesa graphics mode).''<br />
<br />
If you have a custom resolution and a vesamenu with early modesetting, try to append the following in {{ic|syslinux.cfg}} to remove the white block and continue in graphics mode:<br />
<br />
APPEND root=/dev/sda6 ro 5 '''vga=current''' quiet splash<br />
<br />
== See also ==<br />
* [http://www.syslinux.org The Syslinux Project]'s web site.</div>Spaceonehttps://wiki.archlinux.org/index.php?title=Syslinux&diff=213872Syslinux2012-07-21T16:24:40Z<p>Spaceone: /* Keyboard remapping */</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[tr:Syslinux]]<br />
[[zh-CN:Syslinux]]<br />
{{Article summary start}}<br />
{{Article summary text|Describes installing and configuring Syslinux, a collection of bootloaders.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary end}}<br />
<br />
Syslinux is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the fat, ext2, ext3, ext4, and btrfs file systems.<br />
<br />
{{Note|Since Syslinux 4, Extlinux and Syslinux are the same thing.}} <br />
<br />
{{Note|Syslinux does not support [[UEFI]] as on May 2012. According to upstream, UEFI support will be eventually added to Syslinux, but there is no time-frame as to when it will be functional.}}<br />
<br />
== Syslinux Boot Process ==<br />
At boot, the computer loads the [[MBR]] ({{ic|/usr/lib/syslinux/mbr.bin}}). Then the MBR looks for the partition that is marked as active (boot flag). Once found, the volume boot record (VBR) will be executed. In the case of ext2/3/4 and fat12/16/32, the starting sector of {{ic|ldlinux.sys}} is hard-coded into the VBR. The VBR will execute ({{ic|ldlinux.sys}}). Therefore, if the location of {{ic|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 {{ic|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.) Once Syslinux is fully loaded, it looks for a configuration file, either {{ic|extlinux.conf}} or {{ic|syslinux.cfg}}. If one is found, the configuration file is loaded. If no configuration file is found, you will be given a syslinux prompt.<br />
<br />
==Installation==<br />
===Automatic Install - syslinux===<br />
The syslinux-install_update script will install Syslinux, copy COM32 modules to {{ic|/boot/syslinux}}, set the boot flag, and install the MBR. It can handle MBR and GPT disks along with softraid.<br />
<br />
1. Install {{Pkg|syslinux}}:<br />
pacman -S syslinux<br />
2. Make sure {{ic|/boot}} is mounted<br/><br />
3. Run {{ic|syslinux-install_update script}} {{ic|-i}} (install) {{ic|-a}} (set boot flag) {{ic|-m}} (install mbr)<br />
/usr/sbin/syslinux-install_update -iam<br />
4. Edit {{ic|/boot/syslinux/syslinux.cfg}}<br />
<br />
===Manual Install - syslinux===<br />
{{Note| If you are unsure of which partition table you are using (MBR or GPT), you are likely using the MBR partition table. Most of the time GPT will create a special MBR-style partition (type 0xEE) using the whole disk which will be displayed with the following command:<br />
fdisk -l /dev/sda<br />
<br />
or alternatively:<br />
sgdisk -l /dev/sda<br />
<br />
will show "GPT: not present" if it is not a GPT disk.<br />
}}<br />
<br />
{{Note| If you are trying to rescue an installed system with a live CD, be sure to [[Change_Root|chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not {{ic|/dev/}} paths) with the mount point.}}<br />
<br />
Make sure you have the {{Pkg|syslinux}} package installed. Then install Syslinux onto your boot partition, which must contain a fat, ext2, ext3, ext4, or btrfs file system.<br />
You should install it on a mounted directory, not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}} you can install syslinux in the syslinux directory:<br />
mkdir /boot/syslinux<br />
extlinux --install /boot/syslinux <br />
<br />
====MBR Partition Table====<br />
Next you need mark your boot partition active in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|(g)parted}}. It should look like this:<br />
fdisk -l /dev/sda<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
<br />
Install the master boot record:<br />
dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda<br />
<!-- conv=notrunc helps if {{ic|/dev/sda}} is actually a file not a block device --><br />
<br />
An alternate MBR which Syslinux provides is: altmbr.bin. This MBR does ''not'' scan for bootable partitions; instead, the last byte of the MBR is set to a value indicating which partition to boot from. Here is an example of how {{ic|altmbr.bin}} can be copied into position:<br />
<br />
printf '\x5' | cat /usr/lib/syslinux/altmbr.bin - | dd bs=440 count=1 conv=notrunc of=/dev/sda<br />
<br />
In this case, a single byte of value 5 is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device sda. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.<br />
<br />
====GUID Partition Table aka GPT====<br />
Main article [[GUID Partition Table]].<br />
<br />
Bit 2 of the attributes for the {{ic|/boot}} partition need to be set.<br />
<br />
sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute legacy BIOS bootable on partition 1.<br />
<br />
Verify:<br />
sgdisk /dev/sda --attributes=1:show<br />
1:2:1 (legacy BIOS bootable)<br />
<br />
Install the master boot record:<br />
dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda<br />
<br />
====Rebooting====<br />
When you reboot your system now, you will have a syslinux prompt. To automatically boot your system or get a boot menu, you still need to create a configuration file.<br />
<br />
== Configuring syslinux ==<br />
The syslinux configuration file, {{ic|syslinux.cfg}}, should be created in the same directory where you installed syslinux. In our case, {{ic|/boot/syslinux/}}.<br />
<br />
The bootloader will look for either {{ic|syslinux.cfg}} (preferred) or {{ic| extlinux.conf}}<br />
<br />
'''Tips''':<br />
*Instead of {{ic|LINUX}}, the keyword {{ic|KERNEL}} can also be used. {{ic|KERNEL}} tries to detect the type of the file, while {{ic|LINUX}} always expects a Linux kernel. <br />
*{{ic|TIMEOUT}} value is in units of 1/10 of a second.<br />
<br />
=== Examples ===<br />
==== Basic Syslinux Config ====<br />
This is a simple configuration file that will show a boot: prompt and automatically boot after 5 seconds.<br />
<br />
Config:<br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
If you want to boot directly without seeing a prompt, set {{ic|PROMPT}} to {{ic|0}}.<br />
<br />
If you want to use [[UUID]] for persistent device naming instead of device names, change:<br />
APPEND root=/dev/sda2 ro<br />
<br />
to:<br />
APPEND root=UUID=<uuid here> ro<br />
<br />
==== Text Boot menu ====<br />
Syslinux also allows you to use a boot menu. To use it, copy the menu COM32 module to your syslinux directory:<br />
# cp /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is in the same partition as {{ic|/usr}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
Config:<br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
For more details about the menu system, see http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob;f=doc/menu.txt.<br />
<br />
==== Graphical Boot menu ====<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the vesamenu COM32 module to your syslinux folder:<br />
# cp /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is the same partition as {{ic|/}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
[http://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux This config] uses the same menu design as the Arch Install CD. The background file can be found there too.<br />
<br />
Config:<br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
Since Syslinux 3.84, {{ic|vesamenu.c32}} supports the {{ic|MENU RESOLUTION $WIDTH $HEIGHT}} directive.<br />
To use it, insert {{ic|MENU RESOLUTION 1440 900}} into your config for a 1440x900 resolution.<br />
The background picture has to have exactly the right resolution, however, as syslinux will otherwise refuse to load the menu.<br />
<br />
=== Chainloading ===<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy (or symlink) the {{ic|chain.c32}} module to the syslinux directory (for details, see the instructions in the previous section). Then create a section in the configuration file:<br />
<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
<br />
{{ic|hd0 3}} is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. For more details about chainloading, see [http://syslinux.zytor.com/wiki/index.php/Comboot/chain.c32].<br />
<br />
If you have [[grub2]] installed in your boot partition, you can chainload it by using: <br />
<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
<br />
This may be required for booting from ISO images.<br />
<br />
=== Using memtest ===<br />
Use this {{ic|LABEL}} section to launch memtest (install the {{Pkg|memtest86+}} package):<br />
<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
<br />
=== HDT ===<br />
HDT (Hardware Detection Tool) displays hardware information. Like before, the {{ic|.c32}} file has to be copied or symlinked from {{ic|/boot/syslinux/}}.<br />
For PCI info, either copy or symlink {{ic|/usr/share/hwdata/pci.ids}} to {{ic|/boot/syslinux/pci.ids}}<br />
<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
<br />
=== Reboot and power off ===<br />
Use the following sections to reboot or power off your machine:<br />
<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COMBOOT poweroff.com<br />
<br />
=== Clear Menu ===<br />
To clear the screen when exiting the menu, add the following line:<br />
MENU CLEAR<br />
<br />
=== Keyboard remapping ===<br />
If you often have to edit your boot parameters, you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keymap.<br />
<br />
First you have to create a compatible keymap (for example a german one):<br />
cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz ./<br />
cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz ./<br />
gunzip {de,us}.map.gz<br />
mv de.{,k}map<br />
mv us.{,k}map<br />
keytab-lilo de > de.ktl<br />
<br />
Copy {{ic|de.ktl}} as root to {{ic|/boot/syslinux/}} and set ownership to root:<br />
chown root:root /boot/syslinux/de.ktl<br />
<br />
Now edit {{ic|syslinux.conf}} and add<br />
KBDMAP de.ktl<br />
<br />
==Troubleshooting==<br />
===I have a Syslinux Prompt - Yikes!===<br />
You can type in the {{ic|LABEL}} name of the entry that you want to boot (as per your {{ic|syslinux.cfg}}). If you used the example configs, just type:<br />
boot: arch<br />
<br />
If you get an error that the config file could not be loaded, you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 ro initrd=../initramfs-linux.img<br />
<br />
If you do not have access to {{ic|boot:}} in ramfs, and therefore temporarily unable to boot kernel again,<br />
<br />
1) Create temp directory, in order to mount your root partition (if it does not exist already):<br />
<br />
mkdir -p /new_root<br />
<br />
2) Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):<br />
{{Note|If {{ic|/boot}} is on its own ext2 partition then busybox cannot mount it.}}<br />
<br />
mount /dev/sd[a-z][1-9] /new_root<br />
<br />
3) Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.<br />
<br />
4) Reboot.<br />
<br />
===No Default or UI found on some computers===<br />
Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted USB drive may boot on a more recent computer, some computers may hang if the boot partition containing the kernel and initrd are not on a fat16 partition. To prevent an older machine from loading ldlinux and failing to read {{ic|syslinux.cfg}}, use cfdisk to create a fat16 partition (<=2GB) and format with <br />
pacman -S dosfstools<br />
mkfs.msdos -F 16 /dev/sda1<br />
<br />
then install and configure syslinux.<br />
<br />
===Windows boots up! No Syslinux!===<br />
'''Solution:''' Make sure the partition that contains {{ic|/boot}} has the boot flag enabled. Also, make sure the boot flag is not enabled on the Windows partition. See the installation section above.<br />
<br />
The MBR that comes with syslinux looks for the first active partition that has the boot flag set. The Windows partition was likely found first and had the boot flag set. If you wanted, you could use the MBR that Windows or MS-DOS fdisk provides.<br />
<br />
===Menu entries do nothing===<br />
You select a menu entry and it does nothing. It "refreshes" the menu.<br/><br />
This usually means that you have an error in your configuration. Hit {{Keypress|TAB}} to edit your boot parameters. Alternatively, press {{Keypress|Esc}} and type in the LABEL of your boot entry (Example: arch)<br />
<br />
===Cannot remove ldlinux.sys===<br />
ldlinux.sys has the immutable attribute set which prevents the file from being deleted or overwritten. This is because the sector location of the file must not change or else syslinux has to be reinstalled.<br />
To remove: <br />
chattr -i /boot/syslinux/ldlinux.sys<br />
rm /boot/syslinux/ldlinux.sys<br />
<br />
===A white block on the upper left corner appears when a kernel is loaded with modesetting on in early stage and when using vesamenu===<br />
'''Brain0''' said:<br />
''As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my Intel, when having syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in syslinux (the white block is actually an attempt to keep the syslinux menu, but the driver fails to capture the picture from vesa graphics mode).''<br />
<br />
If you have a custom resolution and a vesamenu with early modesetting, try to append the following in {{ic|syslinux.cfg}} to remove the white block and continue in graphics mode:<br />
<br />
APPEND root=/dev/sda6 ro 5 '''vga=current''' quiet splash<br />
<br />
== See also ==<br />
* [http://www.syslinux.org The Syslinux Project]'s web site.</div>Spaceonehttps://wiki.archlinux.org/index.php?title=Syslinux&diff=213871Syslinux2012-07-21T16:23:09Z<p>Spaceone: /* Keyboard remapping */</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[tr:Syslinux]]<br />
[[zh-CN:Syslinux]]<br />
{{Article summary start}}<br />
{{Article summary text|Describes installing and configuring Syslinux, a collection of bootloaders.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary end}}<br />
<br />
Syslinux is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the fat, ext2, ext3, ext4, and btrfs file systems.<br />
<br />
{{Note|Since Syslinux 4, Extlinux and Syslinux are the same thing.}} <br />
<br />
{{Note|Syslinux does not support [[UEFI]] as on May 2012. According to upstream, UEFI support will be eventually added to Syslinux, but there is no time-frame as to when it will be functional.}}<br />
<br />
== Syslinux Boot Process ==<br />
At boot, the computer loads the [[MBR]] ({{ic|/usr/lib/syslinux/mbr.bin}}). Then the MBR looks for the partition that is marked as active (boot flag). Once found, the volume boot record (VBR) will be executed. In the case of ext2/3/4 and fat12/16/32, the starting sector of {{ic|ldlinux.sys}} is hard-coded into the VBR. The VBR will execute ({{ic|ldlinux.sys}}). Therefore, if the location of {{ic|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 {{ic|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.) Once Syslinux is fully loaded, it looks for a configuration file, either {{ic|extlinux.conf}} or {{ic|syslinux.cfg}}. If one is found, the configuration file is loaded. If no configuration file is found, you will be given a syslinux prompt.<br />
<br />
==Installation==<br />
===Automatic Install - syslinux===<br />
The syslinux-install_update script will install Syslinux, copy COM32 modules to {{ic|/boot/syslinux}}, set the boot flag, and install the MBR. It can handle MBR and GPT disks along with softraid.<br />
<br />
1. Install {{Pkg|syslinux}}:<br />
pacman -S syslinux<br />
2. Make sure {{ic|/boot}} is mounted<br/><br />
3. Run {{ic|syslinux-install_update script}} {{ic|-i}} (install) {{ic|-a}} (set boot flag) {{ic|-m}} (install mbr)<br />
/usr/sbin/syslinux-install_update -iam<br />
4. Edit {{ic|/boot/syslinux/syslinux.cfg}}<br />
<br />
===Manual Install - syslinux===<br />
{{Note| If you are unsure of which partition table you are using (MBR or GPT), you are likely using the MBR partition table. Most of the time GPT will create a special MBR-style partition (type 0xEE) using the whole disk which will be displayed with the following command:<br />
fdisk -l /dev/sda<br />
<br />
or alternatively:<br />
sgdisk -l /dev/sda<br />
<br />
will show "GPT: not present" if it is not a GPT disk.<br />
}}<br />
<br />
{{Note| If you are trying to rescue an installed system with a live CD, be sure to [[Change_Root|chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not {{ic|/dev/}} paths) with the mount point.}}<br />
<br />
Make sure you have the {{Pkg|syslinux}} package installed. Then install Syslinux onto your boot partition, which must contain a fat, ext2, ext3, ext4, or btrfs file system.<br />
You should install it on a mounted directory, not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}} you can install syslinux in the syslinux directory:<br />
mkdir /boot/syslinux<br />
extlinux --install /boot/syslinux <br />
<br />
====MBR Partition Table====<br />
Next you need mark your boot partition active in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|(g)parted}}. It should look like this:<br />
fdisk -l /dev/sda<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
<br />
Install the master boot record:<br />
dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda<br />
<!-- conv=notrunc helps if {{ic|/dev/sda}} is actually a file not a block device --><br />
<br />
An alternate MBR which Syslinux provides is: altmbr.bin. This MBR does ''not'' scan for bootable partitions; instead, the last byte of the MBR is set to a value indicating which partition to boot from. Here is an example of how {{ic|altmbr.bin}} can be copied into position:<br />
<br />
printf '\x5' | cat /usr/lib/syslinux/altmbr.bin - | dd bs=440 count=1 conv=notrunc of=/dev/sda<br />
<br />
In this case, a single byte of value 5 is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device sda. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.<br />
<br />
====GUID Partition Table aka GPT====<br />
Main article [[GUID Partition Table]].<br />
<br />
Bit 2 of the attributes for the {{ic|/boot}} partition need to be set.<br />
<br />
sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute legacy BIOS bootable on partition 1.<br />
<br />
Verify:<br />
sgdisk /dev/sda --attributes=1:show<br />
1:2:1 (legacy BIOS bootable)<br />
<br />
Install the master boot record:<br />
dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda<br />
<br />
====Rebooting====<br />
When you reboot your system now, you will have a syslinux prompt. To automatically boot your system or get a boot menu, you still need to create a configuration file.<br />
<br />
== Configuring syslinux ==<br />
The syslinux configuration file, {{ic|syslinux.cfg}}, should be created in the same directory where you installed syslinux. In our case, {{ic|/boot/syslinux/}}.<br />
<br />
The bootloader will look for either {{ic|syslinux.cfg}} (preferred) or {{ic| extlinux.conf}}<br />
<br />
'''Tips''':<br />
*Instead of {{ic|LINUX}}, the keyword {{ic|KERNEL}} can also be used. {{ic|KERNEL}} tries to detect the type of the file, while {{ic|LINUX}} always expects a Linux kernel. <br />
*{{ic|TIMEOUT}} value is in units of 1/10 of a second.<br />
<br />
=== Examples ===<br />
==== Basic Syslinux Config ====<br />
This is a simple configuration file that will show a boot: prompt and automatically boot after 5 seconds.<br />
<br />
Config:<br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
If you want to boot directly without seeing a prompt, set {{ic|PROMPT}} to {{ic|0}}.<br />
<br />
If you want to use [[UUID]] for persistent device naming instead of device names, change:<br />
APPEND root=/dev/sda2 ro<br />
<br />
to:<br />
APPEND root=UUID=<uuid here> ro<br />
<br />
==== Text Boot menu ====<br />
Syslinux also allows you to use a boot menu. To use it, copy the menu COM32 module to your syslinux directory:<br />
# cp /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is in the same partition as {{ic|/usr}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
Config:<br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
For more details about the menu system, see http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob;f=doc/menu.txt.<br />
<br />
==== Graphical Boot menu ====<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the vesamenu COM32 module to your syslinux folder:<br />
# cp /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is the same partition as {{ic|/}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
[http://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux This config] uses the same menu design as the Arch Install CD. The background file can be found there too.<br />
<br />
Config:<br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
Since Syslinux 3.84, {{ic|vesamenu.c32}} supports the {{ic|MENU RESOLUTION $WIDTH $HEIGHT}} directive.<br />
To use it, insert {{ic|MENU RESOLUTION 1440 900}} into your config for a 1440x900 resolution.<br />
The background picture has to have exactly the right resolution, however, as syslinux will otherwise refuse to load the menu.<br />
<br />
=== Chainloading ===<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy (or symlink) the {{ic|chain.c32}} module to the syslinux directory (for details, see the instructions in the previous section). Then create a section in the configuration file:<br />
<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
<br />
{{ic|hd0 3}} is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. For more details about chainloading, see [http://syslinux.zytor.com/wiki/index.php/Comboot/chain.c32].<br />
<br />
If you have [[grub2]] installed in your boot partition, you can chainload it by using: <br />
<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
<br />
This may be required for booting from ISO images.<br />
<br />
=== Using memtest ===<br />
Use this {{ic|LABEL}} section to launch memtest (install the {{Pkg|memtest86+}} package):<br />
<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
<br />
=== HDT ===<br />
HDT (Hardware Detection Tool) displays hardware information. Like before, the {{ic|.c32}} file has to be copied or symlinked from {{ic|/boot/syslinux/}}.<br />
For PCI info, either copy or symlink {{ic|/usr/share/hwdata/pci.ids}} to {{ic|/boot/syslinux/pci.ids}}<br />
<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
<br />
=== Reboot and power off ===<br />
Use the following sections to reboot or power off your machine:<br />
<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COMBOOT poweroff.com<br />
<br />
=== Clear Menu ===<br />
To clear the screen when exiting the menu, add the following line:<br />
MENU CLEAR<br />
<br />
=== Keyboard remapping ===<br />
If you often have to edit your boot parameters, you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keymap.<br />
<br />
First you have to create a compatible keymap (for example a german one):<br />
cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz ./<br />
cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz ./<br />
gunzip {de,us}.map.gz<br />
mv de.map de.kmap<br />
mv us.map us.kmap<br />
keytab-lilo de > de.ktl<br />
<br />
Copy {{ic|de.ktl}} as root to {{ic|/boot/syslinux/}} and set ownership to root:<br />
chown root:root /boot/syslinux/de.ktl<br />
<br />
Now edit {{ic|syslinux.conf}} and add<br />
KBDMAP de.ktl<br />
<br />
==Troubleshooting==<br />
===I have a Syslinux Prompt - Yikes!===<br />
You can type in the {{ic|LABEL}} name of the entry that you want to boot (as per your {{ic|syslinux.cfg}}). If you used the example configs, just type:<br />
boot: arch<br />
<br />
If you get an error that the config file could not be loaded, you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 ro initrd=../initramfs-linux.img<br />
<br />
If you do not have access to {{ic|boot:}} in ramfs, and therefore temporarily unable to boot kernel again,<br />
<br />
1) Create temp directory, in order to mount your root partition (if it does not exist already):<br />
<br />
mkdir -p /new_root<br />
<br />
2) Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):<br />
{{Note|If {{ic|/boot}} is on its own ext2 partition then busybox cannot mount it.}}<br />
<br />
mount /dev/sd[a-z][1-9] /new_root<br />
<br />
3) Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.<br />
<br />
4) Reboot.<br />
<br />
===No Default or UI found on some computers===<br />
Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted USB drive may boot on a more recent computer, some computers may hang if the boot partition containing the kernel and initrd are not on a fat16 partition. To prevent an older machine from loading ldlinux and failing to read {{ic|syslinux.cfg}}, use cfdisk to create a fat16 partition (<=2GB) and format with <br />
pacman -S dosfstools<br />
mkfs.msdos -F 16 /dev/sda1<br />
<br />
then install and configure syslinux.<br />
<br />
===Windows boots up! No Syslinux!===<br />
'''Solution:''' Make sure the partition that contains {{ic|/boot}} has the boot flag enabled. Also, make sure the boot flag is not enabled on the Windows partition. See the installation section above.<br />
<br />
The MBR that comes with syslinux looks for the first active partition that has the boot flag set. The Windows partition was likely found first and had the boot flag set. If you wanted, you could use the MBR that Windows or MS-DOS fdisk provides.<br />
<br />
===Menu entries do nothing===<br />
You select a menu entry and it does nothing. It "refreshes" the menu.<br/><br />
This usually means that you have an error in your configuration. Hit {{Keypress|TAB}} to edit your boot parameters. Alternatively, press {{Keypress|Esc}} and type in the LABEL of your boot entry (Example: arch)<br />
<br />
===Cannot remove ldlinux.sys===<br />
ldlinux.sys has the immutable attribute set which prevents the file from being deleted or overwritten. This is because the sector location of the file must not change or else syslinux has to be reinstalled.<br />
To remove: <br />
chattr -i /boot/syslinux/ldlinux.sys<br />
rm /boot/syslinux/ldlinux.sys<br />
<br />
===A white block on the upper left corner appears when a kernel is loaded with modesetting on in early stage and when using vesamenu===<br />
'''Brain0''' said:<br />
''As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my Intel, when having syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in syslinux (the white block is actually an attempt to keep the syslinux menu, but the driver fails to capture the picture from vesa graphics mode).''<br />
<br />
If you have a custom resolution and a vesamenu with early modesetting, try to append the following in {{ic|syslinux.cfg}} to remove the white block and continue in graphics mode:<br />
<br />
APPEND root=/dev/sda6 ro 5 '''vga=current''' quiet splash<br />
<br />
== See also ==<br />
* [http://www.syslinux.org The Syslinux Project]'s web site.</div>Spaceonehttps://wiki.archlinux.org/index.php?title=Syslinux&diff=213870Syslinux2012-07-21T16:22:45Z<p>Spaceone: Keyboard remapping</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[tr:Syslinux]]<br />
[[zh-CN:Syslinux]]<br />
{{Article summary start}}<br />
{{Article summary text|Describes installing and configuring Syslinux, a collection of bootloaders.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary end}}<br />
<br />
Syslinux is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the fat, ext2, ext3, ext4, and btrfs file systems.<br />
<br />
{{Note|Since Syslinux 4, Extlinux and Syslinux are the same thing.}} <br />
<br />
{{Note|Syslinux does not support [[UEFI]] as on May 2012. According to upstream, UEFI support will be eventually added to Syslinux, but there is no time-frame as to when it will be functional.}}<br />
<br />
== Syslinux Boot Process ==<br />
At boot, the computer loads the [[MBR]] ({{ic|/usr/lib/syslinux/mbr.bin}}). Then the MBR looks for the partition that is marked as active (boot flag). Once found, the volume boot record (VBR) will be executed. In the case of ext2/3/4 and fat12/16/32, the starting sector of {{ic|ldlinux.sys}} is hard-coded into the VBR. The VBR will execute ({{ic|ldlinux.sys}}). Therefore, if the location of {{ic|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 {{ic|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.) Once Syslinux is fully loaded, it looks for a configuration file, either {{ic|extlinux.conf}} or {{ic|syslinux.cfg}}. If one is found, the configuration file is loaded. If no configuration file is found, you will be given a syslinux prompt.<br />
<br />
==Installation==<br />
===Automatic Install - syslinux===<br />
The syslinux-install_update script will install Syslinux, copy COM32 modules to {{ic|/boot/syslinux}}, set the boot flag, and install the MBR. It can handle MBR and GPT disks along with softraid.<br />
<br />
1. Install {{Pkg|syslinux}}:<br />
pacman -S syslinux<br />
2. Make sure {{ic|/boot}} is mounted<br/><br />
3. Run {{ic|syslinux-install_update script}} {{ic|-i}} (install) {{ic|-a}} (set boot flag) {{ic|-m}} (install mbr)<br />
/usr/sbin/syslinux-install_update -iam<br />
4. Edit {{ic|/boot/syslinux/syslinux.cfg}}<br />
<br />
===Manual Install - syslinux===<br />
{{Note| If you are unsure of which partition table you are using (MBR or GPT), you are likely using the MBR partition table. Most of the time GPT will create a special MBR-style partition (type 0xEE) using the whole disk which will be displayed with the following command:<br />
fdisk -l /dev/sda<br />
<br />
or alternatively:<br />
sgdisk -l /dev/sda<br />
<br />
will show "GPT: not present" if it is not a GPT disk.<br />
}}<br />
<br />
{{Note| If you are trying to rescue an installed system with a live CD, be sure to [[Change_Root|chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not {{ic|/dev/}} paths) with the mount point.}}<br />
<br />
Make sure you have the {{Pkg|syslinux}} package installed. Then install Syslinux onto your boot partition, which must contain a fat, ext2, ext3, ext4, or btrfs file system.<br />
You should install it on a mounted directory, not a {{ic|/dev/sdXY}} device. You do not have to install it on the root directory of a file system, e.g., with device {{ic|/dev/sda1}} mounted on {{ic|/boot}} you can install syslinux in the syslinux directory:<br />
mkdir /boot/syslinux<br />
extlinux --install /boot/syslinux <br />
<br />
====MBR Partition Table====<br />
Next you need mark your boot partition active in your partition table. Applications capable of doing this include {{ic|fdisk}}, {{ic|cfdisk}}, {{ic|sfdisk}}, {{ic|(g)parted}}. It should look like this:<br />
fdisk -l /dev/sda<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
<br />
Install the master boot record:<br />
dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda<br />
<!-- conv=notrunc helps if {{ic|/dev/sda}} is actually a file not a block device --><br />
<br />
An alternate MBR which Syslinux provides is: altmbr.bin. This MBR does ''not'' scan for bootable partitions; instead, the last byte of the MBR is set to a value indicating which partition to boot from. Here is an example of how {{ic|altmbr.bin}} can be copied into position:<br />
<br />
printf '\x5' | cat /usr/lib/syslinux/altmbr.bin - | dd bs=440 count=1 conv=notrunc of=/dev/sda<br />
<br />
In this case, a single byte of value 5 is appended to the contents of {{ic|altmbr.bin}} and the resulting 440 bytes are written to the MBR on device sda. Syslinux was installed on the first logical partition ({{ic|/dev/sda5}}) of the disk.<br />
<br />
====GUID Partition Table aka GPT====<br />
Main article [[GUID Partition Table]].<br />
<br />
Bit 2 of the attributes for the {{ic|/boot}} partition need to be set.<br />
<br />
sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute legacy BIOS bootable on partition 1.<br />
<br />
Verify:<br />
sgdisk /dev/sda --attributes=1:show<br />
1:2:1 (legacy BIOS bootable)<br />
<br />
Install the master boot record:<br />
dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda<br />
<br />
====Rebooting====<br />
When you reboot your system now, you will have a syslinux prompt. To automatically boot your system or get a boot menu, you still need to create a configuration file.<br />
<br />
== Configuring syslinux ==<br />
The syslinux configuration file, {{ic|syslinux.cfg}}, should be created in the same directory where you installed syslinux. In our case, {{ic|/boot/syslinux/}}.<br />
<br />
The bootloader will look for either {{ic|syslinux.cfg}} (preferred) or {{ic| extlinux.conf}}<br />
<br />
'''Tips''':<br />
*Instead of {{ic|LINUX}}, the keyword {{ic|KERNEL}} can also be used. {{ic|KERNEL}} tries to detect the type of the file, while {{ic|LINUX}} always expects a Linux kernel. <br />
*{{ic|TIMEOUT}} value is in units of 1/10 of a second.<br />
<br />
=== Examples ===<br />
==== Basic Syslinux Config ====<br />
This is a simple configuration file that will show a boot: prompt and automatically boot after 5 seconds.<br />
<br />
Config:<br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
If you want to boot directly without seeing a prompt, set {{ic|PROMPT}} to {{ic|0}}.<br />
<br />
If you want to use [[UUID]] for persistent device naming instead of device names, change:<br />
APPEND root=/dev/sda2 ro<br />
<br />
to:<br />
APPEND root=UUID=<uuid here> ro<br />
<br />
==== Text Boot menu ====<br />
Syslinux also allows you to use a boot menu. To use it, copy the menu COM32 module to your syslinux directory:<br />
# cp /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is in the same partition as {{ic|/usr}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
Config:<br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
For more details about the menu system, see http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob;f=doc/menu.txt.<br />
<br />
==== Graphical Boot menu ====<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the vesamenu COM32 module to your syslinux folder:<br />
# cp /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
If {{ic|/boot}} is the same partition as {{ic|/}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
[http://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux This config] uses the same menu design as the Arch Install CD. The background file can be found there too.<br />
<br />
Config:<br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://www.syslinux.org/wiki/index.php/Comboot/menu.c32<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
Since Syslinux 3.84, {{ic|vesamenu.c32}} supports the {{ic|MENU RESOLUTION $WIDTH $HEIGHT}} directive.<br />
To use it, insert {{ic|MENU RESOLUTION 1440 900}} into your config for a 1440x900 resolution.<br />
The background picture has to have exactly the right resolution, however, as syslinux will otherwise refuse to load the menu.<br />
<br />
=== Chainloading ===<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy (or symlink) the {{ic|chain.c32}} module to the syslinux directory (for details, see the instructions in the previous section). Then create a section in the configuration file:<br />
<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
<br />
{{ic|hd0 3}} is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. For more details about chainloading, see [http://syslinux.zytor.com/wiki/index.php/Comboot/chain.c32].<br />
<br />
If you have [[grub2]] installed in your boot partition, you can chainload it by using: <br />
<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
<br />
This may be required for booting from ISO images.<br />
<br />
=== Using memtest ===<br />
Use this {{ic|LABEL}} section to launch memtest (install the {{Pkg|memtest86+}} package):<br />
<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
<br />
=== HDT ===<br />
HDT (Hardware Detection Tool) displays hardware information. Like before, the {{ic|.c32}} file has to be copied or symlinked from {{ic|/boot/syslinux/}}.<br />
For PCI info, either copy or symlink {{ic|/usr/share/hwdata/pci.ids}} to {{ic|/boot/syslinux/pci.ids}}<br />
<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
<br />
=== Reboot and power off ===<br />
Use the following sections to reboot or power off your machine:<br />
<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COMBOOT poweroff.com<br />
<br />
=== Clear Menu ===<br />
To clear the screen when exiting the menu, add the following line:<br />
MENU CLEAR<br />
<br />
=== Keyboard remapping ===<br />
If you often have to edit your boot parameters, you might want to remap your keyboard layout. This allows you to enter "=", "/" and other characters easily on a non-US keymap.<br />
<br />
First you have to create a compatible keymap (for example a german one):<br />
cp /usr/share/kbd/keymaps/i386/qwerty/us.map.gz ./<br />
cp /usr/share/kbd/keymaps/i386/qwertz/de.map.gz ./<br />
gunzip {de,us}.map.gz<br />
mv de.map de.kmap<br />
mv us.map us.kmap<br />
keytab-lilo de > de.ktl<br />
<br />
Copy as root {{ic|de.ktl}} to {{ic|/boot/syslinux/}} and set ownership to root:<br />
chown root:root /boot/syslinux/de.ktl<br />
<br />
Now edit {{ic|syslinux.conf}} and add<br />
KBDMAP de.ktl<br />
<br />
==Troubleshooting==<br />
===I have a Syslinux Prompt - Yikes!===<br />
You can type in the {{ic|LABEL}} name of the entry that you want to boot (as per your {{ic|syslinux.cfg}}). If you used the example configs, just type:<br />
boot: arch<br />
<br />
If you get an error that the config file could not be loaded, you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 ro initrd=../initramfs-linux.img<br />
<br />
If you do not have access to {{ic|boot:}} in ramfs, and therefore temporarily unable to boot kernel again,<br />
<br />
1) Create temp directory, in order to mount your root partition (if it does not exist already):<br />
<br />
mkdir -p /new_root<br />
<br />
2) Mount {{ic|/}} under {{ic|/new_root}} (in case {{ic|/boot/}} is on the same partition, otherwise you will need to mount them both):<br />
{{Note|If {{ic|/boot}} is on its own ext2 partition then busybox cannot mount it.}}<br />
<br />
mount /dev/sd[a-z][1-9] /new_root<br />
<br />
3) Use {{ic|vim}} and edit {{ic|syslinux.cfg}} again to suit your needs and save file.<br />
<br />
4) Reboot.<br />
<br />
===No Default or UI found on some computers===<br />
Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted USB drive may boot on a more recent computer, some computers may hang if the boot partition containing the kernel and initrd are not on a fat16 partition. To prevent an older machine from loading ldlinux and failing to read {{ic|syslinux.cfg}}, use cfdisk to create a fat16 partition (<=2GB) and format with <br />
pacman -S dosfstools<br />
mkfs.msdos -F 16 /dev/sda1<br />
<br />
then install and configure syslinux.<br />
<br />
===Windows boots up! No Syslinux!===<br />
'''Solution:''' Make sure the partition that contains {{ic|/boot}} has the boot flag enabled. Also, make sure the boot flag is not enabled on the Windows partition. See the installation section above.<br />
<br />
The MBR that comes with syslinux looks for the first active partition that has the boot flag set. The Windows partition was likely found first and had the boot flag set. If you wanted, you could use the MBR that Windows or MS-DOS fdisk provides.<br />
<br />
===Menu entries do nothing===<br />
You select a menu entry and it does nothing. It "refreshes" the menu.<br/><br />
This usually means that you have an error in your configuration. Hit {{Keypress|TAB}} to edit your boot parameters. Alternatively, press {{Keypress|Esc}} and type in the LABEL of your boot entry (Example: arch)<br />
<br />
===Cannot remove ldlinux.sys===<br />
ldlinux.sys has the immutable attribute set which prevents the file from being deleted or overwritten. This is because the sector location of the file must not change or else syslinux has to be reinstalled.<br />
To remove: <br />
chattr -i /boot/syslinux/ldlinux.sys<br />
rm /boot/syslinux/ldlinux.sys<br />
<br />
===A white block on the upper left corner appears when a kernel is loaded with modesetting on in early stage and when using vesamenu===<br />
'''Brain0''' said:<br />
''As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my Intel, when having syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in syslinux (the white block is actually an attempt to keep the syslinux menu, but the driver fails to capture the picture from vesa graphics mode).''<br />
<br />
If you have a custom resolution and a vesamenu with early modesetting, try to append the following in {{ic|syslinux.cfg}} to remove the white block and continue in graphics mode:<br />
<br />
APPEND root=/dev/sda6 ro 5 '''vga=current''' quiet splash<br />
<br />
== See also ==<br />
* [http://www.syslinux.org The Syslinux Project]'s web site.</div>Spaceone