https://wiki.archlinux.org/api.php?action=feedcontributions&user=Cinelli&feedformat=atomArchWiki - User contributions [en]2024-03-29T13:44:55ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=GRUB&diff=264370GRUB2013-06-26T17:00:49Z<p>Cinelli: /* Install to UEFI system partition */ removed grub.mo</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[ar:GRUB]]<br />
[[cs:GRUB2]]<br />
[[de:GRUB]]<br />
[[es:GRUB2]]<br />
[[fr:GRUB2]]<br />
[[id:GRUB2]]<br />
[[it:GRUB2]]<br />
[[ru:GRUB2]]<br />
[[tr:GRUB2]]<br />
[[zh-CN:GRUB2]]<br />
[[zh-TW:GRUB2]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers various aspects of version 2 of the GRand Unified Bootloader (GRUB).}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|BURG}} - BURG is a brand-new boot loader based on GRUB v2. It can be built on a wider range of OS, and has a highly configurable menu system which works in both text and graphic mode. <br />
{{Article summary wiki|GRUB Legacy}} - previous Version, now obsolete.<br />
{{Article summary heading|Resources}}<br />
{{Article summary wiki|GRUB EFI Examples}}<br />
{{Article summary link|GNU GRUB - GNU Project|https://www.gnu.org/software/grub/}}<br />
{{Article summary end}}<br />
<br />
[https://www.gnu.org/software/grub/ GRUB] - not to be confused with [[GRUB Legacy]] - is the next generation of the GRand Unified Bootloader. GRUB is derived from [http://www.nongnu.org/pupa/ PUPA] which was a research project to develop the next generation of what is now GRUB Legacy. GRUB has been rewritten from scratch to clean up everything and provide modularity and portability [https://www.gnu.org/software/grub/grub-faq.html#q1].<br />
<br />
In brief, the ''bootloader'' is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the Linux kernel. The kernel, in turn, initializes the rest of the operating system.<br />
<br />
== Preface ==<br />
<br />
* The name ''GRUB'' officially refers to version ''2'' of the software, see [https://www.gnu.org/software/grub/]. If you are looking for the article on the legacy version, see [[GRUB Legacy]].<br />
* GRUB supports [[Btrfs]] as root (without a separate {{ic|/boot}} filesystem) compressed with either zlib or LZO<br />
<br />
=== Notes for current GRUB Legacy users ===<br />
<br />
* Upgrading from [[GRUB Legacy]] to GRUB is much the same as freshly installing GRUB, which is covered [[#Installation|below]]<br />
* There are differences in the commands of GRUB Legacy and GRUB. Familiarize yourself with [https://www.gnu.org/software/grub/manual/grub.html#Commands GRUB commands] before proceeding (e.g. "find" has been replaced with "search")<br />
* GRUB is now ''modular'' and no longer requires "stage 1.5". As a result, the bootloader itself is limited -- modules are loaded from the hard drive as needed to expand functionality (e.g. for [[LVM]] or RAID support)<br />
* Device naming has changed between GRUB Legacy and GRUB. Partitions are numbered from 1 instead of 0 while drives are still numbered from 0, and prefixed with partition-table type. For example, {{ic|/dev/sda1}} would be referred to as {{ic|(hd0,msdos1)}} (for MBR) or {{ic|(hd0,gpt1)}} (for GPT)<br />
* If you use systemd without systemd-sysvcompat, and have had {{ic|<nowiki>init=/usr/lib/systemd/systemd</nowiki>}} in your old grub menu.lst, the automatically generated grub.cfg file might not carry over this kernel parameter (giving you "ERROT: Root device mounted successfully, but /sbin/init does not exist" on boot). If so, edit the Arch Linux entry that grub shows you, add {{ic|<nowiki>init=/usr/lib/systemd/systemd</nowiki>}} to the kernel parameters, and then [[Grub#Additional_arguments|make it permanent]].<br />
* GRUB is noticably bigger than GRUB legacy (occupies ~13 MB in /boot). If you are booting from a separate /boot partition, and this partition is smaller than 32 MB, you will run into disk space issues, and pacman will refuse to install new kernels. If you don't want to re-partition your system, switch to [[Syslinux]] instead, which is smaller (occupies ~1.5 MB in /boot).<br />
<br />
==== Backup important data ====<br />
<br />
Although a GRUB installation should run smoothly, it is strongly recommended to keep the GRUB Legacy files before upgrading to GRUB v2.<br />
<br />
# mv /boot/grub /boot/grub-legacy<br />
<br />
Backup the MBR which contains the boot code and partition table (Replace {{ic|/dev/sd'''X'''}} with your actual disk path):<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/mbr_backup bs=512 count=1<br />
<br />
Only 446 bytes of the MBR contain boot code, the next 64 contain the partition table. If you do not want to overwrite your partition table when restoring, it is strongly advised to backup only the MBR boot code:<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/bootcode_backup bs=446 count=1<br />
<br />
If unable to install GRUB2 correctly, see [[#Restore GRUB Legacy]].<br />
<br />
=== Preliminary requirements ===<br />
<br />
==== BIOS systems ====<br />
<br />
===== GUID Partition Table (GPT) specific instructions =====<br />
<br />
GRUB in [[GPT|BIOS-GPT]] configuration requires a [http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html BIOS boot partition] to embed its {{ic|core.img}} in the absence of post-MBR gap in GPT partitioned systems (which is taken over by the GPT Primary Header and Primary Partition table). This partition is used by GRUB only in BIOS-GPT setups. No such partition type exists in case of MBR partitioning (at least not for GRUB). This partition is also not required if the system is UEFI based, as no embedding of bootsectors takes place in that case.<br />
<br />
For a BIOS-GPT configuration, create a 1007 KiB partition at the beginning of the disk using gdisk, cgdisk or GNU Parted with no filesystem. The size of 1007 KiB will allow for the following partition to be correctly alligned at 1024 KiB. If needed, the partition can also be located somewhere else on the disk, but it should be within the first 2 TiB region. Set the partition type to {{ic|ef02}} in (c)gdisk or {{ic|set <BOOT_PART_NUM> bios_grub on}} in GNU Parted.<br />
<br />
{{Note|<br />
* This partition should be created before {{ic|grub-install}} or {{ic|grub-setup}} is run<br />
* gdisk will only allow you to create this partition on the position which will waste the least amount of space (sector 34-2047) if you create it last, after all the other partitions. This is because gdisk will auto-align partitions to 2048-sector boundaries if possible<br />
}}<br />
<br />
===== Master Boot Record (MBR) specific instructions =====<br />
<br />
Usually the post-[[MBR]] gap (after the 512 byte MBR region and before the start of the 1st partition) in many MBR (or msdos disklabel) partitioned systems is 31 KiB when DOS compatibility cylinder alignment issues are satisfied in the partition table. However a post-MBR gap of about 1 to 2 MiB is recommended to provide sufficient room for embedding GRUB's {{ic|core.img}} ({{bug|24103}}). It is advisable to use a partitioner which supports 1 MiB partition alignment to obtain this space as well as satisfy other non-512 byte sector issues (which are unrelated to embedding of {{ic|core.img}}).<br />
<br />
==== UEFI systems ====<br />
<br />
{{Note|It is recommended to read and understand the [[Unified Extensible Firmware Interface|UEFI]], [[GUID Partition Table|GPT]] and [[UEFI Bootloaders]] pages.}}<br />
<br />
===== Create and Mount the UEFI System Partition =====<br />
<br />
Follow [[Unified Extensible Firmware Interface#EFI System Partition]] for instructions on creating a UEFI System Partition. Then mount the UEFI System Partition at {{ic|/boot/efi}}. If you have mounted the UEFI System Partition at some other mountpoint, replace {{ic|/boot/efi}} in the below instructions with that mountpoint:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat <UEFI_SYSTEM_PARTITION> /boot/efi<br />
<br />
Create a {{ic|/boot/efi/EFI}} directory:<br />
<br />
# mkdir /boot/efi/EFI<br />
<br />
== Installation ==<br />
<br />
=== BIOS systems ===<br />
<br />
GRUB can be [[pacman|installed]] with the {{Pkg|grub}} package from the [[official repositories]]. It will replace {{Pkg|grub-legacy}} , if it is installed.<br />
<br />
{{Note|Simply installing the package won't update the {{ic|/boot/grub/i386-pc/core.img}} file and the GRUB modules in {{ic|/boot/grub/i386-pc}}. You need to update them manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install boot files ====<br />
<br />
There are 3 ways to install GRUB boot files in BIOS booting:<br />
* [[#Install to GPT BIOS boot partition]] (recommended with [[GPT]])<br />
* [[#Install to 440-byte MBR boot code region]] (recommended with [[MBR]])<br />
* [[#Install to partition or partitionless disk]] (not recommended)<br />
* [[#Generate core.img alone]] (safest method, but requires another BIOS bootloader like [[GRUB Legacy]] or [[Syslinux]] to be installed to chainload {{ic|/boot/grub/i386-pc/core.img}})<br />
<br />
{{Note|See http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html for additional documentation.}}<br />
<br />
===== Install to GPT BIOS boot partition =====<br />
<br />
[[GUID Partition Table]] disks do not have a reserved "boot track". Therefore you must create a BIOS Boot Partition ({{ic|ef02}}) to hold the GRUB core image.<br />
<br />
Using GNU Parted, you can set this using a command such as the following:<br />
<br />
# parted /dev/disk set <partition-number> bios_grub on<br />
<br />
If you are using gdisk, set the partition type to {{ic|ef02}}. With partitioning programs that require setting the GUID directly, it should be {{ic|‘21686148-6449-6e6f-744e656564454649’}} (or, {{ic|[[wikipedia:BIOS_Boot_partition|Hah!IdontNeedEFI]]}}).<br />
<br />
{{Warning|Be very careful which partition you select when marking it as a BIOS Boot Partition. When GRUB finds a BIOS Boot Partition during installation, it will automatically overwrite part of it. Make sure that the partition does not contain any other data.}}<br />
<br />
To setup {{ic|grub}} on a GPT disk, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, and embed it in the BIOS Boot Partition, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --recheck --debug /dev/sda<br />
<br />
where {{ic|/dev/sda}} is the destination of the installation.<br />
<br />
Continue with [[GRUB#Generate config file]] below.<br />
<br />
===== Install to 440-byte MBR boot code region =====<br />
<br />
To setup {{ic|grub}} in the 440-byte Master Boot Record boot code region, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, embed it in the 31 KiB (minimum size - varies depending on partition alignment) post-MBR gap, and generate the configuration file, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --recheck /dev/sdX<br />
<br />
where {{ic|/dev/sdX}} is the destination of the installation (in this case the MBR of the first SATA disk). If you use [[LVM]] for your {{ic|/boot}}, you can install GRUB on multiple physical disks.<br />
<br />
{{Warning|Make sure to check the {{ic|/boot}} directory if you use the latter. Sometimes the {{ic|boot-directory}} parameter creates another {{ic|/boot}} folder inside of {{ic|/boot}}. A wrong install would look like: {{ic|/boot/boot/grub/}}.}}<br />
<br />
Continue with [[GRUB#Generate config file]] below.<br />
<br />
===== Install to partition or partitionless disk =====<br />
<br />
{{Note|GRUB does not encourage installation to a partition boot sector or a partitionless disk like GRUB Legacy or Syslinux does. This kind of setup is prone to breakage, especially during updates, and is not supported by Arch devs.}}<br />
<br />
To set up grub to a partition boot sector, to a partitionless disk (also called superfloppy) or to a floppy disk, run (using for example {{ic|/dev/sdaX}} as the {{ic|/boot}} partition):<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=i386-pc --recheck --debug --force /dev/sdaX<br />
# chattr -i /boot/grub/i386-pc/core.img<br />
# chattr +i /boot/grub/i386-pc/core.img<br />
<br />
You need to use the {{ic|--force}} option to allow usage of blocklists and should not use {{ic|1=--grub-setup=/bin/true}} (which is similar to simply generating {{ic|core.img}}).<br />
<br />
{{ic|grub-install}} will give out warnings like which should give you the idea of what might go wrong with this approach:<br />
<br />
/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.<br />
/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. <br />
However, blocklists are UNRELIABLE and their use is discouraged.<br />
<br />
Without {{ic|--force}} you may get the below error and {{ic|grub-setup}} will not setup its boot code in the partition boot sector:<br />
<br />
/sbin/grub-setup: error: will not proceed with blocklists<br />
<br />
With {{ic|--force}} you should get:<br />
<br />
Installation finished. No error reported.<br />
<br />
The reason why {{ic|grub-setup}} does not by default allow this is because in case of partition or a partitionless disk is that {{ic|grub}} relies on embedded blocklists in the partition bootsector to locate the {{ic|/boot/grub/i386-pc/core.img}} file and the prefix dir {{ic|/boot/grub}}. The sector locations of {{ic|core.img}} may change whenever the filesystem in the partition is being altered (files copied, deleted etc.). For more info see https://bugzilla.redhat.com/show_bug.cgi?id=728742 and https://bugzilla.redhat.com/show_bug.cgi?id=730915.<br />
<br />
The workaround for this is to set the immutable flag on {{ic|/boot/grub/i386-pc/core.img}} (using chattr command as mentioned above) so that the sector locations of the {{ic|core.img}} file in the disk is not altered. The immutable flag on {{ic|/boot/grub/i386-pc/core.img}} needs to be set only if {{ic|grub}} is installed to a partition boot sector or a partitionless disk, not in case of installation to MBR or simple generation of {{ic|core.img}} without embedding any bootsector (mentioned above).<br />
<br />
===== Generate core.img alone =====<br />
<br />
To populate the {{ic|/boot/grub}} directory and generate a {{ic|/boot/grub/i386-pc/core.img}} file '''without''' embedding any {{ic|grub}} bootsector code in the MBR, post-MBR region, or the partition bootsector, add {{ic|1=--grub-setup=/bin/true}} to {{ic|grub-install}}:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --grub-setup=/bin/true --recheck --debug /dev/sda<br />
<br />
You can then chainload GRUB's {{ic|core.img}} from GRUB Legacy or syslinux as a Linux kernel or a multiboot kernel.<br />
<br />
==== Generate config file ====<br />
<br />
Finally, generate a configuration for GRUB (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|/boot/grub/grub.cfg}}, NOT {{ic|/boot/grub/i386-pc/grub.cfg}}.}}<br />
<br />
If GRUB complains about "no suitable mode found" while booting, go to [[#"No suitable mode found" error]].<br />
<br />
If {{ic|grub-mkconfig}} fails, convert your {{ic|/boot/grub/menu.lst}} file to {{ic|/boot/grub/grub.cfg}} using:<br />
<br />
# grub-menulst2cfg /boot/grub/menu.lst /boot/grub/grub.cfg<br />
<br />
For example:<br />
<br />
{{hc|/boot/grub/menu.lst|<nowiki><br />
default=0<br />
timeout=5<br />
<br />
title Arch Linux Stock Kernel<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux.img<br />
<br />
title Arch Linux Stock Kernel Fallback<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux-fallback.img<br />
</nowiki>}}<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
set default='0'; if [ x"$default" = xsaved ]; then load_env; set default="$saved_entry"; fi<br />
set timeout=5<br />
<br />
menuentry 'Arch Linux Stock Kernel' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux.img' '/initramfs-linux.img'<br />
<br />
}<br />
<br />
menuentry 'Arch Linux Stock Kernel Fallback' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux-fallback.img' '/initramfs-linux-fallback.img'<br />
}<br />
</nowiki>}}<br />
<br />
If you forgot to create a GRUB {{ic|/boot/grub/grub.cfg}} config file and simply rebooted into GRUB Command Shell, type:<br />
<br />
sh:grub> insmod legacycfg<br />
sh:grub> legacy_configfile ${prefix}/menu.lst<br />
<br />
Boot into Arch and re-create the proper GRUB {{ic|/boot/grub/grub.cfg}} config file.<br />
<br />
{{Note|This option works only in BIOS systems, not in UEFI systems.}}<br />
<br />
==== Multiboot ====<br />
This should work out of the box, but an extra utility needs to be installed: os-prober. Install it, then rerun grub-mkconfig -o /boot/grub/grub.cfg. If this fails, you can try manually adding an entry by following the instructions below.<br />
<br />
===== Microsoft Windows installed in BIOS-MBR mode =====<br />
<br />
{{Note|GRUB supports booting {{ic|bootmgr}} directly and chainload of partition boot sector is no longer required to boot Windows in a BIOS-MBR setup.}}<br />
<br />
{{Warning|It is the '''system partition''' that has {{ic|bootmgr}}, not your "real" Windows partition (usually C:). When showing all UUIDs with blkid, the system partition is the one with {{ic|LABEL&#61;"SYSTEM RESERVED"}} and is only about 100 MB in size (much like the boot partition for Arch). See [[Wikipedia:System partition and boot partition]] for more info.}}<br />
<br />
Throughout this section, it is assumed your Windows partition is /dev/sda1. A different partition will change every instance of hd0,msdos1. First, find the UUID of the NTFS filesystem of the Windows's SYSTEM PARTITION where the {{ic|bootmgr}} and its files reside. For example, if Windows {{ic|bootmgr}} exists at {{ic|/media/SYSTEM_RESERVED/bootmgr}}:<br />
<br />
For Windows Vista/7/8:<br />
<br />
# grub-probe --target=fs_uuid /media/SYSTEM_RESERVED/bootmgr<br />
69B235F6749E84CE<br />
<br />
# grub-probe --target=hints_string /media/SYSTEM_RESERVED/bootmgr<br />
--hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1<br />
<br />
{{Note|For Windows XP, replace {{ic|bootmgr}} with {{ic|NTLDR}} in the above commands. And note that there may not be a separate SYSTEM_RESERVED partition; just probe the file NTLDR on your Windows partition.}}<br />
<br />
Then, add the below code to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} and regenerate {{ic|grub.cfg}} with {{ic|grub-mkconfig}} as explained above to boot Windows (XP, Vista, 7 or 8) installed in BIOS-MBR mode:<br />
<br />
For Windows Vista/7/8:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 BIOS-MBR" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /bootmgr<br />
}<br />
<br />
For Windows XP:<br />
<br />
menuentry "Microsoft Windows XP" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /ntldr<br />
}<br />
<br />
{{ic|/etc/grub.d/40_custom}} can be used as a template to create {{ic|/etc/grub.d/nn_custom}}. Where {{ic|nn}} defines the precendence, indicating the order the script is executed. The order scripts are executed determine the placement in the grub boot menu.<br />
<br />
{{Note|{{ic|nn}} should be greater than 06 to ensure necessary scripts are executed first.}}<br />
<br />
=== UEFI systems ===<br />
<br />
{{Note|It is well know that different motherboard manufactures implement UEFI differently. Users experiencing problems getting Grub/EFI to work properly are encouraged to share detailed steps for hardware-specific cases where UEFI booting does not work as described below. In an effort to keep the parent [[GRUB]] article neat and tidy, see the [[GRUB EFI Examples]] page for these special cases.}}<br />
<br />
First install the {{Pkg|grub}} package and then follow the instructions below.<br />
<br />
{{Note|Simply installing the package will not update the {{ic|core.efi}} file and the GRUB modules in the UEFI System Partition. You need to do this manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install boot files ====<br />
<br />
===== Install to UEFI system partition =====<br />
<br />
{{Note|<br />
* The below commands assume you are using installing GRUB for {{ic|x86_64-efi}} (for {{ic|IA32-efi}} replace {{ic|x86_64}} with {{ic|i386}} in the below commands)<br />
* To do this, you need to boot using UEFI and not the BIOS. If you booted by just copying the ISO file to the USB drive, you will need to follow [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO|this guide]] or grub-install will show errors<br />
}}<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Install GRUB UEFI application to {{ic|/boot/efi/EFI/arch_grub}} and its modules to {{ic|/boot/grub/x86_64-efi}} (recommended) using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
<br />
{{Note|Without {{ic|--target}} or {{ic|--directory}} option, grub-install cannot determine for which firmware GRUB is being installed. In such cases {{ic|grub-install}} will show {{ic|source_dir doesn't exist. Please specify --target or --directory}} message.}}<br />
<br />
If you want to install GRUB modules and {{ic|grub.cfg}} at the directory {{ic|/boot/efi/EFI/grub}} and the {{ic|grubx64.efi}} application at {{ic|/boot/efi/EFI/arch_grub}} (ie. all the GRUB UEFI files inside the UEFISYS partition itself) use:<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug<br />
<br />
The {{ic|--efi-directory}} option mentions the mountpoint of UEFI SYSTEM PARTITION , {{ic|--bootloader-id}} mentions the name of the directory used to store the {{ic|grubx64.efi}} file and {{ic|--boot-directory}} mentions the directory wherein the actual modules will be installed (and into which {{ic|grub.cfg}} should be created).<br />
<br />
The actual paths are:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi<br />
<br />
<boot-directory>/grub/x86_64-efi/<all modules, grub.efi, core.efi, grub.cfg><br />
<br />
{{Note|the {{ic|--bootloader-id}} option does not change {{ic|<boot-directory>/grub}}, i.e. you cannot install the modules to {{ic|<boot-directory>/<bootloader-id>}}, the path is hard-coded to be {{ic|<boot-directory>/grub}}.}}<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == <boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
The {{ic|<nowiki><efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi</nowiki>}} is an exact copy of {{ic|<nowiki><boot-directory>/grub/x86_64-efi/core.efi</nowiki>}}.<br />
<br />
{{Note|<br />
* In GRUB 2.00, the {{ic|grub-install}} option {{ic|--efi-directory}} replaces {{ic|--root-directory}} and the latter is deprecated<br />
* The options {{ic|--efi-directory}} and {{ic|--bootloader-id}} are specific to GRUB UEFI<br />
}}<br />
<br />
In all the cases the UEFI SYSTEM PARTITION should be mounted for {{ic|grub-install}} to install {{ic|grubx64.efi}} in it, which will be launched by the firmware (using the {{ic|efibootmgr}} created boot entry in non-Mac systems).<br />
<br />
If you notice carefully, there is no <device_path> option (Eg: {{ic|/dev/sda}}) at the end of the {{ic|grub-install}} command unlike the case of setting up GRUB for BIOS systems. Any <device_path> provided will be ignored by the install script as UEFI bootloaders do not use MBR or Partition boot sectors at all.<br />
<br />
You may now be able to UEFI boot your system by creating a {{ic|grub.cfg}} file by following [[#Generate UEFI Config file]] and [[#Create GRUB entry in the Firmware Boot Manager]].<br />
<br />
==== Generate config file ====<br />
<br />
Finally, generate a configuration for GRUB (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o <boot-directory>/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|<boot-directory>/grub/grub.cfg}}, NOT {{ic|<boot-directory>/grub/x86_64-efi/grub.cfg}}.}}<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot/efi/EFI</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
<br />
This is independent of the value of {{ic|--bootloader-id}} option.<br />
<br />
If GRUB complains about "no suitable mode found" while booting, try [[#"No suitable mode found" error]].<br />
<br />
==== Create GRUB entry in the firmware boot manager ====<br />
<br />
{{ic|grub-install}} automatically tries to create a menu entry in the boot manager. If it doesn't, then see [[Beginners' Guide#GRUB]] for instructions to use {{ic|efibootmgr}} to create a menu entry. However, the problem is likely to be that you haven't booted your CD/USB in UEFI mode, as in [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]].<br />
<br />
==== Create GRUB standalone UEFI application ====<br />
<br />
It is possible to create a {{ic|grubx64_standalone.efi}} application which has all the modules embeddded in a memdisk within the UEFI application, thus removing the need for having a separate directory populated with all the GRUB UEFI modules and other related files. This is done using the {{ic|grub-mkstandalone}} command which is included in {{Pkg|grub}}.<br />
<br />
The easiest way to do this would be with the install command already mentioned before, but specifying the modules to include. For example:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" <any extra files you want to include><br />
<br />
The {{ic|grubx64_standalone.efi}} file expects {{ic|grub.cfg}} to be within its $prefix which is {{ic|(memdisk)/boot/grub}}. The memdisk is embedded within the efi app. The {{ic|grub-mkstandlone}} script allow passing files to be included in the memdisk image to be as the arguments to the script (in <any extra files you want to include>).<br />
<br />
If you have the {{ic|grub.cfg}} at {{ic|/home/user/Desktop/grub.cfg}}, then create a temporary {{ic|/home/user/Desktop/boot/grub/}} directory, copy the {{ic|/home/user/Desktop/grub.cfg}} to {{ic|/home/user/Desktop/boot/grub/grub.cfg}}, cd into {{ic|/home/user/Desktop/boot/grub/}} and run:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" "boot/grub/grub.cfg"<br />
<br />
The reason to cd into {{ic|/home/user/Desktop/boot/grub/}} and to pass the file path as {{ic|boot/grub/grub.cfg}} (notice the lack of a leading slash - boot/ vs /boot/ ) is because {{ic|dir1/dir2/file}} is included as {{ic|(memdisk)/dir1/dir2/file}} by the {{ic|grub-mkstandalone}} script. <br />
<br />
If you pass {{ic|/home/user/Desktop/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/grub.cfg}}. If you pass {{ic|/home/user/Desktop/boot/grub/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/boot/grub/grub.cfg}}. That is the reason for cd'ing into {{ic|/home/user/Desktop/boot/grub/}} and passing {{ic|boot/grub/grub.cfg}}, to include the file as {{ic|(memdisk)/boot/grub/grub.cfg}}, which is what {{ic|grub.efi}} expects the file to be.<br />
<br />
You need to create an UEFI Boot Manager entry for {{ic|/boot/efi/EFI/arch_grub/grubx64_standalone.efi}} using {{ic|efibootmgr}}. Follow [[#Create GRUB entry in the Firmware Boot Manager]].<br />
<br />
==== Multiboot ====<br />
<br />
===== Microsoft Windows installed in UEFI-GPT mode =====<br />
<br />
Find the UUID of the FAT32 filesystem in the UEFI SYSTEM PARTITION where the Windows UEFI Bootloader files reside. For example, if Windows {{ic|bootmgfw.efi}} exists at {{ic|/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi}} (ignore the upper-lower case differences since that is immaterial in FAT filesystem):<br />
<br />
# grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
1ce5-7f28<br />
<br />
# grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
--hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1<br />
<br />
Then, add this code to {{ic|/etc/grub.d/40_custom}} to chainload Windows x86_64 (Vista SP1+, 7 or 8) installed in UEFI-GPT mode:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 x86_64 UEFI-GPT" {<br />
insmod part_gpt<br />
insmod fat<br />
insmod search_fs_uuid<br />
insmod chain<br />
search --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 1ce5-7f28<br />
chainloader /efi/Microsoft/Boot/bootmgfw.efi<br />
}<br />
<br />
Afterwards remake {{ic|/boot/grub/grub.cfg}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
== Configuration ==<br />
<br />
You can also choose to automatically generate or manually edit {{ic|grub.cfg}}.<br />
<br />
{{Note|<br />
* For EFI systems, if GRUB was installed with the {{ic|--boot-directory}} option set, the {{ic|grub.cfg}} file must be placed in the same directory as {{ic|grubx64.efi}}. Otherwise, the {{ic|grub.cfg}} file goes in {{ic|/boot/grub/}}, just like in GRUB BIOS<br />
* [http://members.iinet.net/~herman546/p20/GRUB2%20Configuration%20File%20Commands.html Here] is a quite complete description of how to configure GRUB<br />
}}<br />
<br />
=== Automatically generating using grub-mkconfig ===<br />
<br />
The GRUB {{ic|menu.lst}} equivalent configuration files are {{ic|/etc/default/grub}} and {{ic|/etc/grub.d/*}}. {{ic|grub-mkconfig}} uses these files to generate {{ic|grub.cfg}}. By default the script outputs to stdout. To generate a {{ic|grub.cfg}} file run the command:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{ic|/etc/grub.d/10_linux}} is set to automatically add menu items for Arch linux that work out of the box, to any generated configuration. Other operating systems may need to be added manually to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}<br />
<br />
==== Additional arguments ====<br />
<br />
To pass custom additional arguments to the Linux image, you can set the {{ic|GRUB_CMDLINE_LINUX}} variable in {{ic|/etc/default/grub}}. <br />
<br />
For example, use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX"</nowiki>}} where {{ic|sda'''X'''}} is your swap partition to enable resume after hibernation.<br />
<br />
You can also use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/disk/by-uuid/${swap_uuid}"</nowiki>}}, where {{ic|${swap_uuid} }} is the [[Persistent_block_device_naming|UUID]] of your swap partition.<br />
<br />
Multiple entries are separated by spaces within the double quotes. So, for users who want both resume and systemd it would look like this:<br />
{{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX init=/usr/lib/systemd/systemd"</nowiki>}}<br />
<br />
See [[Kernel parameters]] for more info.<br />
<br />
=== Manually creating grub.cfg ===<br />
<br />
{{Warning|Editing this file is strongly ''not'' recommended. The file is generated by the {{ic|grub-mkconfig}} command, and it is best to edit your {{ic|/etc/default/grub}} or one of the scripts in the {{ic|/etc/grub.d}} folder.}}<br />
<br />
A basic GRUB config file uses the following options:<br />
* {{ic|(hdX,Y)}} is the partition {{ic|Y}} on disk {{ic|X}}, partition numbers starting at 1, disk numbers starting at 0<br />
* {{ic|1=set default=N}} is the default boot entry that is chosen after timeout for user action<br />
* {{ic|1=set timeout=M}} is the time {{ic|M}} to wait in seconds for a user selection before default is booted<br />
* {{ic|<nowiki>menuentry "title" {entry options}</nowiki>}} is a boot entry titled {{ic|title}}<br />
* {{ic|1=set root=(hdX,Y)}} sets the boot partition, where the kernel and GRUB modules are stored (boot need not be a separate partition, and may simply be a directory under the "root" partition ({{ic|/}})<br />
<br />
An example configuration:<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
# Config file for GRUB - The GNU GRand Unified Bootloader<br />
# /boot/grub/grub.cfg<br />
<br />
# DEVICE NAME CONVERSIONS<br />
#<br />
# Linux Grub<br />
# -------------------------<br />
# /dev/fd0 (fd0)<br />
# /dev/sda (hd0)<br />
# /dev/sdb2 (hd1,2)<br />
# /dev/sda3 (hd0,3)<br />
#<br />
<br />
# Timeout for menu<br />
set timeout=5<br />
<br />
# Set default boot entry as Entry 0<br />
set default=0<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
set root=(hd0,1)<br />
linux /vmlinuz-linux root=/dev/sda3 ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
## (1) Windows<br />
#menuentry "Windows" {<br />
# set root=(hd0,3)<br />
# chainloader +1<br />
#}<br />
</nowiki>}}<br />
<br />
=== Dual-booting ===<br />
<br />
{{Note|If you want GRUB to automatically search for other systems, you may wish to install {{Pkg|os-prober}}.}}<br />
<br />
==== Using grub-mkconfig ====<br />
The best way to add other entries is editing the {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} . The entries in this file will be automatically added when running {{ic|grub-mkconfig}}.<br />
After adding the new lines, run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg <br />
to generate an updated {{ic|grub.cfg}}.<br />
<br />
===== With GNU/Linux =====<br />
<br />
Assuming that the other distro is on partition {{ic|sda2}}:<br />
<br />
menuentry "Other Linux" {<br />
set root=(hd0,2)<br />
linux /boot/vmlinuz (add other options here as required)<br />
initrd /boot/initrd.img (if the other kernel uses/needs one)<br />
}<br />
<br />
===== With FreeBSD =====<br />
<br />
Requires that FreeBSD is installed on a single partition with UFS. Assuming it is installed on {{ic|sda4}}:<br />
<br />
menuentry "FreeBSD" {<br />
set root=(hd0,4)<br />
chainloader +1<br />
}<br />
<br />
===== With Windows =====<br />
<br />
This assumes that your Windows partition is {{ic|sda3}}. Remember you need to point set root and chainloader to the system reserve partition that windows made when it installed, not the actual partition windows is on. This example works if your system reserve partition is {{ic|sda3}}.<br />
<br />
# (2) Windows XP<br />
menuentry "Windows XP" {<br />
set root="(hd0,3)"<br />
chainloader +1<br />
}<br />
<br />
If the Windows bootloader is on an entirely different hard drive than GRUB, it may be necessary to trick Windows into believing that it is the first hard drive. This was possible with {{ic|drivemap}}. Assuming GRUB is on {{ic|hd0}} and Windows is on {{ic|hd2}}, you need to add the following after {{ic|set root}}:<br />
<br />
drivemap -s hd0 hd2<br />
<br />
==== With Windows via EasyBCD and NeoGRUB ====<br />
<br />
Since EasyBCD's NeoGRUB currently does not understand the GRUB menu format, chainload to it by replacing the contents of your {{ic|C:\NST\menu.lst}} file with lines similar to the following:<br />
<br />
default 0<br />
timeout 1<br />
<br />
title Chainload into GRUB v2<br />
root (hd0,7)<br />
kernel /boot/grub/i386-pc/core.img<br />
<br />
=== Visual configuration ===<br />
<br />
In GRUB it is possible, by default, to change the look of the menu. Make sure to initialize, if not done already, GRUB graphical terminal, gfxterm, with proper video mode, gfxmode, in GRUB. This can be seen in the section [[#"No suitable mode found" error]]. This video mode is passed by GRUB to the linux kernel via 'gfxpayload' so any visual configurations need this mode in order to be in effect.<br />
<br />
==== Setting the framebuffer resolution ====<br />
<br />
GRUB can set the framebuffer for both GRUB itself and the kernel. The old {{ic|1=vga=}} way is deprecated. The preferred method is editing {{ic|/etc/default/grub}} as the following sample:<br />
<br />
GRUB_GFXMODE=1024x768x32<br />
GRUB_GFXPAYLOAD_LINUX=keep<br />
<br />
To generate the changes, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
The {{ic|gfxpayload}} property will make sure the kernel keeps the resolution.<br />
<br />
{{Note|<br />
* If this example does not work for you try to replace {{ic|1=gfxmode="1024x768x32"}} by {{ic|1=vbemode="0x105"}}. Remember to replace the specified resolution with one suitable for your screen<br />
* To show all the modes you can use {{ic|1=# hwinfo --framebuffer}} (hwinfo is available in [community]), while at GRUB prompt you can use the {{ic|1=vbeinfo}} command<br />
}}<br />
<br />
If this method does not work for you, the deprecated {{ic|1=vga=}} method will still work. Just<br />
add it next to the {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="}} line in {{ic|/etc/default/grub}}<br />
for eg: {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=792"}} will give you a {{ic|1024x768}} resolution.<br />
<br />
You can choose one of these resolutions: {{ic|640×480}}, {{ic|800×600}}, {{ic|1024×768}}, {{ic|1280×1024}}, {{ic|1600×1200}}, {{ic|1920×1200}}<br />
<br />
==== 915resolution hack ====<br />
<br />
Some times for Intel graphic adapters neither {{ic|1=# hwinfo --framebuffer}} nor {{ic|1=vbeinfo}} will show you the desired resolution. In this case you can use {{ic|915resolution}} hack. This hack will temporarily modify video BIOS and add needed resolution. See [http://915resolution.mango-lang.org/ 915resolution's home page]<br />
<br />
First you need to find a video mode which will be modified later. For that we need the GRUB command shell:<br />
{{hc|sh:grub> 915resolution -l|<br />
Intel 800/900 Series VBIOS Hack : version 0.5.3<br />
[...]<br />
'''Mode 30''' : 640x480, 8 bits/pixel<br />
[...]<br />
}}<br />
Next, we overwrite the {{ic|Mode 30}} with {{ic|1440x900}} resolution:<br />
{{hc|/etc/grub.d/00_header|<br />
[...]<br />
'''915resolution 30 1440 900 # Inserted line'''<br />
set gfxmode&#61;${GRUB_GFXMODE}<br />
[...]<br />
}}<br />
Lastly we need to set {{ic|GRUB_GFXMODE}} as described earlier, regenerate GRUB configuration file and reboot to test changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# reboot<br />
<br />
==== Background image and bitmap fonts ====<br />
<br />
GRUB comes with support for background images and bitmap fonts in {{ic|pf2}} format. The unifont font is included in the {{Pkg|grub}} package under the filename {{ic|unicode.pf2}}, or, as only ASCII characters under the name {{ic|ascii.pf2}}.<br />
<br />
Image formats supported include tga, png and jpeg, providing the correct modules are loaded. The maximum supported resolution depends on your hardware.<br />
<br />
Make sure you have set up the proper [[#Setting the framebuffer resolution|framebuffer resolution]].<br />
<br />
Edit {{ic|/etc/default/grub}} like this:<br />
GRUB_BACKGROUND="/boot/grub/myimage"<br />
#GRUB_THEME="/path/to/gfxtheme"<br />
GRUB_FONT="/path/to/font.pf2"<br />
<br />
{{Note|If you have installed GRUB on a separate partition, {{ic|/boot/grub/myimage}} becomes {{ic|/grub/myimage}}.}}<br />
<br />
To generate the changes and add the information into {{ic|grub.cfg}}, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If adding the splash image was successful, the user will see {{ic|"Found background image..."}} in the terminal as the command is executed. <br />
If this phrase is not seen, the image information was probably not incorporated into the {{ic|grub.cfg}} file.<br />
<br />
If the image is not displayed, check:<br />
* The path and the filename in {{ic|/etc/default/grub}} are correct<br />
* The image is of the proper size and format (tga, png, 8-bit jpg)<br />
* The image was saved in the RGB mode, and is not indexed<br />
* The console mode is not enabled in {{ic|/etc/default/grub}}<br />
* The command {{ic|grub-mkconfig}} must be executed to place the background image information into the {{ic|/boot/grub/grub.cfg}} file<br />
<br />
==== Theme ====<br />
<br />
Here is an example for configuring Starfield theme which was included in GRUB package.<br />
<br />
Edit {{ic|/etc/default/grub}}<br />
GRUB_THEME="/usr/share/grub/themes/starfield/theme.txt"<br />
<br />
Generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If configuring the theme was successful, you'll see {{ic|Found theme: /usr/share/grub/themes/starfield/theme.txt}} in the terminal.<br />
Your splash image will usually not be displayed when using a theme.<br />
<br />
==== Menu colors ====<br />
<br />
You can set the menu colors in GRUB. The available colors for GRUB can be found in [https://www.gnu.org/software/grub/manual/html_node/Theme-file-format.html the GRUB Manual].<br />
Here is an example:<br />
<br />
Edit {{ic|/etc/default/grub}}:<br />
GRUB_COLOR_NORMAL="light-blue/black"<br />
GRUB_COLOR_HIGHLIGHT="light-cyan/blue"<br />
<br />
Generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Hidden menu ====<br />
<br />
One of the unique features of GRUB is hiding/skipping the menu and showing it by holding {{keypress|Esc}} when needed. You can also adjust whether you want to see the timeout counter.<br />
<br />
Edit {{ic|/etc/default/grub}} as you wish. Here is an example where the comments from the beginning of the two lines have been removed to enable the feature, the timeout has been set to five seconds and to be shown to the user:<br />
GRUB_HIDDEN_TIMEOUT=5<br />
GRUB_HIDDEN_TIMEOUT_QUIET=false<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Disable framebuffer ====<br />
<br />
Users who use NVIDIA proprietary driver might wish to disable GRUB's framebuffer as it can cause problems with the binary driver.<br />
<br />
To disable framebuffer, edit {{ic|/etc/default/grub}} and uncomment the following line:<br />
GRUB_TERMINAL_OUTPUT=console<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
Another option if you want to keep the framebuffer in GRUB is to revert to text mode just before starting the kernel. To do that modify the variable in {{ic|/etc/default/grub}}:<br />
GRUB_GFXPAYLOAD_LINUX=text<br />
<br />
and rebuild the configuration as before.<br />
<br />
=== Other Options ===<br />
<br />
==== LVM ====<br />
<br />
If you use [[LVM]] for your {{ic|/boot}}, add the following before menuentry lines:<br />
<br />
insmod lvm<br />
<br />
and specify your root in the menuentry as:<br />
<br />
set root=lvm/''lvm_group_name''-''lvm_logical_boot_partition_name''<br />
<br />
Example:<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
insmod lvm<br />
set root=lvm/VolumeGroup-lv_boot<br />
# you can only set following two lines<br />
linux /vmlinuz-linux root=/dev/mapper/VolumeGroup-root ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
==== RAID ====<br />
<br />
GRUB provides convenient handling of RAID volumes. You need to add {{ic|insmod mdraid}} which allows you to address the volume natively. For example, {{ic|/dev/md0}} becomes:<br />
set root=(md0)<br />
<br />
whereas a partitioned RAID volume (e.g. {{ic|/dev/md0p1}}) becomes:<br />
set root=(md0,1)<br />
<br />
==== Persistent block device naming ====<br />
One naming scheme for [[Persistent block device naming]] is the use of globally unique UUIDs to detect partitions instead of the "old" {{ic|/dev/sd*}}. Advantages are covered up in the above linked article. <br />
<br />
Persistent naming via filesystem UUIDs are used by default in GRUB. <br />
<br />
{{Note|The {{ic|/boot/grub.cfg}} file needs regeneration with the new UUID in {{ic|/etc/default/grub}} every time a relevant filesystem is resized or recreated. Remember this when modifying partitions & filesystems with a Live-CD.}}<br />
<br />
Whether to use UUIDs is controlled by an option in {{ic|/etc/default/grub}}:<br />
<br />
# GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Either way, do not forget to generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Using Labels ====<br />
<br />
It is possible to use labels, human-readable strings attached to filesystems, by using the {{ic|--label}} option to {{ic|search}}. First of all, label your existing partition:<br />
# tune2fs -L <LABEL> <PARTITION><br />
<br />
Then, add an entry using labels. An example of this:<br />
<br />
menuentry "Arch Linux, session texte" {<br />
search --label --set=root archroot<br />
linux /boot/vmlinuz-linux root=/dev/disk/by-label/archroot ro<br />
initrd /boot/initramfs-linux.img<br />
}<br />
<br />
==== Recall previous entry ====<br />
<br />
GRUB can remember the last entry you booted from and use this as the default entry to boot from next time. This is useful if you have multiple kernels (i.e., the current Arch one and the LTS kernel as a fallback option) or operating systems. To do this, edit {{ic|/etc/default/grub}} and change the value of {{ic|GRUB_DEFAULT}}:<br />
<br />
GRUB_DEFAULT=saved<br />
<br />
This ensures that GRUB will default to the saved entry. To enable saving the selected entry, add the following line to {{ic|/etc/default/grub}}:<br />
<br />
GRUB_SAVEDEFAULT=true<br />
<br />
{{Note|Manually added menu items, e.g. Windows in {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}, will need {{ic|savedefault}} added. Remember to regenerate([[#Generate config file]]) your configuration file.}}<br />
<br />
==== Changing the default menu entry ====<br />
<br />
To change the default selected entry, edit {{ic|/etc/default/grub}} and change the value of {{ic|GRUB_DEFAULT}}:<br />
<br />
Using numbers :<br />
GRUB_DEFAULT=0<br />
Grub identifies entries in generated menu counted from zero. That means 0 for the first entry which is the default value, 1 for the second and so on.<br />
<br />
Or using menu titles :<br />
GRUB_DEFAULT='Arch Linux, with Linux core repo kernel'<br />
<br />
{{Note|Remember to regenerate([[#Generate config file]]) your configuration file.}}<br />
<br />
==== Security ====<br />
<br />
If you want to secure GRUB so it is not possible for anyone to change boot parameters or use the command line, you can add a user/password combination to GRUB's configuration files. To do this, run the command {{ic|grub-mkpasswd-pbkdf2}}. Enter a password and confirm it:<br />
<br />
{{hc|grub-mkpasswd-pbkdf2|<br />
[...]<br />
Your PBKDF2 is grub.pbkdf2.sha512.10000.C8ABD3E93C4DFC83138B0C7A3D719BC650E6234310DA069E6FDB0DD4156313DA3D0D9BFFC2846C21D5A2DDA515114CF6378F8A064C94198D0618E70D23717E82.509BFA8A4217EAD0B33C87432524C0B6B64B34FBAD22D3E6E6874D9B101996C5F98AB1746FE7C7199147ECF4ABD8661C222EEEDB7D14A843261FFF2C07B1269A<br />
}}<br />
Then, add the following to {{ic|/etc/grub.d/00_header}}:<br />
{{hc|/etc/grub.d/00_header|<br />
cat << EOF<br />
<br />
set superusers<nowiki>=</nowiki>"'''username'''"<br />
password_pbkdf2 '''username''' '''<password>'''<br />
<br />
EOF<br />
}}<br />
where {{ic|<password>}} is the string generated by {{ic|grub-mkpasswd_pbkdf2}}.<br />
<br />
Regenerate your configuration file. Your GRUB command line, boot parameters and all boot entries are now protected.<br />
<br />
This can be relaxed and further customized with more users as described in the "Security" part of [https://www.gnu.org/software/grub/manual/grub.html#Security the GRUB manual].<br />
<br />
==== Root encryption ====<br />
<br />
To let GRUB automatically add the kernel parameters for root encryption,<br />
add {{ic|1=cryptdevice=/dev/yourdevice:label}} to {{ic|GRUB_CMDLINE_LINUX}} in {{ic|/etc/default/grub}}.<br />
<br />
{{Tip|If you're upgrading from a working GRUB Legacy configuration, check {{ic|/boot/grub/menu.lst.pacsave}} for the correct device/label to add. Look for them after the text {{ic|kernel /vmlinuz-linux}}.}}<br />
<br />
Example with root mapped to {{ic|/dev/mapper/root}}:<br />
<br />
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:root"<br />
<br />
Also, disable the usage of UUIDs for the rootfs:<br />
<br />
GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Regenerate the configuration.<br />
<br />
==== Boot non-default entry only once ====<br />
<br />
The command {{ic|grub-reboot}} is very helpful to boot another entry than the default only once. GRUB loads the entry passed in the first command line argument, when the system is rebooted the next time. Most importantly GRUB returns to loading the default entry for all future booting. Changing the configuration file or selecting an entry in the GRUB menu is not necessary.<br />
{{Note|This requires {{ic|1=GRUB_DEFAULT=saved}} in {{ic|/etc/default/grub}} (and then regenerating {{ic|grub.cfg}}) or, in case of hand-made {{ic|grub.cfg}}, the line {{ic|1=set default="${saved_entry}"}}.}}<br />
<br />
=== Booting an ISO directly from GRUB ===<br />
<br />
Edit {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} to add an entry for the target ISO. When finished, update the GRUB menu as with the usual {{ic|grub-mkconfig -o /boot/grub/grub.cfg}} (as root).<br />
<br />
==== Arch ISO ====<br />
<br />
{{Note|The following examples assume the ISO is in {{ic|/archives}} on {{ic|hd0,6}}.}}<br />
{{Tip|For thumbdrives, use something like {{ic|(hd1,$partition)}} and either {{ic|/dev/sdb'''Y'''}} for the {{ic|img_dev}} parameter or [[Persistent_block_device_naming|a persistent name]], e.g. {{ic|img_dev&#61;/dev/disk/by-label/CORSAIR}}.}}<br />
<br />
===== x86_64 =====<br />
<br />
menuentry "Archlinux-2013.05.01-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.05.01-dual.iso"<br />
set partition="6"<br />
loopback loop (hd0,$partition)/$isofile<br />
linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201305 img_dev=/dev/sda$partition img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/x86_64/archiso.img<br />
}<br />
<br />
===== i686 =====<br />
<br />
menuentry "Archlinux-2013.05.01-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.05.01-dual.iso"<br />
set partition="6"<br />
loopback loop (hd0,$partition)/$isofile<br />
linux (loop)/arch/boot/i686/vmlinuz archisolabel=ARCH_201305 img_dev=/dev/sda$partition img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/i686/archiso.img<br />
}<br />
<br />
==== Ubuntu ISO ====<br />
<br />
{{Note|The example assumes that the iso is in {{ic|/archives}} on {{ic|hd0,6}}. Users must adjust the location and hdd/partition in the lines below to match their systems.}}<br />
<br />
menuentry "ubuntu-13.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-13.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)/$isofile<br />
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
menuentry "ubuntu-12.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-12.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)/$isofile<br />
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
==== Other ISOs ====<br />
<br />
Other working configurations from [http://askubuntu.com/questions/141940/how-to-boot-live-iso-images link Source].<br />
<br />
== Using the command shell ==<br />
<br />
Since the MBR is too small to store all GRUB modules, only the menu and a few basic commands reside there. The majority of GRUB functionality remains in modules in {{ic|/boot/grub}}, which are inserted as needed. In error conditions (e.g. if the partition layout changes) GRUB may fail to boot. When this happens, a command shell may appear.<br />
<br />
GRUB offers multiple shells/prompts. If there is a problem reading the menu but the bootloader is able to find the disk, you will likely be dropped to the "normal" shell:<br />
sh:grub><br />
<br />
If there is a more serious problem (e.g. GRUB cannot find required files), you may instead be dropped to the "rescue" shell:<br />
grub rescue><br />
<br />
The rescue shell is a restricted subset of the normal shell, offering much less functionality. If dumped to the rescue shell, first try inserting the "normal" module, then starting the "normal" shell:<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
grub rescue> insmod (hdX,Y)/boot/grub/i386-pc/normal.mod<br />
rescue:grub> normal<br />
<br />
=== Pager support ===<br />
<br />
GRUB supports pager for reading commands that provide long output (like the {{ic|help}} command). This works only in normal shell mode and not in rescue mode. To enable pager, in GRUB command shell type:<br />
sh:grub> set pager=1<br />
<br />
== GUI configuration tools ==<br />
<br />
Following package may be installed:<br />
* {{App|grub-customizer|Customize the bootloader (GRUB or BURG)|https://launchpad.net/grub-customizer|{{AUR|grub-customizer}}}}<br />
* {{App|grub2-editor|KDE4 control module for configuring the GRUB bootloader|http://kde-apps.org/content/show.php?content&#61;139643|{{AUR|grub2-editor}}}}<br />
* {{App|kcm-grub2|This Kcm module manages the most common settings of GRUB|http://kde-apps.org/content/show.php?content&#61;137886|{{AUR|kcm-grub2}}}}<br />
* {{App|startupmanager|GUI app for changing the settings of GRUB Legacy, GRUB, Usplash and Splashy|http://sourceforge.net/projects/startup-manager/|{{AUR|startupmanager}}}}<br />
<br />
== parttool for hide/unhide ==<br />
<br />
If you have a Windows 9x paradigm with hidden {{ic|C:\}} disks GRUB can hide/unhide it using {{ic|parttool}}. For example, to boot the third {{ic|C:\}} disk of three Windows 9x installations on the CLI enter the CLI and:<br />
parttool hd0,1 hidden+ boot-<br />
parttool hd0,2 hidden+ boot-<br />
parttool hd0,3 hidden- boot+<br />
set root=hd0,3<br />
chainloader +1<br />
boot<br />
<br />
== Using the rescue console ==<br />
<br />
See [[#Using the command shell]] first. If unable to activate the standard shell, one possible solution is to boot using a live CD or some other rescue disk to correct configuration errors and reinstall GRUB. However, such a boot disk is not always available (nor necessary); the rescue console is surprisingly robust.<br />
<br />
The available commands in GRUB rescue include {{ic|insmod}}, {{ic|ls}}, {{ic|set}}, and {{ic|unset}}. This example uses {{ic|set}} and {{ic|insmod}}. {{ic|set}} modifies variables and {{ic|insmod}} inserts new modules to add functionality.<br />
<br />
Before starting, the user must know the location of their {{ic|/boot}} partition (be it a separate partition, or a subdirectory under their root):<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
<br />
where X is the physical drive number and Y is the partition number.<br />
<br />
To expand console capabilities, insert the {{ic|linux}} module:<br />
grub rescue> insmod (hdX,Y)/boot/grub/linux.mod<br />
<br />
{{Note|With a separate boot partition, omit {{ic|/boot}} from the path, (i.e. type {{ic|1=set prefix=(hdX,Y)/grub}} and {{ic|insmod (hdX,Y)/grub/linux.mod}}).}}<br />
<br />
This introduces the {{ic|linux}} and {{ic|initrd}} commands, which should be familiar (see [[#Configuration]]).<br />
<br />
An example, booting Arch Linux:<br />
set root=(hd0,5)<br />
linux /boot/vmlinuz-linux root=/dev/sda5<br />
initrd /boot/initramfs-linux.img<br />
boot<br />
<br />
With a separate boot partition, again change the lines accordingly:<br />
set root=(hd0,5)<br />
linux /vmlinuz-linux root=/dev/sda6<br />
initrd /initramfs-linux.img<br />
boot<br />
<br />
After successfully booting the Arch Linux installation, users can correct {{ic|grub.cfg}} as needed and then reinstall GRUB.<br />
<br />
To reinstall GRUB and fix the problem completely, changing {{ic|/dev/sda}} if needed. See [[#Bootloader installation]] for details.<br />
<br />
== Combining the use of UUIDs and basic scripting ==<br />
<br />
If you like the idea of using UUIDs to avoid unreliable BIOS mappings or are struggling with GRUB's syntax, here is an example boot menu item that uses UUIDs and a small script to direct GRUB to the proper disk partitions for your system. All you need to do is replace the UUIDs in the sample with the correct UUIDs for your system. The example applies to a system with a boot and root partition. You will obviously need to modify the GRUB configuration if you have additional partitions:<br />
<br />
menuentry "Arch Linux 64" {<br />
# Set the UUIDs for your boot and root partition respectively<br />
set the_boot_uuid=ece0448f-bb08-486d-9864-ac3271bd8d07<br />
set the_root_uuid=c55da16f-e2af-4603-9e0b-03f5f565ec4a<br />
<br />
# (Note: This may be the same as your boot partition)<br />
<br />
# Get the boot/root devices and set them in the root and grub_boot variables<br />
search --fs-uuid --set=root $the_root_uuid<br />
search --fs-uuid --set=grub_boot $the_boot_uuid<br />
<br />
# Check to see if boot and root are equal.<br />
# If they are, then append /boot to $grub_boot (Since $grub_boot is actually the root partition)<br />
if [ $the_boot_uuid == $the_root_uuid] ; then<br />
set grub_boot=$grub_boot/boot<br />
fi<br />
<br />
# $grub_boot now points to the correct location, so the following will properly find the kernel and initrd<br />
linux ($grub_boot)/vmlinuz-linux root=/dev/disk/by-uuid/$uuid_os_root ro<br />
initrd ($grub_boot)/initramfs-linux.img<br />
}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Intel BIOS not booting GPT ===<br />
<br />
Some Intel BIOS's require at least one bootable MBR partition to be present at boot, causing GPT-partitioned boot setups to be unbootable.<br />
<br />
This can be circumvented by using (for instance) fdisk to mark one of the GPT partitions (preferably the 1007 KiB partition you've created for GRUB already) bootable in the MBR. This can be achieved, using fdisk, by the following commands: Start fdisk against the disk you're installing, for instance {{ic|fdisk /dev/sda}}, then press {{keypress|a}} and select the partition you wish to mark as bootable (probably #1) by pressing the corresponding number, finally press {{keypress|w}} to write the changes to the MBR.<br />
<br />
{{Note|The bootable-marking must be done in {{ic|fdisk}} or similar, not in GParted or others, as they will not set the bootable flag in the MBR.}}<br />
<br />
More information is available [http://www.rodsbooks.com/gdisk/bios.html here]<br />
<br />
=== Enable debug messages ===<br />
<br />
Add:<br />
<br />
set pager=1<br />
set debug=all<br />
<br />
to {{ic|grub.cfg}}.<br />
<br />
=== "No suitable mode found" error ===<br />
<br />
If you get this error when booting any menuentry:<br />
<br />
error: no suitable mode found<br />
Booting however<br />
<br />
Then you need to initialize GRUB graphical terminal ({{ic|gfxterm}}) with proper video mode ({{ic|gfxmode}}) in GRUB. This video mode is passed by GRUB to the linux kernel via 'gfxpayload'. In case of UEFI systems, if the GRUB video mode is not initialized, no kernel boot messages will be shown in the terminal (atleast until KMS kicks in).<br />
<br />
Copy {{ic|/usr/share/grub/unicode.pf2}} to ${GRUB_PREFIX_DIR} ({{ic|/boot/grub/}} in case of BIOS and UEFI systems). If GRUB UEFI was installed with {{ic|1=--boot-directory=/boot/efi/EFI}} set, then the directory is {{ic|/boot/efi/EFI/grub/}}:<br />
<br />
# cp /usr/share/grub/unicode.pf2 ${GRUB_PREFIX_DIR}<br />
<br />
If {{ic|/usr/share/grub/unicode.pf2}} does not exist, install {{Pkg|bdf-unifont}}, create the {{ic|unifont.pf2}} file and then copy it to {{ic|${GRUB_PREFIX_DIR<nowiki>}</nowiki>}}:<br />
<br />
# grub-mkfont -o unicode.pf2 /usr/share/fonts/misc/unifont.bdf<br />
<br />
Then, in the {{ic|grub.cfg}} file, add the following lines to enable GRUB to pass the video mode correctly to the kernel, without of which you will only get a black screen (no output) but booting (actually) proceeds successfully without any system hang.<br />
<br />
BIOS systems:<br />
<br />
insmod vbe<br />
<br />
UEFI systems:<br />
<br />
insmod efi_gop<br />
insmod efi_uga<br />
<br />
After that add the following code (common to both BIOS and UEFI):<br />
<br />
insmod font<br />
<br />
if loadfont ${prefix}/fonts/unicode.pf2<br />
then<br />
insmod gfxterm<br />
set gfxmode=auto<br />
set gfxpayload=keep<br />
terminal_output gfxterm<br />
fi<br />
<br />
As you can see for gfxterm (graphical terminal) to function properly, {{ic|unicode.pf2}} font file should exist in {{ic|${GRUB_PREFIX_DIR<nowiki>}</nowiki>}}.<br />
<br />
=== msdos-style error message ===<br />
<br />
grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding won't be possible!<br />
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.<br />
However, blocklists are UNRELIABLE and its use is discouraged.<br />
grub-setup: error: If you really want blocklists, use --force.<br />
<br />
This error may occur when you try installing GRUB in a VMware container. Read more about it [https://bbs.archlinux.org/viewtopic.php?pid=581760#p581760 here]. It happens when the first partition starts just after the MBR (block 63), without the usual space of 1 MiB (2048 blocks) before the first partition. Read [[#Master Boot Record (MBR) specific instructions]]<br />
<br />
=== GRUB UEFI drops to shell ===<br />
<br />
If GRUB loads but drops you into the rescue shell with no errors, it may be because of a missing or misplaced {{ic|grub.cfg}}. This will happen if GRUB UEFI was installed with {{ic|--boot-directory}} and {{ic|grub.cfg}} is missing OR if the partition number of the boot partition changed (which is hard-coded into the {{ic|grubx64.efi}} file).<br />
<br />
=== GRUB UEFI not loaded ===<br />
<br />
An example of a working EFI:<br />
{{hc|# efibootmgr -v|<br />
BootCurrent: 0000<br />
Timeout: 3 seconds<br />
BootOrder: 0000,0001,0002<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\efi\grub\grub.efi)<br />
Boot0001* Shell HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\EfiShell.efi)<br />
Boot0002* Festplatte BIOS(2,0,00)P0: SAMSUNG HD204UI<br />
}}<br />
<br />
If the screen only goes black for a second and the next boot option is tried afterwards, according to [https://bbs.archlinux.org/viewtopic.php?pid=981560#p981560 this post], moving GRUB to the partition root can help. The boot option has to be deleted and recreated afterwards. The entry for GRUB should look like this then:<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\grub.efi)<br />
<br />
=== Invalid signature ===<br />
<br />
If trying to boot Windows results in an "invalid signature" error, e.g. after reconfiguring partitions or adding additional hard drives, (re)move GRUB's device configuration and let it reconfigure:<br />
# mv /boot/grub/device.map /boot/grub/device.map-old<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
{{ic|grub-mkconfig}} should now mention all found boot options, including Windows. If it works, remove {{ic|/boot/grub/device.map-old}}.<br />
<br />
=== Boot freezes ===<br />
<br />
If booting gets stuck without any error message after GRUB loading the kernel and the initial ramdisk, try removing the {{ic|add_efi_memmap}} kernel parameter.<br />
<br />
=== Restore GRUB Legacy ===<br />
<br />
* Move GRUB v2 files out of the way:<br />
<br />
# mv /boot/grub /boot/grub.nonfunctional<br />
<br />
* Copy GRUB Legacy back to {{ic|/boot}}:<br />
<br />
# cp -af /boot/grub-legacy /boot/grub<br />
<br />
* Replace MBR and next 62 sectors of sda with backed up copy<br />
<br />
{{Warning|This command also restores the partition table, so be careful of overwriting a modified partition table with the old one. It '''will''' mess up your system.}}<br />
<br />
# dd if=/path/to/backup/first-sectors of=/dev/sdX bs=512 count=1<br />
<br />
A safer way is to restore only the MBR boot code use:<br />
<br />
# dd if=/path/to/backup/mbr-boot-code of=/dev/sdX bs=446 count=1<br />
<br />
=== Arch not found from other OS ===<br />
Some have reported that other distributions have trouble finding Arch Linux automatically with os-prober. If this problem arises, it has been reported that detection can be improved with the presence of /etc/lsb-release. This file and updating tool is available with the package {{ic|lsb-release}} in the [[community]] repository.<br />
<br />
== References ==<br />
<br />
# Official GRUB Manual - https://www.gnu.org/software/grub/manual/grub.html<br />
# Ubuntu wiki page for GRUB - https://help.ubuntu.com/community/Grub2<br />
# GRUB wiki page describing steps to compile for UEFI systems - https://help.ubuntu.com/community/UEFIBooting<br />
# Wikipedia's page on [[Wikipedia:BIOS Boot partition|BIOS Boot partition]]<br />
<br />
== See also ==<br />
<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_bios.sh A Linux Bash Shell script to compile and install GRUB for BIOS from BZR Source]<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_uefi.sh A Linux Bash Shell script to compile and install GRUB for UEFI from BZR Source]</div>Cinellihttps://wiki.archlinux.org/index.php?title=GRUB&diff=264369GRUB2013-06-26T17:00:05Z<p>Cinelli: /* Install to UEFI system partition */</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[ar:GRUB]]<br />
[[cs:GRUB2]]<br />
[[de:GRUB]]<br />
[[es:GRUB2]]<br />
[[fr:GRUB2]]<br />
[[id:GRUB2]]<br />
[[it:GRUB2]]<br />
[[ru:GRUB2]]<br />
[[tr:GRUB2]]<br />
[[zh-CN:GRUB2]]<br />
[[zh-TW:GRUB2]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers various aspects of version 2 of the GRand Unified Bootloader (GRUB).}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|BURG}} - BURG is a brand-new boot loader based on GRUB v2. It can be built on a wider range of OS, and has a highly configurable menu system which works in both text and graphic mode. <br />
{{Article summary wiki|GRUB Legacy}} - previous Version, now obsolete.<br />
{{Article summary heading|Resources}}<br />
{{Article summary wiki|GRUB EFI Examples}}<br />
{{Article summary link|GNU GRUB - GNU Project|https://www.gnu.org/software/grub/}}<br />
{{Article summary end}}<br />
<br />
[https://www.gnu.org/software/grub/ GRUB] - not to be confused with [[GRUB Legacy]] - is the next generation of the GRand Unified Bootloader. GRUB is derived from [http://www.nongnu.org/pupa/ PUPA] which was a research project to develop the next generation of what is now GRUB Legacy. GRUB has been rewritten from scratch to clean up everything and provide modularity and portability [https://www.gnu.org/software/grub/grub-faq.html#q1].<br />
<br />
In brief, the ''bootloader'' is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the Linux kernel. The kernel, in turn, initializes the rest of the operating system.<br />
<br />
== Preface ==<br />
<br />
* The name ''GRUB'' officially refers to version ''2'' of the software, see [https://www.gnu.org/software/grub/]. If you are looking for the article on the legacy version, see [[GRUB Legacy]].<br />
* GRUB supports [[Btrfs]] as root (without a separate {{ic|/boot}} filesystem) compressed with either zlib or LZO<br />
<br />
=== Notes for current GRUB Legacy users ===<br />
<br />
* Upgrading from [[GRUB Legacy]] to GRUB is much the same as freshly installing GRUB, which is covered [[#Installation|below]]<br />
* There are differences in the commands of GRUB Legacy and GRUB. Familiarize yourself with [https://www.gnu.org/software/grub/manual/grub.html#Commands GRUB commands] before proceeding (e.g. "find" has been replaced with "search")<br />
* GRUB is now ''modular'' and no longer requires "stage 1.5". As a result, the bootloader itself is limited -- modules are loaded from the hard drive as needed to expand functionality (e.g. for [[LVM]] or RAID support)<br />
* Device naming has changed between GRUB Legacy and GRUB. Partitions are numbered from 1 instead of 0 while drives are still numbered from 0, and prefixed with partition-table type. For example, {{ic|/dev/sda1}} would be referred to as {{ic|(hd0,msdos1)}} (for MBR) or {{ic|(hd0,gpt1)}} (for GPT)<br />
* If you use systemd without systemd-sysvcompat, and have had {{ic|<nowiki>init=/usr/lib/systemd/systemd</nowiki>}} in your old grub menu.lst, the automatically generated grub.cfg file might not carry over this kernel parameter (giving you "ERROT: Root device mounted successfully, but /sbin/init does not exist" on boot). If so, edit the Arch Linux entry that grub shows you, add {{ic|<nowiki>init=/usr/lib/systemd/systemd</nowiki>}} to the kernel parameters, and then [[Grub#Additional_arguments|make it permanent]].<br />
* GRUB is noticably bigger than GRUB legacy (occupies ~13 MB in /boot). If you are booting from a separate /boot partition, and this partition is smaller than 32 MB, you will run into disk space issues, and pacman will refuse to install new kernels. If you don't want to re-partition your system, switch to [[Syslinux]] instead, which is smaller (occupies ~1.5 MB in /boot).<br />
<br />
==== Backup important data ====<br />
<br />
Although a GRUB installation should run smoothly, it is strongly recommended to keep the GRUB Legacy files before upgrading to GRUB v2.<br />
<br />
# mv /boot/grub /boot/grub-legacy<br />
<br />
Backup the MBR which contains the boot code and partition table (Replace {{ic|/dev/sd'''X'''}} with your actual disk path):<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/mbr_backup bs=512 count=1<br />
<br />
Only 446 bytes of the MBR contain boot code, the next 64 contain the partition table. If you do not want to overwrite your partition table when restoring, it is strongly advised to backup only the MBR boot code:<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/bootcode_backup bs=446 count=1<br />
<br />
If unable to install GRUB2 correctly, see [[#Restore GRUB Legacy]].<br />
<br />
=== Preliminary requirements ===<br />
<br />
==== BIOS systems ====<br />
<br />
===== GUID Partition Table (GPT) specific instructions =====<br />
<br />
GRUB in [[GPT|BIOS-GPT]] configuration requires a [http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html BIOS boot partition] to embed its {{ic|core.img}} in the absence of post-MBR gap in GPT partitioned systems (which is taken over by the GPT Primary Header and Primary Partition table). This partition is used by GRUB only in BIOS-GPT setups. No such partition type exists in case of MBR partitioning (at least not for GRUB). This partition is also not required if the system is UEFI based, as no embedding of bootsectors takes place in that case.<br />
<br />
For a BIOS-GPT configuration, create a 1007 KiB partition at the beginning of the disk using gdisk, cgdisk or GNU Parted with no filesystem. The size of 1007 KiB will allow for the following partition to be correctly alligned at 1024 KiB. If needed, the partition can also be located somewhere else on the disk, but it should be within the first 2 TiB region. Set the partition type to {{ic|ef02}} in (c)gdisk or {{ic|set <BOOT_PART_NUM> bios_grub on}} in GNU Parted.<br />
<br />
{{Note|<br />
* This partition should be created before {{ic|grub-install}} or {{ic|grub-setup}} is run<br />
* gdisk will only allow you to create this partition on the position which will waste the least amount of space (sector 34-2047) if you create it last, after all the other partitions. This is because gdisk will auto-align partitions to 2048-sector boundaries if possible<br />
}}<br />
<br />
===== Master Boot Record (MBR) specific instructions =====<br />
<br />
Usually the post-[[MBR]] gap (after the 512 byte MBR region and before the start of the 1st partition) in many MBR (or msdos disklabel) partitioned systems is 31 KiB when DOS compatibility cylinder alignment issues are satisfied in the partition table. However a post-MBR gap of about 1 to 2 MiB is recommended to provide sufficient room for embedding GRUB's {{ic|core.img}} ({{bug|24103}}). It is advisable to use a partitioner which supports 1 MiB partition alignment to obtain this space as well as satisfy other non-512 byte sector issues (which are unrelated to embedding of {{ic|core.img}}).<br />
<br />
==== UEFI systems ====<br />
<br />
{{Note|It is recommended to read and understand the [[Unified Extensible Firmware Interface|UEFI]], [[GUID Partition Table|GPT]] and [[UEFI Bootloaders]] pages.}}<br />
<br />
===== Create and Mount the UEFI System Partition =====<br />
<br />
Follow [[Unified Extensible Firmware Interface#EFI System Partition]] for instructions on creating a UEFI System Partition. Then mount the UEFI System Partition at {{ic|/boot/efi}}. If you have mounted the UEFI System Partition at some other mountpoint, replace {{ic|/boot/efi}} in the below instructions with that mountpoint:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat <UEFI_SYSTEM_PARTITION> /boot/efi<br />
<br />
Create a {{ic|/boot/efi/EFI}} directory:<br />
<br />
# mkdir /boot/efi/EFI<br />
<br />
== Installation ==<br />
<br />
=== BIOS systems ===<br />
<br />
GRUB can be [[pacman|installed]] with the {{Pkg|grub}} package from the [[official repositories]]. It will replace {{Pkg|grub-legacy}} , if it is installed.<br />
<br />
{{Note|Simply installing the package won't update the {{ic|/boot/grub/i386-pc/core.img}} file and the GRUB modules in {{ic|/boot/grub/i386-pc}}. You need to update them manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install boot files ====<br />
<br />
There are 3 ways to install GRUB boot files in BIOS booting:<br />
* [[#Install to GPT BIOS boot partition]] (recommended with [[GPT]])<br />
* [[#Install to 440-byte MBR boot code region]] (recommended with [[MBR]])<br />
* [[#Install to partition or partitionless disk]] (not recommended)<br />
* [[#Generate core.img alone]] (safest method, but requires another BIOS bootloader like [[GRUB Legacy]] or [[Syslinux]] to be installed to chainload {{ic|/boot/grub/i386-pc/core.img}})<br />
<br />
{{Note|See http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html for additional documentation.}}<br />
<br />
===== Install to GPT BIOS boot partition =====<br />
<br />
[[GUID Partition Table]] disks do not have a reserved "boot track". Therefore you must create a BIOS Boot Partition ({{ic|ef02}}) to hold the GRUB core image.<br />
<br />
Using GNU Parted, you can set this using a command such as the following:<br />
<br />
# parted /dev/disk set <partition-number> bios_grub on<br />
<br />
If you are using gdisk, set the partition type to {{ic|ef02}}. With partitioning programs that require setting the GUID directly, it should be {{ic|‘21686148-6449-6e6f-744e656564454649’}} (or, {{ic|[[wikipedia:BIOS_Boot_partition|Hah!IdontNeedEFI]]}}).<br />
<br />
{{Warning|Be very careful which partition you select when marking it as a BIOS Boot Partition. When GRUB finds a BIOS Boot Partition during installation, it will automatically overwrite part of it. Make sure that the partition does not contain any other data.}}<br />
<br />
To setup {{ic|grub}} on a GPT disk, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, and embed it in the BIOS Boot Partition, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --recheck --debug /dev/sda<br />
<br />
where {{ic|/dev/sda}} is the destination of the installation.<br />
<br />
Continue with [[GRUB#Generate config file]] below.<br />
<br />
===== Install to 440-byte MBR boot code region =====<br />
<br />
To setup {{ic|grub}} in the 440-byte Master Boot Record boot code region, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, embed it in the 31 KiB (minimum size - varies depending on partition alignment) post-MBR gap, and generate the configuration file, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --recheck /dev/sdX<br />
<br />
where {{ic|/dev/sdX}} is the destination of the installation (in this case the MBR of the first SATA disk). If you use [[LVM]] for your {{ic|/boot}}, you can install GRUB on multiple physical disks.<br />
<br />
{{Warning|Make sure to check the {{ic|/boot}} directory if you use the latter. Sometimes the {{ic|boot-directory}} parameter creates another {{ic|/boot}} folder inside of {{ic|/boot}}. A wrong install would look like: {{ic|/boot/boot/grub/}}.}}<br />
<br />
Continue with [[GRUB#Generate config file]] below.<br />
<br />
===== Install to partition or partitionless disk =====<br />
<br />
{{Note|GRUB does not encourage installation to a partition boot sector or a partitionless disk like GRUB Legacy or Syslinux does. This kind of setup is prone to breakage, especially during updates, and is not supported by Arch devs.}}<br />
<br />
To set up grub to a partition boot sector, to a partitionless disk (also called superfloppy) or to a floppy disk, run (using for example {{ic|/dev/sdaX}} as the {{ic|/boot}} partition):<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=i386-pc --recheck --debug --force /dev/sdaX<br />
# chattr -i /boot/grub/i386-pc/core.img<br />
# chattr +i /boot/grub/i386-pc/core.img<br />
<br />
You need to use the {{ic|--force}} option to allow usage of blocklists and should not use {{ic|1=--grub-setup=/bin/true}} (which is similar to simply generating {{ic|core.img}}).<br />
<br />
{{ic|grub-install}} will give out warnings like which should give you the idea of what might go wrong with this approach:<br />
<br />
/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.<br />
/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. <br />
However, blocklists are UNRELIABLE and their use is discouraged.<br />
<br />
Without {{ic|--force}} you may get the below error and {{ic|grub-setup}} will not setup its boot code in the partition boot sector:<br />
<br />
/sbin/grub-setup: error: will not proceed with blocklists<br />
<br />
With {{ic|--force}} you should get:<br />
<br />
Installation finished. No error reported.<br />
<br />
The reason why {{ic|grub-setup}} does not by default allow this is because in case of partition or a partitionless disk is that {{ic|grub}} relies on embedded blocklists in the partition bootsector to locate the {{ic|/boot/grub/i386-pc/core.img}} file and the prefix dir {{ic|/boot/grub}}. The sector locations of {{ic|core.img}} may change whenever the filesystem in the partition is being altered (files copied, deleted etc.). For more info see https://bugzilla.redhat.com/show_bug.cgi?id=728742 and https://bugzilla.redhat.com/show_bug.cgi?id=730915.<br />
<br />
The workaround for this is to set the immutable flag on {{ic|/boot/grub/i386-pc/core.img}} (using chattr command as mentioned above) so that the sector locations of the {{ic|core.img}} file in the disk is not altered. The immutable flag on {{ic|/boot/grub/i386-pc/core.img}} needs to be set only if {{ic|grub}} is installed to a partition boot sector or a partitionless disk, not in case of installation to MBR or simple generation of {{ic|core.img}} without embedding any bootsector (mentioned above).<br />
<br />
===== Generate core.img alone =====<br />
<br />
To populate the {{ic|/boot/grub}} directory and generate a {{ic|/boot/grub/i386-pc/core.img}} file '''without''' embedding any {{ic|grub}} bootsector code in the MBR, post-MBR region, or the partition bootsector, add {{ic|1=--grub-setup=/bin/true}} to {{ic|grub-install}}:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --grub-setup=/bin/true --recheck --debug /dev/sda<br />
<br />
You can then chainload GRUB's {{ic|core.img}} from GRUB Legacy or syslinux as a Linux kernel or a multiboot kernel.<br />
<br />
==== Generate config file ====<br />
<br />
Finally, generate a configuration for GRUB (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|/boot/grub/grub.cfg}}, NOT {{ic|/boot/grub/i386-pc/grub.cfg}}.}}<br />
<br />
If GRUB complains about "no suitable mode found" while booting, go to [[#"No suitable mode found" error]].<br />
<br />
If {{ic|grub-mkconfig}} fails, convert your {{ic|/boot/grub/menu.lst}} file to {{ic|/boot/grub/grub.cfg}} using:<br />
<br />
# grub-menulst2cfg /boot/grub/menu.lst /boot/grub/grub.cfg<br />
<br />
For example:<br />
<br />
{{hc|/boot/grub/menu.lst|<nowiki><br />
default=0<br />
timeout=5<br />
<br />
title Arch Linux Stock Kernel<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux.img<br />
<br />
title Arch Linux Stock Kernel Fallback<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux-fallback.img<br />
</nowiki>}}<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
set default='0'; if [ x"$default" = xsaved ]; then load_env; set default="$saved_entry"; fi<br />
set timeout=5<br />
<br />
menuentry 'Arch Linux Stock Kernel' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux.img' '/initramfs-linux.img'<br />
<br />
}<br />
<br />
menuentry 'Arch Linux Stock Kernel Fallback' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux-fallback.img' '/initramfs-linux-fallback.img'<br />
}<br />
</nowiki>}}<br />
<br />
If you forgot to create a GRUB {{ic|/boot/grub/grub.cfg}} config file and simply rebooted into GRUB Command Shell, type:<br />
<br />
sh:grub> insmod legacycfg<br />
sh:grub> legacy_configfile ${prefix}/menu.lst<br />
<br />
Boot into Arch and re-create the proper GRUB {{ic|/boot/grub/grub.cfg}} config file.<br />
<br />
{{Note|This option works only in BIOS systems, not in UEFI systems.}}<br />
<br />
==== Multiboot ====<br />
This should work out of the box, but an extra utility needs to be installed: os-prober. Install it, then rerun grub-mkconfig -o /boot/grub/grub.cfg. If this fails, you can try manually adding an entry by following the instructions below.<br />
<br />
===== Microsoft Windows installed in BIOS-MBR mode =====<br />
<br />
{{Note|GRUB supports booting {{ic|bootmgr}} directly and chainload of partition boot sector is no longer required to boot Windows in a BIOS-MBR setup.}}<br />
<br />
{{Warning|It is the '''system partition''' that has {{ic|bootmgr}}, not your "real" Windows partition (usually C:). When showing all UUIDs with blkid, the system partition is the one with {{ic|LABEL&#61;"SYSTEM RESERVED"}} and is only about 100 MB in size (much like the boot partition for Arch). See [[Wikipedia:System partition and boot partition]] for more info.}}<br />
<br />
Throughout this section, it is assumed your Windows partition is /dev/sda1. A different partition will change every instance of hd0,msdos1. First, find the UUID of the NTFS filesystem of the Windows's SYSTEM PARTITION where the {{ic|bootmgr}} and its files reside. For example, if Windows {{ic|bootmgr}} exists at {{ic|/media/SYSTEM_RESERVED/bootmgr}}:<br />
<br />
For Windows Vista/7/8:<br />
<br />
# grub-probe --target=fs_uuid /media/SYSTEM_RESERVED/bootmgr<br />
69B235F6749E84CE<br />
<br />
# grub-probe --target=hints_string /media/SYSTEM_RESERVED/bootmgr<br />
--hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1<br />
<br />
{{Note|For Windows XP, replace {{ic|bootmgr}} with {{ic|NTLDR}} in the above commands. And note that there may not be a separate SYSTEM_RESERVED partition; just probe the file NTLDR on your Windows partition.}}<br />
<br />
Then, add the below code to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} and regenerate {{ic|grub.cfg}} with {{ic|grub-mkconfig}} as explained above to boot Windows (XP, Vista, 7 or 8) installed in BIOS-MBR mode:<br />
<br />
For Windows Vista/7/8:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 BIOS-MBR" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /bootmgr<br />
}<br />
<br />
For Windows XP:<br />
<br />
menuentry "Microsoft Windows XP" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /ntldr<br />
}<br />
<br />
{{ic|/etc/grub.d/40_custom}} can be used as a template to create {{ic|/etc/grub.d/nn_custom}}. Where {{ic|nn}} defines the precendence, indicating the order the script is executed. The order scripts are executed determine the placement in the grub boot menu.<br />
<br />
{{Note|{{ic|nn}} should be greater than 06 to ensure necessary scripts are executed first.}}<br />
<br />
=== UEFI systems ===<br />
<br />
{{Note|It is well know that different motherboard manufactures implement UEFI differently. Users experiencing problems getting Grub/EFI to work properly are encouraged to share detailed steps for hardware-specific cases where UEFI booting does not work as described below. In an effort to keep the parent [[GRUB]] article neat and tidy, see the [[GRUB EFI Examples]] page for these special cases.}}<br />
<br />
First install the {{Pkg|grub}} package and then follow the instructions below.<br />
<br />
{{Note|Simply installing the package will not update the {{ic|core.efi}} file and the GRUB modules in the UEFI System Partition. You need to do this manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install boot files ====<br />
<br />
===== Install to UEFI system partition =====<br />
<br />
{{Note|<br />
* The below commands assume you are using installing GRUB for {{ic|x86_64-efi}} (for {{ic|IA32-efi}} replace {{ic|x86_64}} with {{ic|i386}} in the below commands)<br />
* To do this, you need to boot using UEFI and not the BIOS. If you booted by just copying the ISO file to the USB drive, you will need to follow [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO|this guide]] or grub-install will show errors<br />
}}<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Install GRUB UEFI application to {{ic|/boot/efi/EFI/arch_grub}} and its modules to {{ic|/boot/grub/x86_64-efi}} (recommended) using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
<br />
{{Note|Without {{ic|--target}} or {{ic|--directory}} option, grub-install cannot determine for which firmware GRUB is being installed. In such cases {{ic|grub-install}} will show {{ic|source_dir doesn't exist. Please specify --target or --directory}} message.}}<br />
<br />
If you want to install GRUB modules and {{ic|grub.cfg}} at the directory {{ic|/boot/efi/EFI/grub}} and the {{ic|grubx64.efi}} application at {{ic|/boot/efi/EFI/arch_grub}} (ie. all the GRUB UEFI files inside the UEFISYS partition itself) use:<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug<br />
# mkdir -p /boot/efi/EFI/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/efi/EFI/grub/locale/en.mo<br />
<br />
The {{ic|--efi-directory}} option mentions the mountpoint of UEFI SYSTEM PARTITION , {{ic|--bootloader-id}} mentions the name of the directory used to store the {{ic|grubx64.efi}} file and {{ic|--boot-directory}} mentions the directory wherein the actual modules will be installed (and into which {{ic|grub.cfg}} should be created).<br />
<br />
The actual paths are:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi<br />
<br />
<boot-directory>/grub/x86_64-efi/<all modules, grub.efi, core.efi, grub.cfg><br />
<br />
{{Note|the {{ic|--bootloader-id}} option does not change {{ic|<boot-directory>/grub}}, i.e. you cannot install the modules to {{ic|<boot-directory>/<bootloader-id>}}, the path is hard-coded to be {{ic|<boot-directory>/grub}}.}}<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == <boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
The {{ic|<nowiki><efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi</nowiki>}} is an exact copy of {{ic|<nowiki><boot-directory>/grub/x86_64-efi/core.efi</nowiki>}}.<br />
<br />
{{Note|<br />
* In GRUB 2.00, the {{ic|grub-install}} option {{ic|--efi-directory}} replaces {{ic|--root-directory}} and the latter is deprecated<br />
* The options {{ic|--efi-directory}} and {{ic|--bootloader-id}} are specific to GRUB UEFI<br />
}}<br />
<br />
In all the cases the UEFI SYSTEM PARTITION should be mounted for {{ic|grub-install}} to install {{ic|grubx64.efi}} in it, which will be launched by the firmware (using the {{ic|efibootmgr}} created boot entry in non-Mac systems).<br />
<br />
If you notice carefully, there is no <device_path> option (Eg: {{ic|/dev/sda}}) at the end of the {{ic|grub-install}} command unlike the case of setting up GRUB for BIOS systems. Any <device_path> provided will be ignored by the install script as UEFI bootloaders do not use MBR or Partition boot sectors at all.<br />
<br />
You may now be able to UEFI boot your system by creating a {{ic|grub.cfg}} file by following [[#Generate UEFI Config file]] and [[#Create GRUB entry in the Firmware Boot Manager]].<br />
<br />
==== Generate config file ====<br />
<br />
Finally, generate a configuration for GRUB (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o <boot-directory>/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|<boot-directory>/grub/grub.cfg}}, NOT {{ic|<boot-directory>/grub/x86_64-efi/grub.cfg}}.}}<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot/efi/EFI</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
<br />
This is independent of the value of {{ic|--bootloader-id}} option.<br />
<br />
If GRUB complains about "no suitable mode found" while booting, try [[#"No suitable mode found" error]].<br />
<br />
==== Create GRUB entry in the firmware boot manager ====<br />
<br />
{{ic|grub-install}} automatically tries to create a menu entry in the boot manager. If it doesn't, then see [[Beginners' Guide#GRUB]] for instructions to use {{ic|efibootmgr}} to create a menu entry. However, the problem is likely to be that you haven't booted your CD/USB in UEFI mode, as in [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]].<br />
<br />
==== Create GRUB standalone UEFI application ====<br />
<br />
It is possible to create a {{ic|grubx64_standalone.efi}} application which has all the modules embeddded in a memdisk within the UEFI application, thus removing the need for having a separate directory populated with all the GRUB UEFI modules and other related files. This is done using the {{ic|grub-mkstandalone}} command which is included in {{Pkg|grub}}.<br />
<br />
The easiest way to do this would be with the install command already mentioned before, but specifying the modules to include. For example:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" <any extra files you want to include><br />
<br />
The {{ic|grubx64_standalone.efi}} file expects {{ic|grub.cfg}} to be within its $prefix which is {{ic|(memdisk)/boot/grub}}. The memdisk is embedded within the efi app. The {{ic|grub-mkstandlone}} script allow passing files to be included in the memdisk image to be as the arguments to the script (in <any extra files you want to include>).<br />
<br />
If you have the {{ic|grub.cfg}} at {{ic|/home/user/Desktop/grub.cfg}}, then create a temporary {{ic|/home/user/Desktop/boot/grub/}} directory, copy the {{ic|/home/user/Desktop/grub.cfg}} to {{ic|/home/user/Desktop/boot/grub/grub.cfg}}, cd into {{ic|/home/user/Desktop/boot/grub/}} and run:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" "boot/grub/grub.cfg"<br />
<br />
The reason to cd into {{ic|/home/user/Desktop/boot/grub/}} and to pass the file path as {{ic|boot/grub/grub.cfg}} (notice the lack of a leading slash - boot/ vs /boot/ ) is because {{ic|dir1/dir2/file}} is included as {{ic|(memdisk)/dir1/dir2/file}} by the {{ic|grub-mkstandalone}} script. <br />
<br />
If you pass {{ic|/home/user/Desktop/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/grub.cfg}}. If you pass {{ic|/home/user/Desktop/boot/grub/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/boot/grub/grub.cfg}}. That is the reason for cd'ing into {{ic|/home/user/Desktop/boot/grub/}} and passing {{ic|boot/grub/grub.cfg}}, to include the file as {{ic|(memdisk)/boot/grub/grub.cfg}}, which is what {{ic|grub.efi}} expects the file to be.<br />
<br />
You need to create an UEFI Boot Manager entry for {{ic|/boot/efi/EFI/arch_grub/grubx64_standalone.efi}} using {{ic|efibootmgr}}. Follow [[#Create GRUB entry in the Firmware Boot Manager]].<br />
<br />
==== Multiboot ====<br />
<br />
===== Microsoft Windows installed in UEFI-GPT mode =====<br />
<br />
Find the UUID of the FAT32 filesystem in the UEFI SYSTEM PARTITION where the Windows UEFI Bootloader files reside. For example, if Windows {{ic|bootmgfw.efi}} exists at {{ic|/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi}} (ignore the upper-lower case differences since that is immaterial in FAT filesystem):<br />
<br />
# grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
1ce5-7f28<br />
<br />
# grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
--hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1<br />
<br />
Then, add this code to {{ic|/etc/grub.d/40_custom}} to chainload Windows x86_64 (Vista SP1+, 7 or 8) installed in UEFI-GPT mode:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 x86_64 UEFI-GPT" {<br />
insmod part_gpt<br />
insmod fat<br />
insmod search_fs_uuid<br />
insmod chain<br />
search --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 1ce5-7f28<br />
chainloader /efi/Microsoft/Boot/bootmgfw.efi<br />
}<br />
<br />
Afterwards remake {{ic|/boot/grub/grub.cfg}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
== Configuration ==<br />
<br />
You can also choose to automatically generate or manually edit {{ic|grub.cfg}}.<br />
<br />
{{Note|<br />
* For EFI systems, if GRUB was installed with the {{ic|--boot-directory}} option set, the {{ic|grub.cfg}} file must be placed in the same directory as {{ic|grubx64.efi}}. Otherwise, the {{ic|grub.cfg}} file goes in {{ic|/boot/grub/}}, just like in GRUB BIOS<br />
* [http://members.iinet.net/~herman546/p20/GRUB2%20Configuration%20File%20Commands.html Here] is a quite complete description of how to configure GRUB<br />
}}<br />
<br />
=== Automatically generating using grub-mkconfig ===<br />
<br />
The GRUB {{ic|menu.lst}} equivalent configuration files are {{ic|/etc/default/grub}} and {{ic|/etc/grub.d/*}}. {{ic|grub-mkconfig}} uses these files to generate {{ic|grub.cfg}}. By default the script outputs to stdout. To generate a {{ic|grub.cfg}} file run the command:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{ic|/etc/grub.d/10_linux}} is set to automatically add menu items for Arch linux that work out of the box, to any generated configuration. Other operating systems may need to be added manually to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}<br />
<br />
==== Additional arguments ====<br />
<br />
To pass custom additional arguments to the Linux image, you can set the {{ic|GRUB_CMDLINE_LINUX}} variable in {{ic|/etc/default/grub}}. <br />
<br />
For example, use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX"</nowiki>}} where {{ic|sda'''X'''}} is your swap partition to enable resume after hibernation.<br />
<br />
You can also use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/disk/by-uuid/${swap_uuid}"</nowiki>}}, where {{ic|${swap_uuid} }} is the [[Persistent_block_device_naming|UUID]] of your swap partition.<br />
<br />
Multiple entries are separated by spaces within the double quotes. So, for users who want both resume and systemd it would look like this:<br />
{{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX init=/usr/lib/systemd/systemd"</nowiki>}}<br />
<br />
See [[Kernel parameters]] for more info.<br />
<br />
=== Manually creating grub.cfg ===<br />
<br />
{{Warning|Editing this file is strongly ''not'' recommended. The file is generated by the {{ic|grub-mkconfig}} command, and it is best to edit your {{ic|/etc/default/grub}} or one of the scripts in the {{ic|/etc/grub.d}} folder.}}<br />
<br />
A basic GRUB config file uses the following options:<br />
* {{ic|(hdX,Y)}} is the partition {{ic|Y}} on disk {{ic|X}}, partition numbers starting at 1, disk numbers starting at 0<br />
* {{ic|1=set default=N}} is the default boot entry that is chosen after timeout for user action<br />
* {{ic|1=set timeout=M}} is the time {{ic|M}} to wait in seconds for a user selection before default is booted<br />
* {{ic|<nowiki>menuentry "title" {entry options}</nowiki>}} is a boot entry titled {{ic|title}}<br />
* {{ic|1=set root=(hdX,Y)}} sets the boot partition, where the kernel and GRUB modules are stored (boot need not be a separate partition, and may simply be a directory under the "root" partition ({{ic|/}})<br />
<br />
An example configuration:<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
# Config file for GRUB - The GNU GRand Unified Bootloader<br />
# /boot/grub/grub.cfg<br />
<br />
# DEVICE NAME CONVERSIONS<br />
#<br />
# Linux Grub<br />
# -------------------------<br />
# /dev/fd0 (fd0)<br />
# /dev/sda (hd0)<br />
# /dev/sdb2 (hd1,2)<br />
# /dev/sda3 (hd0,3)<br />
#<br />
<br />
# Timeout for menu<br />
set timeout=5<br />
<br />
# Set default boot entry as Entry 0<br />
set default=0<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
set root=(hd0,1)<br />
linux /vmlinuz-linux root=/dev/sda3 ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
## (1) Windows<br />
#menuentry "Windows" {<br />
# set root=(hd0,3)<br />
# chainloader +1<br />
#}<br />
</nowiki>}}<br />
<br />
=== Dual-booting ===<br />
<br />
{{Note|If you want GRUB to automatically search for other systems, you may wish to install {{Pkg|os-prober}}.}}<br />
<br />
==== Using grub-mkconfig ====<br />
The best way to add other entries is editing the {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} . The entries in this file will be automatically added when running {{ic|grub-mkconfig}}.<br />
After adding the new lines, run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg <br />
to generate an updated {{ic|grub.cfg}}.<br />
<br />
===== With GNU/Linux =====<br />
<br />
Assuming that the other distro is on partition {{ic|sda2}}:<br />
<br />
menuentry "Other Linux" {<br />
set root=(hd0,2)<br />
linux /boot/vmlinuz (add other options here as required)<br />
initrd /boot/initrd.img (if the other kernel uses/needs one)<br />
}<br />
<br />
===== With FreeBSD =====<br />
<br />
Requires that FreeBSD is installed on a single partition with UFS. Assuming it is installed on {{ic|sda4}}:<br />
<br />
menuentry "FreeBSD" {<br />
set root=(hd0,4)<br />
chainloader +1<br />
}<br />
<br />
===== With Windows =====<br />
<br />
This assumes that your Windows partition is {{ic|sda3}}. Remember you need to point set root and chainloader to the system reserve partition that windows made when it installed, not the actual partition windows is on. This example works if your system reserve partition is {{ic|sda3}}.<br />
<br />
# (2) Windows XP<br />
menuentry "Windows XP" {<br />
set root="(hd0,3)"<br />
chainloader +1<br />
}<br />
<br />
If the Windows bootloader is on an entirely different hard drive than GRUB, it may be necessary to trick Windows into believing that it is the first hard drive. This was possible with {{ic|drivemap}}. Assuming GRUB is on {{ic|hd0}} and Windows is on {{ic|hd2}}, you need to add the following after {{ic|set root}}:<br />
<br />
drivemap -s hd0 hd2<br />
<br />
==== With Windows via EasyBCD and NeoGRUB ====<br />
<br />
Since EasyBCD's NeoGRUB currently does not understand the GRUB menu format, chainload to it by replacing the contents of your {{ic|C:\NST\menu.lst}} file with lines similar to the following:<br />
<br />
default 0<br />
timeout 1<br />
<br />
title Chainload into GRUB v2<br />
root (hd0,7)<br />
kernel /boot/grub/i386-pc/core.img<br />
<br />
=== Visual configuration ===<br />
<br />
In GRUB it is possible, by default, to change the look of the menu. Make sure to initialize, if not done already, GRUB graphical terminal, gfxterm, with proper video mode, gfxmode, in GRUB. This can be seen in the section [[#"No suitable mode found" error]]. This video mode is passed by GRUB to the linux kernel via 'gfxpayload' so any visual configurations need this mode in order to be in effect.<br />
<br />
==== Setting the framebuffer resolution ====<br />
<br />
GRUB can set the framebuffer for both GRUB itself and the kernel. The old {{ic|1=vga=}} way is deprecated. The preferred method is editing {{ic|/etc/default/grub}} as the following sample:<br />
<br />
GRUB_GFXMODE=1024x768x32<br />
GRUB_GFXPAYLOAD_LINUX=keep<br />
<br />
To generate the changes, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
The {{ic|gfxpayload}} property will make sure the kernel keeps the resolution.<br />
<br />
{{Note|<br />
* If this example does not work for you try to replace {{ic|1=gfxmode="1024x768x32"}} by {{ic|1=vbemode="0x105"}}. Remember to replace the specified resolution with one suitable for your screen<br />
* To show all the modes you can use {{ic|1=# hwinfo --framebuffer}} (hwinfo is available in [community]), while at GRUB prompt you can use the {{ic|1=vbeinfo}} command<br />
}}<br />
<br />
If this method does not work for you, the deprecated {{ic|1=vga=}} method will still work. Just<br />
add it next to the {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="}} line in {{ic|/etc/default/grub}}<br />
for eg: {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=792"}} will give you a {{ic|1024x768}} resolution.<br />
<br />
You can choose one of these resolutions: {{ic|640×480}}, {{ic|800×600}}, {{ic|1024×768}}, {{ic|1280×1024}}, {{ic|1600×1200}}, {{ic|1920×1200}}<br />
<br />
==== 915resolution hack ====<br />
<br />
Some times for Intel graphic adapters neither {{ic|1=# hwinfo --framebuffer}} nor {{ic|1=vbeinfo}} will show you the desired resolution. In this case you can use {{ic|915resolution}} hack. This hack will temporarily modify video BIOS and add needed resolution. See [http://915resolution.mango-lang.org/ 915resolution's home page]<br />
<br />
First you need to find a video mode which will be modified later. For that we need the GRUB command shell:<br />
{{hc|sh:grub> 915resolution -l|<br />
Intel 800/900 Series VBIOS Hack : version 0.5.3<br />
[...]<br />
'''Mode 30''' : 640x480, 8 bits/pixel<br />
[...]<br />
}}<br />
Next, we overwrite the {{ic|Mode 30}} with {{ic|1440x900}} resolution:<br />
{{hc|/etc/grub.d/00_header|<br />
[...]<br />
'''915resolution 30 1440 900 # Inserted line'''<br />
set gfxmode&#61;${GRUB_GFXMODE}<br />
[...]<br />
}}<br />
Lastly we need to set {{ic|GRUB_GFXMODE}} as described earlier, regenerate GRUB configuration file and reboot to test changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# reboot<br />
<br />
==== Background image and bitmap fonts ====<br />
<br />
GRUB comes with support for background images and bitmap fonts in {{ic|pf2}} format. The unifont font is included in the {{Pkg|grub}} package under the filename {{ic|unicode.pf2}}, or, as only ASCII characters under the name {{ic|ascii.pf2}}.<br />
<br />
Image formats supported include tga, png and jpeg, providing the correct modules are loaded. The maximum supported resolution depends on your hardware.<br />
<br />
Make sure you have set up the proper [[#Setting the framebuffer resolution|framebuffer resolution]].<br />
<br />
Edit {{ic|/etc/default/grub}} like this:<br />
GRUB_BACKGROUND="/boot/grub/myimage"<br />
#GRUB_THEME="/path/to/gfxtheme"<br />
GRUB_FONT="/path/to/font.pf2"<br />
<br />
{{Note|If you have installed GRUB on a separate partition, {{ic|/boot/grub/myimage}} becomes {{ic|/grub/myimage}}.}}<br />
<br />
To generate the changes and add the information into {{ic|grub.cfg}}, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If adding the splash image was successful, the user will see {{ic|"Found background image..."}} in the terminal as the command is executed. <br />
If this phrase is not seen, the image information was probably not incorporated into the {{ic|grub.cfg}} file.<br />
<br />
If the image is not displayed, check:<br />
* The path and the filename in {{ic|/etc/default/grub}} are correct<br />
* The image is of the proper size and format (tga, png, 8-bit jpg)<br />
* The image was saved in the RGB mode, and is not indexed<br />
* The console mode is not enabled in {{ic|/etc/default/grub}}<br />
* The command {{ic|grub-mkconfig}} must be executed to place the background image information into the {{ic|/boot/grub/grub.cfg}} file<br />
<br />
==== Theme ====<br />
<br />
Here is an example for configuring Starfield theme which was included in GRUB package.<br />
<br />
Edit {{ic|/etc/default/grub}}<br />
GRUB_THEME="/usr/share/grub/themes/starfield/theme.txt"<br />
<br />
Generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If configuring the theme was successful, you'll see {{ic|Found theme: /usr/share/grub/themes/starfield/theme.txt}} in the terminal.<br />
Your splash image will usually not be displayed when using a theme.<br />
<br />
==== Menu colors ====<br />
<br />
You can set the menu colors in GRUB. The available colors for GRUB can be found in [https://www.gnu.org/software/grub/manual/html_node/Theme-file-format.html the GRUB Manual].<br />
Here is an example:<br />
<br />
Edit {{ic|/etc/default/grub}}:<br />
GRUB_COLOR_NORMAL="light-blue/black"<br />
GRUB_COLOR_HIGHLIGHT="light-cyan/blue"<br />
<br />
Generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Hidden menu ====<br />
<br />
One of the unique features of GRUB is hiding/skipping the menu and showing it by holding {{keypress|Esc}} when needed. You can also adjust whether you want to see the timeout counter.<br />
<br />
Edit {{ic|/etc/default/grub}} as you wish. Here is an example where the comments from the beginning of the two lines have been removed to enable the feature, the timeout has been set to five seconds and to be shown to the user:<br />
GRUB_HIDDEN_TIMEOUT=5<br />
GRUB_HIDDEN_TIMEOUT_QUIET=false<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Disable framebuffer ====<br />
<br />
Users who use NVIDIA proprietary driver might wish to disable GRUB's framebuffer as it can cause problems with the binary driver.<br />
<br />
To disable framebuffer, edit {{ic|/etc/default/grub}} and uncomment the following line:<br />
GRUB_TERMINAL_OUTPUT=console<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
Another option if you want to keep the framebuffer in GRUB is to revert to text mode just before starting the kernel. To do that modify the variable in {{ic|/etc/default/grub}}:<br />
GRUB_GFXPAYLOAD_LINUX=text<br />
<br />
and rebuild the configuration as before.<br />
<br />
=== Other Options ===<br />
<br />
==== LVM ====<br />
<br />
If you use [[LVM]] for your {{ic|/boot}}, add the following before menuentry lines:<br />
<br />
insmod lvm<br />
<br />
and specify your root in the menuentry as:<br />
<br />
set root=lvm/''lvm_group_name''-''lvm_logical_boot_partition_name''<br />
<br />
Example:<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
insmod lvm<br />
set root=lvm/VolumeGroup-lv_boot<br />
# you can only set following two lines<br />
linux /vmlinuz-linux root=/dev/mapper/VolumeGroup-root ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
==== RAID ====<br />
<br />
GRUB provides convenient handling of RAID volumes. You need to add {{ic|insmod mdraid}} which allows you to address the volume natively. For example, {{ic|/dev/md0}} becomes:<br />
set root=(md0)<br />
<br />
whereas a partitioned RAID volume (e.g. {{ic|/dev/md0p1}}) becomes:<br />
set root=(md0,1)<br />
<br />
==== Persistent block device naming ====<br />
One naming scheme for [[Persistent block device naming]] is the use of globally unique UUIDs to detect partitions instead of the "old" {{ic|/dev/sd*}}. Advantages are covered up in the above linked article. <br />
<br />
Persistent naming via filesystem UUIDs are used by default in GRUB. <br />
<br />
{{Note|The {{ic|/boot/grub.cfg}} file needs regeneration with the new UUID in {{ic|/etc/default/grub}} every time a relevant filesystem is resized or recreated. Remember this when modifying partitions & filesystems with a Live-CD.}}<br />
<br />
Whether to use UUIDs is controlled by an option in {{ic|/etc/default/grub}}:<br />
<br />
# GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Either way, do not forget to generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Using Labels ====<br />
<br />
It is possible to use labels, human-readable strings attached to filesystems, by using the {{ic|--label}} option to {{ic|search}}. First of all, label your existing partition:<br />
# tune2fs -L <LABEL> <PARTITION><br />
<br />
Then, add an entry using labels. An example of this:<br />
<br />
menuentry "Arch Linux, session texte" {<br />
search --label --set=root archroot<br />
linux /boot/vmlinuz-linux root=/dev/disk/by-label/archroot ro<br />
initrd /boot/initramfs-linux.img<br />
}<br />
<br />
==== Recall previous entry ====<br />
<br />
GRUB can remember the last entry you booted from and use this as the default entry to boot from next time. This is useful if you have multiple kernels (i.e., the current Arch one and the LTS kernel as a fallback option) or operating systems. To do this, edit {{ic|/etc/default/grub}} and change the value of {{ic|GRUB_DEFAULT}}:<br />
<br />
GRUB_DEFAULT=saved<br />
<br />
This ensures that GRUB will default to the saved entry. To enable saving the selected entry, add the following line to {{ic|/etc/default/grub}}:<br />
<br />
GRUB_SAVEDEFAULT=true<br />
<br />
{{Note|Manually added menu items, e.g. Windows in {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}, will need {{ic|savedefault}} added. Remember to regenerate([[#Generate config file]]) your configuration file.}}<br />
<br />
==== Changing the default menu entry ====<br />
<br />
To change the default selected entry, edit {{ic|/etc/default/grub}} and change the value of {{ic|GRUB_DEFAULT}}:<br />
<br />
Using numbers :<br />
GRUB_DEFAULT=0<br />
Grub identifies entries in generated menu counted from zero. That means 0 for the first entry which is the default value, 1 for the second and so on.<br />
<br />
Or using menu titles :<br />
GRUB_DEFAULT='Arch Linux, with Linux core repo kernel'<br />
<br />
{{Note|Remember to regenerate([[#Generate config file]]) your configuration file.}}<br />
<br />
==== Security ====<br />
<br />
If you want to secure GRUB so it is not possible for anyone to change boot parameters or use the command line, you can add a user/password combination to GRUB's configuration files. To do this, run the command {{ic|grub-mkpasswd-pbkdf2}}. Enter a password and confirm it:<br />
<br />
{{hc|grub-mkpasswd-pbkdf2|<br />
[...]<br />
Your PBKDF2 is grub.pbkdf2.sha512.10000.C8ABD3E93C4DFC83138B0C7A3D719BC650E6234310DA069E6FDB0DD4156313DA3D0D9BFFC2846C21D5A2DDA515114CF6378F8A064C94198D0618E70D23717E82.509BFA8A4217EAD0B33C87432524C0B6B64B34FBAD22D3E6E6874D9B101996C5F98AB1746FE7C7199147ECF4ABD8661C222EEEDB7D14A843261FFF2C07B1269A<br />
}}<br />
Then, add the following to {{ic|/etc/grub.d/00_header}}:<br />
{{hc|/etc/grub.d/00_header|<br />
cat << EOF<br />
<br />
set superusers<nowiki>=</nowiki>"'''username'''"<br />
password_pbkdf2 '''username''' '''<password>'''<br />
<br />
EOF<br />
}}<br />
where {{ic|<password>}} is the string generated by {{ic|grub-mkpasswd_pbkdf2}}.<br />
<br />
Regenerate your configuration file. Your GRUB command line, boot parameters and all boot entries are now protected.<br />
<br />
This can be relaxed and further customized with more users as described in the "Security" part of [https://www.gnu.org/software/grub/manual/grub.html#Security the GRUB manual].<br />
<br />
==== Root encryption ====<br />
<br />
To let GRUB automatically add the kernel parameters for root encryption,<br />
add {{ic|1=cryptdevice=/dev/yourdevice:label}} to {{ic|GRUB_CMDLINE_LINUX}} in {{ic|/etc/default/grub}}.<br />
<br />
{{Tip|If you're upgrading from a working GRUB Legacy configuration, check {{ic|/boot/grub/menu.lst.pacsave}} for the correct device/label to add. Look for them after the text {{ic|kernel /vmlinuz-linux}}.}}<br />
<br />
Example with root mapped to {{ic|/dev/mapper/root}}:<br />
<br />
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:root"<br />
<br />
Also, disable the usage of UUIDs for the rootfs:<br />
<br />
GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Regenerate the configuration.<br />
<br />
==== Boot non-default entry only once ====<br />
<br />
The command {{ic|grub-reboot}} is very helpful to boot another entry than the default only once. GRUB loads the entry passed in the first command line argument, when the system is rebooted the next time. Most importantly GRUB returns to loading the default entry for all future booting. Changing the configuration file or selecting an entry in the GRUB menu is not necessary.<br />
{{Note|This requires {{ic|1=GRUB_DEFAULT=saved}} in {{ic|/etc/default/grub}} (and then regenerating {{ic|grub.cfg}}) or, in case of hand-made {{ic|grub.cfg}}, the line {{ic|1=set default="${saved_entry}"}}.}}<br />
<br />
=== Booting an ISO directly from GRUB ===<br />
<br />
Edit {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} to add an entry for the target ISO. When finished, update the GRUB menu as with the usual {{ic|grub-mkconfig -o /boot/grub/grub.cfg}} (as root).<br />
<br />
==== Arch ISO ====<br />
<br />
{{Note|The following examples assume the ISO is in {{ic|/archives}} on {{ic|hd0,6}}.}}<br />
{{Tip|For thumbdrives, use something like {{ic|(hd1,$partition)}} and either {{ic|/dev/sdb'''Y'''}} for the {{ic|img_dev}} parameter or [[Persistent_block_device_naming|a persistent name]], e.g. {{ic|img_dev&#61;/dev/disk/by-label/CORSAIR}}.}}<br />
<br />
===== x86_64 =====<br />
<br />
menuentry "Archlinux-2013.05.01-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.05.01-dual.iso"<br />
set partition="6"<br />
loopback loop (hd0,$partition)/$isofile<br />
linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201305 img_dev=/dev/sda$partition img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/x86_64/archiso.img<br />
}<br />
<br />
===== i686 =====<br />
<br />
menuentry "Archlinux-2013.05.01-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.05.01-dual.iso"<br />
set partition="6"<br />
loopback loop (hd0,$partition)/$isofile<br />
linux (loop)/arch/boot/i686/vmlinuz archisolabel=ARCH_201305 img_dev=/dev/sda$partition img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/i686/archiso.img<br />
}<br />
<br />
==== Ubuntu ISO ====<br />
<br />
{{Note|The example assumes that the iso is in {{ic|/archives}} on {{ic|hd0,6}}. Users must adjust the location and hdd/partition in the lines below to match their systems.}}<br />
<br />
menuentry "ubuntu-13.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-13.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)/$isofile<br />
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
menuentry "ubuntu-12.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-12.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)/$isofile<br />
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
==== Other ISOs ====<br />
<br />
Other working configurations from [http://askubuntu.com/questions/141940/how-to-boot-live-iso-images link Source].<br />
<br />
== Using the command shell ==<br />
<br />
Since the MBR is too small to store all GRUB modules, only the menu and a few basic commands reside there. The majority of GRUB functionality remains in modules in {{ic|/boot/grub}}, which are inserted as needed. In error conditions (e.g. if the partition layout changes) GRUB may fail to boot. When this happens, a command shell may appear.<br />
<br />
GRUB offers multiple shells/prompts. If there is a problem reading the menu but the bootloader is able to find the disk, you will likely be dropped to the "normal" shell:<br />
sh:grub><br />
<br />
If there is a more serious problem (e.g. GRUB cannot find required files), you may instead be dropped to the "rescue" shell:<br />
grub rescue><br />
<br />
The rescue shell is a restricted subset of the normal shell, offering much less functionality. If dumped to the rescue shell, first try inserting the "normal" module, then starting the "normal" shell:<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
grub rescue> insmod (hdX,Y)/boot/grub/i386-pc/normal.mod<br />
rescue:grub> normal<br />
<br />
=== Pager support ===<br />
<br />
GRUB supports pager for reading commands that provide long output (like the {{ic|help}} command). This works only in normal shell mode and not in rescue mode. To enable pager, in GRUB command shell type:<br />
sh:grub> set pager=1<br />
<br />
== GUI configuration tools ==<br />
<br />
Following package may be installed:<br />
* {{App|grub-customizer|Customize the bootloader (GRUB or BURG)|https://launchpad.net/grub-customizer|{{AUR|grub-customizer}}}}<br />
* {{App|grub2-editor|KDE4 control module for configuring the GRUB bootloader|http://kde-apps.org/content/show.php?content&#61;139643|{{AUR|grub2-editor}}}}<br />
* {{App|kcm-grub2|This Kcm module manages the most common settings of GRUB|http://kde-apps.org/content/show.php?content&#61;137886|{{AUR|kcm-grub2}}}}<br />
* {{App|startupmanager|GUI app for changing the settings of GRUB Legacy, GRUB, Usplash and Splashy|http://sourceforge.net/projects/startup-manager/|{{AUR|startupmanager}}}}<br />
<br />
== parttool for hide/unhide ==<br />
<br />
If you have a Windows 9x paradigm with hidden {{ic|C:\}} disks GRUB can hide/unhide it using {{ic|parttool}}. For example, to boot the third {{ic|C:\}} disk of three Windows 9x installations on the CLI enter the CLI and:<br />
parttool hd0,1 hidden+ boot-<br />
parttool hd0,2 hidden+ boot-<br />
parttool hd0,3 hidden- boot+<br />
set root=hd0,3<br />
chainloader +1<br />
boot<br />
<br />
== Using the rescue console ==<br />
<br />
See [[#Using the command shell]] first. If unable to activate the standard shell, one possible solution is to boot using a live CD or some other rescue disk to correct configuration errors and reinstall GRUB. However, such a boot disk is not always available (nor necessary); the rescue console is surprisingly robust.<br />
<br />
The available commands in GRUB rescue include {{ic|insmod}}, {{ic|ls}}, {{ic|set}}, and {{ic|unset}}. This example uses {{ic|set}} and {{ic|insmod}}. {{ic|set}} modifies variables and {{ic|insmod}} inserts new modules to add functionality.<br />
<br />
Before starting, the user must know the location of their {{ic|/boot}} partition (be it a separate partition, or a subdirectory under their root):<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
<br />
where X is the physical drive number and Y is the partition number.<br />
<br />
To expand console capabilities, insert the {{ic|linux}} module:<br />
grub rescue> insmod (hdX,Y)/boot/grub/linux.mod<br />
<br />
{{Note|With a separate boot partition, omit {{ic|/boot}} from the path, (i.e. type {{ic|1=set prefix=(hdX,Y)/grub}} and {{ic|insmod (hdX,Y)/grub/linux.mod}}).}}<br />
<br />
This introduces the {{ic|linux}} and {{ic|initrd}} commands, which should be familiar (see [[#Configuration]]).<br />
<br />
An example, booting Arch Linux:<br />
set root=(hd0,5)<br />
linux /boot/vmlinuz-linux root=/dev/sda5<br />
initrd /boot/initramfs-linux.img<br />
boot<br />
<br />
With a separate boot partition, again change the lines accordingly:<br />
set root=(hd0,5)<br />
linux /vmlinuz-linux root=/dev/sda6<br />
initrd /initramfs-linux.img<br />
boot<br />
<br />
After successfully booting the Arch Linux installation, users can correct {{ic|grub.cfg}} as needed and then reinstall GRUB.<br />
<br />
To reinstall GRUB and fix the problem completely, changing {{ic|/dev/sda}} if needed. See [[#Bootloader installation]] for details.<br />
<br />
== Combining the use of UUIDs and basic scripting ==<br />
<br />
If you like the idea of using UUIDs to avoid unreliable BIOS mappings or are struggling with GRUB's syntax, here is an example boot menu item that uses UUIDs and a small script to direct GRUB to the proper disk partitions for your system. All you need to do is replace the UUIDs in the sample with the correct UUIDs for your system. The example applies to a system with a boot and root partition. You will obviously need to modify the GRUB configuration if you have additional partitions:<br />
<br />
menuentry "Arch Linux 64" {<br />
# Set the UUIDs for your boot and root partition respectively<br />
set the_boot_uuid=ece0448f-bb08-486d-9864-ac3271bd8d07<br />
set the_root_uuid=c55da16f-e2af-4603-9e0b-03f5f565ec4a<br />
<br />
# (Note: This may be the same as your boot partition)<br />
<br />
# Get the boot/root devices and set them in the root and grub_boot variables<br />
search --fs-uuid --set=root $the_root_uuid<br />
search --fs-uuid --set=grub_boot $the_boot_uuid<br />
<br />
# Check to see if boot and root are equal.<br />
# If they are, then append /boot to $grub_boot (Since $grub_boot is actually the root partition)<br />
if [ $the_boot_uuid == $the_root_uuid] ; then<br />
set grub_boot=$grub_boot/boot<br />
fi<br />
<br />
# $grub_boot now points to the correct location, so the following will properly find the kernel and initrd<br />
linux ($grub_boot)/vmlinuz-linux root=/dev/disk/by-uuid/$uuid_os_root ro<br />
initrd ($grub_boot)/initramfs-linux.img<br />
}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Intel BIOS not booting GPT ===<br />
<br />
Some Intel BIOS's require at least one bootable MBR partition to be present at boot, causing GPT-partitioned boot setups to be unbootable.<br />
<br />
This can be circumvented by using (for instance) fdisk to mark one of the GPT partitions (preferably the 1007 KiB partition you've created for GRUB already) bootable in the MBR. This can be achieved, using fdisk, by the following commands: Start fdisk against the disk you're installing, for instance {{ic|fdisk /dev/sda}}, then press {{keypress|a}} and select the partition you wish to mark as bootable (probably #1) by pressing the corresponding number, finally press {{keypress|w}} to write the changes to the MBR.<br />
<br />
{{Note|The bootable-marking must be done in {{ic|fdisk}} or similar, not in GParted or others, as they will not set the bootable flag in the MBR.}}<br />
<br />
More information is available [http://www.rodsbooks.com/gdisk/bios.html here]<br />
<br />
=== Enable debug messages ===<br />
<br />
Add:<br />
<br />
set pager=1<br />
set debug=all<br />
<br />
to {{ic|grub.cfg}}.<br />
<br />
=== "No suitable mode found" error ===<br />
<br />
If you get this error when booting any menuentry:<br />
<br />
error: no suitable mode found<br />
Booting however<br />
<br />
Then you need to initialize GRUB graphical terminal ({{ic|gfxterm}}) with proper video mode ({{ic|gfxmode}}) in GRUB. This video mode is passed by GRUB to the linux kernel via 'gfxpayload'. In case of UEFI systems, if the GRUB video mode is not initialized, no kernel boot messages will be shown in the terminal (atleast until KMS kicks in).<br />
<br />
Copy {{ic|/usr/share/grub/unicode.pf2}} to ${GRUB_PREFIX_DIR} ({{ic|/boot/grub/}} in case of BIOS and UEFI systems). If GRUB UEFI was installed with {{ic|1=--boot-directory=/boot/efi/EFI}} set, then the directory is {{ic|/boot/efi/EFI/grub/}}:<br />
<br />
# cp /usr/share/grub/unicode.pf2 ${GRUB_PREFIX_DIR}<br />
<br />
If {{ic|/usr/share/grub/unicode.pf2}} does not exist, install {{Pkg|bdf-unifont}}, create the {{ic|unifont.pf2}} file and then copy it to {{ic|${GRUB_PREFIX_DIR<nowiki>}</nowiki>}}:<br />
<br />
# grub-mkfont -o unicode.pf2 /usr/share/fonts/misc/unifont.bdf<br />
<br />
Then, in the {{ic|grub.cfg}} file, add the following lines to enable GRUB to pass the video mode correctly to the kernel, without of which you will only get a black screen (no output) but booting (actually) proceeds successfully without any system hang.<br />
<br />
BIOS systems:<br />
<br />
insmod vbe<br />
<br />
UEFI systems:<br />
<br />
insmod efi_gop<br />
insmod efi_uga<br />
<br />
After that add the following code (common to both BIOS and UEFI):<br />
<br />
insmod font<br />
<br />
if loadfont ${prefix}/fonts/unicode.pf2<br />
then<br />
insmod gfxterm<br />
set gfxmode=auto<br />
set gfxpayload=keep<br />
terminal_output gfxterm<br />
fi<br />
<br />
As you can see for gfxterm (graphical terminal) to function properly, {{ic|unicode.pf2}} font file should exist in {{ic|${GRUB_PREFIX_DIR<nowiki>}</nowiki>}}.<br />
<br />
=== msdos-style error message ===<br />
<br />
grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding won't be possible!<br />
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.<br />
However, blocklists are UNRELIABLE and its use is discouraged.<br />
grub-setup: error: If you really want blocklists, use --force.<br />
<br />
This error may occur when you try installing GRUB in a VMware container. Read more about it [https://bbs.archlinux.org/viewtopic.php?pid=581760#p581760 here]. It happens when the first partition starts just after the MBR (block 63), without the usual space of 1 MiB (2048 blocks) before the first partition. Read [[#Master Boot Record (MBR) specific instructions]]<br />
<br />
=== GRUB UEFI drops to shell ===<br />
<br />
If GRUB loads but drops you into the rescue shell with no errors, it may be because of a missing or misplaced {{ic|grub.cfg}}. This will happen if GRUB UEFI was installed with {{ic|--boot-directory}} and {{ic|grub.cfg}} is missing OR if the partition number of the boot partition changed (which is hard-coded into the {{ic|grubx64.efi}} file).<br />
<br />
=== GRUB UEFI not loaded ===<br />
<br />
An example of a working EFI:<br />
{{hc|# efibootmgr -v|<br />
BootCurrent: 0000<br />
Timeout: 3 seconds<br />
BootOrder: 0000,0001,0002<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\efi\grub\grub.efi)<br />
Boot0001* Shell HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\EfiShell.efi)<br />
Boot0002* Festplatte BIOS(2,0,00)P0: SAMSUNG HD204UI<br />
}}<br />
<br />
If the screen only goes black for a second and the next boot option is tried afterwards, according to [https://bbs.archlinux.org/viewtopic.php?pid=981560#p981560 this post], moving GRUB to the partition root can help. The boot option has to be deleted and recreated afterwards. The entry for GRUB should look like this then:<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\grub.efi)<br />
<br />
=== Invalid signature ===<br />
<br />
If trying to boot Windows results in an "invalid signature" error, e.g. after reconfiguring partitions or adding additional hard drives, (re)move GRUB's device configuration and let it reconfigure:<br />
# mv /boot/grub/device.map /boot/grub/device.map-old<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
{{ic|grub-mkconfig}} should now mention all found boot options, including Windows. If it works, remove {{ic|/boot/grub/device.map-old}}.<br />
<br />
=== Boot freezes ===<br />
<br />
If booting gets stuck without any error message after GRUB loading the kernel and the initial ramdisk, try removing the {{ic|add_efi_memmap}} kernel parameter.<br />
<br />
=== Restore GRUB Legacy ===<br />
<br />
* Move GRUB v2 files out of the way:<br />
<br />
# mv /boot/grub /boot/grub.nonfunctional<br />
<br />
* Copy GRUB Legacy back to {{ic|/boot}}:<br />
<br />
# cp -af /boot/grub-legacy /boot/grub<br />
<br />
* Replace MBR and next 62 sectors of sda with backed up copy<br />
<br />
{{Warning|This command also restores the partition table, so be careful of overwriting a modified partition table with the old one. It '''will''' mess up your system.}}<br />
<br />
# dd if=/path/to/backup/first-sectors of=/dev/sdX bs=512 count=1<br />
<br />
A safer way is to restore only the MBR boot code use:<br />
<br />
# dd if=/path/to/backup/mbr-boot-code of=/dev/sdX bs=446 count=1<br />
<br />
=== Arch not found from other OS ===<br />
Some have reported that other distributions have trouble finding Arch Linux automatically with os-prober. If this problem arises, it has been reported that detection can be improved with the presence of /etc/lsb-release. This file and updating tool is available with the package {{ic|lsb-release}} in the [[community]] repository.<br />
<br />
== References ==<br />
<br />
# Official GRUB Manual - https://www.gnu.org/software/grub/manual/grub.html<br />
# Ubuntu wiki page for GRUB - https://help.ubuntu.com/community/Grub2<br />
# GRUB wiki page describing steps to compile for UEFI systems - https://help.ubuntu.com/community/UEFIBooting<br />
# Wikipedia's page on [[Wikipedia:BIOS Boot partition|BIOS Boot partition]]<br />
<br />
== See also ==<br />
<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_bios.sh A Linux Bash Shell script to compile and install GRUB for BIOS from BZR Source]<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_uefi.sh A Linux Bash Shell script to compile and install GRUB for UEFI from BZR Source]</div>Cinellihttps://wiki.archlinux.org/index.php?title=GRUB&diff=264368GRUB2013-06-26T16:59:49Z<p>Cinelli: /* Generate core.img alone */</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[ar:GRUB]]<br />
[[cs:GRUB2]]<br />
[[de:GRUB]]<br />
[[es:GRUB2]]<br />
[[fr:GRUB2]]<br />
[[id:GRUB2]]<br />
[[it:GRUB2]]<br />
[[ru:GRUB2]]<br />
[[tr:GRUB2]]<br />
[[zh-CN:GRUB2]]<br />
[[zh-TW:GRUB2]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers various aspects of version 2 of the GRand Unified Bootloader (GRUB).}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|BURG}} - BURG is a brand-new boot loader based on GRUB v2. It can be built on a wider range of OS, and has a highly configurable menu system which works in both text and graphic mode. <br />
{{Article summary wiki|GRUB Legacy}} - previous Version, now obsolete.<br />
{{Article summary heading|Resources}}<br />
{{Article summary wiki|GRUB EFI Examples}}<br />
{{Article summary link|GNU GRUB - GNU Project|https://www.gnu.org/software/grub/}}<br />
{{Article summary end}}<br />
<br />
[https://www.gnu.org/software/grub/ GRUB] - not to be confused with [[GRUB Legacy]] - is the next generation of the GRand Unified Bootloader. GRUB is derived from [http://www.nongnu.org/pupa/ PUPA] which was a research project to develop the next generation of what is now GRUB Legacy. GRUB has been rewritten from scratch to clean up everything and provide modularity and portability [https://www.gnu.org/software/grub/grub-faq.html#q1].<br />
<br />
In brief, the ''bootloader'' is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the Linux kernel. The kernel, in turn, initializes the rest of the operating system.<br />
<br />
== Preface ==<br />
<br />
* The name ''GRUB'' officially refers to version ''2'' of the software, see [https://www.gnu.org/software/grub/]. If you are looking for the article on the legacy version, see [[GRUB Legacy]].<br />
* GRUB supports [[Btrfs]] as root (without a separate {{ic|/boot}} filesystem) compressed with either zlib or LZO<br />
<br />
=== Notes for current GRUB Legacy users ===<br />
<br />
* Upgrading from [[GRUB Legacy]] to GRUB is much the same as freshly installing GRUB, which is covered [[#Installation|below]]<br />
* There are differences in the commands of GRUB Legacy and GRUB. Familiarize yourself with [https://www.gnu.org/software/grub/manual/grub.html#Commands GRUB commands] before proceeding (e.g. "find" has been replaced with "search")<br />
* GRUB is now ''modular'' and no longer requires "stage 1.5". As a result, the bootloader itself is limited -- modules are loaded from the hard drive as needed to expand functionality (e.g. for [[LVM]] or RAID support)<br />
* Device naming has changed between GRUB Legacy and GRUB. Partitions are numbered from 1 instead of 0 while drives are still numbered from 0, and prefixed with partition-table type. For example, {{ic|/dev/sda1}} would be referred to as {{ic|(hd0,msdos1)}} (for MBR) or {{ic|(hd0,gpt1)}} (for GPT)<br />
* If you use systemd without systemd-sysvcompat, and have had {{ic|<nowiki>init=/usr/lib/systemd/systemd</nowiki>}} in your old grub menu.lst, the automatically generated grub.cfg file might not carry over this kernel parameter (giving you "ERROT: Root device mounted successfully, but /sbin/init does not exist" on boot). If so, edit the Arch Linux entry that grub shows you, add {{ic|<nowiki>init=/usr/lib/systemd/systemd</nowiki>}} to the kernel parameters, and then [[Grub#Additional_arguments|make it permanent]].<br />
* GRUB is noticably bigger than GRUB legacy (occupies ~13 MB in /boot). If you are booting from a separate /boot partition, and this partition is smaller than 32 MB, you will run into disk space issues, and pacman will refuse to install new kernels. If you don't want to re-partition your system, switch to [[Syslinux]] instead, which is smaller (occupies ~1.5 MB in /boot).<br />
<br />
==== Backup important data ====<br />
<br />
Although a GRUB installation should run smoothly, it is strongly recommended to keep the GRUB Legacy files before upgrading to GRUB v2.<br />
<br />
# mv /boot/grub /boot/grub-legacy<br />
<br />
Backup the MBR which contains the boot code and partition table (Replace {{ic|/dev/sd'''X'''}} with your actual disk path):<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/mbr_backup bs=512 count=1<br />
<br />
Only 446 bytes of the MBR contain boot code, the next 64 contain the partition table. If you do not want to overwrite your partition table when restoring, it is strongly advised to backup only the MBR boot code:<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/bootcode_backup bs=446 count=1<br />
<br />
If unable to install GRUB2 correctly, see [[#Restore GRUB Legacy]].<br />
<br />
=== Preliminary requirements ===<br />
<br />
==== BIOS systems ====<br />
<br />
===== GUID Partition Table (GPT) specific instructions =====<br />
<br />
GRUB in [[GPT|BIOS-GPT]] configuration requires a [http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html BIOS boot partition] to embed its {{ic|core.img}} in the absence of post-MBR gap in GPT partitioned systems (which is taken over by the GPT Primary Header and Primary Partition table). This partition is used by GRUB only in BIOS-GPT setups. No such partition type exists in case of MBR partitioning (at least not for GRUB). This partition is also not required if the system is UEFI based, as no embedding of bootsectors takes place in that case.<br />
<br />
For a BIOS-GPT configuration, create a 1007 KiB partition at the beginning of the disk using gdisk, cgdisk or GNU Parted with no filesystem. The size of 1007 KiB will allow for the following partition to be correctly alligned at 1024 KiB. If needed, the partition can also be located somewhere else on the disk, but it should be within the first 2 TiB region. Set the partition type to {{ic|ef02}} in (c)gdisk or {{ic|set <BOOT_PART_NUM> bios_grub on}} in GNU Parted.<br />
<br />
{{Note|<br />
* This partition should be created before {{ic|grub-install}} or {{ic|grub-setup}} is run<br />
* gdisk will only allow you to create this partition on the position which will waste the least amount of space (sector 34-2047) if you create it last, after all the other partitions. This is because gdisk will auto-align partitions to 2048-sector boundaries if possible<br />
}}<br />
<br />
===== Master Boot Record (MBR) specific instructions =====<br />
<br />
Usually the post-[[MBR]] gap (after the 512 byte MBR region and before the start of the 1st partition) in many MBR (or msdos disklabel) partitioned systems is 31 KiB when DOS compatibility cylinder alignment issues are satisfied in the partition table. However a post-MBR gap of about 1 to 2 MiB is recommended to provide sufficient room for embedding GRUB's {{ic|core.img}} ({{bug|24103}}). It is advisable to use a partitioner which supports 1 MiB partition alignment to obtain this space as well as satisfy other non-512 byte sector issues (which are unrelated to embedding of {{ic|core.img}}).<br />
<br />
==== UEFI systems ====<br />
<br />
{{Note|It is recommended to read and understand the [[Unified Extensible Firmware Interface|UEFI]], [[GUID Partition Table|GPT]] and [[UEFI Bootloaders]] pages.}}<br />
<br />
===== Create and Mount the UEFI System Partition =====<br />
<br />
Follow [[Unified Extensible Firmware Interface#EFI System Partition]] for instructions on creating a UEFI System Partition. Then mount the UEFI System Partition at {{ic|/boot/efi}}. If you have mounted the UEFI System Partition at some other mountpoint, replace {{ic|/boot/efi}} in the below instructions with that mountpoint:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat <UEFI_SYSTEM_PARTITION> /boot/efi<br />
<br />
Create a {{ic|/boot/efi/EFI}} directory:<br />
<br />
# mkdir /boot/efi/EFI<br />
<br />
== Installation ==<br />
<br />
=== BIOS systems ===<br />
<br />
GRUB can be [[pacman|installed]] with the {{Pkg|grub}} package from the [[official repositories]]. It will replace {{Pkg|grub-legacy}} , if it is installed.<br />
<br />
{{Note|Simply installing the package won't update the {{ic|/boot/grub/i386-pc/core.img}} file and the GRUB modules in {{ic|/boot/grub/i386-pc}}. You need to update them manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install boot files ====<br />
<br />
There are 3 ways to install GRUB boot files in BIOS booting:<br />
* [[#Install to GPT BIOS boot partition]] (recommended with [[GPT]])<br />
* [[#Install to 440-byte MBR boot code region]] (recommended with [[MBR]])<br />
* [[#Install to partition or partitionless disk]] (not recommended)<br />
* [[#Generate core.img alone]] (safest method, but requires another BIOS bootloader like [[GRUB Legacy]] or [[Syslinux]] to be installed to chainload {{ic|/boot/grub/i386-pc/core.img}})<br />
<br />
{{Note|See http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html for additional documentation.}}<br />
<br />
===== Install to GPT BIOS boot partition =====<br />
<br />
[[GUID Partition Table]] disks do not have a reserved "boot track". Therefore you must create a BIOS Boot Partition ({{ic|ef02}}) to hold the GRUB core image.<br />
<br />
Using GNU Parted, you can set this using a command such as the following:<br />
<br />
# parted /dev/disk set <partition-number> bios_grub on<br />
<br />
If you are using gdisk, set the partition type to {{ic|ef02}}. With partitioning programs that require setting the GUID directly, it should be {{ic|‘21686148-6449-6e6f-744e656564454649’}} (or, {{ic|[[wikipedia:BIOS_Boot_partition|Hah!IdontNeedEFI]]}}).<br />
<br />
{{Warning|Be very careful which partition you select when marking it as a BIOS Boot Partition. When GRUB finds a BIOS Boot Partition during installation, it will automatically overwrite part of it. Make sure that the partition does not contain any other data.}}<br />
<br />
To setup {{ic|grub}} on a GPT disk, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, and embed it in the BIOS Boot Partition, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --recheck --debug /dev/sda<br />
<br />
where {{ic|/dev/sda}} is the destination of the installation.<br />
<br />
Continue with [[GRUB#Generate config file]] below.<br />
<br />
===== Install to 440-byte MBR boot code region =====<br />
<br />
To setup {{ic|grub}} in the 440-byte Master Boot Record boot code region, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, embed it in the 31 KiB (minimum size - varies depending on partition alignment) post-MBR gap, and generate the configuration file, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --recheck /dev/sdX<br />
<br />
where {{ic|/dev/sdX}} is the destination of the installation (in this case the MBR of the first SATA disk). If you use [[LVM]] for your {{ic|/boot}}, you can install GRUB on multiple physical disks.<br />
<br />
{{Warning|Make sure to check the {{ic|/boot}} directory if you use the latter. Sometimes the {{ic|boot-directory}} parameter creates another {{ic|/boot}} folder inside of {{ic|/boot}}. A wrong install would look like: {{ic|/boot/boot/grub/}}.}}<br />
<br />
Continue with [[GRUB#Generate config file]] below.<br />
<br />
===== Install to partition or partitionless disk =====<br />
<br />
{{Note|GRUB does not encourage installation to a partition boot sector or a partitionless disk like GRUB Legacy or Syslinux does. This kind of setup is prone to breakage, especially during updates, and is not supported by Arch devs.}}<br />
<br />
To set up grub to a partition boot sector, to a partitionless disk (also called superfloppy) or to a floppy disk, run (using for example {{ic|/dev/sdaX}} as the {{ic|/boot}} partition):<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=i386-pc --recheck --debug --force /dev/sdaX<br />
# chattr -i /boot/grub/i386-pc/core.img<br />
# chattr +i /boot/grub/i386-pc/core.img<br />
<br />
You need to use the {{ic|--force}} option to allow usage of blocklists and should not use {{ic|1=--grub-setup=/bin/true}} (which is similar to simply generating {{ic|core.img}}).<br />
<br />
{{ic|grub-install}} will give out warnings like which should give you the idea of what might go wrong with this approach:<br />
<br />
/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.<br />
/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. <br />
However, blocklists are UNRELIABLE and their use is discouraged.<br />
<br />
Without {{ic|--force}} you may get the below error and {{ic|grub-setup}} will not setup its boot code in the partition boot sector:<br />
<br />
/sbin/grub-setup: error: will not proceed with blocklists<br />
<br />
With {{ic|--force}} you should get:<br />
<br />
Installation finished. No error reported.<br />
<br />
The reason why {{ic|grub-setup}} does not by default allow this is because in case of partition or a partitionless disk is that {{ic|grub}} relies on embedded blocklists in the partition bootsector to locate the {{ic|/boot/grub/i386-pc/core.img}} file and the prefix dir {{ic|/boot/grub}}. The sector locations of {{ic|core.img}} may change whenever the filesystem in the partition is being altered (files copied, deleted etc.). For more info see https://bugzilla.redhat.com/show_bug.cgi?id=728742 and https://bugzilla.redhat.com/show_bug.cgi?id=730915.<br />
<br />
The workaround for this is to set the immutable flag on {{ic|/boot/grub/i386-pc/core.img}} (using chattr command as mentioned above) so that the sector locations of the {{ic|core.img}} file in the disk is not altered. The immutable flag on {{ic|/boot/grub/i386-pc/core.img}} needs to be set only if {{ic|grub}} is installed to a partition boot sector or a partitionless disk, not in case of installation to MBR or simple generation of {{ic|core.img}} without embedding any bootsector (mentioned above).<br />
<br />
===== Generate core.img alone =====<br />
<br />
To populate the {{ic|/boot/grub}} directory and generate a {{ic|/boot/grub/i386-pc/core.img}} file '''without''' embedding any {{ic|grub}} bootsector code in the MBR, post-MBR region, or the partition bootsector, add {{ic|1=--grub-setup=/bin/true}} to {{ic|grub-install}}:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --grub-setup=/bin/true --recheck --debug /dev/sda<br />
<br />
You can then chainload GRUB's {{ic|core.img}} from GRUB Legacy or syslinux as a Linux kernel or a multiboot kernel.<br />
<br />
==== Generate config file ====<br />
<br />
Finally, generate a configuration for GRUB (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|/boot/grub/grub.cfg}}, NOT {{ic|/boot/grub/i386-pc/grub.cfg}}.}}<br />
<br />
If GRUB complains about "no suitable mode found" while booting, go to [[#"No suitable mode found" error]].<br />
<br />
If {{ic|grub-mkconfig}} fails, convert your {{ic|/boot/grub/menu.lst}} file to {{ic|/boot/grub/grub.cfg}} using:<br />
<br />
# grub-menulst2cfg /boot/grub/menu.lst /boot/grub/grub.cfg<br />
<br />
For example:<br />
<br />
{{hc|/boot/grub/menu.lst|<nowiki><br />
default=0<br />
timeout=5<br />
<br />
title Arch Linux Stock Kernel<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux.img<br />
<br />
title Arch Linux Stock Kernel Fallback<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux-fallback.img<br />
</nowiki>}}<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
set default='0'; if [ x"$default" = xsaved ]; then load_env; set default="$saved_entry"; fi<br />
set timeout=5<br />
<br />
menuentry 'Arch Linux Stock Kernel' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux.img' '/initramfs-linux.img'<br />
<br />
}<br />
<br />
menuentry 'Arch Linux Stock Kernel Fallback' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux-fallback.img' '/initramfs-linux-fallback.img'<br />
}<br />
</nowiki>}}<br />
<br />
If you forgot to create a GRUB {{ic|/boot/grub/grub.cfg}} config file and simply rebooted into GRUB Command Shell, type:<br />
<br />
sh:grub> insmod legacycfg<br />
sh:grub> legacy_configfile ${prefix}/menu.lst<br />
<br />
Boot into Arch and re-create the proper GRUB {{ic|/boot/grub/grub.cfg}} config file.<br />
<br />
{{Note|This option works only in BIOS systems, not in UEFI systems.}}<br />
<br />
==== Multiboot ====<br />
This should work out of the box, but an extra utility needs to be installed: os-prober. Install it, then rerun grub-mkconfig -o /boot/grub/grub.cfg. If this fails, you can try manually adding an entry by following the instructions below.<br />
<br />
===== Microsoft Windows installed in BIOS-MBR mode =====<br />
<br />
{{Note|GRUB supports booting {{ic|bootmgr}} directly and chainload of partition boot sector is no longer required to boot Windows in a BIOS-MBR setup.}}<br />
<br />
{{Warning|It is the '''system partition''' that has {{ic|bootmgr}}, not your "real" Windows partition (usually C:). When showing all UUIDs with blkid, the system partition is the one with {{ic|LABEL&#61;"SYSTEM RESERVED"}} and is only about 100 MB in size (much like the boot partition for Arch). See [[Wikipedia:System partition and boot partition]] for more info.}}<br />
<br />
Throughout this section, it is assumed your Windows partition is /dev/sda1. A different partition will change every instance of hd0,msdos1. First, find the UUID of the NTFS filesystem of the Windows's SYSTEM PARTITION where the {{ic|bootmgr}} and its files reside. For example, if Windows {{ic|bootmgr}} exists at {{ic|/media/SYSTEM_RESERVED/bootmgr}}:<br />
<br />
For Windows Vista/7/8:<br />
<br />
# grub-probe --target=fs_uuid /media/SYSTEM_RESERVED/bootmgr<br />
69B235F6749E84CE<br />
<br />
# grub-probe --target=hints_string /media/SYSTEM_RESERVED/bootmgr<br />
--hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1<br />
<br />
{{Note|For Windows XP, replace {{ic|bootmgr}} with {{ic|NTLDR}} in the above commands. And note that there may not be a separate SYSTEM_RESERVED partition; just probe the file NTLDR on your Windows partition.}}<br />
<br />
Then, add the below code to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} and regenerate {{ic|grub.cfg}} with {{ic|grub-mkconfig}} as explained above to boot Windows (XP, Vista, 7 or 8) installed in BIOS-MBR mode:<br />
<br />
For Windows Vista/7/8:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 BIOS-MBR" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /bootmgr<br />
}<br />
<br />
For Windows XP:<br />
<br />
menuentry "Microsoft Windows XP" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /ntldr<br />
}<br />
<br />
{{ic|/etc/grub.d/40_custom}} can be used as a template to create {{ic|/etc/grub.d/nn_custom}}. Where {{ic|nn}} defines the precendence, indicating the order the script is executed. The order scripts are executed determine the placement in the grub boot menu.<br />
<br />
{{Note|{{ic|nn}} should be greater than 06 to ensure necessary scripts are executed first.}}<br />
<br />
=== UEFI systems ===<br />
<br />
{{Note|It is well know that different motherboard manufactures implement UEFI differently. Users experiencing problems getting Grub/EFI to work properly are encouraged to share detailed steps for hardware-specific cases where UEFI booting does not work as described below. In an effort to keep the parent [[GRUB]] article neat and tidy, see the [[GRUB EFI Examples]] page for these special cases.}}<br />
<br />
First install the {{Pkg|grub}} package and then follow the instructions below.<br />
<br />
{{Note|Simply installing the package will not update the {{ic|core.efi}} file and the GRUB modules in the UEFI System Partition. You need to do this manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install boot files ====<br />
<br />
===== Install to UEFI system partition =====<br />
<br />
{{Note|<br />
* The below commands assume you are using installing GRUB for {{ic|x86_64-efi}} (for {{ic|IA32-efi}} replace {{ic|x86_64}} with {{ic|i386}} in the below commands)<br />
* To do this, you need to boot using UEFI and not the BIOS. If you booted by just copying the ISO file to the USB drive, you will need to follow [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO|this guide]] or grub-install will show errors<br />
}}<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Install GRUB UEFI application to {{ic|/boot/efi/EFI/arch_grub}} and its modules to {{ic|/boot/grub/x86_64-efi}} (recommended) using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
{{Note|Without {{ic|--target}} or {{ic|--directory}} option, grub-install cannot determine for which firmware GRUB is being installed. In such cases {{ic|grub-install}} will show {{ic|source_dir doesn't exist. Please specify --target or --directory}} message.}}<br />
<br />
If you want to install GRUB modules and {{ic|grub.cfg}} at the directory {{ic|/boot/efi/EFI/grub}} and the {{ic|grubx64.efi}} application at {{ic|/boot/efi/EFI/arch_grub}} (ie. all the GRUB UEFI files inside the UEFISYS partition itself) use:<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug<br />
# mkdir -p /boot/efi/EFI/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/efi/EFI/grub/locale/en.mo<br />
<br />
The {{ic|--efi-directory}} option mentions the mountpoint of UEFI SYSTEM PARTITION , {{ic|--bootloader-id}} mentions the name of the directory used to store the {{ic|grubx64.efi}} file and {{ic|--boot-directory}} mentions the directory wherein the actual modules will be installed (and into which {{ic|grub.cfg}} should be created).<br />
<br />
The actual paths are:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi<br />
<br />
<boot-directory>/grub/x86_64-efi/<all modules, grub.efi, core.efi, grub.cfg><br />
<br />
{{Note|the {{ic|--bootloader-id}} option does not change {{ic|<boot-directory>/grub}}, i.e. you cannot install the modules to {{ic|<boot-directory>/<bootloader-id>}}, the path is hard-coded to be {{ic|<boot-directory>/grub}}.}}<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == <boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
The {{ic|<nowiki><efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi</nowiki>}} is an exact copy of {{ic|<nowiki><boot-directory>/grub/x86_64-efi/core.efi</nowiki>}}.<br />
<br />
{{Note|<br />
* In GRUB 2.00, the {{ic|grub-install}} option {{ic|--efi-directory}} replaces {{ic|--root-directory}} and the latter is deprecated<br />
* The options {{ic|--efi-directory}} and {{ic|--bootloader-id}} are specific to GRUB UEFI<br />
}}<br />
<br />
In all the cases the UEFI SYSTEM PARTITION should be mounted for {{ic|grub-install}} to install {{ic|grubx64.efi}} in it, which will be launched by the firmware (using the {{ic|efibootmgr}} created boot entry in non-Mac systems).<br />
<br />
If you notice carefully, there is no <device_path> option (Eg: {{ic|/dev/sda}}) at the end of the {{ic|grub-install}} command unlike the case of setting up GRUB for BIOS systems. Any <device_path> provided will be ignored by the install script as UEFI bootloaders do not use MBR or Partition boot sectors at all.<br />
<br />
You may now be able to UEFI boot your system by creating a {{ic|grub.cfg}} file by following [[#Generate UEFI Config file]] and [[#Create GRUB entry in the Firmware Boot Manager]].<br />
<br />
==== Generate config file ====<br />
<br />
Finally, generate a configuration for GRUB (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o <boot-directory>/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|<boot-directory>/grub/grub.cfg}}, NOT {{ic|<boot-directory>/grub/x86_64-efi/grub.cfg}}.}}<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot/efi/EFI</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
<br />
This is independent of the value of {{ic|--bootloader-id}} option.<br />
<br />
If GRUB complains about "no suitable mode found" while booting, try [[#"No suitable mode found" error]].<br />
<br />
==== Create GRUB entry in the firmware boot manager ====<br />
<br />
{{ic|grub-install}} automatically tries to create a menu entry in the boot manager. If it doesn't, then see [[Beginners' Guide#GRUB]] for instructions to use {{ic|efibootmgr}} to create a menu entry. However, the problem is likely to be that you haven't booted your CD/USB in UEFI mode, as in [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]].<br />
<br />
==== Create GRUB standalone UEFI application ====<br />
<br />
It is possible to create a {{ic|grubx64_standalone.efi}} application which has all the modules embeddded in a memdisk within the UEFI application, thus removing the need for having a separate directory populated with all the GRUB UEFI modules and other related files. This is done using the {{ic|grub-mkstandalone}} command which is included in {{Pkg|grub}}.<br />
<br />
The easiest way to do this would be with the install command already mentioned before, but specifying the modules to include. For example:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" <any extra files you want to include><br />
<br />
The {{ic|grubx64_standalone.efi}} file expects {{ic|grub.cfg}} to be within its $prefix which is {{ic|(memdisk)/boot/grub}}. The memdisk is embedded within the efi app. The {{ic|grub-mkstandlone}} script allow passing files to be included in the memdisk image to be as the arguments to the script (in <any extra files you want to include>).<br />
<br />
If you have the {{ic|grub.cfg}} at {{ic|/home/user/Desktop/grub.cfg}}, then create a temporary {{ic|/home/user/Desktop/boot/grub/}} directory, copy the {{ic|/home/user/Desktop/grub.cfg}} to {{ic|/home/user/Desktop/boot/grub/grub.cfg}}, cd into {{ic|/home/user/Desktop/boot/grub/}} and run:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" "boot/grub/grub.cfg"<br />
<br />
The reason to cd into {{ic|/home/user/Desktop/boot/grub/}} and to pass the file path as {{ic|boot/grub/grub.cfg}} (notice the lack of a leading slash - boot/ vs /boot/ ) is because {{ic|dir1/dir2/file}} is included as {{ic|(memdisk)/dir1/dir2/file}} by the {{ic|grub-mkstandalone}} script. <br />
<br />
If you pass {{ic|/home/user/Desktop/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/grub.cfg}}. If you pass {{ic|/home/user/Desktop/boot/grub/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/boot/grub/grub.cfg}}. That is the reason for cd'ing into {{ic|/home/user/Desktop/boot/grub/}} and passing {{ic|boot/grub/grub.cfg}}, to include the file as {{ic|(memdisk)/boot/grub/grub.cfg}}, which is what {{ic|grub.efi}} expects the file to be.<br />
<br />
You need to create an UEFI Boot Manager entry for {{ic|/boot/efi/EFI/arch_grub/grubx64_standalone.efi}} using {{ic|efibootmgr}}. Follow [[#Create GRUB entry in the Firmware Boot Manager]].<br />
<br />
==== Multiboot ====<br />
<br />
===== Microsoft Windows installed in UEFI-GPT mode =====<br />
<br />
Find the UUID of the FAT32 filesystem in the UEFI SYSTEM PARTITION where the Windows UEFI Bootloader files reside. For example, if Windows {{ic|bootmgfw.efi}} exists at {{ic|/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi}} (ignore the upper-lower case differences since that is immaterial in FAT filesystem):<br />
<br />
# grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
1ce5-7f28<br />
<br />
# grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
--hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1<br />
<br />
Then, add this code to {{ic|/etc/grub.d/40_custom}} to chainload Windows x86_64 (Vista SP1+, 7 or 8) installed in UEFI-GPT mode:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 x86_64 UEFI-GPT" {<br />
insmod part_gpt<br />
insmod fat<br />
insmod search_fs_uuid<br />
insmod chain<br />
search --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 1ce5-7f28<br />
chainloader /efi/Microsoft/Boot/bootmgfw.efi<br />
}<br />
<br />
Afterwards remake {{ic|/boot/grub/grub.cfg}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
== Configuration ==<br />
<br />
You can also choose to automatically generate or manually edit {{ic|grub.cfg}}.<br />
<br />
{{Note|<br />
* For EFI systems, if GRUB was installed with the {{ic|--boot-directory}} option set, the {{ic|grub.cfg}} file must be placed in the same directory as {{ic|grubx64.efi}}. Otherwise, the {{ic|grub.cfg}} file goes in {{ic|/boot/grub/}}, just like in GRUB BIOS<br />
* [http://members.iinet.net/~herman546/p20/GRUB2%20Configuration%20File%20Commands.html Here] is a quite complete description of how to configure GRUB<br />
}}<br />
<br />
=== Automatically generating using grub-mkconfig ===<br />
<br />
The GRUB {{ic|menu.lst}} equivalent configuration files are {{ic|/etc/default/grub}} and {{ic|/etc/grub.d/*}}. {{ic|grub-mkconfig}} uses these files to generate {{ic|grub.cfg}}. By default the script outputs to stdout. To generate a {{ic|grub.cfg}} file run the command:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{ic|/etc/grub.d/10_linux}} is set to automatically add menu items for Arch linux that work out of the box, to any generated configuration. Other operating systems may need to be added manually to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}<br />
<br />
==== Additional arguments ====<br />
<br />
To pass custom additional arguments to the Linux image, you can set the {{ic|GRUB_CMDLINE_LINUX}} variable in {{ic|/etc/default/grub}}. <br />
<br />
For example, use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX"</nowiki>}} where {{ic|sda'''X'''}} is your swap partition to enable resume after hibernation.<br />
<br />
You can also use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/disk/by-uuid/${swap_uuid}"</nowiki>}}, where {{ic|${swap_uuid} }} is the [[Persistent_block_device_naming|UUID]] of your swap partition.<br />
<br />
Multiple entries are separated by spaces within the double quotes. So, for users who want both resume and systemd it would look like this:<br />
{{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX init=/usr/lib/systemd/systemd"</nowiki>}}<br />
<br />
See [[Kernel parameters]] for more info.<br />
<br />
=== Manually creating grub.cfg ===<br />
<br />
{{Warning|Editing this file is strongly ''not'' recommended. The file is generated by the {{ic|grub-mkconfig}} command, and it is best to edit your {{ic|/etc/default/grub}} or one of the scripts in the {{ic|/etc/grub.d}} folder.}}<br />
<br />
A basic GRUB config file uses the following options:<br />
* {{ic|(hdX,Y)}} is the partition {{ic|Y}} on disk {{ic|X}}, partition numbers starting at 1, disk numbers starting at 0<br />
* {{ic|1=set default=N}} is the default boot entry that is chosen after timeout for user action<br />
* {{ic|1=set timeout=M}} is the time {{ic|M}} to wait in seconds for a user selection before default is booted<br />
* {{ic|<nowiki>menuentry "title" {entry options}</nowiki>}} is a boot entry titled {{ic|title}}<br />
* {{ic|1=set root=(hdX,Y)}} sets the boot partition, where the kernel and GRUB modules are stored (boot need not be a separate partition, and may simply be a directory under the "root" partition ({{ic|/}})<br />
<br />
An example configuration:<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
# Config file for GRUB - The GNU GRand Unified Bootloader<br />
# /boot/grub/grub.cfg<br />
<br />
# DEVICE NAME CONVERSIONS<br />
#<br />
# Linux Grub<br />
# -------------------------<br />
# /dev/fd0 (fd0)<br />
# /dev/sda (hd0)<br />
# /dev/sdb2 (hd1,2)<br />
# /dev/sda3 (hd0,3)<br />
#<br />
<br />
# Timeout for menu<br />
set timeout=5<br />
<br />
# Set default boot entry as Entry 0<br />
set default=0<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
set root=(hd0,1)<br />
linux /vmlinuz-linux root=/dev/sda3 ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
## (1) Windows<br />
#menuentry "Windows" {<br />
# set root=(hd0,3)<br />
# chainloader +1<br />
#}<br />
</nowiki>}}<br />
<br />
=== Dual-booting ===<br />
<br />
{{Note|If you want GRUB to automatically search for other systems, you may wish to install {{Pkg|os-prober}}.}}<br />
<br />
==== Using grub-mkconfig ====<br />
The best way to add other entries is editing the {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} . The entries in this file will be automatically added when running {{ic|grub-mkconfig}}.<br />
After adding the new lines, run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg <br />
to generate an updated {{ic|grub.cfg}}.<br />
<br />
===== With GNU/Linux =====<br />
<br />
Assuming that the other distro is on partition {{ic|sda2}}:<br />
<br />
menuentry "Other Linux" {<br />
set root=(hd0,2)<br />
linux /boot/vmlinuz (add other options here as required)<br />
initrd /boot/initrd.img (if the other kernel uses/needs one)<br />
}<br />
<br />
===== With FreeBSD =====<br />
<br />
Requires that FreeBSD is installed on a single partition with UFS. Assuming it is installed on {{ic|sda4}}:<br />
<br />
menuentry "FreeBSD" {<br />
set root=(hd0,4)<br />
chainloader +1<br />
}<br />
<br />
===== With Windows =====<br />
<br />
This assumes that your Windows partition is {{ic|sda3}}. Remember you need to point set root and chainloader to the system reserve partition that windows made when it installed, not the actual partition windows is on. This example works if your system reserve partition is {{ic|sda3}}.<br />
<br />
# (2) Windows XP<br />
menuentry "Windows XP" {<br />
set root="(hd0,3)"<br />
chainloader +1<br />
}<br />
<br />
If the Windows bootloader is on an entirely different hard drive than GRUB, it may be necessary to trick Windows into believing that it is the first hard drive. This was possible with {{ic|drivemap}}. Assuming GRUB is on {{ic|hd0}} and Windows is on {{ic|hd2}}, you need to add the following after {{ic|set root}}:<br />
<br />
drivemap -s hd0 hd2<br />
<br />
==== With Windows via EasyBCD and NeoGRUB ====<br />
<br />
Since EasyBCD's NeoGRUB currently does not understand the GRUB menu format, chainload to it by replacing the contents of your {{ic|C:\NST\menu.lst}} file with lines similar to the following:<br />
<br />
default 0<br />
timeout 1<br />
<br />
title Chainload into GRUB v2<br />
root (hd0,7)<br />
kernel /boot/grub/i386-pc/core.img<br />
<br />
=== Visual configuration ===<br />
<br />
In GRUB it is possible, by default, to change the look of the menu. Make sure to initialize, if not done already, GRUB graphical terminal, gfxterm, with proper video mode, gfxmode, in GRUB. This can be seen in the section [[#"No suitable mode found" error]]. This video mode is passed by GRUB to the linux kernel via 'gfxpayload' so any visual configurations need this mode in order to be in effect.<br />
<br />
==== Setting the framebuffer resolution ====<br />
<br />
GRUB can set the framebuffer for both GRUB itself and the kernel. The old {{ic|1=vga=}} way is deprecated. The preferred method is editing {{ic|/etc/default/grub}} as the following sample:<br />
<br />
GRUB_GFXMODE=1024x768x32<br />
GRUB_GFXPAYLOAD_LINUX=keep<br />
<br />
To generate the changes, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
The {{ic|gfxpayload}} property will make sure the kernel keeps the resolution.<br />
<br />
{{Note|<br />
* If this example does not work for you try to replace {{ic|1=gfxmode="1024x768x32"}} by {{ic|1=vbemode="0x105"}}. Remember to replace the specified resolution with one suitable for your screen<br />
* To show all the modes you can use {{ic|1=# hwinfo --framebuffer}} (hwinfo is available in [community]), while at GRUB prompt you can use the {{ic|1=vbeinfo}} command<br />
}}<br />
<br />
If this method does not work for you, the deprecated {{ic|1=vga=}} method will still work. Just<br />
add it next to the {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="}} line in {{ic|/etc/default/grub}}<br />
for eg: {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=792"}} will give you a {{ic|1024x768}} resolution.<br />
<br />
You can choose one of these resolutions: {{ic|640×480}}, {{ic|800×600}}, {{ic|1024×768}}, {{ic|1280×1024}}, {{ic|1600×1200}}, {{ic|1920×1200}}<br />
<br />
==== 915resolution hack ====<br />
<br />
Some times for Intel graphic adapters neither {{ic|1=# hwinfo --framebuffer}} nor {{ic|1=vbeinfo}} will show you the desired resolution. In this case you can use {{ic|915resolution}} hack. This hack will temporarily modify video BIOS and add needed resolution. See [http://915resolution.mango-lang.org/ 915resolution's home page]<br />
<br />
First you need to find a video mode which will be modified later. For that we need the GRUB command shell:<br />
{{hc|sh:grub> 915resolution -l|<br />
Intel 800/900 Series VBIOS Hack : version 0.5.3<br />
[...]<br />
'''Mode 30''' : 640x480, 8 bits/pixel<br />
[...]<br />
}}<br />
Next, we overwrite the {{ic|Mode 30}} with {{ic|1440x900}} resolution:<br />
{{hc|/etc/grub.d/00_header|<br />
[...]<br />
'''915resolution 30 1440 900 # Inserted line'''<br />
set gfxmode&#61;${GRUB_GFXMODE}<br />
[...]<br />
}}<br />
Lastly we need to set {{ic|GRUB_GFXMODE}} as described earlier, regenerate GRUB configuration file and reboot to test changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# reboot<br />
<br />
==== Background image and bitmap fonts ====<br />
<br />
GRUB comes with support for background images and bitmap fonts in {{ic|pf2}} format. The unifont font is included in the {{Pkg|grub}} package under the filename {{ic|unicode.pf2}}, or, as only ASCII characters under the name {{ic|ascii.pf2}}.<br />
<br />
Image formats supported include tga, png and jpeg, providing the correct modules are loaded. The maximum supported resolution depends on your hardware.<br />
<br />
Make sure you have set up the proper [[#Setting the framebuffer resolution|framebuffer resolution]].<br />
<br />
Edit {{ic|/etc/default/grub}} like this:<br />
GRUB_BACKGROUND="/boot/grub/myimage"<br />
#GRUB_THEME="/path/to/gfxtheme"<br />
GRUB_FONT="/path/to/font.pf2"<br />
<br />
{{Note|If you have installed GRUB on a separate partition, {{ic|/boot/grub/myimage}} becomes {{ic|/grub/myimage}}.}}<br />
<br />
To generate the changes and add the information into {{ic|grub.cfg}}, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If adding the splash image was successful, the user will see {{ic|"Found background image..."}} in the terminal as the command is executed. <br />
If this phrase is not seen, the image information was probably not incorporated into the {{ic|grub.cfg}} file.<br />
<br />
If the image is not displayed, check:<br />
* The path and the filename in {{ic|/etc/default/grub}} are correct<br />
* The image is of the proper size and format (tga, png, 8-bit jpg)<br />
* The image was saved in the RGB mode, and is not indexed<br />
* The console mode is not enabled in {{ic|/etc/default/grub}}<br />
* The command {{ic|grub-mkconfig}} must be executed to place the background image information into the {{ic|/boot/grub/grub.cfg}} file<br />
<br />
==== Theme ====<br />
<br />
Here is an example for configuring Starfield theme which was included in GRUB package.<br />
<br />
Edit {{ic|/etc/default/grub}}<br />
GRUB_THEME="/usr/share/grub/themes/starfield/theme.txt"<br />
<br />
Generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If configuring the theme was successful, you'll see {{ic|Found theme: /usr/share/grub/themes/starfield/theme.txt}} in the terminal.<br />
Your splash image will usually not be displayed when using a theme.<br />
<br />
==== Menu colors ====<br />
<br />
You can set the menu colors in GRUB. The available colors for GRUB can be found in [https://www.gnu.org/software/grub/manual/html_node/Theme-file-format.html the GRUB Manual].<br />
Here is an example:<br />
<br />
Edit {{ic|/etc/default/grub}}:<br />
GRUB_COLOR_NORMAL="light-blue/black"<br />
GRUB_COLOR_HIGHLIGHT="light-cyan/blue"<br />
<br />
Generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Hidden menu ====<br />
<br />
One of the unique features of GRUB is hiding/skipping the menu and showing it by holding {{keypress|Esc}} when needed. You can also adjust whether you want to see the timeout counter.<br />
<br />
Edit {{ic|/etc/default/grub}} as you wish. Here is an example where the comments from the beginning of the two lines have been removed to enable the feature, the timeout has been set to five seconds and to be shown to the user:<br />
GRUB_HIDDEN_TIMEOUT=5<br />
GRUB_HIDDEN_TIMEOUT_QUIET=false<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Disable framebuffer ====<br />
<br />
Users who use NVIDIA proprietary driver might wish to disable GRUB's framebuffer as it can cause problems with the binary driver.<br />
<br />
To disable framebuffer, edit {{ic|/etc/default/grub}} and uncomment the following line:<br />
GRUB_TERMINAL_OUTPUT=console<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
Another option if you want to keep the framebuffer in GRUB is to revert to text mode just before starting the kernel. To do that modify the variable in {{ic|/etc/default/grub}}:<br />
GRUB_GFXPAYLOAD_LINUX=text<br />
<br />
and rebuild the configuration as before.<br />
<br />
=== Other Options ===<br />
<br />
==== LVM ====<br />
<br />
If you use [[LVM]] for your {{ic|/boot}}, add the following before menuentry lines:<br />
<br />
insmod lvm<br />
<br />
and specify your root in the menuentry as:<br />
<br />
set root=lvm/''lvm_group_name''-''lvm_logical_boot_partition_name''<br />
<br />
Example:<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
insmod lvm<br />
set root=lvm/VolumeGroup-lv_boot<br />
# you can only set following two lines<br />
linux /vmlinuz-linux root=/dev/mapper/VolumeGroup-root ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
==== RAID ====<br />
<br />
GRUB provides convenient handling of RAID volumes. You need to add {{ic|insmod mdraid}} which allows you to address the volume natively. For example, {{ic|/dev/md0}} becomes:<br />
set root=(md0)<br />
<br />
whereas a partitioned RAID volume (e.g. {{ic|/dev/md0p1}}) becomes:<br />
set root=(md0,1)<br />
<br />
==== Persistent block device naming ====<br />
One naming scheme for [[Persistent block device naming]] is the use of globally unique UUIDs to detect partitions instead of the "old" {{ic|/dev/sd*}}. Advantages are covered up in the above linked article. <br />
<br />
Persistent naming via filesystem UUIDs are used by default in GRUB. <br />
<br />
{{Note|The {{ic|/boot/grub.cfg}} file needs regeneration with the new UUID in {{ic|/etc/default/grub}} every time a relevant filesystem is resized or recreated. Remember this when modifying partitions & filesystems with a Live-CD.}}<br />
<br />
Whether to use UUIDs is controlled by an option in {{ic|/etc/default/grub}}:<br />
<br />
# GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Either way, do not forget to generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Using Labels ====<br />
<br />
It is possible to use labels, human-readable strings attached to filesystems, by using the {{ic|--label}} option to {{ic|search}}. First of all, label your existing partition:<br />
# tune2fs -L <LABEL> <PARTITION><br />
<br />
Then, add an entry using labels. An example of this:<br />
<br />
menuentry "Arch Linux, session texte" {<br />
search --label --set=root archroot<br />
linux /boot/vmlinuz-linux root=/dev/disk/by-label/archroot ro<br />
initrd /boot/initramfs-linux.img<br />
}<br />
<br />
==== Recall previous entry ====<br />
<br />
GRUB can remember the last entry you booted from and use this as the default entry to boot from next time. This is useful if you have multiple kernels (i.e., the current Arch one and the LTS kernel as a fallback option) or operating systems. To do this, edit {{ic|/etc/default/grub}} and change the value of {{ic|GRUB_DEFAULT}}:<br />
<br />
GRUB_DEFAULT=saved<br />
<br />
This ensures that GRUB will default to the saved entry. To enable saving the selected entry, add the following line to {{ic|/etc/default/grub}}:<br />
<br />
GRUB_SAVEDEFAULT=true<br />
<br />
{{Note|Manually added menu items, e.g. Windows in {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}, will need {{ic|savedefault}} added. Remember to regenerate([[#Generate config file]]) your configuration file.}}<br />
<br />
==== Changing the default menu entry ====<br />
<br />
To change the default selected entry, edit {{ic|/etc/default/grub}} and change the value of {{ic|GRUB_DEFAULT}}:<br />
<br />
Using numbers :<br />
GRUB_DEFAULT=0<br />
Grub identifies entries in generated menu counted from zero. That means 0 for the first entry which is the default value, 1 for the second and so on.<br />
<br />
Or using menu titles :<br />
GRUB_DEFAULT='Arch Linux, with Linux core repo kernel'<br />
<br />
{{Note|Remember to regenerate([[#Generate config file]]) your configuration file.}}<br />
<br />
==== Security ====<br />
<br />
If you want to secure GRUB so it is not possible for anyone to change boot parameters or use the command line, you can add a user/password combination to GRUB's configuration files. To do this, run the command {{ic|grub-mkpasswd-pbkdf2}}. Enter a password and confirm it:<br />
<br />
{{hc|grub-mkpasswd-pbkdf2|<br />
[...]<br />
Your PBKDF2 is grub.pbkdf2.sha512.10000.C8ABD3E93C4DFC83138B0C7A3D719BC650E6234310DA069E6FDB0DD4156313DA3D0D9BFFC2846C21D5A2DDA515114CF6378F8A064C94198D0618E70D23717E82.509BFA8A4217EAD0B33C87432524C0B6B64B34FBAD22D3E6E6874D9B101996C5F98AB1746FE7C7199147ECF4ABD8661C222EEEDB7D14A843261FFF2C07B1269A<br />
}}<br />
Then, add the following to {{ic|/etc/grub.d/00_header}}:<br />
{{hc|/etc/grub.d/00_header|<br />
cat << EOF<br />
<br />
set superusers<nowiki>=</nowiki>"'''username'''"<br />
password_pbkdf2 '''username''' '''<password>'''<br />
<br />
EOF<br />
}}<br />
where {{ic|<password>}} is the string generated by {{ic|grub-mkpasswd_pbkdf2}}.<br />
<br />
Regenerate your configuration file. Your GRUB command line, boot parameters and all boot entries are now protected.<br />
<br />
This can be relaxed and further customized with more users as described in the "Security" part of [https://www.gnu.org/software/grub/manual/grub.html#Security the GRUB manual].<br />
<br />
==== Root encryption ====<br />
<br />
To let GRUB automatically add the kernel parameters for root encryption,<br />
add {{ic|1=cryptdevice=/dev/yourdevice:label}} to {{ic|GRUB_CMDLINE_LINUX}} in {{ic|/etc/default/grub}}.<br />
<br />
{{Tip|If you're upgrading from a working GRUB Legacy configuration, check {{ic|/boot/grub/menu.lst.pacsave}} for the correct device/label to add. Look for them after the text {{ic|kernel /vmlinuz-linux}}.}}<br />
<br />
Example with root mapped to {{ic|/dev/mapper/root}}:<br />
<br />
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:root"<br />
<br />
Also, disable the usage of UUIDs for the rootfs:<br />
<br />
GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Regenerate the configuration.<br />
<br />
==== Boot non-default entry only once ====<br />
<br />
The command {{ic|grub-reboot}} is very helpful to boot another entry than the default only once. GRUB loads the entry passed in the first command line argument, when the system is rebooted the next time. Most importantly GRUB returns to loading the default entry for all future booting. Changing the configuration file or selecting an entry in the GRUB menu is not necessary.<br />
{{Note|This requires {{ic|1=GRUB_DEFAULT=saved}} in {{ic|/etc/default/grub}} (and then regenerating {{ic|grub.cfg}}) or, in case of hand-made {{ic|grub.cfg}}, the line {{ic|1=set default="${saved_entry}"}}.}}<br />
<br />
=== Booting an ISO directly from GRUB ===<br />
<br />
Edit {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} to add an entry for the target ISO. When finished, update the GRUB menu as with the usual {{ic|grub-mkconfig -o /boot/grub/grub.cfg}} (as root).<br />
<br />
==== Arch ISO ====<br />
<br />
{{Note|The following examples assume the ISO is in {{ic|/archives}} on {{ic|hd0,6}}.}}<br />
{{Tip|For thumbdrives, use something like {{ic|(hd1,$partition)}} and either {{ic|/dev/sdb'''Y'''}} for the {{ic|img_dev}} parameter or [[Persistent_block_device_naming|a persistent name]], e.g. {{ic|img_dev&#61;/dev/disk/by-label/CORSAIR}}.}}<br />
<br />
===== x86_64 =====<br />
<br />
menuentry "Archlinux-2013.05.01-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.05.01-dual.iso"<br />
set partition="6"<br />
loopback loop (hd0,$partition)/$isofile<br />
linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201305 img_dev=/dev/sda$partition img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/x86_64/archiso.img<br />
}<br />
<br />
===== i686 =====<br />
<br />
menuentry "Archlinux-2013.05.01-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.05.01-dual.iso"<br />
set partition="6"<br />
loopback loop (hd0,$partition)/$isofile<br />
linux (loop)/arch/boot/i686/vmlinuz archisolabel=ARCH_201305 img_dev=/dev/sda$partition img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/i686/archiso.img<br />
}<br />
<br />
==== Ubuntu ISO ====<br />
<br />
{{Note|The example assumes that the iso is in {{ic|/archives}} on {{ic|hd0,6}}. Users must adjust the location and hdd/partition in the lines below to match their systems.}}<br />
<br />
menuentry "ubuntu-13.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-13.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)/$isofile<br />
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
menuentry "ubuntu-12.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-12.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)/$isofile<br />
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
==== Other ISOs ====<br />
<br />
Other working configurations from [http://askubuntu.com/questions/141940/how-to-boot-live-iso-images link Source].<br />
<br />
== Using the command shell ==<br />
<br />
Since the MBR is too small to store all GRUB modules, only the menu and a few basic commands reside there. The majority of GRUB functionality remains in modules in {{ic|/boot/grub}}, which are inserted as needed. In error conditions (e.g. if the partition layout changes) GRUB may fail to boot. When this happens, a command shell may appear.<br />
<br />
GRUB offers multiple shells/prompts. If there is a problem reading the menu but the bootloader is able to find the disk, you will likely be dropped to the "normal" shell:<br />
sh:grub><br />
<br />
If there is a more serious problem (e.g. GRUB cannot find required files), you may instead be dropped to the "rescue" shell:<br />
grub rescue><br />
<br />
The rescue shell is a restricted subset of the normal shell, offering much less functionality. If dumped to the rescue shell, first try inserting the "normal" module, then starting the "normal" shell:<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
grub rescue> insmod (hdX,Y)/boot/grub/i386-pc/normal.mod<br />
rescue:grub> normal<br />
<br />
=== Pager support ===<br />
<br />
GRUB supports pager for reading commands that provide long output (like the {{ic|help}} command). This works only in normal shell mode and not in rescue mode. To enable pager, in GRUB command shell type:<br />
sh:grub> set pager=1<br />
<br />
== GUI configuration tools ==<br />
<br />
Following package may be installed:<br />
* {{App|grub-customizer|Customize the bootloader (GRUB or BURG)|https://launchpad.net/grub-customizer|{{AUR|grub-customizer}}}}<br />
* {{App|grub2-editor|KDE4 control module for configuring the GRUB bootloader|http://kde-apps.org/content/show.php?content&#61;139643|{{AUR|grub2-editor}}}}<br />
* {{App|kcm-grub2|This Kcm module manages the most common settings of GRUB|http://kde-apps.org/content/show.php?content&#61;137886|{{AUR|kcm-grub2}}}}<br />
* {{App|startupmanager|GUI app for changing the settings of GRUB Legacy, GRUB, Usplash and Splashy|http://sourceforge.net/projects/startup-manager/|{{AUR|startupmanager}}}}<br />
<br />
== parttool for hide/unhide ==<br />
<br />
If you have a Windows 9x paradigm with hidden {{ic|C:\}} disks GRUB can hide/unhide it using {{ic|parttool}}. For example, to boot the third {{ic|C:\}} disk of three Windows 9x installations on the CLI enter the CLI and:<br />
parttool hd0,1 hidden+ boot-<br />
parttool hd0,2 hidden+ boot-<br />
parttool hd0,3 hidden- boot+<br />
set root=hd0,3<br />
chainloader +1<br />
boot<br />
<br />
== Using the rescue console ==<br />
<br />
See [[#Using the command shell]] first. If unable to activate the standard shell, one possible solution is to boot using a live CD or some other rescue disk to correct configuration errors and reinstall GRUB. However, such a boot disk is not always available (nor necessary); the rescue console is surprisingly robust.<br />
<br />
The available commands in GRUB rescue include {{ic|insmod}}, {{ic|ls}}, {{ic|set}}, and {{ic|unset}}. This example uses {{ic|set}} and {{ic|insmod}}. {{ic|set}} modifies variables and {{ic|insmod}} inserts new modules to add functionality.<br />
<br />
Before starting, the user must know the location of their {{ic|/boot}} partition (be it a separate partition, or a subdirectory under their root):<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
<br />
where X is the physical drive number and Y is the partition number.<br />
<br />
To expand console capabilities, insert the {{ic|linux}} module:<br />
grub rescue> insmod (hdX,Y)/boot/grub/linux.mod<br />
<br />
{{Note|With a separate boot partition, omit {{ic|/boot}} from the path, (i.e. type {{ic|1=set prefix=(hdX,Y)/grub}} and {{ic|insmod (hdX,Y)/grub/linux.mod}}).}}<br />
<br />
This introduces the {{ic|linux}} and {{ic|initrd}} commands, which should be familiar (see [[#Configuration]]).<br />
<br />
An example, booting Arch Linux:<br />
set root=(hd0,5)<br />
linux /boot/vmlinuz-linux root=/dev/sda5<br />
initrd /boot/initramfs-linux.img<br />
boot<br />
<br />
With a separate boot partition, again change the lines accordingly:<br />
set root=(hd0,5)<br />
linux /vmlinuz-linux root=/dev/sda6<br />
initrd /initramfs-linux.img<br />
boot<br />
<br />
After successfully booting the Arch Linux installation, users can correct {{ic|grub.cfg}} as needed and then reinstall GRUB.<br />
<br />
To reinstall GRUB and fix the problem completely, changing {{ic|/dev/sda}} if needed. See [[#Bootloader installation]] for details.<br />
<br />
== Combining the use of UUIDs and basic scripting ==<br />
<br />
If you like the idea of using UUIDs to avoid unreliable BIOS mappings or are struggling with GRUB's syntax, here is an example boot menu item that uses UUIDs and a small script to direct GRUB to the proper disk partitions for your system. All you need to do is replace the UUIDs in the sample with the correct UUIDs for your system. The example applies to a system with a boot and root partition. You will obviously need to modify the GRUB configuration if you have additional partitions:<br />
<br />
menuentry "Arch Linux 64" {<br />
# Set the UUIDs for your boot and root partition respectively<br />
set the_boot_uuid=ece0448f-bb08-486d-9864-ac3271bd8d07<br />
set the_root_uuid=c55da16f-e2af-4603-9e0b-03f5f565ec4a<br />
<br />
# (Note: This may be the same as your boot partition)<br />
<br />
# Get the boot/root devices and set them in the root and grub_boot variables<br />
search --fs-uuid --set=root $the_root_uuid<br />
search --fs-uuid --set=grub_boot $the_boot_uuid<br />
<br />
# Check to see if boot and root are equal.<br />
# If they are, then append /boot to $grub_boot (Since $grub_boot is actually the root partition)<br />
if [ $the_boot_uuid == $the_root_uuid] ; then<br />
set grub_boot=$grub_boot/boot<br />
fi<br />
<br />
# $grub_boot now points to the correct location, so the following will properly find the kernel and initrd<br />
linux ($grub_boot)/vmlinuz-linux root=/dev/disk/by-uuid/$uuid_os_root ro<br />
initrd ($grub_boot)/initramfs-linux.img<br />
}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Intel BIOS not booting GPT ===<br />
<br />
Some Intel BIOS's require at least one bootable MBR partition to be present at boot, causing GPT-partitioned boot setups to be unbootable.<br />
<br />
This can be circumvented by using (for instance) fdisk to mark one of the GPT partitions (preferably the 1007 KiB partition you've created for GRUB already) bootable in the MBR. This can be achieved, using fdisk, by the following commands: Start fdisk against the disk you're installing, for instance {{ic|fdisk /dev/sda}}, then press {{keypress|a}} and select the partition you wish to mark as bootable (probably #1) by pressing the corresponding number, finally press {{keypress|w}} to write the changes to the MBR.<br />
<br />
{{Note|The bootable-marking must be done in {{ic|fdisk}} or similar, not in GParted or others, as they will not set the bootable flag in the MBR.}}<br />
<br />
More information is available [http://www.rodsbooks.com/gdisk/bios.html here]<br />
<br />
=== Enable debug messages ===<br />
<br />
Add:<br />
<br />
set pager=1<br />
set debug=all<br />
<br />
to {{ic|grub.cfg}}.<br />
<br />
=== "No suitable mode found" error ===<br />
<br />
If you get this error when booting any menuentry:<br />
<br />
error: no suitable mode found<br />
Booting however<br />
<br />
Then you need to initialize GRUB graphical terminal ({{ic|gfxterm}}) with proper video mode ({{ic|gfxmode}}) in GRUB. This video mode is passed by GRUB to the linux kernel via 'gfxpayload'. In case of UEFI systems, if the GRUB video mode is not initialized, no kernel boot messages will be shown in the terminal (atleast until KMS kicks in).<br />
<br />
Copy {{ic|/usr/share/grub/unicode.pf2}} to ${GRUB_PREFIX_DIR} ({{ic|/boot/grub/}} in case of BIOS and UEFI systems). If GRUB UEFI was installed with {{ic|1=--boot-directory=/boot/efi/EFI}} set, then the directory is {{ic|/boot/efi/EFI/grub/}}:<br />
<br />
# cp /usr/share/grub/unicode.pf2 ${GRUB_PREFIX_DIR}<br />
<br />
If {{ic|/usr/share/grub/unicode.pf2}} does not exist, install {{Pkg|bdf-unifont}}, create the {{ic|unifont.pf2}} file and then copy it to {{ic|${GRUB_PREFIX_DIR<nowiki>}</nowiki>}}:<br />
<br />
# grub-mkfont -o unicode.pf2 /usr/share/fonts/misc/unifont.bdf<br />
<br />
Then, in the {{ic|grub.cfg}} file, add the following lines to enable GRUB to pass the video mode correctly to the kernel, without of which you will only get a black screen (no output) but booting (actually) proceeds successfully without any system hang.<br />
<br />
BIOS systems:<br />
<br />
insmod vbe<br />
<br />
UEFI systems:<br />
<br />
insmod efi_gop<br />
insmod efi_uga<br />
<br />
After that add the following code (common to both BIOS and UEFI):<br />
<br />
insmod font<br />
<br />
if loadfont ${prefix}/fonts/unicode.pf2<br />
then<br />
insmod gfxterm<br />
set gfxmode=auto<br />
set gfxpayload=keep<br />
terminal_output gfxterm<br />
fi<br />
<br />
As you can see for gfxterm (graphical terminal) to function properly, {{ic|unicode.pf2}} font file should exist in {{ic|${GRUB_PREFIX_DIR<nowiki>}</nowiki>}}.<br />
<br />
=== msdos-style error message ===<br />
<br />
grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding won't be possible!<br />
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.<br />
However, blocklists are UNRELIABLE and its use is discouraged.<br />
grub-setup: error: If you really want blocklists, use --force.<br />
<br />
This error may occur when you try installing GRUB in a VMware container. Read more about it [https://bbs.archlinux.org/viewtopic.php?pid=581760#p581760 here]. It happens when the first partition starts just after the MBR (block 63), without the usual space of 1 MiB (2048 blocks) before the first partition. Read [[#Master Boot Record (MBR) specific instructions]]<br />
<br />
=== GRUB UEFI drops to shell ===<br />
<br />
If GRUB loads but drops you into the rescue shell with no errors, it may be because of a missing or misplaced {{ic|grub.cfg}}. This will happen if GRUB UEFI was installed with {{ic|--boot-directory}} and {{ic|grub.cfg}} is missing OR if the partition number of the boot partition changed (which is hard-coded into the {{ic|grubx64.efi}} file).<br />
<br />
=== GRUB UEFI not loaded ===<br />
<br />
An example of a working EFI:<br />
{{hc|# efibootmgr -v|<br />
BootCurrent: 0000<br />
Timeout: 3 seconds<br />
BootOrder: 0000,0001,0002<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\efi\grub\grub.efi)<br />
Boot0001* Shell HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\EfiShell.efi)<br />
Boot0002* Festplatte BIOS(2,0,00)P0: SAMSUNG HD204UI<br />
}}<br />
<br />
If the screen only goes black for a second and the next boot option is tried afterwards, according to [https://bbs.archlinux.org/viewtopic.php?pid=981560#p981560 this post], moving GRUB to the partition root can help. The boot option has to be deleted and recreated afterwards. The entry for GRUB should look like this then:<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\grub.efi)<br />
<br />
=== Invalid signature ===<br />
<br />
If trying to boot Windows results in an "invalid signature" error, e.g. after reconfiguring partitions or adding additional hard drives, (re)move GRUB's device configuration and let it reconfigure:<br />
# mv /boot/grub/device.map /boot/grub/device.map-old<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
{{ic|grub-mkconfig}} should now mention all found boot options, including Windows. If it works, remove {{ic|/boot/grub/device.map-old}}.<br />
<br />
=== Boot freezes ===<br />
<br />
If booting gets stuck without any error message after GRUB loading the kernel and the initial ramdisk, try removing the {{ic|add_efi_memmap}} kernel parameter.<br />
<br />
=== Restore GRUB Legacy ===<br />
<br />
* Move GRUB v2 files out of the way:<br />
<br />
# mv /boot/grub /boot/grub.nonfunctional<br />
<br />
* Copy GRUB Legacy back to {{ic|/boot}}:<br />
<br />
# cp -af /boot/grub-legacy /boot/grub<br />
<br />
* Replace MBR and next 62 sectors of sda with backed up copy<br />
<br />
{{Warning|This command also restores the partition table, so be careful of overwriting a modified partition table with the old one. It '''will''' mess up your system.}}<br />
<br />
# dd if=/path/to/backup/first-sectors of=/dev/sdX bs=512 count=1<br />
<br />
A safer way is to restore only the MBR boot code use:<br />
<br />
# dd if=/path/to/backup/mbr-boot-code of=/dev/sdX bs=446 count=1<br />
<br />
=== Arch not found from other OS ===<br />
Some have reported that other distributions have trouble finding Arch Linux automatically with os-prober. If this problem arises, it has been reported that detection can be improved with the presence of /etc/lsb-release. This file and updating tool is available with the package {{ic|lsb-release}} in the [[community]] repository.<br />
<br />
== References ==<br />
<br />
# Official GRUB Manual - https://www.gnu.org/software/grub/manual/grub.html<br />
# Ubuntu wiki page for GRUB - https://help.ubuntu.com/community/Grub2<br />
# GRUB wiki page describing steps to compile for UEFI systems - https://help.ubuntu.com/community/UEFIBooting<br />
# Wikipedia's page on [[Wikipedia:BIOS Boot partition|BIOS Boot partition]]<br />
<br />
== See also ==<br />
<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_bios.sh A Linux Bash Shell script to compile and install GRUB for BIOS from BZR Source]<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_uefi.sh A Linux Bash Shell script to compile and install GRUB for UEFI from BZR Source]</div>Cinellihttps://wiki.archlinux.org/index.php?title=GRUB&diff=264367GRUB2013-06-26T16:59:29Z<p>Cinelli: /* Install to partition or partitionless disk */ grub.mo</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[ar:GRUB]]<br />
[[cs:GRUB2]]<br />
[[de:GRUB]]<br />
[[es:GRUB2]]<br />
[[fr:GRUB2]]<br />
[[id:GRUB2]]<br />
[[it:GRUB2]]<br />
[[ru:GRUB2]]<br />
[[tr:GRUB2]]<br />
[[zh-CN:GRUB2]]<br />
[[zh-TW:GRUB2]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers various aspects of version 2 of the GRand Unified Bootloader (GRUB).}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|BURG}} - BURG is a brand-new boot loader based on GRUB v2. It can be built on a wider range of OS, and has a highly configurable menu system which works in both text and graphic mode. <br />
{{Article summary wiki|GRUB Legacy}} - previous Version, now obsolete.<br />
{{Article summary heading|Resources}}<br />
{{Article summary wiki|GRUB EFI Examples}}<br />
{{Article summary link|GNU GRUB - GNU Project|https://www.gnu.org/software/grub/}}<br />
{{Article summary end}}<br />
<br />
[https://www.gnu.org/software/grub/ GRUB] - not to be confused with [[GRUB Legacy]] - is the next generation of the GRand Unified Bootloader. GRUB is derived from [http://www.nongnu.org/pupa/ PUPA] which was a research project to develop the next generation of what is now GRUB Legacy. GRUB has been rewritten from scratch to clean up everything and provide modularity and portability [https://www.gnu.org/software/grub/grub-faq.html#q1].<br />
<br />
In brief, the ''bootloader'' is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the Linux kernel. The kernel, in turn, initializes the rest of the operating system.<br />
<br />
== Preface ==<br />
<br />
* The name ''GRUB'' officially refers to version ''2'' of the software, see [https://www.gnu.org/software/grub/]. If you are looking for the article on the legacy version, see [[GRUB Legacy]].<br />
* GRUB supports [[Btrfs]] as root (without a separate {{ic|/boot}} filesystem) compressed with either zlib or LZO<br />
<br />
=== Notes for current GRUB Legacy users ===<br />
<br />
* Upgrading from [[GRUB Legacy]] to GRUB is much the same as freshly installing GRUB, which is covered [[#Installation|below]]<br />
* There are differences in the commands of GRUB Legacy and GRUB. Familiarize yourself with [https://www.gnu.org/software/grub/manual/grub.html#Commands GRUB commands] before proceeding (e.g. "find" has been replaced with "search")<br />
* GRUB is now ''modular'' and no longer requires "stage 1.5". As a result, the bootloader itself is limited -- modules are loaded from the hard drive as needed to expand functionality (e.g. for [[LVM]] or RAID support)<br />
* Device naming has changed between GRUB Legacy and GRUB. Partitions are numbered from 1 instead of 0 while drives are still numbered from 0, and prefixed with partition-table type. For example, {{ic|/dev/sda1}} would be referred to as {{ic|(hd0,msdos1)}} (for MBR) or {{ic|(hd0,gpt1)}} (for GPT)<br />
* If you use systemd without systemd-sysvcompat, and have had {{ic|<nowiki>init=/usr/lib/systemd/systemd</nowiki>}} in your old grub menu.lst, the automatically generated grub.cfg file might not carry over this kernel parameter (giving you "ERROT: Root device mounted successfully, but /sbin/init does not exist" on boot). If so, edit the Arch Linux entry that grub shows you, add {{ic|<nowiki>init=/usr/lib/systemd/systemd</nowiki>}} to the kernel parameters, and then [[Grub#Additional_arguments|make it permanent]].<br />
* GRUB is noticably bigger than GRUB legacy (occupies ~13 MB in /boot). If you are booting from a separate /boot partition, and this partition is smaller than 32 MB, you will run into disk space issues, and pacman will refuse to install new kernels. If you don't want to re-partition your system, switch to [[Syslinux]] instead, which is smaller (occupies ~1.5 MB in /boot).<br />
<br />
==== Backup important data ====<br />
<br />
Although a GRUB installation should run smoothly, it is strongly recommended to keep the GRUB Legacy files before upgrading to GRUB v2.<br />
<br />
# mv /boot/grub /boot/grub-legacy<br />
<br />
Backup the MBR which contains the boot code and partition table (Replace {{ic|/dev/sd'''X'''}} with your actual disk path):<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/mbr_backup bs=512 count=1<br />
<br />
Only 446 bytes of the MBR contain boot code, the next 64 contain the partition table. If you do not want to overwrite your partition table when restoring, it is strongly advised to backup only the MBR boot code:<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/bootcode_backup bs=446 count=1<br />
<br />
If unable to install GRUB2 correctly, see [[#Restore GRUB Legacy]].<br />
<br />
=== Preliminary requirements ===<br />
<br />
==== BIOS systems ====<br />
<br />
===== GUID Partition Table (GPT) specific instructions =====<br />
<br />
GRUB in [[GPT|BIOS-GPT]] configuration requires a [http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html BIOS boot partition] to embed its {{ic|core.img}} in the absence of post-MBR gap in GPT partitioned systems (which is taken over by the GPT Primary Header and Primary Partition table). This partition is used by GRUB only in BIOS-GPT setups. No such partition type exists in case of MBR partitioning (at least not for GRUB). This partition is also not required if the system is UEFI based, as no embedding of bootsectors takes place in that case.<br />
<br />
For a BIOS-GPT configuration, create a 1007 KiB partition at the beginning of the disk using gdisk, cgdisk or GNU Parted with no filesystem. The size of 1007 KiB will allow for the following partition to be correctly alligned at 1024 KiB. If needed, the partition can also be located somewhere else on the disk, but it should be within the first 2 TiB region. Set the partition type to {{ic|ef02}} in (c)gdisk or {{ic|set <BOOT_PART_NUM> bios_grub on}} in GNU Parted.<br />
<br />
{{Note|<br />
* This partition should be created before {{ic|grub-install}} or {{ic|grub-setup}} is run<br />
* gdisk will only allow you to create this partition on the position which will waste the least amount of space (sector 34-2047) if you create it last, after all the other partitions. This is because gdisk will auto-align partitions to 2048-sector boundaries if possible<br />
}}<br />
<br />
===== Master Boot Record (MBR) specific instructions =====<br />
<br />
Usually the post-[[MBR]] gap (after the 512 byte MBR region and before the start of the 1st partition) in many MBR (or msdos disklabel) partitioned systems is 31 KiB when DOS compatibility cylinder alignment issues are satisfied in the partition table. However a post-MBR gap of about 1 to 2 MiB is recommended to provide sufficient room for embedding GRUB's {{ic|core.img}} ({{bug|24103}}). It is advisable to use a partitioner which supports 1 MiB partition alignment to obtain this space as well as satisfy other non-512 byte sector issues (which are unrelated to embedding of {{ic|core.img}}).<br />
<br />
==== UEFI systems ====<br />
<br />
{{Note|It is recommended to read and understand the [[Unified Extensible Firmware Interface|UEFI]], [[GUID Partition Table|GPT]] and [[UEFI Bootloaders]] pages.}}<br />
<br />
===== Create and Mount the UEFI System Partition =====<br />
<br />
Follow [[Unified Extensible Firmware Interface#EFI System Partition]] for instructions on creating a UEFI System Partition. Then mount the UEFI System Partition at {{ic|/boot/efi}}. If you have mounted the UEFI System Partition at some other mountpoint, replace {{ic|/boot/efi}} in the below instructions with that mountpoint:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat <UEFI_SYSTEM_PARTITION> /boot/efi<br />
<br />
Create a {{ic|/boot/efi/EFI}} directory:<br />
<br />
# mkdir /boot/efi/EFI<br />
<br />
== Installation ==<br />
<br />
=== BIOS systems ===<br />
<br />
GRUB can be [[pacman|installed]] with the {{Pkg|grub}} package from the [[official repositories]]. It will replace {{Pkg|grub-legacy}} , if it is installed.<br />
<br />
{{Note|Simply installing the package won't update the {{ic|/boot/grub/i386-pc/core.img}} file and the GRUB modules in {{ic|/boot/grub/i386-pc}}. You need to update them manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install boot files ====<br />
<br />
There are 3 ways to install GRUB boot files in BIOS booting:<br />
* [[#Install to GPT BIOS boot partition]] (recommended with [[GPT]])<br />
* [[#Install to 440-byte MBR boot code region]] (recommended with [[MBR]])<br />
* [[#Install to partition or partitionless disk]] (not recommended)<br />
* [[#Generate core.img alone]] (safest method, but requires another BIOS bootloader like [[GRUB Legacy]] or [[Syslinux]] to be installed to chainload {{ic|/boot/grub/i386-pc/core.img}})<br />
<br />
{{Note|See http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html for additional documentation.}}<br />
<br />
===== Install to GPT BIOS boot partition =====<br />
<br />
[[GUID Partition Table]] disks do not have a reserved "boot track". Therefore you must create a BIOS Boot Partition ({{ic|ef02}}) to hold the GRUB core image.<br />
<br />
Using GNU Parted, you can set this using a command such as the following:<br />
<br />
# parted /dev/disk set <partition-number> bios_grub on<br />
<br />
If you are using gdisk, set the partition type to {{ic|ef02}}. With partitioning programs that require setting the GUID directly, it should be {{ic|‘21686148-6449-6e6f-744e656564454649’}} (or, {{ic|[[wikipedia:BIOS_Boot_partition|Hah!IdontNeedEFI]]}}).<br />
<br />
{{Warning|Be very careful which partition you select when marking it as a BIOS Boot Partition. When GRUB finds a BIOS Boot Partition during installation, it will automatically overwrite part of it. Make sure that the partition does not contain any other data.}}<br />
<br />
To setup {{ic|grub}} on a GPT disk, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, and embed it in the BIOS Boot Partition, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --recheck --debug /dev/sda<br />
<br />
where {{ic|/dev/sda}} is the destination of the installation.<br />
<br />
Continue with [[GRUB#Generate config file]] below.<br />
<br />
===== Install to 440-byte MBR boot code region =====<br />
<br />
To setup {{ic|grub}} in the 440-byte Master Boot Record boot code region, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, embed it in the 31 KiB (minimum size - varies depending on partition alignment) post-MBR gap, and generate the configuration file, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --recheck /dev/sdX<br />
<br />
where {{ic|/dev/sdX}} is the destination of the installation (in this case the MBR of the first SATA disk). If you use [[LVM]] for your {{ic|/boot}}, you can install GRUB on multiple physical disks.<br />
<br />
{{Warning|Make sure to check the {{ic|/boot}} directory if you use the latter. Sometimes the {{ic|boot-directory}} parameter creates another {{ic|/boot}} folder inside of {{ic|/boot}}. A wrong install would look like: {{ic|/boot/boot/grub/}}.}}<br />
<br />
Continue with [[GRUB#Generate config file]] below.<br />
<br />
===== Install to partition or partitionless disk =====<br />
<br />
{{Note|GRUB does not encourage installation to a partition boot sector or a partitionless disk like GRUB Legacy or Syslinux does. This kind of setup is prone to breakage, especially during updates, and is not supported by Arch devs.}}<br />
<br />
To set up grub to a partition boot sector, to a partitionless disk (also called superfloppy) or to a floppy disk, run (using for example {{ic|/dev/sdaX}} as the {{ic|/boot}} partition):<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=i386-pc --recheck --debug --force /dev/sdaX<br />
# chattr -i /boot/grub/i386-pc/core.img<br />
# chattr +i /boot/grub/i386-pc/core.img<br />
<br />
You need to use the {{ic|--force}} option to allow usage of blocklists and should not use {{ic|1=--grub-setup=/bin/true}} (which is similar to simply generating {{ic|core.img}}).<br />
<br />
{{ic|grub-install}} will give out warnings like which should give you the idea of what might go wrong with this approach:<br />
<br />
/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.<br />
/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. <br />
However, blocklists are UNRELIABLE and their use is discouraged.<br />
<br />
Without {{ic|--force}} you may get the below error and {{ic|grub-setup}} will not setup its boot code in the partition boot sector:<br />
<br />
/sbin/grub-setup: error: will not proceed with blocklists<br />
<br />
With {{ic|--force}} you should get:<br />
<br />
Installation finished. No error reported.<br />
<br />
The reason why {{ic|grub-setup}} does not by default allow this is because in case of partition or a partitionless disk is that {{ic|grub}} relies on embedded blocklists in the partition bootsector to locate the {{ic|/boot/grub/i386-pc/core.img}} file and the prefix dir {{ic|/boot/grub}}. The sector locations of {{ic|core.img}} may change whenever the filesystem in the partition is being altered (files copied, deleted etc.). For more info see https://bugzilla.redhat.com/show_bug.cgi?id=728742 and https://bugzilla.redhat.com/show_bug.cgi?id=730915.<br />
<br />
The workaround for this is to set the immutable flag on {{ic|/boot/grub/i386-pc/core.img}} (using chattr command as mentioned above) so that the sector locations of the {{ic|core.img}} file in the disk is not altered. The immutable flag on {{ic|/boot/grub/i386-pc/core.img}} needs to be set only if {{ic|grub}} is installed to a partition boot sector or a partitionless disk, not in case of installation to MBR or simple generation of {{ic|core.img}} without embedding any bootsector (mentioned above).<br />
<br />
===== Generate core.img alone =====<br />
<br />
To populate the {{ic|/boot/grub}} directory and generate a {{ic|/boot/grub/i386-pc/core.img}} file '''without''' embedding any {{ic|grub}} bootsector code in the MBR, post-MBR region, or the partition bootsector, add {{ic|1=--grub-setup=/bin/true}} to {{ic|grub-install}}:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --grub-setup=/bin/true --recheck --debug /dev/sda<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
You can then chainload GRUB's {{ic|core.img}} from GRUB Legacy or syslinux as a Linux kernel or a multiboot kernel.<br />
<br />
==== Generate config file ====<br />
<br />
Finally, generate a configuration for GRUB (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|/boot/grub/grub.cfg}}, NOT {{ic|/boot/grub/i386-pc/grub.cfg}}.}}<br />
<br />
If GRUB complains about "no suitable mode found" while booting, go to [[#"No suitable mode found" error]].<br />
<br />
If {{ic|grub-mkconfig}} fails, convert your {{ic|/boot/grub/menu.lst}} file to {{ic|/boot/grub/grub.cfg}} using:<br />
<br />
# grub-menulst2cfg /boot/grub/menu.lst /boot/grub/grub.cfg<br />
<br />
For example:<br />
<br />
{{hc|/boot/grub/menu.lst|<nowiki><br />
default=0<br />
timeout=5<br />
<br />
title Arch Linux Stock Kernel<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux.img<br />
<br />
title Arch Linux Stock Kernel Fallback<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux-fallback.img<br />
</nowiki>}}<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
set default='0'; if [ x"$default" = xsaved ]; then load_env; set default="$saved_entry"; fi<br />
set timeout=5<br />
<br />
menuentry 'Arch Linux Stock Kernel' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux.img' '/initramfs-linux.img'<br />
<br />
}<br />
<br />
menuentry 'Arch Linux Stock Kernel Fallback' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux-fallback.img' '/initramfs-linux-fallback.img'<br />
}<br />
</nowiki>}}<br />
<br />
If you forgot to create a GRUB {{ic|/boot/grub/grub.cfg}} config file and simply rebooted into GRUB Command Shell, type:<br />
<br />
sh:grub> insmod legacycfg<br />
sh:grub> legacy_configfile ${prefix}/menu.lst<br />
<br />
Boot into Arch and re-create the proper GRUB {{ic|/boot/grub/grub.cfg}} config file.<br />
<br />
{{Note|This option works only in BIOS systems, not in UEFI systems.}}<br />
<br />
==== Multiboot ====<br />
This should work out of the box, but an extra utility needs to be installed: os-prober. Install it, then rerun grub-mkconfig -o /boot/grub/grub.cfg. If this fails, you can try manually adding an entry by following the instructions below.<br />
<br />
===== Microsoft Windows installed in BIOS-MBR mode =====<br />
<br />
{{Note|GRUB supports booting {{ic|bootmgr}} directly and chainload of partition boot sector is no longer required to boot Windows in a BIOS-MBR setup.}}<br />
<br />
{{Warning|It is the '''system partition''' that has {{ic|bootmgr}}, not your "real" Windows partition (usually C:). When showing all UUIDs with blkid, the system partition is the one with {{ic|LABEL&#61;"SYSTEM RESERVED"}} and is only about 100 MB in size (much like the boot partition for Arch). See [[Wikipedia:System partition and boot partition]] for more info.}}<br />
<br />
Throughout this section, it is assumed your Windows partition is /dev/sda1. A different partition will change every instance of hd0,msdos1. First, find the UUID of the NTFS filesystem of the Windows's SYSTEM PARTITION where the {{ic|bootmgr}} and its files reside. For example, if Windows {{ic|bootmgr}} exists at {{ic|/media/SYSTEM_RESERVED/bootmgr}}:<br />
<br />
For Windows Vista/7/8:<br />
<br />
# grub-probe --target=fs_uuid /media/SYSTEM_RESERVED/bootmgr<br />
69B235F6749E84CE<br />
<br />
# grub-probe --target=hints_string /media/SYSTEM_RESERVED/bootmgr<br />
--hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1<br />
<br />
{{Note|For Windows XP, replace {{ic|bootmgr}} with {{ic|NTLDR}} in the above commands. And note that there may not be a separate SYSTEM_RESERVED partition; just probe the file NTLDR on your Windows partition.}}<br />
<br />
Then, add the below code to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} and regenerate {{ic|grub.cfg}} with {{ic|grub-mkconfig}} as explained above to boot Windows (XP, Vista, 7 or 8) installed in BIOS-MBR mode:<br />
<br />
For Windows Vista/7/8:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 BIOS-MBR" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /bootmgr<br />
}<br />
<br />
For Windows XP:<br />
<br />
menuentry "Microsoft Windows XP" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /ntldr<br />
}<br />
<br />
{{ic|/etc/grub.d/40_custom}} can be used as a template to create {{ic|/etc/grub.d/nn_custom}}. Where {{ic|nn}} defines the precendence, indicating the order the script is executed. The order scripts are executed determine the placement in the grub boot menu.<br />
<br />
{{Note|{{ic|nn}} should be greater than 06 to ensure necessary scripts are executed first.}}<br />
<br />
=== UEFI systems ===<br />
<br />
{{Note|It is well know that different motherboard manufactures implement UEFI differently. Users experiencing problems getting Grub/EFI to work properly are encouraged to share detailed steps for hardware-specific cases where UEFI booting does not work as described below. In an effort to keep the parent [[GRUB]] article neat and tidy, see the [[GRUB EFI Examples]] page for these special cases.}}<br />
<br />
First install the {{Pkg|grub}} package and then follow the instructions below.<br />
<br />
{{Note|Simply installing the package will not update the {{ic|core.efi}} file and the GRUB modules in the UEFI System Partition. You need to do this manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install boot files ====<br />
<br />
===== Install to UEFI system partition =====<br />
<br />
{{Note|<br />
* The below commands assume you are using installing GRUB for {{ic|x86_64-efi}} (for {{ic|IA32-efi}} replace {{ic|x86_64}} with {{ic|i386}} in the below commands)<br />
* To do this, you need to boot using UEFI and not the BIOS. If you booted by just copying the ISO file to the USB drive, you will need to follow [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO|this guide]] or grub-install will show errors<br />
}}<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Install GRUB UEFI application to {{ic|/boot/efi/EFI/arch_grub}} and its modules to {{ic|/boot/grub/x86_64-efi}} (recommended) using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
{{Note|Without {{ic|--target}} or {{ic|--directory}} option, grub-install cannot determine for which firmware GRUB is being installed. In such cases {{ic|grub-install}} will show {{ic|source_dir doesn't exist. Please specify --target or --directory}} message.}}<br />
<br />
If you want to install GRUB modules and {{ic|grub.cfg}} at the directory {{ic|/boot/efi/EFI/grub}} and the {{ic|grubx64.efi}} application at {{ic|/boot/efi/EFI/arch_grub}} (ie. all the GRUB UEFI files inside the UEFISYS partition itself) use:<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug<br />
# mkdir -p /boot/efi/EFI/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/efi/EFI/grub/locale/en.mo<br />
<br />
The {{ic|--efi-directory}} option mentions the mountpoint of UEFI SYSTEM PARTITION , {{ic|--bootloader-id}} mentions the name of the directory used to store the {{ic|grubx64.efi}} file and {{ic|--boot-directory}} mentions the directory wherein the actual modules will be installed (and into which {{ic|grub.cfg}} should be created).<br />
<br />
The actual paths are:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi<br />
<br />
<boot-directory>/grub/x86_64-efi/<all modules, grub.efi, core.efi, grub.cfg><br />
<br />
{{Note|the {{ic|--bootloader-id}} option does not change {{ic|<boot-directory>/grub}}, i.e. you cannot install the modules to {{ic|<boot-directory>/<bootloader-id>}}, the path is hard-coded to be {{ic|<boot-directory>/grub}}.}}<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == <boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
The {{ic|<nowiki><efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi</nowiki>}} is an exact copy of {{ic|<nowiki><boot-directory>/grub/x86_64-efi/core.efi</nowiki>}}.<br />
<br />
{{Note|<br />
* In GRUB 2.00, the {{ic|grub-install}} option {{ic|--efi-directory}} replaces {{ic|--root-directory}} and the latter is deprecated<br />
* The options {{ic|--efi-directory}} and {{ic|--bootloader-id}} are specific to GRUB UEFI<br />
}}<br />
<br />
In all the cases the UEFI SYSTEM PARTITION should be mounted for {{ic|grub-install}} to install {{ic|grubx64.efi}} in it, which will be launched by the firmware (using the {{ic|efibootmgr}} created boot entry in non-Mac systems).<br />
<br />
If you notice carefully, there is no <device_path> option (Eg: {{ic|/dev/sda}}) at the end of the {{ic|grub-install}} command unlike the case of setting up GRUB for BIOS systems. Any <device_path> provided will be ignored by the install script as UEFI bootloaders do not use MBR or Partition boot sectors at all.<br />
<br />
You may now be able to UEFI boot your system by creating a {{ic|grub.cfg}} file by following [[#Generate UEFI Config file]] and [[#Create GRUB entry in the Firmware Boot Manager]].<br />
<br />
==== Generate config file ====<br />
<br />
Finally, generate a configuration for GRUB (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o <boot-directory>/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|<boot-directory>/grub/grub.cfg}}, NOT {{ic|<boot-directory>/grub/x86_64-efi/grub.cfg}}.}}<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot/efi/EFI</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
<br />
This is independent of the value of {{ic|--bootloader-id}} option.<br />
<br />
If GRUB complains about "no suitable mode found" while booting, try [[#"No suitable mode found" error]].<br />
<br />
==== Create GRUB entry in the firmware boot manager ====<br />
<br />
{{ic|grub-install}} automatically tries to create a menu entry in the boot manager. If it doesn't, then see [[Beginners' Guide#GRUB]] for instructions to use {{ic|efibootmgr}} to create a menu entry. However, the problem is likely to be that you haven't booted your CD/USB in UEFI mode, as in [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]].<br />
<br />
==== Create GRUB standalone UEFI application ====<br />
<br />
It is possible to create a {{ic|grubx64_standalone.efi}} application which has all the modules embeddded in a memdisk within the UEFI application, thus removing the need for having a separate directory populated with all the GRUB UEFI modules and other related files. This is done using the {{ic|grub-mkstandalone}} command which is included in {{Pkg|grub}}.<br />
<br />
The easiest way to do this would be with the install command already mentioned before, but specifying the modules to include. For example:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" <any extra files you want to include><br />
<br />
The {{ic|grubx64_standalone.efi}} file expects {{ic|grub.cfg}} to be within its $prefix which is {{ic|(memdisk)/boot/grub}}. The memdisk is embedded within the efi app. The {{ic|grub-mkstandlone}} script allow passing files to be included in the memdisk image to be as the arguments to the script (in <any extra files you want to include>).<br />
<br />
If you have the {{ic|grub.cfg}} at {{ic|/home/user/Desktop/grub.cfg}}, then create a temporary {{ic|/home/user/Desktop/boot/grub/}} directory, copy the {{ic|/home/user/Desktop/grub.cfg}} to {{ic|/home/user/Desktop/boot/grub/grub.cfg}}, cd into {{ic|/home/user/Desktop/boot/grub/}} and run:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" "boot/grub/grub.cfg"<br />
<br />
The reason to cd into {{ic|/home/user/Desktop/boot/grub/}} and to pass the file path as {{ic|boot/grub/grub.cfg}} (notice the lack of a leading slash - boot/ vs /boot/ ) is because {{ic|dir1/dir2/file}} is included as {{ic|(memdisk)/dir1/dir2/file}} by the {{ic|grub-mkstandalone}} script. <br />
<br />
If you pass {{ic|/home/user/Desktop/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/grub.cfg}}. If you pass {{ic|/home/user/Desktop/boot/grub/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/boot/grub/grub.cfg}}. That is the reason for cd'ing into {{ic|/home/user/Desktop/boot/grub/}} and passing {{ic|boot/grub/grub.cfg}}, to include the file as {{ic|(memdisk)/boot/grub/grub.cfg}}, which is what {{ic|grub.efi}} expects the file to be.<br />
<br />
You need to create an UEFI Boot Manager entry for {{ic|/boot/efi/EFI/arch_grub/grubx64_standalone.efi}} using {{ic|efibootmgr}}. Follow [[#Create GRUB entry in the Firmware Boot Manager]].<br />
<br />
==== Multiboot ====<br />
<br />
===== Microsoft Windows installed in UEFI-GPT mode =====<br />
<br />
Find the UUID of the FAT32 filesystem in the UEFI SYSTEM PARTITION where the Windows UEFI Bootloader files reside. For example, if Windows {{ic|bootmgfw.efi}} exists at {{ic|/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi}} (ignore the upper-lower case differences since that is immaterial in FAT filesystem):<br />
<br />
# grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
1ce5-7f28<br />
<br />
# grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
--hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1<br />
<br />
Then, add this code to {{ic|/etc/grub.d/40_custom}} to chainload Windows x86_64 (Vista SP1+, 7 or 8) installed in UEFI-GPT mode:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 x86_64 UEFI-GPT" {<br />
insmod part_gpt<br />
insmod fat<br />
insmod search_fs_uuid<br />
insmod chain<br />
search --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 1ce5-7f28<br />
chainloader /efi/Microsoft/Boot/bootmgfw.efi<br />
}<br />
<br />
Afterwards remake {{ic|/boot/grub/grub.cfg}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
== Configuration ==<br />
<br />
You can also choose to automatically generate or manually edit {{ic|grub.cfg}}.<br />
<br />
{{Note|<br />
* For EFI systems, if GRUB was installed with the {{ic|--boot-directory}} option set, the {{ic|grub.cfg}} file must be placed in the same directory as {{ic|grubx64.efi}}. Otherwise, the {{ic|grub.cfg}} file goes in {{ic|/boot/grub/}}, just like in GRUB BIOS<br />
* [http://members.iinet.net/~herman546/p20/GRUB2%20Configuration%20File%20Commands.html Here] is a quite complete description of how to configure GRUB<br />
}}<br />
<br />
=== Automatically generating using grub-mkconfig ===<br />
<br />
The GRUB {{ic|menu.lst}} equivalent configuration files are {{ic|/etc/default/grub}} and {{ic|/etc/grub.d/*}}. {{ic|grub-mkconfig}} uses these files to generate {{ic|grub.cfg}}. By default the script outputs to stdout. To generate a {{ic|grub.cfg}} file run the command:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{ic|/etc/grub.d/10_linux}} is set to automatically add menu items for Arch linux that work out of the box, to any generated configuration. Other operating systems may need to be added manually to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}<br />
<br />
==== Additional arguments ====<br />
<br />
To pass custom additional arguments to the Linux image, you can set the {{ic|GRUB_CMDLINE_LINUX}} variable in {{ic|/etc/default/grub}}. <br />
<br />
For example, use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX"</nowiki>}} where {{ic|sda'''X'''}} is your swap partition to enable resume after hibernation.<br />
<br />
You can also use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/disk/by-uuid/${swap_uuid}"</nowiki>}}, where {{ic|${swap_uuid} }} is the [[Persistent_block_device_naming|UUID]] of your swap partition.<br />
<br />
Multiple entries are separated by spaces within the double quotes. So, for users who want both resume and systemd it would look like this:<br />
{{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX init=/usr/lib/systemd/systemd"</nowiki>}}<br />
<br />
See [[Kernel parameters]] for more info.<br />
<br />
=== Manually creating grub.cfg ===<br />
<br />
{{Warning|Editing this file is strongly ''not'' recommended. The file is generated by the {{ic|grub-mkconfig}} command, and it is best to edit your {{ic|/etc/default/grub}} or one of the scripts in the {{ic|/etc/grub.d}} folder.}}<br />
<br />
A basic GRUB config file uses the following options:<br />
* {{ic|(hdX,Y)}} is the partition {{ic|Y}} on disk {{ic|X}}, partition numbers starting at 1, disk numbers starting at 0<br />
* {{ic|1=set default=N}} is the default boot entry that is chosen after timeout for user action<br />
* {{ic|1=set timeout=M}} is the time {{ic|M}} to wait in seconds for a user selection before default is booted<br />
* {{ic|<nowiki>menuentry "title" {entry options}</nowiki>}} is a boot entry titled {{ic|title}}<br />
* {{ic|1=set root=(hdX,Y)}} sets the boot partition, where the kernel and GRUB modules are stored (boot need not be a separate partition, and may simply be a directory under the "root" partition ({{ic|/}})<br />
<br />
An example configuration:<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
# Config file for GRUB - The GNU GRand Unified Bootloader<br />
# /boot/grub/grub.cfg<br />
<br />
# DEVICE NAME CONVERSIONS<br />
#<br />
# Linux Grub<br />
# -------------------------<br />
# /dev/fd0 (fd0)<br />
# /dev/sda (hd0)<br />
# /dev/sdb2 (hd1,2)<br />
# /dev/sda3 (hd0,3)<br />
#<br />
<br />
# Timeout for menu<br />
set timeout=5<br />
<br />
# Set default boot entry as Entry 0<br />
set default=0<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
set root=(hd0,1)<br />
linux /vmlinuz-linux root=/dev/sda3 ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
## (1) Windows<br />
#menuentry "Windows" {<br />
# set root=(hd0,3)<br />
# chainloader +1<br />
#}<br />
</nowiki>}}<br />
<br />
=== Dual-booting ===<br />
<br />
{{Note|If you want GRUB to automatically search for other systems, you may wish to install {{Pkg|os-prober}}.}}<br />
<br />
==== Using grub-mkconfig ====<br />
The best way to add other entries is editing the {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} . The entries in this file will be automatically added when running {{ic|grub-mkconfig}}.<br />
After adding the new lines, run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg <br />
to generate an updated {{ic|grub.cfg}}.<br />
<br />
===== With GNU/Linux =====<br />
<br />
Assuming that the other distro is on partition {{ic|sda2}}:<br />
<br />
menuentry "Other Linux" {<br />
set root=(hd0,2)<br />
linux /boot/vmlinuz (add other options here as required)<br />
initrd /boot/initrd.img (if the other kernel uses/needs one)<br />
}<br />
<br />
===== With FreeBSD =====<br />
<br />
Requires that FreeBSD is installed on a single partition with UFS. Assuming it is installed on {{ic|sda4}}:<br />
<br />
menuentry "FreeBSD" {<br />
set root=(hd0,4)<br />
chainloader +1<br />
}<br />
<br />
===== With Windows =====<br />
<br />
This assumes that your Windows partition is {{ic|sda3}}. Remember you need to point set root and chainloader to the system reserve partition that windows made when it installed, not the actual partition windows is on. This example works if your system reserve partition is {{ic|sda3}}.<br />
<br />
# (2) Windows XP<br />
menuentry "Windows XP" {<br />
set root="(hd0,3)"<br />
chainloader +1<br />
}<br />
<br />
If the Windows bootloader is on an entirely different hard drive than GRUB, it may be necessary to trick Windows into believing that it is the first hard drive. This was possible with {{ic|drivemap}}. Assuming GRUB is on {{ic|hd0}} and Windows is on {{ic|hd2}}, you need to add the following after {{ic|set root}}:<br />
<br />
drivemap -s hd0 hd2<br />
<br />
==== With Windows via EasyBCD and NeoGRUB ====<br />
<br />
Since EasyBCD's NeoGRUB currently does not understand the GRUB menu format, chainload to it by replacing the contents of your {{ic|C:\NST\menu.lst}} file with lines similar to the following:<br />
<br />
default 0<br />
timeout 1<br />
<br />
title Chainload into GRUB v2<br />
root (hd0,7)<br />
kernel /boot/grub/i386-pc/core.img<br />
<br />
=== Visual configuration ===<br />
<br />
In GRUB it is possible, by default, to change the look of the menu. Make sure to initialize, if not done already, GRUB graphical terminal, gfxterm, with proper video mode, gfxmode, in GRUB. This can be seen in the section [[#"No suitable mode found" error]]. This video mode is passed by GRUB to the linux kernel via 'gfxpayload' so any visual configurations need this mode in order to be in effect.<br />
<br />
==== Setting the framebuffer resolution ====<br />
<br />
GRUB can set the framebuffer for both GRUB itself and the kernel. The old {{ic|1=vga=}} way is deprecated. The preferred method is editing {{ic|/etc/default/grub}} as the following sample:<br />
<br />
GRUB_GFXMODE=1024x768x32<br />
GRUB_GFXPAYLOAD_LINUX=keep<br />
<br />
To generate the changes, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
The {{ic|gfxpayload}} property will make sure the kernel keeps the resolution.<br />
<br />
{{Note|<br />
* If this example does not work for you try to replace {{ic|1=gfxmode="1024x768x32"}} by {{ic|1=vbemode="0x105"}}. Remember to replace the specified resolution with one suitable for your screen<br />
* To show all the modes you can use {{ic|1=# hwinfo --framebuffer}} (hwinfo is available in [community]), while at GRUB prompt you can use the {{ic|1=vbeinfo}} command<br />
}}<br />
<br />
If this method does not work for you, the deprecated {{ic|1=vga=}} method will still work. Just<br />
add it next to the {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="}} line in {{ic|/etc/default/grub}}<br />
for eg: {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=792"}} will give you a {{ic|1024x768}} resolution.<br />
<br />
You can choose one of these resolutions: {{ic|640×480}}, {{ic|800×600}}, {{ic|1024×768}}, {{ic|1280×1024}}, {{ic|1600×1200}}, {{ic|1920×1200}}<br />
<br />
==== 915resolution hack ====<br />
<br />
Some times for Intel graphic adapters neither {{ic|1=# hwinfo --framebuffer}} nor {{ic|1=vbeinfo}} will show you the desired resolution. In this case you can use {{ic|915resolution}} hack. This hack will temporarily modify video BIOS and add needed resolution. See [http://915resolution.mango-lang.org/ 915resolution's home page]<br />
<br />
First you need to find a video mode which will be modified later. For that we need the GRUB command shell:<br />
{{hc|sh:grub> 915resolution -l|<br />
Intel 800/900 Series VBIOS Hack : version 0.5.3<br />
[...]<br />
'''Mode 30''' : 640x480, 8 bits/pixel<br />
[...]<br />
}}<br />
Next, we overwrite the {{ic|Mode 30}} with {{ic|1440x900}} resolution:<br />
{{hc|/etc/grub.d/00_header|<br />
[...]<br />
'''915resolution 30 1440 900 # Inserted line'''<br />
set gfxmode&#61;${GRUB_GFXMODE}<br />
[...]<br />
}}<br />
Lastly we need to set {{ic|GRUB_GFXMODE}} as described earlier, regenerate GRUB configuration file and reboot to test changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# reboot<br />
<br />
==== Background image and bitmap fonts ====<br />
<br />
GRUB comes with support for background images and bitmap fonts in {{ic|pf2}} format. The unifont font is included in the {{Pkg|grub}} package under the filename {{ic|unicode.pf2}}, or, as only ASCII characters under the name {{ic|ascii.pf2}}.<br />
<br />
Image formats supported include tga, png and jpeg, providing the correct modules are loaded. The maximum supported resolution depends on your hardware.<br />
<br />
Make sure you have set up the proper [[#Setting the framebuffer resolution|framebuffer resolution]].<br />
<br />
Edit {{ic|/etc/default/grub}} like this:<br />
GRUB_BACKGROUND="/boot/grub/myimage"<br />
#GRUB_THEME="/path/to/gfxtheme"<br />
GRUB_FONT="/path/to/font.pf2"<br />
<br />
{{Note|If you have installed GRUB on a separate partition, {{ic|/boot/grub/myimage}} becomes {{ic|/grub/myimage}}.}}<br />
<br />
To generate the changes and add the information into {{ic|grub.cfg}}, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If adding the splash image was successful, the user will see {{ic|"Found background image..."}} in the terminal as the command is executed. <br />
If this phrase is not seen, the image information was probably not incorporated into the {{ic|grub.cfg}} file.<br />
<br />
If the image is not displayed, check:<br />
* The path and the filename in {{ic|/etc/default/grub}} are correct<br />
* The image is of the proper size and format (tga, png, 8-bit jpg)<br />
* The image was saved in the RGB mode, and is not indexed<br />
* The console mode is not enabled in {{ic|/etc/default/grub}}<br />
* The command {{ic|grub-mkconfig}} must be executed to place the background image information into the {{ic|/boot/grub/grub.cfg}} file<br />
<br />
==== Theme ====<br />
<br />
Here is an example for configuring Starfield theme which was included in GRUB package.<br />
<br />
Edit {{ic|/etc/default/grub}}<br />
GRUB_THEME="/usr/share/grub/themes/starfield/theme.txt"<br />
<br />
Generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If configuring the theme was successful, you'll see {{ic|Found theme: /usr/share/grub/themes/starfield/theme.txt}} in the terminal.<br />
Your splash image will usually not be displayed when using a theme.<br />
<br />
==== Menu colors ====<br />
<br />
You can set the menu colors in GRUB. The available colors for GRUB can be found in [https://www.gnu.org/software/grub/manual/html_node/Theme-file-format.html the GRUB Manual].<br />
Here is an example:<br />
<br />
Edit {{ic|/etc/default/grub}}:<br />
GRUB_COLOR_NORMAL="light-blue/black"<br />
GRUB_COLOR_HIGHLIGHT="light-cyan/blue"<br />
<br />
Generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Hidden menu ====<br />
<br />
One of the unique features of GRUB is hiding/skipping the menu and showing it by holding {{keypress|Esc}} when needed. You can also adjust whether you want to see the timeout counter.<br />
<br />
Edit {{ic|/etc/default/grub}} as you wish. Here is an example where the comments from the beginning of the two lines have been removed to enable the feature, the timeout has been set to five seconds and to be shown to the user:<br />
GRUB_HIDDEN_TIMEOUT=5<br />
GRUB_HIDDEN_TIMEOUT_QUIET=false<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Disable framebuffer ====<br />
<br />
Users who use NVIDIA proprietary driver might wish to disable GRUB's framebuffer as it can cause problems with the binary driver.<br />
<br />
To disable framebuffer, edit {{ic|/etc/default/grub}} and uncomment the following line:<br />
GRUB_TERMINAL_OUTPUT=console<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
Another option if you want to keep the framebuffer in GRUB is to revert to text mode just before starting the kernel. To do that modify the variable in {{ic|/etc/default/grub}}:<br />
GRUB_GFXPAYLOAD_LINUX=text<br />
<br />
and rebuild the configuration as before.<br />
<br />
=== Other Options ===<br />
<br />
==== LVM ====<br />
<br />
If you use [[LVM]] for your {{ic|/boot}}, add the following before menuentry lines:<br />
<br />
insmod lvm<br />
<br />
and specify your root in the menuentry as:<br />
<br />
set root=lvm/''lvm_group_name''-''lvm_logical_boot_partition_name''<br />
<br />
Example:<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
insmod lvm<br />
set root=lvm/VolumeGroup-lv_boot<br />
# you can only set following two lines<br />
linux /vmlinuz-linux root=/dev/mapper/VolumeGroup-root ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
==== RAID ====<br />
<br />
GRUB provides convenient handling of RAID volumes. You need to add {{ic|insmod mdraid}} which allows you to address the volume natively. For example, {{ic|/dev/md0}} becomes:<br />
set root=(md0)<br />
<br />
whereas a partitioned RAID volume (e.g. {{ic|/dev/md0p1}}) becomes:<br />
set root=(md0,1)<br />
<br />
==== Persistent block device naming ====<br />
One naming scheme for [[Persistent block device naming]] is the use of globally unique UUIDs to detect partitions instead of the "old" {{ic|/dev/sd*}}. Advantages are covered up in the above linked article. <br />
<br />
Persistent naming via filesystem UUIDs are used by default in GRUB. <br />
<br />
{{Note|The {{ic|/boot/grub.cfg}} file needs regeneration with the new UUID in {{ic|/etc/default/grub}} every time a relevant filesystem is resized or recreated. Remember this when modifying partitions & filesystems with a Live-CD.}}<br />
<br />
Whether to use UUIDs is controlled by an option in {{ic|/etc/default/grub}}:<br />
<br />
# GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Either way, do not forget to generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Using Labels ====<br />
<br />
It is possible to use labels, human-readable strings attached to filesystems, by using the {{ic|--label}} option to {{ic|search}}. First of all, label your existing partition:<br />
# tune2fs -L <LABEL> <PARTITION><br />
<br />
Then, add an entry using labels. An example of this:<br />
<br />
menuentry "Arch Linux, session texte" {<br />
search --label --set=root archroot<br />
linux /boot/vmlinuz-linux root=/dev/disk/by-label/archroot ro<br />
initrd /boot/initramfs-linux.img<br />
}<br />
<br />
==== Recall previous entry ====<br />
<br />
GRUB can remember the last entry you booted from and use this as the default entry to boot from next time. This is useful if you have multiple kernels (i.e., the current Arch one and the LTS kernel as a fallback option) or operating systems. To do this, edit {{ic|/etc/default/grub}} and change the value of {{ic|GRUB_DEFAULT}}:<br />
<br />
GRUB_DEFAULT=saved<br />
<br />
This ensures that GRUB will default to the saved entry. To enable saving the selected entry, add the following line to {{ic|/etc/default/grub}}:<br />
<br />
GRUB_SAVEDEFAULT=true<br />
<br />
{{Note|Manually added menu items, e.g. Windows in {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}, will need {{ic|savedefault}} added. Remember to regenerate([[#Generate config file]]) your configuration file.}}<br />
<br />
==== Changing the default menu entry ====<br />
<br />
To change the default selected entry, edit {{ic|/etc/default/grub}} and change the value of {{ic|GRUB_DEFAULT}}:<br />
<br />
Using numbers :<br />
GRUB_DEFAULT=0<br />
Grub identifies entries in generated menu counted from zero. That means 0 for the first entry which is the default value, 1 for the second and so on.<br />
<br />
Or using menu titles :<br />
GRUB_DEFAULT='Arch Linux, with Linux core repo kernel'<br />
<br />
{{Note|Remember to regenerate([[#Generate config file]]) your configuration file.}}<br />
<br />
==== Security ====<br />
<br />
If you want to secure GRUB so it is not possible for anyone to change boot parameters or use the command line, you can add a user/password combination to GRUB's configuration files. To do this, run the command {{ic|grub-mkpasswd-pbkdf2}}. Enter a password and confirm it:<br />
<br />
{{hc|grub-mkpasswd-pbkdf2|<br />
[...]<br />
Your PBKDF2 is grub.pbkdf2.sha512.10000.C8ABD3E93C4DFC83138B0C7A3D719BC650E6234310DA069E6FDB0DD4156313DA3D0D9BFFC2846C21D5A2DDA515114CF6378F8A064C94198D0618E70D23717E82.509BFA8A4217EAD0B33C87432524C0B6B64B34FBAD22D3E6E6874D9B101996C5F98AB1746FE7C7199147ECF4ABD8661C222EEEDB7D14A843261FFF2C07B1269A<br />
}}<br />
Then, add the following to {{ic|/etc/grub.d/00_header}}:<br />
{{hc|/etc/grub.d/00_header|<br />
cat << EOF<br />
<br />
set superusers<nowiki>=</nowiki>"'''username'''"<br />
password_pbkdf2 '''username''' '''<password>'''<br />
<br />
EOF<br />
}}<br />
where {{ic|<password>}} is the string generated by {{ic|grub-mkpasswd_pbkdf2}}.<br />
<br />
Regenerate your configuration file. Your GRUB command line, boot parameters and all boot entries are now protected.<br />
<br />
This can be relaxed and further customized with more users as described in the "Security" part of [https://www.gnu.org/software/grub/manual/grub.html#Security the GRUB manual].<br />
<br />
==== Root encryption ====<br />
<br />
To let GRUB automatically add the kernel parameters for root encryption,<br />
add {{ic|1=cryptdevice=/dev/yourdevice:label}} to {{ic|GRUB_CMDLINE_LINUX}} in {{ic|/etc/default/grub}}.<br />
<br />
{{Tip|If you're upgrading from a working GRUB Legacy configuration, check {{ic|/boot/grub/menu.lst.pacsave}} for the correct device/label to add. Look for them after the text {{ic|kernel /vmlinuz-linux}}.}}<br />
<br />
Example with root mapped to {{ic|/dev/mapper/root}}:<br />
<br />
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:root"<br />
<br />
Also, disable the usage of UUIDs for the rootfs:<br />
<br />
GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Regenerate the configuration.<br />
<br />
==== Boot non-default entry only once ====<br />
<br />
The command {{ic|grub-reboot}} is very helpful to boot another entry than the default only once. GRUB loads the entry passed in the first command line argument, when the system is rebooted the next time. Most importantly GRUB returns to loading the default entry for all future booting. Changing the configuration file or selecting an entry in the GRUB menu is not necessary.<br />
{{Note|This requires {{ic|1=GRUB_DEFAULT=saved}} in {{ic|/etc/default/grub}} (and then regenerating {{ic|grub.cfg}}) or, in case of hand-made {{ic|grub.cfg}}, the line {{ic|1=set default="${saved_entry}"}}.}}<br />
<br />
=== Booting an ISO directly from GRUB ===<br />
<br />
Edit {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} to add an entry for the target ISO. When finished, update the GRUB menu as with the usual {{ic|grub-mkconfig -o /boot/grub/grub.cfg}} (as root).<br />
<br />
==== Arch ISO ====<br />
<br />
{{Note|The following examples assume the ISO is in {{ic|/archives}} on {{ic|hd0,6}}.}}<br />
{{Tip|For thumbdrives, use something like {{ic|(hd1,$partition)}} and either {{ic|/dev/sdb'''Y'''}} for the {{ic|img_dev}} parameter or [[Persistent_block_device_naming|a persistent name]], e.g. {{ic|img_dev&#61;/dev/disk/by-label/CORSAIR}}.}}<br />
<br />
===== x86_64 =====<br />
<br />
menuentry "Archlinux-2013.05.01-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.05.01-dual.iso"<br />
set partition="6"<br />
loopback loop (hd0,$partition)/$isofile<br />
linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201305 img_dev=/dev/sda$partition img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/x86_64/archiso.img<br />
}<br />
<br />
===== i686 =====<br />
<br />
menuentry "Archlinux-2013.05.01-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.05.01-dual.iso"<br />
set partition="6"<br />
loopback loop (hd0,$partition)/$isofile<br />
linux (loop)/arch/boot/i686/vmlinuz archisolabel=ARCH_201305 img_dev=/dev/sda$partition img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/i686/archiso.img<br />
}<br />
<br />
==== Ubuntu ISO ====<br />
<br />
{{Note|The example assumes that the iso is in {{ic|/archives}} on {{ic|hd0,6}}. Users must adjust the location and hdd/partition in the lines below to match their systems.}}<br />
<br />
menuentry "ubuntu-13.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-13.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)/$isofile<br />
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
menuentry "ubuntu-12.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-12.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)/$isofile<br />
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
==== Other ISOs ====<br />
<br />
Other working configurations from [http://askubuntu.com/questions/141940/how-to-boot-live-iso-images link Source].<br />
<br />
== Using the command shell ==<br />
<br />
Since the MBR is too small to store all GRUB modules, only the menu and a few basic commands reside there. The majority of GRUB functionality remains in modules in {{ic|/boot/grub}}, which are inserted as needed. In error conditions (e.g. if the partition layout changes) GRUB may fail to boot. When this happens, a command shell may appear.<br />
<br />
GRUB offers multiple shells/prompts. If there is a problem reading the menu but the bootloader is able to find the disk, you will likely be dropped to the "normal" shell:<br />
sh:grub><br />
<br />
If there is a more serious problem (e.g. GRUB cannot find required files), you may instead be dropped to the "rescue" shell:<br />
grub rescue><br />
<br />
The rescue shell is a restricted subset of the normal shell, offering much less functionality. If dumped to the rescue shell, first try inserting the "normal" module, then starting the "normal" shell:<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
grub rescue> insmod (hdX,Y)/boot/grub/i386-pc/normal.mod<br />
rescue:grub> normal<br />
<br />
=== Pager support ===<br />
<br />
GRUB supports pager for reading commands that provide long output (like the {{ic|help}} command). This works only in normal shell mode and not in rescue mode. To enable pager, in GRUB command shell type:<br />
sh:grub> set pager=1<br />
<br />
== GUI configuration tools ==<br />
<br />
Following package may be installed:<br />
* {{App|grub-customizer|Customize the bootloader (GRUB or BURG)|https://launchpad.net/grub-customizer|{{AUR|grub-customizer}}}}<br />
* {{App|grub2-editor|KDE4 control module for configuring the GRUB bootloader|http://kde-apps.org/content/show.php?content&#61;139643|{{AUR|grub2-editor}}}}<br />
* {{App|kcm-grub2|This Kcm module manages the most common settings of GRUB|http://kde-apps.org/content/show.php?content&#61;137886|{{AUR|kcm-grub2}}}}<br />
* {{App|startupmanager|GUI app for changing the settings of GRUB Legacy, GRUB, Usplash and Splashy|http://sourceforge.net/projects/startup-manager/|{{AUR|startupmanager}}}}<br />
<br />
== parttool for hide/unhide ==<br />
<br />
If you have a Windows 9x paradigm with hidden {{ic|C:\}} disks GRUB can hide/unhide it using {{ic|parttool}}. For example, to boot the third {{ic|C:\}} disk of three Windows 9x installations on the CLI enter the CLI and:<br />
parttool hd0,1 hidden+ boot-<br />
parttool hd0,2 hidden+ boot-<br />
parttool hd0,3 hidden- boot+<br />
set root=hd0,3<br />
chainloader +1<br />
boot<br />
<br />
== Using the rescue console ==<br />
<br />
See [[#Using the command shell]] first. If unable to activate the standard shell, one possible solution is to boot using a live CD or some other rescue disk to correct configuration errors and reinstall GRUB. However, such a boot disk is not always available (nor necessary); the rescue console is surprisingly robust.<br />
<br />
The available commands in GRUB rescue include {{ic|insmod}}, {{ic|ls}}, {{ic|set}}, and {{ic|unset}}. This example uses {{ic|set}} and {{ic|insmod}}. {{ic|set}} modifies variables and {{ic|insmod}} inserts new modules to add functionality.<br />
<br />
Before starting, the user must know the location of their {{ic|/boot}} partition (be it a separate partition, or a subdirectory under their root):<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
<br />
where X is the physical drive number and Y is the partition number.<br />
<br />
To expand console capabilities, insert the {{ic|linux}} module:<br />
grub rescue> insmod (hdX,Y)/boot/grub/linux.mod<br />
<br />
{{Note|With a separate boot partition, omit {{ic|/boot}} from the path, (i.e. type {{ic|1=set prefix=(hdX,Y)/grub}} and {{ic|insmod (hdX,Y)/grub/linux.mod}}).}}<br />
<br />
This introduces the {{ic|linux}} and {{ic|initrd}} commands, which should be familiar (see [[#Configuration]]).<br />
<br />
An example, booting Arch Linux:<br />
set root=(hd0,5)<br />
linux /boot/vmlinuz-linux root=/dev/sda5<br />
initrd /boot/initramfs-linux.img<br />
boot<br />
<br />
With a separate boot partition, again change the lines accordingly:<br />
set root=(hd0,5)<br />
linux /vmlinuz-linux root=/dev/sda6<br />
initrd /initramfs-linux.img<br />
boot<br />
<br />
After successfully booting the Arch Linux installation, users can correct {{ic|grub.cfg}} as needed and then reinstall GRUB.<br />
<br />
To reinstall GRUB and fix the problem completely, changing {{ic|/dev/sda}} if needed. See [[#Bootloader installation]] for details.<br />
<br />
== Combining the use of UUIDs and basic scripting ==<br />
<br />
If you like the idea of using UUIDs to avoid unreliable BIOS mappings or are struggling with GRUB's syntax, here is an example boot menu item that uses UUIDs and a small script to direct GRUB to the proper disk partitions for your system. All you need to do is replace the UUIDs in the sample with the correct UUIDs for your system. The example applies to a system with a boot and root partition. You will obviously need to modify the GRUB configuration if you have additional partitions:<br />
<br />
menuentry "Arch Linux 64" {<br />
# Set the UUIDs for your boot and root partition respectively<br />
set the_boot_uuid=ece0448f-bb08-486d-9864-ac3271bd8d07<br />
set the_root_uuid=c55da16f-e2af-4603-9e0b-03f5f565ec4a<br />
<br />
# (Note: This may be the same as your boot partition)<br />
<br />
# Get the boot/root devices and set them in the root and grub_boot variables<br />
search --fs-uuid --set=root $the_root_uuid<br />
search --fs-uuid --set=grub_boot $the_boot_uuid<br />
<br />
# Check to see if boot and root are equal.<br />
# If they are, then append /boot to $grub_boot (Since $grub_boot is actually the root partition)<br />
if [ $the_boot_uuid == $the_root_uuid] ; then<br />
set grub_boot=$grub_boot/boot<br />
fi<br />
<br />
# $grub_boot now points to the correct location, so the following will properly find the kernel and initrd<br />
linux ($grub_boot)/vmlinuz-linux root=/dev/disk/by-uuid/$uuid_os_root ro<br />
initrd ($grub_boot)/initramfs-linux.img<br />
}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Intel BIOS not booting GPT ===<br />
<br />
Some Intel BIOS's require at least one bootable MBR partition to be present at boot, causing GPT-partitioned boot setups to be unbootable.<br />
<br />
This can be circumvented by using (for instance) fdisk to mark one of the GPT partitions (preferably the 1007 KiB partition you've created for GRUB already) bootable in the MBR. This can be achieved, using fdisk, by the following commands: Start fdisk against the disk you're installing, for instance {{ic|fdisk /dev/sda}}, then press {{keypress|a}} and select the partition you wish to mark as bootable (probably #1) by pressing the corresponding number, finally press {{keypress|w}} to write the changes to the MBR.<br />
<br />
{{Note|The bootable-marking must be done in {{ic|fdisk}} or similar, not in GParted or others, as they will not set the bootable flag in the MBR.}}<br />
<br />
More information is available [http://www.rodsbooks.com/gdisk/bios.html here]<br />
<br />
=== Enable debug messages ===<br />
<br />
Add:<br />
<br />
set pager=1<br />
set debug=all<br />
<br />
to {{ic|grub.cfg}}.<br />
<br />
=== "No suitable mode found" error ===<br />
<br />
If you get this error when booting any menuentry:<br />
<br />
error: no suitable mode found<br />
Booting however<br />
<br />
Then you need to initialize GRUB graphical terminal ({{ic|gfxterm}}) with proper video mode ({{ic|gfxmode}}) in GRUB. This video mode is passed by GRUB to the linux kernel via 'gfxpayload'. In case of UEFI systems, if the GRUB video mode is not initialized, no kernel boot messages will be shown in the terminal (atleast until KMS kicks in).<br />
<br />
Copy {{ic|/usr/share/grub/unicode.pf2}} to ${GRUB_PREFIX_DIR} ({{ic|/boot/grub/}} in case of BIOS and UEFI systems). If GRUB UEFI was installed with {{ic|1=--boot-directory=/boot/efi/EFI}} set, then the directory is {{ic|/boot/efi/EFI/grub/}}:<br />
<br />
# cp /usr/share/grub/unicode.pf2 ${GRUB_PREFIX_DIR}<br />
<br />
If {{ic|/usr/share/grub/unicode.pf2}} does not exist, install {{Pkg|bdf-unifont}}, create the {{ic|unifont.pf2}} file and then copy it to {{ic|${GRUB_PREFIX_DIR<nowiki>}</nowiki>}}:<br />
<br />
# grub-mkfont -o unicode.pf2 /usr/share/fonts/misc/unifont.bdf<br />
<br />
Then, in the {{ic|grub.cfg}} file, add the following lines to enable GRUB to pass the video mode correctly to the kernel, without of which you will only get a black screen (no output) but booting (actually) proceeds successfully without any system hang.<br />
<br />
BIOS systems:<br />
<br />
insmod vbe<br />
<br />
UEFI systems:<br />
<br />
insmod efi_gop<br />
insmod efi_uga<br />
<br />
After that add the following code (common to both BIOS and UEFI):<br />
<br />
insmod font<br />
<br />
if loadfont ${prefix}/fonts/unicode.pf2<br />
then<br />
insmod gfxterm<br />
set gfxmode=auto<br />
set gfxpayload=keep<br />
terminal_output gfxterm<br />
fi<br />
<br />
As you can see for gfxterm (graphical terminal) to function properly, {{ic|unicode.pf2}} font file should exist in {{ic|${GRUB_PREFIX_DIR<nowiki>}</nowiki>}}.<br />
<br />
=== msdos-style error message ===<br />
<br />
grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding won't be possible!<br />
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.<br />
However, blocklists are UNRELIABLE and its use is discouraged.<br />
grub-setup: error: If you really want blocklists, use --force.<br />
<br />
This error may occur when you try installing GRUB in a VMware container. Read more about it [https://bbs.archlinux.org/viewtopic.php?pid=581760#p581760 here]. It happens when the first partition starts just after the MBR (block 63), without the usual space of 1 MiB (2048 blocks) before the first partition. Read [[#Master Boot Record (MBR) specific instructions]]<br />
<br />
=== GRUB UEFI drops to shell ===<br />
<br />
If GRUB loads but drops you into the rescue shell with no errors, it may be because of a missing or misplaced {{ic|grub.cfg}}. This will happen if GRUB UEFI was installed with {{ic|--boot-directory}} and {{ic|grub.cfg}} is missing OR if the partition number of the boot partition changed (which is hard-coded into the {{ic|grubx64.efi}} file).<br />
<br />
=== GRUB UEFI not loaded ===<br />
<br />
An example of a working EFI:<br />
{{hc|# efibootmgr -v|<br />
BootCurrent: 0000<br />
Timeout: 3 seconds<br />
BootOrder: 0000,0001,0002<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\efi\grub\grub.efi)<br />
Boot0001* Shell HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\EfiShell.efi)<br />
Boot0002* Festplatte BIOS(2,0,00)P0: SAMSUNG HD204UI<br />
}}<br />
<br />
If the screen only goes black for a second and the next boot option is tried afterwards, according to [https://bbs.archlinux.org/viewtopic.php?pid=981560#p981560 this post], moving GRUB to the partition root can help. The boot option has to be deleted and recreated afterwards. The entry for GRUB should look like this then:<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\grub.efi)<br />
<br />
=== Invalid signature ===<br />
<br />
If trying to boot Windows results in an "invalid signature" error, e.g. after reconfiguring partitions or adding additional hard drives, (re)move GRUB's device configuration and let it reconfigure:<br />
# mv /boot/grub/device.map /boot/grub/device.map-old<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
{{ic|grub-mkconfig}} should now mention all found boot options, including Windows. If it works, remove {{ic|/boot/grub/device.map-old}}.<br />
<br />
=== Boot freezes ===<br />
<br />
If booting gets stuck without any error message after GRUB loading the kernel and the initial ramdisk, try removing the {{ic|add_efi_memmap}} kernel parameter.<br />
<br />
=== Restore GRUB Legacy ===<br />
<br />
* Move GRUB v2 files out of the way:<br />
<br />
# mv /boot/grub /boot/grub.nonfunctional<br />
<br />
* Copy GRUB Legacy back to {{ic|/boot}}:<br />
<br />
# cp -af /boot/grub-legacy /boot/grub<br />
<br />
* Replace MBR and next 62 sectors of sda with backed up copy<br />
<br />
{{Warning|This command also restores the partition table, so be careful of overwriting a modified partition table with the old one. It '''will''' mess up your system.}}<br />
<br />
# dd if=/path/to/backup/first-sectors of=/dev/sdX bs=512 count=1<br />
<br />
A safer way is to restore only the MBR boot code use:<br />
<br />
# dd if=/path/to/backup/mbr-boot-code of=/dev/sdX bs=446 count=1<br />
<br />
=== Arch not found from other OS ===<br />
Some have reported that other distributions have trouble finding Arch Linux automatically with os-prober. If this problem arises, it has been reported that detection can be improved with the presence of /etc/lsb-release. This file and updating tool is available with the package {{ic|lsb-release}} in the [[community]] repository.<br />
<br />
== References ==<br />
<br />
# Official GRUB Manual - https://www.gnu.org/software/grub/manual/grub.html<br />
# Ubuntu wiki page for GRUB - https://help.ubuntu.com/community/Grub2<br />
# GRUB wiki page describing steps to compile for UEFI systems - https://help.ubuntu.com/community/UEFIBooting<br />
# Wikipedia's page on [[Wikipedia:BIOS Boot partition|BIOS Boot partition]]<br />
<br />
== See also ==<br />
<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_bios.sh A Linux Bash Shell script to compile and install GRUB for BIOS from BZR Source]<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_uefi.sh A Linux Bash Shell script to compile and install GRUB for UEFI from BZR Source]</div>Cinellihttps://wiki.archlinux.org/index.php?title=GRUB&diff=264366GRUB2013-06-26T16:58:42Z<p>Cinelli: /* Install to GPT BIOS boot partition */ grub.mo removed.</p>
<hr />
<div>[[Category:Boot loaders]]<br />
[[ar:GRUB]]<br />
[[cs:GRUB2]]<br />
[[de:GRUB]]<br />
[[es:GRUB2]]<br />
[[fr:GRUB2]]<br />
[[id:GRUB2]]<br />
[[it:GRUB2]]<br />
[[ru:GRUB2]]<br />
[[tr:GRUB2]]<br />
[[zh-CN:GRUB2]]<br />
[[zh-TW:GRUB2]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers various aspects of version 2 of the GRand Unified Bootloader (GRUB).}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|BURG}} - BURG is a brand-new boot loader based on GRUB v2. It can be built on a wider range of OS, and has a highly configurable menu system which works in both text and graphic mode. <br />
{{Article summary wiki|GRUB Legacy}} - previous Version, now obsolete.<br />
{{Article summary heading|Resources}}<br />
{{Article summary wiki|GRUB EFI Examples}}<br />
{{Article summary link|GNU GRUB - GNU Project|https://www.gnu.org/software/grub/}}<br />
{{Article summary end}}<br />
<br />
[https://www.gnu.org/software/grub/ GRUB] - not to be confused with [[GRUB Legacy]] - is the next generation of the GRand Unified Bootloader. GRUB is derived from [http://www.nongnu.org/pupa/ PUPA] which was a research project to develop the next generation of what is now GRUB Legacy. GRUB has been rewritten from scratch to clean up everything and provide modularity and portability [https://www.gnu.org/software/grub/grub-faq.html#q1].<br />
<br />
In brief, the ''bootloader'' is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the Linux kernel. The kernel, in turn, initializes the rest of the operating system.<br />
<br />
== Preface ==<br />
<br />
* The name ''GRUB'' officially refers to version ''2'' of the software, see [https://www.gnu.org/software/grub/]. If you are looking for the article on the legacy version, see [[GRUB Legacy]].<br />
* GRUB supports [[Btrfs]] as root (without a separate {{ic|/boot}} filesystem) compressed with either zlib or LZO<br />
<br />
=== Notes for current GRUB Legacy users ===<br />
<br />
* Upgrading from [[GRUB Legacy]] to GRUB is much the same as freshly installing GRUB, which is covered [[#Installation|below]]<br />
* There are differences in the commands of GRUB Legacy and GRUB. Familiarize yourself with [https://www.gnu.org/software/grub/manual/grub.html#Commands GRUB commands] before proceeding (e.g. "find" has been replaced with "search")<br />
* GRUB is now ''modular'' and no longer requires "stage 1.5". As a result, the bootloader itself is limited -- modules are loaded from the hard drive as needed to expand functionality (e.g. for [[LVM]] or RAID support)<br />
* Device naming has changed between GRUB Legacy and GRUB. Partitions are numbered from 1 instead of 0 while drives are still numbered from 0, and prefixed with partition-table type. For example, {{ic|/dev/sda1}} would be referred to as {{ic|(hd0,msdos1)}} (for MBR) or {{ic|(hd0,gpt1)}} (for GPT)<br />
* If you use systemd without systemd-sysvcompat, and have had {{ic|<nowiki>init=/usr/lib/systemd/systemd</nowiki>}} in your old grub menu.lst, the automatically generated grub.cfg file might not carry over this kernel parameter (giving you "ERROT: Root device mounted successfully, but /sbin/init does not exist" on boot). If so, edit the Arch Linux entry that grub shows you, add {{ic|<nowiki>init=/usr/lib/systemd/systemd</nowiki>}} to the kernel parameters, and then [[Grub#Additional_arguments|make it permanent]].<br />
* GRUB is noticably bigger than GRUB legacy (occupies ~13 MB in /boot). If you are booting from a separate /boot partition, and this partition is smaller than 32 MB, you will run into disk space issues, and pacman will refuse to install new kernels. If you don't want to re-partition your system, switch to [[Syslinux]] instead, which is smaller (occupies ~1.5 MB in /boot).<br />
<br />
==== Backup important data ====<br />
<br />
Although a GRUB installation should run smoothly, it is strongly recommended to keep the GRUB Legacy files before upgrading to GRUB v2.<br />
<br />
# mv /boot/grub /boot/grub-legacy<br />
<br />
Backup the MBR which contains the boot code and partition table (Replace {{ic|/dev/sd'''X'''}} with your actual disk path):<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/mbr_backup bs=512 count=1<br />
<br />
Only 446 bytes of the MBR contain boot code, the next 64 contain the partition table. If you do not want to overwrite your partition table when restoring, it is strongly advised to backup only the MBR boot code:<br />
<br />
# dd if=/dev/sdX of=/path/to/backup/bootcode_backup bs=446 count=1<br />
<br />
If unable to install GRUB2 correctly, see [[#Restore GRUB Legacy]].<br />
<br />
=== Preliminary requirements ===<br />
<br />
==== BIOS systems ====<br />
<br />
===== GUID Partition Table (GPT) specific instructions =====<br />
<br />
GRUB in [[GPT|BIOS-GPT]] configuration requires a [http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html BIOS boot partition] to embed its {{ic|core.img}} in the absence of post-MBR gap in GPT partitioned systems (which is taken over by the GPT Primary Header and Primary Partition table). This partition is used by GRUB only in BIOS-GPT setups. No such partition type exists in case of MBR partitioning (at least not for GRUB). This partition is also not required if the system is UEFI based, as no embedding of bootsectors takes place in that case.<br />
<br />
For a BIOS-GPT configuration, create a 1007 KiB partition at the beginning of the disk using gdisk, cgdisk or GNU Parted with no filesystem. The size of 1007 KiB will allow for the following partition to be correctly alligned at 1024 KiB. If needed, the partition can also be located somewhere else on the disk, but it should be within the first 2 TiB region. Set the partition type to {{ic|ef02}} in (c)gdisk or {{ic|set <BOOT_PART_NUM> bios_grub on}} in GNU Parted.<br />
<br />
{{Note|<br />
* This partition should be created before {{ic|grub-install}} or {{ic|grub-setup}} is run<br />
* gdisk will only allow you to create this partition on the position which will waste the least amount of space (sector 34-2047) if you create it last, after all the other partitions. This is because gdisk will auto-align partitions to 2048-sector boundaries if possible<br />
}}<br />
<br />
===== Master Boot Record (MBR) specific instructions =====<br />
<br />
Usually the post-[[MBR]] gap (after the 512 byte MBR region and before the start of the 1st partition) in many MBR (or msdos disklabel) partitioned systems is 31 KiB when DOS compatibility cylinder alignment issues are satisfied in the partition table. However a post-MBR gap of about 1 to 2 MiB is recommended to provide sufficient room for embedding GRUB's {{ic|core.img}} ({{bug|24103}}). It is advisable to use a partitioner which supports 1 MiB partition alignment to obtain this space as well as satisfy other non-512 byte sector issues (which are unrelated to embedding of {{ic|core.img}}).<br />
<br />
==== UEFI systems ====<br />
<br />
{{Note|It is recommended to read and understand the [[Unified Extensible Firmware Interface|UEFI]], [[GUID Partition Table|GPT]] and [[UEFI Bootloaders]] pages.}}<br />
<br />
===== Create and Mount the UEFI System Partition =====<br />
<br />
Follow [[Unified Extensible Firmware Interface#EFI System Partition]] for instructions on creating a UEFI System Partition. Then mount the UEFI System Partition at {{ic|/boot/efi}}. If you have mounted the UEFI System Partition at some other mountpoint, replace {{ic|/boot/efi}} in the below instructions with that mountpoint:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat <UEFI_SYSTEM_PARTITION> /boot/efi<br />
<br />
Create a {{ic|/boot/efi/EFI}} directory:<br />
<br />
# mkdir /boot/efi/EFI<br />
<br />
== Installation ==<br />
<br />
=== BIOS systems ===<br />
<br />
GRUB can be [[pacman|installed]] with the {{Pkg|grub}} package from the [[official repositories]]. It will replace {{Pkg|grub-legacy}} , if it is installed.<br />
<br />
{{Note|Simply installing the package won't update the {{ic|/boot/grub/i386-pc/core.img}} file and the GRUB modules in {{ic|/boot/grub/i386-pc}}. You need to update them manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install boot files ====<br />
<br />
There are 3 ways to install GRUB boot files in BIOS booting:<br />
* [[#Install to GPT BIOS boot partition]] (recommended with [[GPT]])<br />
* [[#Install to 440-byte MBR boot code region]] (recommended with [[MBR]])<br />
* [[#Install to partition or partitionless disk]] (not recommended)<br />
* [[#Generate core.img alone]] (safest method, but requires another BIOS bootloader like [[GRUB Legacy]] or [[Syslinux]] to be installed to chainload {{ic|/boot/grub/i386-pc/core.img}})<br />
<br />
{{Note|See http://www.gnu.org/software/grub/manual/html_node/BIOS-installation.html for additional documentation.}}<br />
<br />
===== Install to GPT BIOS boot partition =====<br />
<br />
[[GUID Partition Table]] disks do not have a reserved "boot track". Therefore you must create a BIOS Boot Partition ({{ic|ef02}}) to hold the GRUB core image.<br />
<br />
Using GNU Parted, you can set this using a command such as the following:<br />
<br />
# parted /dev/disk set <partition-number> bios_grub on<br />
<br />
If you are using gdisk, set the partition type to {{ic|ef02}}. With partitioning programs that require setting the GUID directly, it should be {{ic|‘21686148-6449-6e6f-744e656564454649’}} (or, {{ic|[[wikipedia:BIOS_Boot_partition|Hah!IdontNeedEFI]]}}).<br />
<br />
{{Warning|Be very careful which partition you select when marking it as a BIOS Boot Partition. When GRUB finds a BIOS Boot Partition during installation, it will automatically overwrite part of it. Make sure that the partition does not contain any other data.}}<br />
<br />
To setup {{ic|grub}} on a GPT disk, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, and embed it in the BIOS Boot Partition, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --recheck --debug /dev/sda<br />
<br />
where {{ic|/dev/sda}} is the destination of the installation.<br />
<br />
Continue with [[GRUB#Generate config file]] below.<br />
<br />
===== Install to 440-byte MBR boot code region =====<br />
<br />
To setup {{ic|grub}} in the 440-byte Master Boot Record boot code region, populate the {{ic|/boot/grub}} directory, generate the {{ic|/boot/grub/i386-pc/core.img}} file, embed it in the 31 KiB (minimum size - varies depending on partition alignment) post-MBR gap, and generate the configuration file, run:<br />
<br />
# modprobe dm-mod<br />
# grub-install --recheck /dev/sdX<br />
<br />
where {{ic|/dev/sdX}} is the destination of the installation (in this case the MBR of the first SATA disk). If you use [[LVM]] for your {{ic|/boot}}, you can install GRUB on multiple physical disks.<br />
<br />
{{Warning|Make sure to check the {{ic|/boot}} directory if you use the latter. Sometimes the {{ic|boot-directory}} parameter creates another {{ic|/boot}} folder inside of {{ic|/boot}}. A wrong install would look like: {{ic|/boot/boot/grub/}}.}}<br />
<br />
Continue with [[GRUB#Generate config file]] below.<br />
<br />
===== Install to partition or partitionless disk =====<br />
<br />
{{Note|GRUB does not encourage installation to a partition boot sector or a partitionless disk like GRUB Legacy or Syslinux does. This kind of setup is prone to breakage, especially during updates, and is not supported by Arch devs.}}<br />
<br />
To set up grub to a partition boot sector, to a partitionless disk (also called superfloppy) or to a floppy disk, run (using for example {{ic|/dev/sdaX}} as the {{ic|/boot}} partition):<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=i386-pc --recheck --debug --force /dev/sdaX<br />
# chattr -i /boot/grub/i386-pc/core.img<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
# chattr +i /boot/grub/i386-pc/core.img<br />
<br />
You need to use the {{ic|--force}} option to allow usage of blocklists and should not use {{ic|1=--grub-setup=/bin/true}} (which is similar to simply generating {{ic|core.img}}).<br />
<br />
{{ic|grub-install}} will give out warnings like which should give you the idea of what might go wrong with this approach:<br />
<br />
/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.<br />
/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. <br />
However, blocklists are UNRELIABLE and their use is discouraged.<br />
<br />
Without {{ic|--force}} you may get the below error and {{ic|grub-setup}} will not setup its boot code in the partition boot sector:<br />
<br />
/sbin/grub-setup: error: will not proceed with blocklists<br />
<br />
With {{ic|--force}} you should get:<br />
<br />
Installation finished. No error reported.<br />
<br />
The reason why {{ic|grub-setup}} does not by default allow this is because in case of partition or a partitionless disk is that {{ic|grub}} relies on embedded blocklists in the partition bootsector to locate the {{ic|/boot/grub/i386-pc/core.img}} file and the prefix dir {{ic|/boot/grub}}. The sector locations of {{ic|core.img}} may change whenever the filesystem in the partition is being altered (files copied, deleted etc.). For more info see https://bugzilla.redhat.com/show_bug.cgi?id=728742 and https://bugzilla.redhat.com/show_bug.cgi?id=730915.<br />
<br />
The workaround for this is to set the immutable flag on {{ic|/boot/grub/i386-pc/core.img}} (using chattr command as mentioned above) so that the sector locations of the {{ic|core.img}} file in the disk is not altered. The immutable flag on {{ic|/boot/grub/i386-pc/core.img}} needs to be set only if {{ic|grub}} is installed to a partition boot sector or a partitionless disk, not in case of installation to MBR or simple generation of {{ic|core.img}} without embedding any bootsector (mentioned above).<br />
<br />
===== Generate core.img alone =====<br />
<br />
To populate the {{ic|/boot/grub}} directory and generate a {{ic|/boot/grub/i386-pc/core.img}} file '''without''' embedding any {{ic|grub}} bootsector code in the MBR, post-MBR region, or the partition bootsector, add {{ic|1=--grub-setup=/bin/true}} to {{ic|grub-install}}:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=i386-pc --grub-setup=/bin/true --recheck --debug /dev/sda<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
You can then chainload GRUB's {{ic|core.img}} from GRUB Legacy or syslinux as a Linux kernel or a multiboot kernel.<br />
<br />
==== Generate config file ====<br />
<br />
Finally, generate a configuration for GRUB (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|/boot/grub/grub.cfg}}, NOT {{ic|/boot/grub/i386-pc/grub.cfg}}.}}<br />
<br />
If GRUB complains about "no suitable mode found" while booting, go to [[#"No suitable mode found" error]].<br />
<br />
If {{ic|grub-mkconfig}} fails, convert your {{ic|/boot/grub/menu.lst}} file to {{ic|/boot/grub/grub.cfg}} using:<br />
<br />
# grub-menulst2cfg /boot/grub/menu.lst /boot/grub/grub.cfg<br />
<br />
For example:<br />
<br />
{{hc|/boot/grub/menu.lst|<nowiki><br />
default=0<br />
timeout=5<br />
<br />
title Arch Linux Stock Kernel<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux.img<br />
<br />
title Arch Linux Stock Kernel Fallback<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/sda2 ro<br />
initrd /initramfs-linux-fallback.img<br />
</nowiki>}}<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
set default='0'; if [ x"$default" = xsaved ]; then load_env; set default="$saved_entry"; fi<br />
set timeout=5<br />
<br />
menuentry 'Arch Linux Stock Kernel' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux.img' '/initramfs-linux.img'<br />
<br />
}<br />
<br />
menuentry 'Arch Linux Stock Kernel Fallback' {<br />
set root='(hd0,1)'; set legacy_hdbias='0'<br />
legacy_kernel '/vmlinuz-linux' '/vmlinuz-linux' 'root=/dev/sda2' 'ro'<br />
legacy_initrd '/initramfs-linux-fallback.img' '/initramfs-linux-fallback.img'<br />
}<br />
</nowiki>}}<br />
<br />
If you forgot to create a GRUB {{ic|/boot/grub/grub.cfg}} config file and simply rebooted into GRUB Command Shell, type:<br />
<br />
sh:grub> insmod legacycfg<br />
sh:grub> legacy_configfile ${prefix}/menu.lst<br />
<br />
Boot into Arch and re-create the proper GRUB {{ic|/boot/grub/grub.cfg}} config file.<br />
<br />
{{Note|This option works only in BIOS systems, not in UEFI systems.}}<br />
<br />
==== Multiboot ====<br />
This should work out of the box, but an extra utility needs to be installed: os-prober. Install it, then rerun grub-mkconfig -o /boot/grub/grub.cfg. If this fails, you can try manually adding an entry by following the instructions below.<br />
<br />
===== Microsoft Windows installed in BIOS-MBR mode =====<br />
<br />
{{Note|GRUB supports booting {{ic|bootmgr}} directly and chainload of partition boot sector is no longer required to boot Windows in a BIOS-MBR setup.}}<br />
<br />
{{Warning|It is the '''system partition''' that has {{ic|bootmgr}}, not your "real" Windows partition (usually C:). When showing all UUIDs with blkid, the system partition is the one with {{ic|LABEL&#61;"SYSTEM RESERVED"}} and is only about 100 MB in size (much like the boot partition for Arch). See [[Wikipedia:System partition and boot partition]] for more info.}}<br />
<br />
Throughout this section, it is assumed your Windows partition is /dev/sda1. A different partition will change every instance of hd0,msdos1. First, find the UUID of the NTFS filesystem of the Windows's SYSTEM PARTITION where the {{ic|bootmgr}} and its files reside. For example, if Windows {{ic|bootmgr}} exists at {{ic|/media/SYSTEM_RESERVED/bootmgr}}:<br />
<br />
For Windows Vista/7/8:<br />
<br />
# grub-probe --target=fs_uuid /media/SYSTEM_RESERVED/bootmgr<br />
69B235F6749E84CE<br />
<br />
# grub-probe --target=hints_string /media/SYSTEM_RESERVED/bootmgr<br />
--hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1<br />
<br />
{{Note|For Windows XP, replace {{ic|bootmgr}} with {{ic|NTLDR}} in the above commands. And note that there may not be a separate SYSTEM_RESERVED partition; just probe the file NTLDR on your Windows partition.}}<br />
<br />
Then, add the below code to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} and regenerate {{ic|grub.cfg}} with {{ic|grub-mkconfig}} as explained above to boot Windows (XP, Vista, 7 or 8) installed in BIOS-MBR mode:<br />
<br />
For Windows Vista/7/8:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 BIOS-MBR" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /bootmgr<br />
}<br />
<br />
For Windows XP:<br />
<br />
menuentry "Microsoft Windows XP" {<br />
insmod part_msdos<br />
insmod ntfs<br />
insmod search_fs_uuid<br />
insmod ntldr <br />
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE<br />
ntldr /ntldr<br />
}<br />
<br />
{{ic|/etc/grub.d/40_custom}} can be used as a template to create {{ic|/etc/grub.d/nn_custom}}. Where {{ic|nn}} defines the precendence, indicating the order the script is executed. The order scripts are executed determine the placement in the grub boot menu.<br />
<br />
{{Note|{{ic|nn}} should be greater than 06 to ensure necessary scripts are executed first.}}<br />
<br />
=== UEFI systems ===<br />
<br />
{{Note|It is well know that different motherboard manufactures implement UEFI differently. Users experiencing problems getting Grub/EFI to work properly are encouraged to share detailed steps for hardware-specific cases where UEFI booting does not work as described below. In an effort to keep the parent [[GRUB]] article neat and tidy, see the [[GRUB EFI Examples]] page for these special cases.}}<br />
<br />
First install the {{Pkg|grub}} package and then follow the instructions below.<br />
<br />
{{Note|Simply installing the package will not update the {{ic|core.efi}} file and the GRUB modules in the UEFI System Partition. You need to do this manually using {{ic|grub-install}} as explained below.}}<br />
<br />
==== Install boot files ====<br />
<br />
===== Install to UEFI system partition =====<br />
<br />
{{Note|<br />
* The below commands assume you are using installing GRUB for {{ic|x86_64-efi}} (for {{ic|IA32-efi}} replace {{ic|x86_64}} with {{ic|i386}} in the below commands)<br />
* To do this, you need to boot using UEFI and not the BIOS. If you booted by just copying the ISO file to the USB drive, you will need to follow [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO|this guide]] or grub-install will show errors<br />
}}<br />
<br />
The UEFI system partition will need to be mounted at {{ic|/boot/efi/}} for the GRUB install script to detect it:<br />
<br />
# mkdir -p /boot/efi<br />
# mount -t vfat /dev/sdXY /boot/efi<br />
<br />
Install GRUB UEFI application to {{ic|/boot/efi/EFI/arch_grub}} and its modules to {{ic|/boot/grub/x86_64-efi}} (recommended) using:<br />
<br />
# modprobe dm-mod<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
{{Note|Without {{ic|--target}} or {{ic|--directory}} option, grub-install cannot determine for which firmware GRUB is being installed. In such cases {{ic|grub-install}} will show {{ic|source_dir doesn't exist. Please specify --target or --directory}} message.}}<br />
<br />
If you want to install GRUB modules and {{ic|grub.cfg}} at the directory {{ic|/boot/efi/EFI/grub}} and the {{ic|grubx64.efi}} application at {{ic|/boot/efi/EFI/arch_grub}} (ie. all the GRUB UEFI files inside the UEFISYS partition itself) use:<br />
<br />
# modprobe dm-mod <br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug<br />
# mkdir -p /boot/efi/EFI/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/efi/EFI/grub/locale/en.mo<br />
<br />
The {{ic|--efi-directory}} option mentions the mountpoint of UEFI SYSTEM PARTITION , {{ic|--bootloader-id}} mentions the name of the directory used to store the {{ic|grubx64.efi}} file and {{ic|--boot-directory}} mentions the directory wherein the actual modules will be installed (and into which {{ic|grub.cfg}} should be created).<br />
<br />
The actual paths are:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi<br />
<br />
<boot-directory>/grub/x86_64-efi/<all modules, grub.efi, core.efi, grub.cfg><br />
<br />
{{Note|the {{ic|--bootloader-id}} option does not change {{ic|<boot-directory>/grub}}, i.e. you cannot install the modules to {{ic|<boot-directory>/<bootloader-id>}}, the path is hard-coded to be {{ic|<boot-directory>/grub}}.}}<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == <boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot/efi/EFI --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/efi/EFI/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=arch_grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/arch_grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
In {{ic|<nowiki>--efi-directory=/boot/efi --boot-directory=/boot --bootloader-id=grub</nowiki>}}:<br />
<br />
<efi-directory>/<EFI or efi>/<bootloader-id> == /boot/efi/EFI/grub<br />
<boot-directory>/grub == /boot/grub<br />
<br />
The {{ic|<nowiki><efi-directory>/<EFI or efi>/<bootloader-id>/grubx64.efi</nowiki>}} is an exact copy of {{ic|<nowiki><boot-directory>/grub/x86_64-efi/core.efi</nowiki>}}.<br />
<br />
{{Note|<br />
* In GRUB 2.00, the {{ic|grub-install}} option {{ic|--efi-directory}} replaces {{ic|--root-directory}} and the latter is deprecated<br />
* The options {{ic|--efi-directory}} and {{ic|--bootloader-id}} are specific to GRUB UEFI<br />
}}<br />
<br />
In all the cases the UEFI SYSTEM PARTITION should be mounted for {{ic|grub-install}} to install {{ic|grubx64.efi}} in it, which will be launched by the firmware (using the {{ic|efibootmgr}} created boot entry in non-Mac systems).<br />
<br />
If you notice carefully, there is no <device_path> option (Eg: {{ic|/dev/sda}}) at the end of the {{ic|grub-install}} command unlike the case of setting up GRUB for BIOS systems. Any <device_path> provided will be ignored by the install script as UEFI bootloaders do not use MBR or Partition boot sectors at all.<br />
<br />
You may now be able to UEFI boot your system by creating a {{ic|grub.cfg}} file by following [[#Generate UEFI Config file]] and [[#Create GRUB entry in the Firmware Boot Manager]].<br />
<br />
==== Generate config file ====<br />
<br />
Finally, generate a configuration for GRUB (this is explained in greater detail in the Configuration section):<br />
<br />
# grub-mkconfig -o <boot-directory>/grub/grub.cfg<br />
<br />
{{Note|The file path is {{ic|<boot-directory>/grub/grub.cfg}}, NOT {{ic|<boot-directory>/grub/x86_64-efi/grub.cfg}}.}}<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If you used {{ic|<nowiki>--boot-directory=/boot/efi/EFI</nowiki>}}:<br />
<br />
# grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg<br />
<br />
This is independent of the value of {{ic|--bootloader-id}} option.<br />
<br />
If GRUB complains about "no suitable mode found" while booting, try [[#"No suitable mode found" error]].<br />
<br />
==== Create GRUB entry in the firmware boot manager ====<br />
<br />
{{ic|grub-install}} automatically tries to create a menu entry in the boot manager. If it doesn't, then see [[Beginners' Guide#GRUB]] for instructions to use {{ic|efibootmgr}} to create a menu entry. However, the problem is likely to be that you haven't booted your CD/USB in UEFI mode, as in [[Unified Extensible Firmware Interface#Create UEFI bootable USB from ISO]].<br />
<br />
==== Create GRUB standalone UEFI application ====<br />
<br />
It is possible to create a {{ic|grubx64_standalone.efi}} application which has all the modules embeddded in a memdisk within the UEFI application, thus removing the need for having a separate directory populated with all the GRUB UEFI modules and other related files. This is done using the {{ic|grub-mkstandalone}} command which is included in {{Pkg|grub}}.<br />
<br />
The easiest way to do this would be with the install command already mentioned before, but specifying the modules to include. For example:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" <any extra files you want to include><br />
<br />
The {{ic|grubx64_standalone.efi}} file expects {{ic|grub.cfg}} to be within its $prefix which is {{ic|(memdisk)/boot/grub}}. The memdisk is embedded within the efi app. The {{ic|grub-mkstandlone}} script allow passing files to be included in the memdisk image to be as the arguments to the script (in <any extra files you want to include>).<br />
<br />
If you have the {{ic|grub.cfg}} at {{ic|/home/user/Desktop/grub.cfg}}, then create a temporary {{ic|/home/user/Desktop/boot/grub/}} directory, copy the {{ic|/home/user/Desktop/grub.cfg}} to {{ic|/home/user/Desktop/boot/grub/grub.cfg}}, cd into {{ic|/home/user/Desktop/boot/grub/}} and run:<br />
<br />
# grub-mkstandalone --directory="/usr/lib/grub/x86_64-efi/" --format="x86_64-efi" --compression="xz" \<br />
--output="/boot/efi/EFI/arch_grub/grubx64_standalone.efi" "boot/grub/grub.cfg"<br />
<br />
The reason to cd into {{ic|/home/user/Desktop/boot/grub/}} and to pass the file path as {{ic|boot/grub/grub.cfg}} (notice the lack of a leading slash - boot/ vs /boot/ ) is because {{ic|dir1/dir2/file}} is included as {{ic|(memdisk)/dir1/dir2/file}} by the {{ic|grub-mkstandalone}} script. <br />
<br />
If you pass {{ic|/home/user/Desktop/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/grub.cfg}}. If you pass {{ic|/home/user/Desktop/boot/grub/grub.cfg}} the file will be included as {{ic|(memdisk)/home/user/Desktop/boot/grub/grub.cfg}}. That is the reason for cd'ing into {{ic|/home/user/Desktop/boot/grub/}} and passing {{ic|boot/grub/grub.cfg}}, to include the file as {{ic|(memdisk)/boot/grub/grub.cfg}}, which is what {{ic|grub.efi}} expects the file to be.<br />
<br />
You need to create an UEFI Boot Manager entry for {{ic|/boot/efi/EFI/arch_grub/grubx64_standalone.efi}} using {{ic|efibootmgr}}. Follow [[#Create GRUB entry in the Firmware Boot Manager]].<br />
<br />
==== Multiboot ====<br />
<br />
===== Microsoft Windows installed in UEFI-GPT mode =====<br />
<br />
Find the UUID of the FAT32 filesystem in the UEFI SYSTEM PARTITION where the Windows UEFI Bootloader files reside. For example, if Windows {{ic|bootmgfw.efi}} exists at {{ic|/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi}} (ignore the upper-lower case differences since that is immaterial in FAT filesystem):<br />
<br />
# grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
1ce5-7f28<br />
<br />
# grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi<br />
--hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1<br />
<br />
Then, add this code to {{ic|/etc/grub.d/40_custom}} to chainload Windows x86_64 (Vista SP1+, 7 or 8) installed in UEFI-GPT mode:<br />
<br />
menuentry "Microsoft Windows Vista/7/8 x86_64 UEFI-GPT" {<br />
insmod part_gpt<br />
insmod fat<br />
insmod search_fs_uuid<br />
insmod chain<br />
search --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 1ce5-7f28<br />
chainloader /efi/Microsoft/Boot/bootmgfw.efi<br />
}<br />
<br />
Afterwards remake {{ic|/boot/grub/grub.cfg}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
== Configuration ==<br />
<br />
You can also choose to automatically generate or manually edit {{ic|grub.cfg}}.<br />
<br />
{{Note|<br />
* For EFI systems, if GRUB was installed with the {{ic|--boot-directory}} option set, the {{ic|grub.cfg}} file must be placed in the same directory as {{ic|grubx64.efi}}. Otherwise, the {{ic|grub.cfg}} file goes in {{ic|/boot/grub/}}, just like in GRUB BIOS<br />
* [http://members.iinet.net/~herman546/p20/GRUB2%20Configuration%20File%20Commands.html Here] is a quite complete description of how to configure GRUB<br />
}}<br />
<br />
=== Automatically generating using grub-mkconfig ===<br />
<br />
The GRUB {{ic|menu.lst}} equivalent configuration files are {{ic|/etc/default/grub}} and {{ic|/etc/grub.d/*}}. {{ic|grub-mkconfig}} uses these files to generate {{ic|grub.cfg}}. By default the script outputs to stdout. To generate a {{ic|grub.cfg}} file run the command:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{ic|/etc/grub.d/10_linux}} is set to automatically add menu items for Arch linux that work out of the box, to any generated configuration. Other operating systems may need to be added manually to {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}<br />
<br />
==== Additional arguments ====<br />
<br />
To pass custom additional arguments to the Linux image, you can set the {{ic|GRUB_CMDLINE_LINUX}} variable in {{ic|/etc/default/grub}}. <br />
<br />
For example, use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX"</nowiki>}} where {{ic|sda'''X'''}} is your swap partition to enable resume after hibernation.<br />
<br />
You can also use {{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/disk/by-uuid/${swap_uuid}"</nowiki>}}, where {{ic|${swap_uuid} }} is the [[Persistent_block_device_naming|UUID]] of your swap partition.<br />
<br />
Multiple entries are separated by spaces within the double quotes. So, for users who want both resume and systemd it would look like this:<br />
{{ic|<nowiki>GRUB_CMDLINE_LINUX="resume=/dev/sdaX init=/usr/lib/systemd/systemd"</nowiki>}}<br />
<br />
See [[Kernel parameters]] for more info.<br />
<br />
=== Manually creating grub.cfg ===<br />
<br />
{{Warning|Editing this file is strongly ''not'' recommended. The file is generated by the {{ic|grub-mkconfig}} command, and it is best to edit your {{ic|/etc/default/grub}} or one of the scripts in the {{ic|/etc/grub.d}} folder.}}<br />
<br />
A basic GRUB config file uses the following options:<br />
* {{ic|(hdX,Y)}} is the partition {{ic|Y}} on disk {{ic|X}}, partition numbers starting at 1, disk numbers starting at 0<br />
* {{ic|1=set default=N}} is the default boot entry that is chosen after timeout for user action<br />
* {{ic|1=set timeout=M}} is the time {{ic|M}} to wait in seconds for a user selection before default is booted<br />
* {{ic|<nowiki>menuentry "title" {entry options}</nowiki>}} is a boot entry titled {{ic|title}}<br />
* {{ic|1=set root=(hdX,Y)}} sets the boot partition, where the kernel and GRUB modules are stored (boot need not be a separate partition, and may simply be a directory under the "root" partition ({{ic|/}})<br />
<br />
An example configuration:<br />
<br />
{{hc|/boot/grub/grub.cfg|<nowiki><br />
# Config file for GRUB - The GNU GRand Unified Bootloader<br />
# /boot/grub/grub.cfg<br />
<br />
# DEVICE NAME CONVERSIONS<br />
#<br />
# Linux Grub<br />
# -------------------------<br />
# /dev/fd0 (fd0)<br />
# /dev/sda (hd0)<br />
# /dev/sdb2 (hd1,2)<br />
# /dev/sda3 (hd0,3)<br />
#<br />
<br />
# Timeout for menu<br />
set timeout=5<br />
<br />
# Set default boot entry as Entry 0<br />
set default=0<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
set root=(hd0,1)<br />
linux /vmlinuz-linux root=/dev/sda3 ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
## (1) Windows<br />
#menuentry "Windows" {<br />
# set root=(hd0,3)<br />
# chainloader +1<br />
#}<br />
</nowiki>}}<br />
<br />
=== Dual-booting ===<br />
<br />
{{Note|If you want GRUB to automatically search for other systems, you may wish to install {{Pkg|os-prober}}.}}<br />
<br />
==== Using grub-mkconfig ====<br />
The best way to add other entries is editing the {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} . The entries in this file will be automatically added when running {{ic|grub-mkconfig}}.<br />
After adding the new lines, run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg <br />
to generate an updated {{ic|grub.cfg}}.<br />
<br />
===== With GNU/Linux =====<br />
<br />
Assuming that the other distro is on partition {{ic|sda2}}:<br />
<br />
menuentry "Other Linux" {<br />
set root=(hd0,2)<br />
linux /boot/vmlinuz (add other options here as required)<br />
initrd /boot/initrd.img (if the other kernel uses/needs one)<br />
}<br />
<br />
===== With FreeBSD =====<br />
<br />
Requires that FreeBSD is installed on a single partition with UFS. Assuming it is installed on {{ic|sda4}}:<br />
<br />
menuentry "FreeBSD" {<br />
set root=(hd0,4)<br />
chainloader +1<br />
}<br />
<br />
===== With Windows =====<br />
<br />
This assumes that your Windows partition is {{ic|sda3}}. Remember you need to point set root and chainloader to the system reserve partition that windows made when it installed, not the actual partition windows is on. This example works if your system reserve partition is {{ic|sda3}}.<br />
<br />
# (2) Windows XP<br />
menuentry "Windows XP" {<br />
set root="(hd0,3)"<br />
chainloader +1<br />
}<br />
<br />
If the Windows bootloader is on an entirely different hard drive than GRUB, it may be necessary to trick Windows into believing that it is the first hard drive. This was possible with {{ic|drivemap}}. Assuming GRUB is on {{ic|hd0}} and Windows is on {{ic|hd2}}, you need to add the following after {{ic|set root}}:<br />
<br />
drivemap -s hd0 hd2<br />
<br />
==== With Windows via EasyBCD and NeoGRUB ====<br />
<br />
Since EasyBCD's NeoGRUB currently does not understand the GRUB menu format, chainload to it by replacing the contents of your {{ic|C:\NST\menu.lst}} file with lines similar to the following:<br />
<br />
default 0<br />
timeout 1<br />
<br />
title Chainload into GRUB v2<br />
root (hd0,7)<br />
kernel /boot/grub/i386-pc/core.img<br />
<br />
=== Visual configuration ===<br />
<br />
In GRUB it is possible, by default, to change the look of the menu. Make sure to initialize, if not done already, GRUB graphical terminal, gfxterm, with proper video mode, gfxmode, in GRUB. This can be seen in the section [[#"No suitable mode found" error]]. This video mode is passed by GRUB to the linux kernel via 'gfxpayload' so any visual configurations need this mode in order to be in effect.<br />
<br />
==== Setting the framebuffer resolution ====<br />
<br />
GRUB can set the framebuffer for both GRUB itself and the kernel. The old {{ic|1=vga=}} way is deprecated. The preferred method is editing {{ic|/etc/default/grub}} as the following sample:<br />
<br />
GRUB_GFXMODE=1024x768x32<br />
GRUB_GFXPAYLOAD_LINUX=keep<br />
<br />
To generate the changes, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
The {{ic|gfxpayload}} property will make sure the kernel keeps the resolution.<br />
<br />
{{Note|<br />
* If this example does not work for you try to replace {{ic|1=gfxmode="1024x768x32"}} by {{ic|1=vbemode="0x105"}}. Remember to replace the specified resolution with one suitable for your screen<br />
* To show all the modes you can use {{ic|1=# hwinfo --framebuffer}} (hwinfo is available in [community]), while at GRUB prompt you can use the {{ic|1=vbeinfo}} command<br />
}}<br />
<br />
If this method does not work for you, the deprecated {{ic|1=vga=}} method will still work. Just<br />
add it next to the {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="}} line in {{ic|/etc/default/grub}}<br />
for eg: {{ic|1="GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=792"}} will give you a {{ic|1024x768}} resolution.<br />
<br />
You can choose one of these resolutions: {{ic|640×480}}, {{ic|800×600}}, {{ic|1024×768}}, {{ic|1280×1024}}, {{ic|1600×1200}}, {{ic|1920×1200}}<br />
<br />
==== 915resolution hack ====<br />
<br />
Some times for Intel graphic adapters neither {{ic|1=# hwinfo --framebuffer}} nor {{ic|1=vbeinfo}} will show you the desired resolution. In this case you can use {{ic|915resolution}} hack. This hack will temporarily modify video BIOS and add needed resolution. See [http://915resolution.mango-lang.org/ 915resolution's home page]<br />
<br />
First you need to find a video mode which will be modified later. For that we need the GRUB command shell:<br />
{{hc|sh:grub> 915resolution -l|<br />
Intel 800/900 Series VBIOS Hack : version 0.5.3<br />
[...]<br />
'''Mode 30''' : 640x480, 8 bits/pixel<br />
[...]<br />
}}<br />
Next, we overwrite the {{ic|Mode 30}} with {{ic|1440x900}} resolution:<br />
{{hc|/etc/grub.d/00_header|<br />
[...]<br />
'''915resolution 30 1440 900 # Inserted line'''<br />
set gfxmode&#61;${GRUB_GFXMODE}<br />
[...]<br />
}}<br />
Lastly we need to set {{ic|GRUB_GFXMODE}} as described earlier, regenerate GRUB configuration file and reboot to test changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
# reboot<br />
<br />
==== Background image and bitmap fonts ====<br />
<br />
GRUB comes with support for background images and bitmap fonts in {{ic|pf2}} format. The unifont font is included in the {{Pkg|grub}} package under the filename {{ic|unicode.pf2}}, or, as only ASCII characters under the name {{ic|ascii.pf2}}.<br />
<br />
Image formats supported include tga, png and jpeg, providing the correct modules are loaded. The maximum supported resolution depends on your hardware.<br />
<br />
Make sure you have set up the proper [[#Setting the framebuffer resolution|framebuffer resolution]].<br />
<br />
Edit {{ic|/etc/default/grub}} like this:<br />
GRUB_BACKGROUND="/boot/grub/myimage"<br />
#GRUB_THEME="/path/to/gfxtheme"<br />
GRUB_FONT="/path/to/font.pf2"<br />
<br />
{{Note|If you have installed GRUB on a separate partition, {{ic|/boot/grub/myimage}} becomes {{ic|/grub/myimage}}.}}<br />
<br />
To generate the changes and add the information into {{ic|grub.cfg}}, run: <br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If adding the splash image was successful, the user will see {{ic|"Found background image..."}} in the terminal as the command is executed. <br />
If this phrase is not seen, the image information was probably not incorporated into the {{ic|grub.cfg}} file.<br />
<br />
If the image is not displayed, check:<br />
* The path and the filename in {{ic|/etc/default/grub}} are correct<br />
* The image is of the proper size and format (tga, png, 8-bit jpg)<br />
* The image was saved in the RGB mode, and is not indexed<br />
* The console mode is not enabled in {{ic|/etc/default/grub}}<br />
* The command {{ic|grub-mkconfig}} must be executed to place the background image information into the {{ic|/boot/grub/grub.cfg}} file<br />
<br />
==== Theme ====<br />
<br />
Here is an example for configuring Starfield theme which was included in GRUB package.<br />
<br />
Edit {{ic|/etc/default/grub}}<br />
GRUB_THEME="/usr/share/grub/themes/starfield/theme.txt"<br />
<br />
Generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
If configuring the theme was successful, you'll see {{ic|Found theme: /usr/share/grub/themes/starfield/theme.txt}} in the terminal.<br />
Your splash image will usually not be displayed when using a theme.<br />
<br />
==== Menu colors ====<br />
<br />
You can set the menu colors in GRUB. The available colors for GRUB can be found in [https://www.gnu.org/software/grub/manual/html_node/Theme-file-format.html the GRUB Manual].<br />
Here is an example:<br />
<br />
Edit {{ic|/etc/default/grub}}:<br />
GRUB_COLOR_NORMAL="light-blue/black"<br />
GRUB_COLOR_HIGHLIGHT="light-cyan/blue"<br />
<br />
Generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Hidden menu ====<br />
<br />
One of the unique features of GRUB is hiding/skipping the menu and showing it by holding {{keypress|Esc}} when needed. You can also adjust whether you want to see the timeout counter.<br />
<br />
Edit {{ic|/etc/default/grub}} as you wish. Here is an example where the comments from the beginning of the two lines have been removed to enable the feature, the timeout has been set to five seconds and to be shown to the user:<br />
GRUB_HIDDEN_TIMEOUT=5<br />
GRUB_HIDDEN_TIMEOUT_QUIET=false<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Disable framebuffer ====<br />
<br />
Users who use NVIDIA proprietary driver might wish to disable GRUB's framebuffer as it can cause problems with the binary driver.<br />
<br />
To disable framebuffer, edit {{ic|/etc/default/grub}} and uncomment the following line:<br />
GRUB_TERMINAL_OUTPUT=console<br />
<br />
and run:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
Another option if you want to keep the framebuffer in GRUB is to revert to text mode just before starting the kernel. To do that modify the variable in {{ic|/etc/default/grub}}:<br />
GRUB_GFXPAYLOAD_LINUX=text<br />
<br />
and rebuild the configuration as before.<br />
<br />
=== Other Options ===<br />
<br />
==== LVM ====<br />
<br />
If you use [[LVM]] for your {{ic|/boot}}, add the following before menuentry lines:<br />
<br />
insmod lvm<br />
<br />
and specify your root in the menuentry as:<br />
<br />
set root=lvm/''lvm_group_name''-''lvm_logical_boot_partition_name''<br />
<br />
Example:<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
insmod lvm<br />
set root=lvm/VolumeGroup-lv_boot<br />
# you can only set following two lines<br />
linux /vmlinuz-linux root=/dev/mapper/VolumeGroup-root ro<br />
initrd /initramfs-linux.img<br />
}<br />
<br />
==== RAID ====<br />
<br />
GRUB provides convenient handling of RAID volumes. You need to add {{ic|insmod mdraid}} which allows you to address the volume natively. For example, {{ic|/dev/md0}} becomes:<br />
set root=(md0)<br />
<br />
whereas a partitioned RAID volume (e.g. {{ic|/dev/md0p1}}) becomes:<br />
set root=(md0,1)<br />
<br />
==== Persistent block device naming ====<br />
One naming scheme for [[Persistent block device naming]] is the use of globally unique UUIDs to detect partitions instead of the "old" {{ic|/dev/sd*}}. Advantages are covered up in the above linked article. <br />
<br />
Persistent naming via filesystem UUIDs are used by default in GRUB. <br />
<br />
{{Note|The {{ic|/boot/grub.cfg}} file needs regeneration with the new UUID in {{ic|/etc/default/grub}} every time a relevant filesystem is resized or recreated. Remember this when modifying partitions & filesystems with a Live-CD.}}<br />
<br />
Whether to use UUIDs is controlled by an option in {{ic|/etc/default/grub}}:<br />
<br />
# GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Either way, do not forget to generate the changes:<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Using Labels ====<br />
<br />
It is possible to use labels, human-readable strings attached to filesystems, by using the {{ic|--label}} option to {{ic|search}}. First of all, label your existing partition:<br />
# tune2fs -L <LABEL> <PARTITION><br />
<br />
Then, add an entry using labels. An example of this:<br />
<br />
menuentry "Arch Linux, session texte" {<br />
search --label --set=root archroot<br />
linux /boot/vmlinuz-linux root=/dev/disk/by-label/archroot ro<br />
initrd /boot/initramfs-linux.img<br />
}<br />
<br />
==== Recall previous entry ====<br />
<br />
GRUB can remember the last entry you booted from and use this as the default entry to boot from next time. This is useful if you have multiple kernels (i.e., the current Arch one and the LTS kernel as a fallback option) or operating systems. To do this, edit {{ic|/etc/default/grub}} and change the value of {{ic|GRUB_DEFAULT}}:<br />
<br />
GRUB_DEFAULT=saved<br />
<br />
This ensures that GRUB will default to the saved entry. To enable saving the selected entry, add the following line to {{ic|/etc/default/grub}}:<br />
<br />
GRUB_SAVEDEFAULT=true<br />
<br />
{{Note|Manually added menu items, e.g. Windows in {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}}, will need {{ic|savedefault}} added. Remember to regenerate([[#Generate config file]]) your configuration file.}}<br />
<br />
==== Changing the default menu entry ====<br />
<br />
To change the default selected entry, edit {{ic|/etc/default/grub}} and change the value of {{ic|GRUB_DEFAULT}}:<br />
<br />
Using numbers :<br />
GRUB_DEFAULT=0<br />
Grub identifies entries in generated menu counted from zero. That means 0 for the first entry which is the default value, 1 for the second and so on.<br />
<br />
Or using menu titles :<br />
GRUB_DEFAULT='Arch Linux, with Linux core repo kernel'<br />
<br />
{{Note|Remember to regenerate([[#Generate config file]]) your configuration file.}}<br />
<br />
==== Security ====<br />
<br />
If you want to secure GRUB so it is not possible for anyone to change boot parameters or use the command line, you can add a user/password combination to GRUB's configuration files. To do this, run the command {{ic|grub-mkpasswd-pbkdf2}}. Enter a password and confirm it:<br />
<br />
{{hc|grub-mkpasswd-pbkdf2|<br />
[...]<br />
Your PBKDF2 is grub.pbkdf2.sha512.10000.C8ABD3E93C4DFC83138B0C7A3D719BC650E6234310DA069E6FDB0DD4156313DA3D0D9BFFC2846C21D5A2DDA515114CF6378F8A064C94198D0618E70D23717E82.509BFA8A4217EAD0B33C87432524C0B6B64B34FBAD22D3E6E6874D9B101996C5F98AB1746FE7C7199147ECF4ABD8661C222EEEDB7D14A843261FFF2C07B1269A<br />
}}<br />
Then, add the following to {{ic|/etc/grub.d/00_header}}:<br />
{{hc|/etc/grub.d/00_header|<br />
cat << EOF<br />
<br />
set superusers<nowiki>=</nowiki>"'''username'''"<br />
password_pbkdf2 '''username''' '''<password>'''<br />
<br />
EOF<br />
}}<br />
where {{ic|<password>}} is the string generated by {{ic|grub-mkpasswd_pbkdf2}}.<br />
<br />
Regenerate your configuration file. Your GRUB command line, boot parameters and all boot entries are now protected.<br />
<br />
This can be relaxed and further customized with more users as described in the "Security" part of [https://www.gnu.org/software/grub/manual/grub.html#Security the GRUB manual].<br />
<br />
==== Root encryption ====<br />
<br />
To let GRUB automatically add the kernel parameters for root encryption,<br />
add {{ic|1=cryptdevice=/dev/yourdevice:label}} to {{ic|GRUB_CMDLINE_LINUX}} in {{ic|/etc/default/grub}}.<br />
<br />
{{Tip|If you're upgrading from a working GRUB Legacy configuration, check {{ic|/boot/grub/menu.lst.pacsave}} for the correct device/label to add. Look for them after the text {{ic|kernel /vmlinuz-linux}}.}}<br />
<br />
Example with root mapped to {{ic|/dev/mapper/root}}:<br />
<br />
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:root"<br />
<br />
Also, disable the usage of UUIDs for the rootfs:<br />
<br />
GRUB_DISABLE_LINUX_UUID=true<br />
<br />
Regenerate the configuration.<br />
<br />
==== Boot non-default entry only once ====<br />
<br />
The command {{ic|grub-reboot}} is very helpful to boot another entry than the default only once. GRUB loads the entry passed in the first command line argument, when the system is rebooted the next time. Most importantly GRUB returns to loading the default entry for all future booting. Changing the configuration file or selecting an entry in the GRUB menu is not necessary.<br />
{{Note|This requires {{ic|1=GRUB_DEFAULT=saved}} in {{ic|/etc/default/grub}} (and then regenerating {{ic|grub.cfg}}) or, in case of hand-made {{ic|grub.cfg}}, the line {{ic|1=set default="${saved_entry}"}}.}}<br />
<br />
=== Booting an ISO directly from GRUB ===<br />
<br />
Edit {{ic|/etc/grub.d/40_custom}} or {{ic|/boot/grub/custom.cfg}} to add an entry for the target ISO. When finished, update the GRUB menu as with the usual {{ic|grub-mkconfig -o /boot/grub/grub.cfg}} (as root).<br />
<br />
==== Arch ISO ====<br />
<br />
{{Note|The following examples assume the ISO is in {{ic|/archives}} on {{ic|hd0,6}}.}}<br />
{{Tip|For thumbdrives, use something like {{ic|(hd1,$partition)}} and either {{ic|/dev/sdb'''Y'''}} for the {{ic|img_dev}} parameter or [[Persistent_block_device_naming|a persistent name]], e.g. {{ic|img_dev&#61;/dev/disk/by-label/CORSAIR}}.}}<br />
<br />
===== x86_64 =====<br />
<br />
menuentry "Archlinux-2013.05.01-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.05.01-dual.iso"<br />
set partition="6"<br />
loopback loop (hd0,$partition)/$isofile<br />
linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201305 img_dev=/dev/sda$partition img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/x86_64/archiso.img<br />
}<br />
<br />
===== i686 =====<br />
<br />
menuentry "Archlinux-2013.05.01-dual.iso" --class iso {<br />
set isofile="/archives/archlinux-2013.05.01-dual.iso"<br />
set partition="6"<br />
loopback loop (hd0,$partition)/$isofile<br />
linux (loop)/arch/boot/i686/vmlinuz archisolabel=ARCH_201305 img_dev=/dev/sda$partition img_loop=$isofile earlymodules=loop<br />
initrd (loop)/arch/boot/i686/archiso.img<br />
}<br />
<br />
==== Ubuntu ISO ====<br />
<br />
{{Note|The example assumes that the iso is in {{ic|/archives}} on {{ic|hd0,6}}. Users must adjust the location and hdd/partition in the lines below to match their systems.}}<br />
<br />
menuentry "ubuntu-13.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-13.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)/$isofile<br />
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
menuentry "ubuntu-12.04-desktop-amd64.iso" {<br />
set isofile="/archives/ubuntu-12.04-desktop-amd64.iso"<br />
loopback loop (hd0,6)/$isofile<br />
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet noeject noprompt splash --<br />
initrd (loop)/casper/initrd.lz<br />
}<br />
<br />
==== Other ISOs ====<br />
<br />
Other working configurations from [http://askubuntu.com/questions/141940/how-to-boot-live-iso-images link Source].<br />
<br />
== Using the command shell ==<br />
<br />
Since the MBR is too small to store all GRUB modules, only the menu and a few basic commands reside there. The majority of GRUB functionality remains in modules in {{ic|/boot/grub}}, which are inserted as needed. In error conditions (e.g. if the partition layout changes) GRUB may fail to boot. When this happens, a command shell may appear.<br />
<br />
GRUB offers multiple shells/prompts. If there is a problem reading the menu but the bootloader is able to find the disk, you will likely be dropped to the "normal" shell:<br />
sh:grub><br />
<br />
If there is a more serious problem (e.g. GRUB cannot find required files), you may instead be dropped to the "rescue" shell:<br />
grub rescue><br />
<br />
The rescue shell is a restricted subset of the normal shell, offering much less functionality. If dumped to the rescue shell, first try inserting the "normal" module, then starting the "normal" shell:<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
grub rescue> insmod (hdX,Y)/boot/grub/i386-pc/normal.mod<br />
rescue:grub> normal<br />
<br />
=== Pager support ===<br />
<br />
GRUB supports pager for reading commands that provide long output (like the {{ic|help}} command). This works only in normal shell mode and not in rescue mode. To enable pager, in GRUB command shell type:<br />
sh:grub> set pager=1<br />
<br />
== GUI configuration tools ==<br />
<br />
Following package may be installed:<br />
* {{App|grub-customizer|Customize the bootloader (GRUB or BURG)|https://launchpad.net/grub-customizer|{{AUR|grub-customizer}}}}<br />
* {{App|grub2-editor|KDE4 control module for configuring the GRUB bootloader|http://kde-apps.org/content/show.php?content&#61;139643|{{AUR|grub2-editor}}}}<br />
* {{App|kcm-grub2|This Kcm module manages the most common settings of GRUB|http://kde-apps.org/content/show.php?content&#61;137886|{{AUR|kcm-grub2}}}}<br />
* {{App|startupmanager|GUI app for changing the settings of GRUB Legacy, GRUB, Usplash and Splashy|http://sourceforge.net/projects/startup-manager/|{{AUR|startupmanager}}}}<br />
<br />
== parttool for hide/unhide ==<br />
<br />
If you have a Windows 9x paradigm with hidden {{ic|C:\}} disks GRUB can hide/unhide it using {{ic|parttool}}. For example, to boot the third {{ic|C:\}} disk of three Windows 9x installations on the CLI enter the CLI and:<br />
parttool hd0,1 hidden+ boot-<br />
parttool hd0,2 hidden+ boot-<br />
parttool hd0,3 hidden- boot+<br />
set root=hd0,3<br />
chainloader +1<br />
boot<br />
<br />
== Using the rescue console ==<br />
<br />
See [[#Using the command shell]] first. If unable to activate the standard shell, one possible solution is to boot using a live CD or some other rescue disk to correct configuration errors and reinstall GRUB. However, such a boot disk is not always available (nor necessary); the rescue console is surprisingly robust.<br />
<br />
The available commands in GRUB rescue include {{ic|insmod}}, {{ic|ls}}, {{ic|set}}, and {{ic|unset}}. This example uses {{ic|set}} and {{ic|insmod}}. {{ic|set}} modifies variables and {{ic|insmod}} inserts new modules to add functionality.<br />
<br />
Before starting, the user must know the location of their {{ic|/boot}} partition (be it a separate partition, or a subdirectory under their root):<br />
grub rescue> set prefix=(hdX,Y)/boot/grub<br />
<br />
where X is the physical drive number and Y is the partition number.<br />
<br />
To expand console capabilities, insert the {{ic|linux}} module:<br />
grub rescue> insmod (hdX,Y)/boot/grub/linux.mod<br />
<br />
{{Note|With a separate boot partition, omit {{ic|/boot}} from the path, (i.e. type {{ic|1=set prefix=(hdX,Y)/grub}} and {{ic|insmod (hdX,Y)/grub/linux.mod}}).}}<br />
<br />
This introduces the {{ic|linux}} and {{ic|initrd}} commands, which should be familiar (see [[#Configuration]]).<br />
<br />
An example, booting Arch Linux:<br />
set root=(hd0,5)<br />
linux /boot/vmlinuz-linux root=/dev/sda5<br />
initrd /boot/initramfs-linux.img<br />
boot<br />
<br />
With a separate boot partition, again change the lines accordingly:<br />
set root=(hd0,5)<br />
linux /vmlinuz-linux root=/dev/sda6<br />
initrd /initramfs-linux.img<br />
boot<br />
<br />
After successfully booting the Arch Linux installation, users can correct {{ic|grub.cfg}} as needed and then reinstall GRUB.<br />
<br />
To reinstall GRUB and fix the problem completely, changing {{ic|/dev/sda}} if needed. See [[#Bootloader installation]] for details.<br />
<br />
== Combining the use of UUIDs and basic scripting ==<br />
<br />
If you like the idea of using UUIDs to avoid unreliable BIOS mappings or are struggling with GRUB's syntax, here is an example boot menu item that uses UUIDs and a small script to direct GRUB to the proper disk partitions for your system. All you need to do is replace the UUIDs in the sample with the correct UUIDs for your system. The example applies to a system with a boot and root partition. You will obviously need to modify the GRUB configuration if you have additional partitions:<br />
<br />
menuentry "Arch Linux 64" {<br />
# Set the UUIDs for your boot and root partition respectively<br />
set the_boot_uuid=ece0448f-bb08-486d-9864-ac3271bd8d07<br />
set the_root_uuid=c55da16f-e2af-4603-9e0b-03f5f565ec4a<br />
<br />
# (Note: This may be the same as your boot partition)<br />
<br />
# Get the boot/root devices and set them in the root and grub_boot variables<br />
search --fs-uuid --set=root $the_root_uuid<br />
search --fs-uuid --set=grub_boot $the_boot_uuid<br />
<br />
# Check to see if boot and root are equal.<br />
# If they are, then append /boot to $grub_boot (Since $grub_boot is actually the root partition)<br />
if [ $the_boot_uuid == $the_root_uuid] ; then<br />
set grub_boot=$grub_boot/boot<br />
fi<br />
<br />
# $grub_boot now points to the correct location, so the following will properly find the kernel and initrd<br />
linux ($grub_boot)/vmlinuz-linux root=/dev/disk/by-uuid/$uuid_os_root ro<br />
initrd ($grub_boot)/initramfs-linux.img<br />
}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Intel BIOS not booting GPT ===<br />
<br />
Some Intel BIOS's require at least one bootable MBR partition to be present at boot, causing GPT-partitioned boot setups to be unbootable.<br />
<br />
This can be circumvented by using (for instance) fdisk to mark one of the GPT partitions (preferably the 1007 KiB partition you've created for GRUB already) bootable in the MBR. This can be achieved, using fdisk, by the following commands: Start fdisk against the disk you're installing, for instance {{ic|fdisk /dev/sda}}, then press {{keypress|a}} and select the partition you wish to mark as bootable (probably #1) by pressing the corresponding number, finally press {{keypress|w}} to write the changes to the MBR.<br />
<br />
{{Note|The bootable-marking must be done in {{ic|fdisk}} or similar, not in GParted or others, as they will not set the bootable flag in the MBR.}}<br />
<br />
More information is available [http://www.rodsbooks.com/gdisk/bios.html here]<br />
<br />
=== Enable debug messages ===<br />
<br />
Add:<br />
<br />
set pager=1<br />
set debug=all<br />
<br />
to {{ic|grub.cfg}}.<br />
<br />
=== "No suitable mode found" error ===<br />
<br />
If you get this error when booting any menuentry:<br />
<br />
error: no suitable mode found<br />
Booting however<br />
<br />
Then you need to initialize GRUB graphical terminal ({{ic|gfxterm}}) with proper video mode ({{ic|gfxmode}}) in GRUB. This video mode is passed by GRUB to the linux kernel via 'gfxpayload'. In case of UEFI systems, if the GRUB video mode is not initialized, no kernel boot messages will be shown in the terminal (atleast until KMS kicks in).<br />
<br />
Copy {{ic|/usr/share/grub/unicode.pf2}} to ${GRUB_PREFIX_DIR} ({{ic|/boot/grub/}} in case of BIOS and UEFI systems). If GRUB UEFI was installed with {{ic|1=--boot-directory=/boot/efi/EFI}} set, then the directory is {{ic|/boot/efi/EFI/grub/}}:<br />
<br />
# cp /usr/share/grub/unicode.pf2 ${GRUB_PREFIX_DIR}<br />
<br />
If {{ic|/usr/share/grub/unicode.pf2}} does not exist, install {{Pkg|bdf-unifont}}, create the {{ic|unifont.pf2}} file and then copy it to {{ic|${GRUB_PREFIX_DIR<nowiki>}</nowiki>}}:<br />
<br />
# grub-mkfont -o unicode.pf2 /usr/share/fonts/misc/unifont.bdf<br />
<br />
Then, in the {{ic|grub.cfg}} file, add the following lines to enable GRUB to pass the video mode correctly to the kernel, without of which you will only get a black screen (no output) but booting (actually) proceeds successfully without any system hang.<br />
<br />
BIOS systems:<br />
<br />
insmod vbe<br />
<br />
UEFI systems:<br />
<br />
insmod efi_gop<br />
insmod efi_uga<br />
<br />
After that add the following code (common to both BIOS and UEFI):<br />
<br />
insmod font<br />
<br />
if loadfont ${prefix}/fonts/unicode.pf2<br />
then<br />
insmod gfxterm<br />
set gfxmode=auto<br />
set gfxpayload=keep<br />
terminal_output gfxterm<br />
fi<br />
<br />
As you can see for gfxterm (graphical terminal) to function properly, {{ic|unicode.pf2}} font file should exist in {{ic|${GRUB_PREFIX_DIR<nowiki>}</nowiki>}}.<br />
<br />
=== msdos-style error message ===<br />
<br />
grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding won't be possible!<br />
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.<br />
However, blocklists are UNRELIABLE and its use is discouraged.<br />
grub-setup: error: If you really want blocklists, use --force.<br />
<br />
This error may occur when you try installing GRUB in a VMware container. Read more about it [https://bbs.archlinux.org/viewtopic.php?pid=581760#p581760 here]. It happens when the first partition starts just after the MBR (block 63), without the usual space of 1 MiB (2048 blocks) before the first partition. Read [[#Master Boot Record (MBR) specific instructions]]<br />
<br />
=== GRUB UEFI drops to shell ===<br />
<br />
If GRUB loads but drops you into the rescue shell with no errors, it may be because of a missing or misplaced {{ic|grub.cfg}}. This will happen if GRUB UEFI was installed with {{ic|--boot-directory}} and {{ic|grub.cfg}} is missing OR if the partition number of the boot partition changed (which is hard-coded into the {{ic|grubx64.efi}} file).<br />
<br />
=== GRUB UEFI not loaded ===<br />
<br />
An example of a working EFI:<br />
{{hc|# efibootmgr -v|<br />
BootCurrent: 0000<br />
Timeout: 3 seconds<br />
BootOrder: 0000,0001,0002<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\efi\grub\grub.efi)<br />
Boot0001* Shell HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\EfiShell.efi)<br />
Boot0002* Festplatte BIOS(2,0,00)P0: SAMSUNG HD204UI<br />
}}<br />
<br />
If the screen only goes black for a second and the next boot option is tried afterwards, according to [https://bbs.archlinux.org/viewtopic.php?pid=981560#p981560 this post], moving GRUB to the partition root can help. The boot option has to be deleted and recreated afterwards. The entry for GRUB should look like this then:<br />
Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\grub.efi)<br />
<br />
=== Invalid signature ===<br />
<br />
If trying to boot Windows results in an "invalid signature" error, e.g. after reconfiguring partitions or adding additional hard drives, (re)move GRUB's device configuration and let it reconfigure:<br />
# mv /boot/grub/device.map /boot/grub/device.map-old<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
{{ic|grub-mkconfig}} should now mention all found boot options, including Windows. If it works, remove {{ic|/boot/grub/device.map-old}}.<br />
<br />
=== Boot freezes ===<br />
<br />
If booting gets stuck without any error message after GRUB loading the kernel and the initial ramdisk, try removing the {{ic|add_efi_memmap}} kernel parameter.<br />
<br />
=== Restore GRUB Legacy ===<br />
<br />
* Move GRUB v2 files out of the way:<br />
<br />
# mv /boot/grub /boot/grub.nonfunctional<br />
<br />
* Copy GRUB Legacy back to {{ic|/boot}}:<br />
<br />
# cp -af /boot/grub-legacy /boot/grub<br />
<br />
* Replace MBR and next 62 sectors of sda with backed up copy<br />
<br />
{{Warning|This command also restores the partition table, so be careful of overwriting a modified partition table with the old one. It '''will''' mess up your system.}}<br />
<br />
# dd if=/path/to/backup/first-sectors of=/dev/sdX bs=512 count=1<br />
<br />
A safer way is to restore only the MBR boot code use:<br />
<br />
# dd if=/path/to/backup/mbr-boot-code of=/dev/sdX bs=446 count=1<br />
<br />
=== Arch not found from other OS ===<br />
Some have reported that other distributions have trouble finding Arch Linux automatically with os-prober. If this problem arises, it has been reported that detection can be improved with the presence of /etc/lsb-release. This file and updating tool is available with the package {{ic|lsb-release}} in the [[community]] repository.<br />
<br />
== References ==<br />
<br />
# Official GRUB Manual - https://www.gnu.org/software/grub/manual/grub.html<br />
# Ubuntu wiki page for GRUB - https://help.ubuntu.com/community/Grub2<br />
# GRUB wiki page describing steps to compile for UEFI systems - https://help.ubuntu.com/community/UEFIBooting<br />
# Wikipedia's page on [[Wikipedia:BIOS Boot partition|BIOS Boot partition]]<br />
<br />
== See also ==<br />
<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_bios.sh A Linux Bash Shell script to compile and install GRUB for BIOS from BZR Source]<br />
# [https://github.com/the-ridikulus-rat/My_Shell_Scripts/blob/master/grub/grub_uefi.sh A Linux Bash Shell script to compile and install GRUB for UEFI from BZR Source]</div>Cinellihttps://wiki.archlinux.org/index.php?title=Beginners%27_guide&diff=264269Beginners' guide2013-06-26T07:45:01Z<p>Cinelli: /* GRUB */ grub.mo is no longer part of the grub package.</p>
<hr />
<div><noinclude><br />
[[Category:Getting and installing Arch]]<br />
[[Category:About Arch]]<br />
[[ar:Beginners' Guide/Installation]]<br />
[[da:Beginners' Guide/Installation]]<br />
[[es:Beginners' Guide/Installation]]<br />
[[hr:Beginners' Guide/Installation]]<br />
[[hu:Beginners' Guide/Installation]]<br />
[[it:Beginners' Guide/Installation]]<br />
[[ja:Beginners' Guide/Installation]]<br />
[[ko:Beginners' Guide/Installation]]<br />
[[nl:Beginners' Guide/Installatie]]<br />
[[pl:Beginners' Guide/Installation]]<br />
[[pt:Beginners' Guide/Installation]]<br />
[[ro:Ghidul începătorilor/Instalare]]<br />
[[ru:Beginners' Guide/Installation]]<br />
[[sr:Beginners' Guide/Installation]]<br />
[[zh-CN:Beginners' Guide/Installation]]<br />
[[zh-TW:Beginners' Guide/Installation]]<br />
{{Tip|This is part of a multi-page article for The Beginners' Guide. '''[[Beginners' Guide|Click here]]''' if you would rather read the guide in its entirety.}}<br />
</noinclude><br />
== Installation ==<br />
<br />
You are now presented with a shell prompt, automatically logged in as root.<br />
<br />
=== Change the language ===<br />
<br />
{{Tip|These are optional for the majority of users. Useful only if you plan on writing in your own language in any of the configuration files, if you use diacritical marks in the Wi-Fi password, or if you would like to receive system messages (e.g. possible errors) in your own language.}}<br />
<br />
By default, the keyboard layout is set to {{ic|us}}. If you have a non-[[Wikipedia:File:KB United States-NoAltGr.svg|US]] keyboard layout, run:<br />
<br />
# loadkeys ''layout''<br />
<br />
...where ''layout'' can be {{ic|fr}}, {{ic|uk}}, {{ic|dvorak}}, {{ic|be-latin1}}, etc. See [[KEYMAP#Keyboard layouts|here]] for a comprehensive list.<br />
<br />
The font should also be changed, because most languages use more glyphs than the 26 letter [[Wikipedia:English alphabet|English alphabet]]. Otherwise some foreign characters may show up as white squares or as other symbols. Note that the name is case-sensitive, so please type it ''exactly'' as you see it:<br />
<br />
# setfont Lat2-Terminus16<br />
<br />
By default, the language is set to English (US). If you would like to change the language for the install process ''(German, in this example)'', remove the {{ic|#}} in front of the [http://www.greendesktiny.com/support/knowledgebase_detail.php?ref=EUH-483 locale] you want from {{ic|/etc/locale.gen}}, along with English (US). Please choose the {{ic|UTF-8}} entry.<br />
<br />
Use {{Keypress|Ctrl+X}} to exit, and when prompted to save changes, press {{Keypress|Y}} and {{Keypress|Enter}} to use the same filename.<br />
<br />
{{hc|# nano /etc/locale.gen|<br />
en_US.UTF-8 UTF-8<br />
de_DE.UTF-8 UTF-8}}<br />
<br />
# locale-gen<br />
# export LANG=de_DE.UTF-8<br />
<br />
Remember, {{Keypress|LAlt+LShift}} activates and deactivates the keymap.<br />
<br />
=== Establish an internet connection ===<br />
<br />
{{Warning|As of v197, udev no longer assigns network interface names according to the wlanX and ethX naming scheme. If you are coming from a different distribution or are reinstalling Arch and not aware of the new interface naming style, please do not assume that your wireless interface is named wlan0, or that your wired interface is named eth0. You can use the command {{ic|ip link}} to discover the names of your interfaces.}}<br />
<br />
The {{ic|dhcpcd}} network daemon starts automatically during boot and it will attempt to start a wired connection. Try to ping a server to see if a connection was established. For example, Google's DNS servers:<br />
<br />
{{hc|# ping -c 3 www.google.com|2=<br />
PING www.l.google.com (74.125.132.105) 56(84) bytes of data.<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=1 ttl=50 time=17.0 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=2 ttl=50 time=18.2 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=3 ttl=50 time=16.6 ms<br />
<br />
--- www.l.google.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2003ms<br />
rtt min/avg/max/mdev = 16.660/17.320/18.254/0.678 ms}}<br />
<br />
If you get a {{ic|ping: unknown host}} error, first check if there is an issue with your cable or wireless signal strength. If not, you will need to set up the network manually, as explained below. Once a connection is established move on to [[#Prepare the storage drive|Prepare the storage drive]].<br />
<br />
==== Wired ====<br />
<br />
Follow this procedure if you need to set up a wired connection via a static IP address.<br />
<br />
First, disable the dhcpcd service which was started automatically at boot:<br />
<br />
# systemctl stop dhcpcd.service<br />
<br />
Identify the name of your Ethernet interface.<br />
<br />
{{hc|# ip link|<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
2: enp2s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000<br />
link/ether 00:11:25:31:69:20 brd ff:ff:ff:ff:ff:ff<br />
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT qlen 1000<br />
link/ether 01:02:03:04:05:06 brd ff:ff:ff:ff:ff:ff}}<br />
<br />
In this example, the Ethernet interface is {{ic|enp2s0f0}}. If you are unsure, your Ethernet interface is likely to start with the letter "e", and unlikely to be "lo" or start with the letter "w". You can also use {{ic|iwconfig}} and see which interfaces are not wireless:<br />
<br />
{{hc|# iwconfig|2=<br />
enp2s0f0 no wireless extensions.<br />
wlp3s0 IEEE 802.11bgn ESSID:"NETGEAR97"<br />
Mode:Managed Frequency:2.427 GHz Access Point: 2C:B0:5D:9C:72:BF<br />
Bit Rate=65 Mb/s Tx-Power=16 dBm<br />
Retry long limit:7 RTS thr:off Fragment thr:off<br />
Power Management:on<br />
Link Quality=61/70 Signal level=-49 dBm<br />
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0<br />
Tx excessive retries:0 Invalid misc:430 Missed beacon:0<br />
lo no wireless extensions.}}<br />
<br />
In this example, neither {{ic|enp2s0f0}} nor the loopback device have wireless extensions, meaning {{ic|enp2s0f0}} is our Ethernet interface.<br />
<br />
You also need to know these settings:<br />
<br />
* Static IP address.<br />
* Subnet mask.<br />
* Gateway's IP address.<br />
* Name servers' (DNS) IP addresses.<br />
* Domain name (unless you are on a local LAN, in which case you can make it up).<br />
<br />
Activate the connected Ethernet interface (e.g. {{ic|enp2s0f0}}):<br />
<br />
# ip link set enp2s0f0 up<br />
<br />
Add the address:<br />
<br />
# ip addr add ''ip_address''/''subnetmask'' dev ''interface_name''<br />
<br />
For example:<br />
<br />
# ip addr add 192.168.1.2/24 dev enp2s0f0<br />
<br />
For more options, run {{ic|man ip}}.<br />
<br />
Add your gateway like this, substituting your own gateway's IP address:<br />
<br />
# ip route add default via ''ip_address''<br />
<br />
For example:<br />
<br />
# ip route add default via 192.168.1.1<br />
<br />
Edit {{ic|resolv.conf}}, substituting your name servers' IP addresses and your local domain name:<br />
<br />
{{hc|# nano /etc/resolv.conf|<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com}}<br />
<br />
{{Note|Currently, you may include a maximum of three {{ic|nameserver}} lines.}}<br />
<br />
You should now have a working network connection. If you do not, check the detailed [[Network Configuration]] page.<br />
<br />
==== Wireless ====<br />
<br />
Follow this procedure if you need wireless connectivity (Wi-Fi) during the installation process.<br />
<br />
First, identify the name of your wireless interface.<br />
<br />
{{hc|# iw dev|2=<br />
phy#0<br />
Interface wlp3s0<br />
ifindex 3<br />
wdev 0x1<br />
addr 00:21:6a:5e:52:bc<br />
type managed<br />
}}<br />
<br />
In this example, {{ic|wlp3s0}} is the available wireless interface. If you are unsure, your wireless interface is likely to start with the letter "w", and unlikely to be "lo" or start with the letter "e". <br />
<br />
{{Note|If you do not see output similar to this, then your wireless driver has not been loaded. If this is the case, you must load the driver yourself. Please see [[Wireless Setup]] for more detailed information.}}<br />
<br />
Bring the interface up with:<br />
<br />
# ip link set wlp3s0 up<br />
<br />
A small percentage of wireless chipsets also require firmware, in addition to a corresponding driver. If you get output like {{ic|SIOCSIFFLAGS: No such file or directory}}, this means you will need to manually load the firmware. If unsure, invoke {{ic|dmesg}} to query the kernel log for a firmware request from the wireless chipset. For example, if you have an Intel chipset which requires and has requested firmware from the kernel at boot:<br />
<br />
{{hc|# dmesg <nowiki>|</nowiki> grep firmware|<br />
firmware: requesting iwlwifi-5000-1.ucode}}<br />
<br />
If there is no output, it may be concluded that the system's wireless chipset does not require firmware.<br />
<br />
{{Warning|Wireless chipset firmware packages (for cards which require them) are pre-installed under {{ic|/usr/lib/firmware}} in the live environment (on CD/USB stick) '''but must be explicitly installed to your actual system to provide wireless functionality after you reboot into it!''' Package installation is covered later in this guide. Ensure installation of both your wireless module and firmware before rebooting! See [[Wireless Setup]] if you are unsure about the requirement of corresponding firmware installation for your particular chipset.}}<br />
<br />
Next, use {{Pkg|netctl}}'s {{ic|wifi-menu}} to connect to a network:<br />
<br />
# wifi-menu wlp3s0<br />
<br />
You should now have a working network connection. If you do not, check the detailed [[Wireless Setup]] page.<br />
<br />
Alternatively, use {{ic|iw dev wlp3s0 scan <nowiki>|</nowiki> grep SSID}} to scan for available networks, then connect to a network with:<br />
<br />
# wpa_supplicant -B -i wlp3s0 -c <(wpa_passphrase "''ssid''" "''psk''")<br />
<br />
You need to replace ''ssid'' with the name of your network (e.g. "Linksys etc...") and ''psk'' with your wireless password, '''leaving the quotes around the network name and password.'''<br />
<br />
Finally, you have to give your interface an IP address. This can be set manually or using the dhcp:<br />
<br />
# dhcpcd wlp3s0<br />
<br />
==== Analog modem, ISDN or PPoE DSL ====<br />
<br />
For xDSL, dial-up and ISDN connections, see [[Direct Modem Connection]].<br />
<br />
==== Behind a proxy server ====<br />
<br />
If you are behind a proxy server, you will need to export the {{ic|http_proxy}} and {{ic|ftp_proxy}} environment variables. See [[Proxy settings]] for more information.<br />
<br />
=== Prepare the storage drive ===<br />
<br />
{{Warning|Partitioning can destroy data. You are '''strongly''' cautioned and advised to backup any critical data before proceeding.}}<br />
<br />
Absolute beginners are encouraged to use a graphical partitioning tool. [http://gparted.sourceforge.net/download.php GParted] is a good example, and is [http://gparted.sourceforge.net/livecd.php provided as a "live" CD]. It is also included on live CDs of most Linux distributions such as [[Wikipedia:Ubuntu (operating system)|Ubuntu]] and [[Wikipedia:Linux Mint|Linux Mint]]. A drive should first be [[partitioning|partitioned]] and the partitions should be formatted with a [[File Systems|file system]] before rebooting.<br />
<br />
The recommendation for a system that will boot via UEFI rather than MBR legacy boot is to format the drive using a GPT partition table. This means that if the drive was previously already partitioned with an MBR (MSDOS) partition table it will now have a new partition table created which will destroy all other data on the drive. Once the new partition table has been created on a drive, only then can individual partitions be created with any chosen format type. When using Gparted, selecting the option to create a new partition table gives an "msdos" partition table by default. If you are intending to follow the advice to create a GPT partition table then you need to choose "Advanced" and then select "gpt" from the drop-down menu. This cannot be done if you have a pre-existing Windows installation on the drive which you wish not to destroy. It is therefore extremely important to not change the partition table to GPT if you intend on having a dual boot system. Leave the Windows install untouched and try to get the Linux install working with UEFI on a drive that contains an MBR (legacy) partition table. <br />
<br />
In addition, some newer computers come pre-installed with Windows 8 which will be using Secure Boot. Arch Linux currently does not support Secure Boot, but some Windows 8 installations have been seen not to boot if Secure Boot is turned off in the BIOS. In some cases it is necessary to turn off both Secure Boot as well as Fastboot in the BIOS options in order to allow Windows 8 to boot without Secure Boot. However there are potential security risks in turning off Secure Boot for booting up Windows 8. Therefore, it may be a better option to keep the Windows 8 install intact and have an independent hard drive for the Linux install - which can then be partitioned from scratch using a GPT partition table. Once that is done, creating several ext4/FAT32/swap partitions on the second drive may be a better way forward if the computer has two drives available. This is often not easy or possible on a small laptop. Currently, Secure Boot is still not in a fully stable state for reliable operation, even for Linux distributions that support it.<br />
<br />
See [[Swap]] for details if you wish to set up a swap partition or swap file. A swap file is easier to resize than a partition and can be created at any point after installation, but cannot be used with a Btrfs filesystem.<br />
<br />
If you have already done so, proceed to [[#Mount the partitions|Mount the partitions]].<br />
<br />
Otherwise, see the following example.<br />
<br />
==== Example ====<br />
<br />
The Arch Linux install media includes the following partitioning tools: {{ic|fdisk}}, {{ic|gdisk}}, {{ic|cfdisk}}, {{ic|cgdisk}}, {{ic|parted}}.<br />
<br />
{{Tip|Use the {{ic|lsblk}} command to list the hard disks attached to your system, along with the sizes of their existing partitions. This will help you to be confident you are partitioning the right disk.}}<br />
<br />
{{Box BLUE|Notes regarding [[UEFI]] boot:|<br />
* If you have a UEFI motherboard, you will need to create an extra [[Unified Extensible Firmware Interface#EFI_System_Partition|UEFI System Partition]].<br />
* It is recommended to always use GPT for UEFI boot, as some UEFI firmwares do not allow UEFI-MBR boot.}}<br />
<br />
{{Box BLUE|Notes regarding [[GPT]] partitioning:|<br />
* If you are not dual booting with Windows, then it is advisable to use GPT instead of MBR. Read [[GPT]] for a list of advantages.<br />
* If you have a BIOS motherboard (or plan on booting in BIOS compatibility mode) and you want to setup GRUB on a GPT-partitioned drive, you will need to create an extra [[GRUB#GUID Partition Table (GPT) specific instructions|BIOS Boot Partition]] of size 1007 KiB and {{ic|EF02}} type code. Syslinux does not need one.<br />
* Some BIOS systems may have issues with GPT. See http://mjg59.dreamwidth.org/8035.html and http://rodsbooks.com/gdisk/bios.html for more info and possible workarounds.}}<br />
<br />
{{Note|If you are installing to a USB flash key, see [[Installing Arch Linux on a USB key]].}}<br />
<br />
The example system will contain a 15 GB root partition, and a [[Partitioning#/home|home]] partition for the remaining space. Choose either [[MBR]] or [[GPT]]. Do not choose both!<br />
<br />
It should be emphasized that partitioning is a personal choice and that this example is only for illustrative purposes. See [[Partitioning]].<br />
<br />
{| class="wikitable"<br />
|-<br />
| rowspan="2" | '''MBR'''<br />
| rowspan="2"| {{ic|cfdisk&nbsp;/dev/sda}}<br />
| '''Root:'''<br />
<br />
* Choose New (or press {{Keypress|N}}) – {{Keypress|Enter}} for Primary – type in "15360" – {{Keypress|Enter}} for Beginning – {{Keypress|Enter}} for Bootable.<br />
|-<br />
|<br />
'''Home:'''<br />
<br />
* Press the down arrow to move to the free space area.<br />
* Choose New (or press {{Keypress|N}}) – {{Keypress|Enter}} for Primary – {{Keypress|Enter}} to use the rest of the drive (or you could type in the desired size).<br />
|-<br />
| rowspan="2" | '''GPT'''<br />
| rowspan="2"| {{ic|cgdisk&nbsp;/dev/sda}}<br />
| '''Root:'''<br />
<br />
* Choose New (or press {{Keypress|N}}) – {{Keypress|Enter}} for the first sector (2048) – type in "15G" – {{Keypress|Enter}} for the default hex code (8300) – {{Keypress|Enter}} for a blank partition name.<br />
|-<br />
| '''Home:'''<br />
<br />
* Press the down arrow a couple of times to move to the larger free space area.<br />
* Choose New (or press {{Keypress|N}}) – {{Keypress|Enter}} for the first sector – {{Keypress|Enter}} to use the rest of the drive (or you could type in the desired size; for example "30G") – {{Keypress|Enter}} for the default hex code (8300) – {{Keypress|Enter}} for a blank partition name.<br />
|}<br />
<br />
If you chose MBR, here is what it should look like:<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-----------------------------------------------------------------------<br />
sda1 Boot Primary Linux 15360<br />
sda2 Primary Linux 133000*<br />
<br />
If you chose GPT, here is what it should look like:<br />
<br />
Part. # Size Partition Type Partition Name<br />
----------------------------------------------------------------<br />
1007.0 KiB free space<br />
1 15.0 GiB Linux filesystem<br />
2 123.45 GiB Linux filesystem<br />
<br />
Double check and make sure that you are happy with the partition sizes as well as the partition table layout before continuing.<br />
<br />
If you would like to start over, you can simply select Quit (or press {{Keypress|Q}}) to exit without saving changes and then restart cfdisk (or cgdisk).<br />
<br />
If you are satisfied, choose Write (or press {{Keypress|Shift+W}}) to finalize and to write the partition table to the drive. Type "yes" and choose Quit (or press {{Keypress|Q}}) to exit without making any more changes.<br />
<br />
Simply partitioning is not enough; the partitions also need a [[File Systems|filesystem]]. To format the partitions with an ext4 filesystem:<br />
<br />
{{Warning|Double check and triple check that it is actually {{ic|/dev/sda1}} and {{ic|/dev/sda2}} that you want to format. You can use {{ic|lsblk}} to help with this.}}<br />
<br />
# mkfs.ext4 /dev/sda1<br />
# mkfs.ext4 /dev/sda2<br />
<br />
If you have made a partition dedicated to swap (code 82), do not forget to format and activate it with:<br />
<br />
# mkswap /dev/sda''X''<br />
# swapon /dev/sda''X''<br />
<br />
For UEFI, you should format the ESP partition (usually sda1) with:<br />
# mkfs.vfat -F32 /dev/sda1<br />
<br />
=== Mount the partitions ===<br />
<br />
Each partition is identified with a number suffix. For example, {{ic|sda1}} specifies the first partition of the first drive, while {{ic|sda}} designates the entire drive.<br />
<br />
To display the current partition layout:<br />
<br />
# lsblk /dev/sda<br />
<br />
{{Note|Do not mount more than one partition to the same directory. And pay attention, because the mounting order is important.}}<br />
<br />
First, mount the root partition on {{ic|/mnt}}. Following the example above (yours may be different), it would be:<br />
<br />
# mount /dev/sda1 /mnt<br />
<br />
Then mount the home partition and any other separate partition ({{ic|/boot}}, {{ic|/var}}, etc), if you have any:<br />
<br />
# mkdir /mnt/home<br />
# mount /dev/sda2 /mnt/home<br />
<br />
In case you have a UEFI motherboard, mount the UEFI partition:<br />
<br />
# mkdir -p /mnt/boot<br />
# mount /dev/sda''X'' /mnt/boot<br />
<br />
=== Select a mirror ===<br />
<br />
Before installing, you may want to edit the {{ic|mirrorlist}} file and place your preferred mirror first. A copy of this file will be installed on your new system by {{ic|pacstrap}} as well, so it is worth getting it right.<br />
<br />
{{hc|# nano /etc/pacman.d/mirrorlist|<br />
##<br />
## Arch Linux repository mirrorlist<br />
## Sorted by mirror score from mirror status page<br />
## Generated on 2012-MM-DD<br />
##<br />
<br />
<nowiki>Server = http://mirror.example.xyz/archlinux/$repo/os/$arch</nowiki><br />
...}}<br />
<br />
* {{Keypress|Alt+6}} to copy a {{ic|Server}} line.<br />
* {{Keypress|PageUp}} key to scroll up.<br />
* {{Keypress|Ctrl+U}} to paste it at the top of the list.<br />
* {{Keypress|Ctrl+X}} to exit, and when prompted to save changes, press {{Keypress|Y}} and {{Keypress|Enter}} to use the same filename.<br />
<br />
If you want, you can make it the ''only'' mirror available by getting rid of everything else (using {{Keypress|Ctrl+K}}), but it is usually a good idea to have a few more, in case the first one goes offline.<br />
<br />
{{Tip|<br />
* Use the [https://www.archlinux.org/mirrorlist/ Mirrorlist Generator] to get an updated list for your country. HTTP mirrors are faster than FTP, because of something called [[Wikipedia:Keepalive|keepalive]]. With FTP, pacman has to send out a signal each time it downloads a package, resulting in a brief pause. For other ways to generate a mirror list, see [[Mirrors#Sorting mirrors|Sorting mirrors]] and [[Reflector]].<br />
* [https://archlinux.org/mirrors/status/ Arch Linux MirrorStatus] reports various aspects about the mirrors such as network problems with mirrors, data collection problems, the last time mirrors have been synced, etc.}}<br />
<br />
{{Note|<br />
* Whenever in the future you change your list of mirrors, always remember to force pacman to refresh all package lists with {{ic|pacman -Syy}}. This is considered to be good practice and will avoid possible headaches. See [[Mirrors]] for more information.<br />
* If you are using an older installation medium, your mirrorlist might be outdated, which might lead to problems when updating Arch Linux (see {{Bug|22510}}). Therefore it is advised to obtain the latest mirror information as described above.<br />
* Some issues have been reported in the [https://bbs.archlinux.org/ Arch Linux forums] regarding network problems that prevent pacman from updating/synchronizing repositories (see [https://bbs.archlinux.org/viewtopic.php?id&#61;68944] and [https://bbs.archlinux.org/viewtopic.php?id&#61;65728]). When installing Arch Linux natively, these issues have been resolved by replacing the default pacman file downloader with an alternative (see [[Improve Pacman Performance]] for more details). When installing Arch Linux as a guest OS in [[VirtualBox]], this issue has also been addressed by using "Host interface" instead of "NAT" in the machine properties.}}<br />
<br />
=== Install the base system ===<br />
<br />
The base system is installed using the [https://github.com/falconindy/arch-install-scripts/blob/master/pacstrap.in pacstrap] script.<br />
<br />
The {{ic|-i}} switch can be omitted if you wish to install every package from the ''base'' group without prompting.<br />
<br />
# pacstrap -i /mnt base<br />
<br />
{{Note|If pacman fails to verify your packages, check the system time with {{ic|cal}}. If the system date is invalid (e.g. it shows the year 2010), signing keys will be considered expired (or invalid), signature checks on packages will fail and installation will be interrupted. Make sure to correct the system time, either by doing so manually or with the {{Pkg|ntp}} client, and retry running the pacstrap command. Refer to [[Time]] page for more information on correcting system time.}}<br />
<br />
{{Note|If pacman complains that {{ic|error: failed to commit transaction (invalid or corrupted package)}}, run the following command:<br />
# pacman-key --init && pacman-key --populate archlinux<br />
}}<br />
<br />
This will give you a basic Arch system. Other packages can be installed later using [[pacman]].<br />
<br />
=== Generate an fstab ===<br />
<br />
Generate an [[fstab]] file with the following command. UUIDs will be used because they have certain advantages (see [[fstab#Identifying filesystems]]). If you would prefer to use labels instead, replace the {{ic|-U}} option with {{ic|-L}}.<br />
<br />
# genfstab -U -p /mnt >> /mnt/etc/fstab<br />
# nano /mnt/etc/fstab<br />
<br />
{{Warning|The fstab file should always be checked after generating it. If you encounter errors running genfstab or later in the install process, do '''not''' run genfstab again; just edit the fstab file.}}<br />
<br />
A few considerations:<br />
<br />
* The last field determines the order that in which partitions are checked at start up : {{ic|1}} , {{ic|2}} or {{ic|0}} (see [[fstab#Field definitions]]).<br />
* Only the root ({{ic|/}}) partition needs {{ic|1}} for the last field. Everything else should have either {{ic|2}} or {{ic|0}}.<br />
* You will normally want your ''swap'' partition to have {{ic|0}} i.e. 'do not check'.<br />
<br />
=== Chroot and configure the base system ===<br />
<br />
Next, we [[chroot]] into our newly installed system:<br />
<br />
# arch-chroot /mnt<br />
<br />
{{Note|Use {{ic|arch-chroot /mnt /bin/bash}} to chroot into a bash shell.}}<br />
At this stage of the installation, you will configure the primary configuration files of your Arch Linux base system. These can either be created if they do not exist, or edited if you wish to change the defaults.<br />
<br />
Closely following and understanding these steps is of key importance to ensure a properly configured system.<br />
<br />
==== Locale ====<br />
<br />
Locales are used by '''glibc''' and other locale-aware programs or libraries for rendering text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards.<br />
<br />
There are two files that need editing: {{ic|locale.gen}} and {{ic|locale.conf}}.<br />
<br />
* The {{ic|locale.gen}} file is empty by default (everything is commented out) and you need to remove the {{ic|#}} in front of the line(s) you want. You may uncomment more lines than just English (US), as long as you choose their {{ic|UTF-8}} encoding:<br />
<br />
{{hc|# nano /etc/locale.gen|<br />
en_US.UTF-8 UTF-8<br />
de_DE.UTF-8 UTF-8}}<br />
<br />
# locale-gen<br />
<br />
This will run on every '''glibc''' upgrade, generating all the locales specified in {{ic|/etc/locale.gen}}.<br />
<br />
* The {{ic|locale.conf}} file does not exist by default. Setting only {{ic|LANG}} should be enough. It will act as the default value for all other variables.<br />
<br />
# echo LANG=en_US.UTF-8 > /etc/locale.conf<br />
# export LANG=en_US.UTF-8<br />
<br />
{{Note|If you set some other language than English (US) at the beginning of the install, the above commands would be something like:<br />
# echo LANG<nowiki>=</nowiki>de_DE.UTF-8 > /etc/locale.conf<br />
# export LANG<nowiki>=</nowiki>de_DE.UTF-8<br />
}}<br />
<br />
To use other locales for other {{ic|LC_*}} variables, run {{ic|locale}} to see the available options and add them to {{ic|locale.conf}}. It is not recommended to set the {{ic|LC_ALL}} variable. An advanced example can be found [[Locale#Setting_system-wide_locale|here]].<br />
<br />
==== Console font and keymap ====<br />
<br />
If you set a keymap at [[#Change_the_language|the beginning]] of the install process, load it now, as well, because the environment has changed. For example:<br />
<br />
# loadkeys ''de-latin1''<br />
# setfont Lat2-Terminus16<br />
<br />
To make them available after reboot, edit {{ic|vconsole.conf}}:<br />
<br />
{{hc|# nano /etc/vconsole.conf|2=<br />
KEYMAP=de-latin1<br />
FONT=Lat2-Terminus16<br />
}}<br />
<br />
* {{ic|KEYMAP}} – Please note that this setting is only valid for your TTYs, not any graphical window managers or Xorg.<br />
<br />
* {{ic|FONT}} – Available alternate console fonts reside in {{ic|/usr/share/kbd/consolefonts/}}. The default (blank) is safe, but some foreign characters may show up as white squares or as other symbols. It is recommended that you change it to {{ic|Lat2-Terminus16}}, because according to {{ic|/usr/share/kbd/consolefonts/README.Lat2-Terminus16}}, it claims to support "about 110 language sets".<br />
<br />
* Possible option {{ic|FONT_MAP}} – Defines the console map to load at boot. Read {{ic|man setfont}}. Removing it or leaving it blank is safe.<br />
<br />
See [[Fonts#Console_fonts|Console fonts]] and {{ic|man vconsole.conf}} for more information.<br />
<br />
==== Time zone ====<br />
<br />
Available time zones and subzones can be found in the {{ic|/usr/share/zoneinfo/<Zone>/<SubZone>}} directories.<br />
<br />
To view the available <Zone>, check the directory {{ic|/usr/share/zoneinfo/}}:<br />
<br />
# ls /usr/share/zoneinfo/<br />
<br />
Similarly, you can check the contents of directories belonging to a <SubZone>:<br />
<br />
# ls /usr/share/zoneinfo/Europe<br />
<br />
Create a symbolic link {{ic|/etc/localtime}} to your zone file {{ic|/usr/share/zoneinfo/<Zone>/<SubZone>}} using this command:<br />
<br />
# ln -s /usr/share/zoneinfo/<Zone>/<SubZone> /etc/localtime<br />
<br />
'''Example:'''<br />
<br />
# ln -s /usr/share/zoneinfo/Europe/Minsk /etc/localtime<br />
<br />
==== Hardware clock ====<br />
<br />
Set the hardware clock mode uniformly between your operating systems. Otherwise, they may overwrite the hardware clock and cause time shifts.<br />
<br />
You can generate {{ic|/etc/adjtime}} automatically by using one of the following commands:<br />
<br />
* '''UTC''' (recommended)<br />
<br />
: {{Note|Using [[Wikipedia:Coordinated Universal Time|UTC]] for the hardware clock does not mean that software will display time in UTC.}}<br />
<br />
: {{bc|# hwclock --systohc --utc}}<br />
<br />
To synchronize your "UTC" time over the internet, see [[Network Time Protocol daemon|NTPd]].<br />
<br />
* '''localtime''' (discouraged; used by default in Windows)<br />
<br />
: {{Warning|Using ''localtime'' may lead to several known and unfixable bugs. However, there are no plans to drop support for ''localtime''.}}<br />
<br />
: {{bc|# hwclock --systohc --localtime}}<br />
<br />
If you have (or planning on having) a dual boot setup with Windows:<br />
<br />
* Recommended: Set both Arch Linux and Windows to use UTC. A quick [[Time#UTC in Windows|registry fix]] is needed. Also, be sure to prevent Windows from synchronizing the time on-line, because the hardware clock will default back to ''localtime''.<br />
<br />
* Not recommended: Set Arch Linux to ''localtime'' and disable any time-related services, like [[Network Time Protocol daemon|NTPd]] . This will let Windows take care of hardware clock corrections and you will need to remember to boot into Windows at least two times a year (in Spring and Autumn) when [[Wikipedia:Daylight saving time|DST]] kicks in. So please do not ask on the forums why the clock is one hour behind or ahead if you usually go for days or weeks without booting into Windows.<br />
<br />
==== Kernel modules ====<br />
<br />
{{Tip|This is just an example, you do not need to set it. All needed modules are automatically loaded by udev, so you will rarely need to add something here. Only add modules that you know are missing.}}<br />
<br />
For kernel modules to load during boot, place a {{ic|*.conf}} file in {{ic|/etc/modules-load.d/}}, with a name based on the program that uses them.<br />
<br />
{{hc|# nano /etc/modules-load.d/virtio-net.conf|<br />
# Load 'virtio-net.ko' at boot.<br />
<br />
virtio-net}}<br />
<br />
If there are more modules to load per {{ic|*.conf}}, the module names can be separated by newlines. A good example are the [[VirtualBox#Arch Linux guests|VirtualBox Guest Additions]].<br />
<br />
Empty lines and lines starting with {{ic|#}} or {{ic|;}} are ignored.<br />
<br />
==== Hostname ====<br />
<br />
Set the [[Wikipedia:hostname|hostname]] to your liking (e.g. ''arch''):<br />
<br />
# echo ''myhostname'' > /etc/hostname<br />
<br />
{{Note|There is no need to edit {{ic|/etc/hosts}}.}}<br />
<br />
=== Configure the network ===<br />
<br />
You need to configure the network again, but this time for your newly installed environment. The procedure and prerequisites are very similar to the one described [[#Establish an internet connection|above]], except we are going to make it persistent and automatically run at boot.<br />
<br />
{{Note|For more in-depth information on network configration, visit [[Network Configuration]] and [[Wireless Setup]].}}<br />
<br />
{{Note|If you would like to use the old interface naming scheme (ie. eth* and wlan*) you can accomplish this by creating an empty file at {{ic|/etc/udev/rules.d/80-net-name-slot.rules}} which will mask the file of the same name located under {{ic|/usr/lib/udev/rules.d}} (alternatively, instead of an empty file, using a symlink to {{ic|/dev/null}} is also an acceptable masking method).}}<br />
<br />
==== Wired ====<br />
<br />
===== Dynamic IP =====<br />
<br />
; Using dhcpcd<br />
<br />
If you only use a single fixed wired network connection, you do not need a network management service and can simply enable the {{ic|dhcpcd}} service. Here, {{ic|''interface_name''}} is your wired interface:<br />
<br />
# systemctl enable dhcpcd@''interface_name''.service<br />
<br />
; Using netctl<br />
<br />
Copy a sample profile from {{ic|/etc/netctl/examples}} to {{ic|/etc/netctl}}:<br />
<br />
# cd /etc/netctl<br />
# cp examples/ethernet-dhcp my-network<br />
<br />
Edit the profile as needed (modify {{ic|Interface}}):<br />
<br />
# nano my-network<br />
<br />
Enable the {{ic|my-network}} profile:<br />
<br />
# netctl enable my-network<br />
<br />
; Using netctl-ifplugd<br />
<br />
Alternatively, you can use {{ic|netctl-ifplugd}}, which gracefully handles dynamic connections to new networks:<br />
<br />
Install {{Pkg|ifplugd}}, which is required for {{ic|netctl-ifplugd}}:<br />
<br />
# pacman -S ifplugd<br />
<br />
Then enable for interface that you want:<br />
<br />
# systemctl enable netctl-ifplugd@<interface>.service<br />
<br />
{{Tip|[[Netctl]] also provides {{ic|netctl-auto}}, which can be used to handle wired profiles in conjunction with {{ic|netctl-ifplugd}}.}}<br />
<br />
===== Static IP =====<br />
<br />
; Using netctl<br />
<br />
Copy a sample profile from {{ic|/etc/netctl/examples}} to {{ic|/etc/netctl}}:<br />
<br />
# cd /etc/netctl<br />
# cp examples/ethernet-static my-network<br />
<br />
Edit the profile as needed (modify {{ic|Interface}}, {{ic|Address}}, {{ic|Gateway}} and {{ic|DNS}}):<br />
<br />
# nano my-network<br />
<br />
* Notice the {{ic|/24}} in {{ic|Address}} which is the [[wikipedia:Classless Inter-Domain Routing#CIDR notation|CIDR notation]] of a {{ic|255.255.255.0}} netmask<br />
<br />
Enable above created profile to start it at every boot:<br />
<br />
# netctl enable my-network<br />
<br />
==== Wireless ====<br />
<br />
{{Note|If your wireless adapter requires a firmware (as described in the above [[#Wireless|Establish an internet connection]] section and also [[Wireless Setup#Drivers and firmware|here]]), install the package containing your firmware. Most of the time, the {{Pkg|linux-firmware}} package will contain the needed firmware. Though for some devices, the required firmware might be in its own package. For example:<br />
{{bc|# pacman -S zd1211-firmware}}<br />
See [[Wireless Setup]] for more info.}}<br />
<br />
Install {{pkg|iw}}, {{pkg|wpa_supplicant}} and {{pkg|wpa_actiond}} which you will need to connect to a network:<br />
<br />
# pacman -S iw wpa_supplicant wpa_actiond<br />
<br />
===== Adding wireless networks =====<br />
; Using wifi-menu<br />
<br />
Install {{pkg|dialog}}, which is required for {{ic|wifi-menu}}:<br />
<br />
# pacman -S dialog<br />
<br />
After finishing the rest of this installation and rebooting, you can connect to the network with {{ic|wifi-menu ''interface_name''}} (where {{ic|''interface_name''}} is the interface of your wireless chipset).<br />
<br />
# wifi-menu ''interface_name''<br />
<br />
{{Warning|This must be done *after* your reboot when you are no longer chrooted. The process spawned by this command will conflict with the one you have running outside of the chroot. Alternatively, you could just configure a network profile manually using the following templates so that you do not have to worry about using {{ic|wifi-menu}} at all.}}<br />
<br />
; Using manual netctl profiles<br />
<br />
Copy a network profile from {{ic|/etc/netctl/examples}} to {{ic|/etc/netctl}}:<br />
<br />
# cd /etc/netctl<br />
# cp examples/wireless-wpa my-network<br />
<br />
Edit the profile as needed (modify {{ic|Interface}}, {{ic|ESSID}} and {{ic|Key}}):<br />
<br />
# nano my-network<br />
<br />
===== Connect automatically to known networks =====<br />
Enable the {{ic|netctl-auto}} service, which will connect to known networks and gracefully handle roaming and disconnects:<br />
<br />
# systemctl enable netctl-auto@''interface_name''.service<br />
<br />
{{Tip|[[Netctl]] also provides {{ic|netctl-ifplugd}}, which can be used to handle wired profiles in conjunction with {{ic|netctl-auto}}.}}<br />
<br />
==== Analog modem, ISDN or PPoE DSL ====<br />
<br />
For xDSL, dial-up and ISDN connections, see [[Direct Modem Connection]].<br />
<br />
=== Create an initial ramdisk environment ===<br />
<br />
{{Tip|Most users can skip this step and use the defaults provided in {{ic|mkinitcpio.conf}}. The initramfs image (from the {{ic|/boot}} folder) has already been generated based on this file when the {{Pkg|linux}} package (the Linux kernel) was installed earlier with {{ic|pacstrap}}.}}<br />
<br />
Here you need to set the right [[Mkinitcpio#HOOKS|hooks]] if the root is on a USB drive, if you use RAID, LVM, or if {{ic|/usr}} is on a separate partition.<br />
<br />
Edit {{ic|/etc/mkinitcpio.conf}} as needed and re-generate the initramfs image with:<br />
<br />
# mkinitcpio -p linux<br />
<br />
{{Note|Arch VPS installations on QEMU (e.g. when using {{ic|virt-manager}}) may need {{ic|virtio}} modules in {{ic|mkinitcpio.conf}} to be able to boot.<br />
<br />
{{hc|# nano /etc/mkinitcpio.conf|2=<br />
MODULES="virtio virtio_blk virtio_pci virtio_net"}}}}<br />
<br />
=== Set the root password ===<br />
<br />
Set the root password with:<br />
<br />
# passwd<br />
<br />
=== Install and configure a bootloader ===<br />
<br />
==== For BIOS motherboards ====<br />
<br />
For BIOS systems, two bootloaders are available: Syslinux and GRUB. Choose the bootloader as per your convenience.<br />
<br />
* Syslinux is (currently) limited to loading only files from the partition where it was installed. Its configuration file is considered to be easier to understand. An example configuration can be found [https://bbs.archlinux.org/viewtopic.php?pid=1109328#p1109328 here].<br />
<br />
* GRUB is more feature-rich and supports more complex scenarios. Its configuration file(s) is more similar to a scripting language, which may be difficult for beginners to manually write. It is recommended that they automatically generate one.<br />
<br />
{{Note|Some BIOS systems may have issues with GPT. See http://mjg59.dreamwidth.org/8035.html and http://rodsbooks.com/gdisk/bios.html for more info and possible workarounds.}}<br />
<br />
===== Syslinux =====<br />
<br />
{{Note|If you opted for a GUID partition table for your hard drive earlier, you need to install the {{Pkg|gptfdisk}} package now for this next step to work, assuming you haven't installed it already.}}<br />
<br />
Install the {{Pkg|syslinux}} package and then use the {{ic|syslinux-install_update}} script to automatically ''install'' the bootloader ({{ic|-i}}), mark the partition ''active'' by setting the boot flag ({{ic|-a}}), and install the ''MBR'' boot code ({{ic|-m}}):<br />
<br />
# pacman -S syslinux<br />
# syslinux-install_update -i -a -m<br />
<br />
Configure {{ic|syslinux.cfg}} to point to the right root partition. This step is vital. If it points to the wrong partition, Arch Linux will not boot. Change {{ic|/dev/sda3}} to reflect your root partition ''(if you partitioned your drive as in [[#Prepare the storage drive|the example]], your root partition is sda1)''. Do the same for the fallback entry.<br />
<br />
{{hc|# nano /boot/syslinux/syslinux.cfg|2=<br />
...<br />
LABEL arch<br />
...<br />
APPEND root=/dev/sda3 ro<br />
...}}<br />
<br />
For more information on configuring and using Syslinux, see [[Syslinux]].<br />
<br />
===== GRUB =====<br />
<br />
Install the {{Pkg|grub}} package and then run {{ic|grub-install}} to install the bootloader:<br />
<br />
{{Note|Change {{ic|/dev/sda}} to reflect the drive you installed Arch on. Do not append a partition number (do not use {{ic|sda''X''}}).}}<br />
<br />
{{Note|For GPT-partitioned drives on BIOS motherboards, you also need a "BIOS Boot Partition". See [[GRUB#GUID Partition Table (GPT) specific instructions|GPT-specific instructions]] and [[GRUB#Install_to_GPT_BIOS_boot_partition|Install to GPT BIOS boot partition]] in the GRUB page.}}<br />
<br />
# pacman -S grub<br />
# grub-install --recheck /dev/sda<br />
<br />
{{Note| If it is an installation on virtualbox as guest, while running grub-install command as in above, you might get an error like "/usr/sbin/grub-bios-setup: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible". Executing {{ic|parted -s /dev/sda set 1 bios_grub on}} and then retrying ''grub-install'' should solve the problem.}}<br />
<br />
While using a manually created {{ic|grub.cfg}} is absolutely fine, it is recommended that beginners automatically generate one:<br />
<br />
{{Tip|To automatically search for other operating systems on your computer, install {{Pkg|os-prober}} ({{ic|pacman -S os-prober}}) before running the next command.}}<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
For more information on configuring and using GRUB, see [[GRUB]].<br />
<br />
==== For UEFI motherboards ====<br />
<br />
For UEFI boot, the drive needs to be GPT-partitioned and an "[[Unified Extensible Firmware Interface#EFI System Partition|UEFI System Partition]]" (512 MiB or larger, type {{ic|EF00}}, formatted with FAT32) must be present and mounted on {{ic|/boot}}. If you have followed this guide from the beginning, you have already done all of these.<br />
<br />
===== EFISTUB =====<br />
<br />
The Linux kernel can act as its own bootloader using EFISTUB. This is the UEFI boot method recommended by developers and simpler than using a separate bootloader.<br />
<br />
1. Install efibootmgr:<br />
<br />
# pacman -S efibootmgr<br />
<br />
2. Add Arch Linux boot entry, replacing '''sdaX''' with your root partition, usually '''sda2''':<br />
<br />
# efibootmgr -c -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/'''sdaX''' ro quiet initrd=/initramfs-linux.img"<br />
<br />
{{Note|On some systems, the above command will not work properly. It will execute without any visible error, but the UEFI boot menu will not have been correctly updated with a new entry. To determine whether the command executed properly, run {{ic|efibootmgr}} without any arguments and see if a new entry has appeared in the list displayed. If there is no new entry, then it will not be possible to boot Arch upon reboot, as the UEFI boot menu has been left unchanged. In this case, you will instead have to enter the UEFI shell and manually add an entry to the UEFI boot menu with the {{ic|bcfg}} command, as described [[Unified Extensible Firmware Interface#bcfg|here]].}}<br />
<br />
{{Note|On some ASUS motherboards, there is an EFI bug that always reports {{ic|MaxVariableSize&#61;0}}. Combined with a recent kernel that enforces checks on this value, this prevents {{ic|efibootmgr}} from setting new EFI variables. These motherboards do not support the UEFI Shell v2, so you cannot use the {{ic|bcfg}} method either. To work around this, add {{ic|efi_no_storage_paranoia}} to the kernel command line. You can do this by pressing "e" at the bootloader menu.}}<br />
<br />
{{Note|On some UEFI motherboards like the Intel Z77 boards, adding entries with efibootmgr or bcfg from efi shell will not work because they don't show up on the boot menu list after being added to NVRAM.<br />
<br />
To solve this you have to trick the UEFI firmware that Windows boot manager is present on the ESP partition.<br />
<br />
<br />
Copy the bootx64.efi file from USB drive as bootmgfw.efi efi file to your ESP partition by booting into EFI shell and typing:<br />
<br />
FS1:<br />
cd EFI<br />
mkdir Microsoft<br />
cd Microsoft<br />
mkdir Boot<br />
cp FS0:\EFI\BOOT\bootx64.efi FS1:\EFI\Microsoft\Boot\bootmgfw.efi<br />
<br />
After reboot, any entries added to NVRAM should show up in the boot menu.}}<br />
<br />
===== Gummiboot Loader =====<br />
<br />
If you want to use a bootloader for dualbooting with other operating systems, gummiboot is the recommended loader. Download it, and let it install itself to {{ic|/boot}}:<br />
<br />
# pacman -S gummiboot<br />
# gummiboot install<br />
<br />
You will need to manually create a configuration file to add an entry for Arch Linux to the gummiboot loader. Create {{ic|/boot/loader/entries/arch.conf}} and add the following contents, replacing '''sdaX''' with your root partition, usually '''sda2''':<br />
<br />
{{hc|# nano /boot/loader/entries/arch.conf|2=<br />
title Arch Linux<br />
linux /vmlinuz-linux<br />
initrd /initramfs-linux.img<br />
options root=/dev/'''sdaX''' ro<br />
}}<br />
<br />
Use efibootmgr to add gummibot to NVRAM:<br />
# efibootmgr -c -w -l '\EFI\gummiboot\gummibootx64.efi' -L "Gummiboot"<br />
<br />
{{Note|You will see an error during gummiboot install, it fails to add itself to NVRAM because of a bug https://bugs.archlinux.org/task/34292. Hence why manually adding entry with efibootmgr is preferred method.}}<br />
<br />
{{Note|Read more about: [[Gummiboot]]. For other bootloaders see [[UEFI Bootloaders]].}}<br />
<br />
=== Unmount the partitions and reboot ===<br />
<br />
Exit from the chroot environment:<br />
<br />
# exit<br />
<br />
Since the partitions are mounted under {{ic|/mnt}}, we use the following command to unmount them:<br />
<br />
# umount /mnt/{boot,home,}<br />
<br />
Reboot the computer:<br />
<br />
# reboot<br />
<br />
{{Tip|If you face error "/sbin/init does not exist" on next boot, look for systemd binary path and pass it as kernel argument while booting up. For example, "init &#61; /usr/lib/systemd/systemd" }}<br />
{{Tip|Be sure to remove the installation media, otherwise you will boot back into it.}}<noinclude><br />
{{Beginners' Guide navigation}}</noinclude></div>Cinellihttps://wiki.archlinux.org/index.php?title=Dotfiles&diff=261042Dotfiles2013-06-04T02:14:26Z<p>Cinelli: /* Repositories */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Dotfiles]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|This article collects links to many user repositories containing custom configuration files.}}<br />
{{Article summary end}}<br />
<br />
'''dotfiles''' are configuration files<br />
<br />
== Managing dotfiles with git ==<br />
A popular way of keeping a centralized copy of your dotfiles is hosting them on github.<br />
<br />
== Repositories ==<br />
<br />
{| class="wikitable sortable" border="1" cellpadding="1" cellspacing="0"<br />
! scope="col" | Author<br />
! scope="col" | Shell<br />
! scope="col" | WM / DE<br />
! scope="col" | Editor<br />
! scope="col" | Terminal<br />
! scope="col" | Multiplexer<br />
! scope="col" | Audio<br />
! scope="col" | Monitor<br />
! scope="col" | Mail<br />
! scope="col" | IRC<br />
|-<br />
! [https://github.com/pbrisbin/dotfiles brisbin33]<br />
| [https://github.com/pbrisbin/oh-my-zsh zsh] || [https://github.com/pbrisbin/xmonad-config xmonad] || [https://github.com/pbrisbin/vim-config vim] || rxvt-unicode || || ncmpcpp || conky || [https://github.com/pbrisbin/mutt-config mutt] || irssi<br />
|-<br />
! [https://github.com/cinelli/dotfiles cinelli]<br />
| zsh || dwm || vim || termite-git || || pianobar || htop || mutt-kz || weechat<br />
|-<br />
! [https://github.com/falconindy/dotfiles falconindy]<br />
| bash || i3 || vim || rxvt-unicode || || ncmpcpp || conky || mutt ||<br />
|-<br />
! [https://github.com/graysky2/configs/tree/master/dotfiles graysky]<br />
| zsh || xfce4 || vim || terminal || || ncmpcpp || custom || thunderbird ||<br />
|-<br />
! [http://code.gtmanfred.com/cgit/dotfiles.git/tree/?h=tower gtmanfred]<br />
| zsh || dwm || vim || termite-git || tmux || mpd || conky || mutt || weechat<br />
|-<br />
! [https://bitbucket.org/jasonwryan/eeepc/src jasonwryan]<br />
| bash || dwm || vim || rxvt-unicode || tmux || ncmpcpp || bash script || mutt || irrsi<br />
|-<br />
! [http://github.com/meskarune/.dotfiles meskarune]<br />
| bash || herbstluftwm || vim || rxvt-unicode || screen || || conky || || weechat<br />
|-<br />
! [https://github.com/neersighted/dotfiles neersighted]<br />
| zsh || i3 || vim || rxvt-unicode || tmux || ncmpcpp || htop || mutt || irssi<br />
|-<br />
! [https://github.com/ok100/configs OK100]<br />
| bash || dwm || vim || rxvt-unicode || || cmus || conky, dzen || mutt || weechat<br />
|-<br />
! [http://hg.subtle.de/dotfiles/file unexist]<br />
| zsh || subtle || vim || rxvt-unicode || || ncmpcpp || || mutt || irssi<br />
|-<br />
! [http://github.com/vodik/dotfiles vodik]<br />
| zsh || xmonad || vim || termite-git || tmux || ncmpcpp || custom || mutt || weechat<br />
|-<br />
! [http://github.com/w0ng/dotfiles w0ng]<br />
| zsh || dwm || vim || rxvt-unicode || tmux || ncmpcpp || custom || mutt || irssi<br />
|-<br />
! [http://github.com/Wintervenom/Configuration Wintervenom]<br />
| bash || herbstluftwm ||vim || rxvt-unicode || screen ||mpd ([https://github.com/Wintervenom/Scripts/tree/master/audio/mpd mpc-utils]) || [https://github.com/Wintervenom/Scripts/blob/master/wm/herbstluftwm/hlwm-dzen2https://github.com/wolfcore/dotfiles hlwm-dzen2] || mutt || weechat<br />
|-<br />
! [http://github.com/wolfcore/dotfiles wolfcore] <br />
| bash || dwm || vim || rxvt-unicode || tmux || cmus || custom || || weechat<br />
|-<br />
! [https://github.com/xfausto/dotfiles xfausto]<br />
| zsh || dwm || vim || st || || ncmpcpp || conky || ||<br />
|-<br />
! [https://github.com/zendeavor zendeavor]<br />
| [https://github.com/zendeavor/config-stuff/tree/sandbag/zsh zsh] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/config i3] || [https://github.com/zendeavor/dotvim/tree/sandbag vim] || [https://github.com/zendeavor/config-stuff/blob/sandbag/X11/Xresources#L14 rxvt-unicode] || [https://github.com/zendeavor/config-stuff/tree/sandbag/tmux tmux] || [https://github.com/zendeavor/config-stuff/blob/sandbag/ncmpcpp/config ncmpcpp] || [https://github.com/zendeavor/config-stuff/blob/sandbag/i3/i3status.conf i3status] || || [https://github.com/zendeavor/config-stuff/tree/kiwi/weechat weechat]<br />
|-<br />
|}<br />
<br />
== See also ==<br />
* [http://mywiki.wooledge.org/DotFiles Dotfiles - Greg's Wiki]<br />
* [http://www.haskell.org/haskellwiki/Xmonad/Config_archive XMonad Config Archive]<br />
* [http://dotshare.it dotshare.it]<br />
* [http://dotfiles.org dotfiles.org] - [http://techie.cat/all-contents-from-dotfiles-org/ Copy of contents]</div>Cinellihttps://wiki.archlinux.org/index.php?title=AMD_Catalyst&diff=254658AMD Catalyst2013-04-20T10:04:33Z<p>Cinelli: /* Installing from the official repository */</p>
<hr />
<div>[[Category:Graphics]]<br />
[[Category:X Server]]<br />
[[es:ATI Catalyst]]<br />
[[fr:ATI#Catalyst]]<br />
[[it:AMD Catalyst]]<br />
[[zh-CN:AMD Catalyst]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of AMD's proprietary Linux "Catalyst" video card driver.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|ATI}}<br />
{{Article summary wiki|Xorg}}<br />
{{Article summary heading|Resources}}<br />
{{Article summary link|cchtml.com - Unofficial Wiki for the ATI Linux Driver|http://wiki.cchtml.com/index.php/Main_Page}}<br />
{{Article summary link|Unofficial ATI Linux Driver Bugzilla|http://ati.cchtml.com/query.cgi}}<br />
{{Article summary end}}<br />
<br />
Owners of '''ATI/AMD''' video cards have a choice between AMD's proprietary driver ({{AUR|catalyst}}) and the [[ATI|open source driver]] ({{Pkg|xf86-video-ati}}). This article covers the proprietary driver.<br />
<br />
AMD's Linux driver package ''catalyst'' was previously named ''fglrx'' ('''F'''ire'''GL''' and '''R'''adeon '''X'''). Only the package name has changed, while the kernel module retains its original ''fglrx.ko'' filename. Therefore, any mention of fglrx below is specifically in reference to the ''kernel module'', '''not the package'''.<br />
<br />
As of October 2012, binary packages are being offered. Currently, packages are available in the [community] repository, but it's unknown what will happen when an Xorg upgrade will break the driver. In the past, Catalyst [https://www.archlinux.org/news/ati-catalyst-support-dropped/ has been dropped] from official Arch support because of dissatisfaction with the quality and speed of development. Also, a legacy driver for Radeon HD 2xxx 3xxx 4xxx is not available in [community] yet. For more information, see [https://bbs.archlinux.org/viewtopic.php?pid=1166052#p1166052/ this] this forum post and onwards.<br />
<br />
Compared to the open source driver, Catalyst performs worse in 2D graphics, but has a better support for 3D rendering. Supported devices are [[wikipedia:Radeon|ATI/AMD Radeon]] video cards with chipset R600 and newer (as of Catalyst 9.4). See [[wikipedia:Comparison_of_AMD_graphics_processing_units|this table]], or the Xorg [http://www.x.org/wiki/RadeonFeature#Decoder_ring_for_engineering_vs_marketing_names "Decoder ring",] to translate ''model'' names (X1900, HD4850) to/from ''chip'' names (R580, RV770 respectively).<br />
<br />
== Installation ==<br />
<br />
There are four ways of installing Catalyst on your system. One way is to use the official [community] repository, but this does not contain the legacy driver. Another one is to use Vi0L0's (Arch's unofficial Catalyst maintainer) repository. This repository does contain all the necessary packages. The third method you can use is the AUR; PKGBUILDs offered here are also made by Vi0L0 and are the same he uses to built packages for his repository. Lastly, you can install the driver directly from AMD.<br />
<br />
Before choosing the method you prefer, you will have to see which driver you need. Since Catalyst 12.4, AMD has separated its development for Radeon HD 2xxx, 3xxx and 4xxx cards into the '''legacy''' Catalyst driver. For Radeon HD 5xxx and newer, there is the regular Catalyst driver. Regardless of the driver you need, you will also need the Catalyst utilities.<br />
<br />
{{Note|After the instructions for every method of installing, you will find general instructions '''everyone''' has to perform, regardless of the method you used.}}<br />
<br />
=== Installing the driver ===<br />
==== Installing from the official repository ====<br />
This is the most simple and straightforward way, as it requires no unofficial repositories and because this package uses [[Dynamic Kernel Module Support|DKMS]] to automatically rebuilt the kernel modules when the kernel is upgraded. If this repository holds the packages you need, it is suggested you take this one. <br />
<br />
To install Catalyst, [[Pacman|install]] {{Pkg|catalyst-dkms}} from the [[official repositories]] and {{Pkg|catalyst-utils}} from the [[AUR]].<br />
<br />
{{Note|If pacman asks you about removing '''libgl''' you can safely do so.}}<br />
<br />
{{Note|If you intend to use [[Dynamic Kernel Module Support|DKMS]] don't forget to install {{Pkg|linux-headers}} and enable the {{ic|dkms.service}} [[daemons|service]].}}<br />
<br />
If you are on 64-bit and also need 32-bit OpenGL support, install {{Pkg|lib32-catalyst-utils}} from the [[multilib]] repository.<br />
<br />
If you need OpenCL support, install {{Pkg|opencl-catalyst}}.<br />
<br />
Later on, a legacy driver will also be offered here.<br />
<br />
==== Installing from the unofficial repository ====<br />
If you need packages that currently aren't hosted by the official repository and don't fancy building the packages from the [[Arch User Repository|AUR]], this is the way to go. The repository is maintained by our unofficial Catalyst maintainer, Vi0L0. All packages are signed and I consider them safe to use. As you will see later on in this article, Vi0L0 is also responsible for many other packages that will help you get your system working with your ATI graphic cards. <br />
<br />
Vi0L0 has three different Catalyst repositories, each having different drivers:<br />
*[catalyst]; for the regular Catalyst driver needed by Radeon HD 5xxx and up, it contains the latest (stable or beta) Catalyst release;<br />
*[catalyst-stable]; for the regular Catalyst driver needed by Radeon HD 5xxx and up, with the latest stable driver;<br />
*[catalyst-hd234k]; for the legacy Catalyst driver needed by Radeon HD 2xxx, 3xxx and 4xxx cards. <br />
<br />
{{Warning|The Legacy driver does not support Xorg 1.13 or 1.14 for now. Support should be added by AMD in a century or two, but this could be sooner. Should you want to use this driver, see [[#Xorg repositories]] for instructions on how to roll back to or hold back Xorg 1.12.}}<br />
<br />
To enable one of these, you will have to edit {{ic|/etc/pacman.conf}} and add the repository of choice's information '''above all other repositories''' in {{ic|/etc/pacman.conf}}.<br />
<br />
*For [catalyst], add:<br />
<br />
[catalyst]<br />
<nowiki>Server = http://catalyst.wirephire.com/repo/catalyst/$arch</nowiki><br />
<br />
*For [catalyst-stable], add:<br />
<br />
[catalyst-stable]<br />
<nowiki>Server = http://catalyst.wirephire.com/repo/catalyst/$arch</nowiki><br />
<br />
*For [catalyst-hd234k], add:<br />
<br />
[catalyst-hd234k]<br />
<nowiki>Server = http://catalyst.wirephire.com/repo/catalyst-hd234k/$arch</nowiki><br />
<br />
You must also [[User:Vi0L0|add Vi0L0's GPG key]] so that pacman trusts the repositories.<br />
<br />
# pacman-key --keyserver pgp.mit.edu --recv-keys 0xabed422d653c3094<br />
# pacman-key --lsign-key 0xabed422d653c3094<br />
<br />
Once you have done this, update pacman's database and install the packages:<br />
<br />
# pacman -Syu<br />
# pacman -S catalyst catalyst-utils<br />
<br />
{{Note|If pacman asks you about removing '''libgl''' you can safely do so.}}<br />
<br />
{{Warning|Recently, development and updates of the Linux kernel have speed up, which is causing that incompatibilities between the Linux kernel and the Catalyst package are showing more often. For Vi0L0, it's getting more and more difficult to keep up with this pace and as such, we have seen a lot of users asking for what to do in the forums. Often, the solution is to a) wait for Vi0L0 to rebuilt the Catalyst package against those newer versions, b) do so yourself or c) hold back the Linux kernel update. The easiest solution is to do so yourself, not manually, but by using Vi0L0's excellent [[#Catalyst-hook]].}}<br />
<br />
If you are on 64-bit and also need 32-bit OpenGL support:<br />
<br />
# pacman -S lib32-catalyst-utils<br />
<br />
Repositories also contain other packages, that can ''replace'' the catalyst-hook package:<br />
<br />
* '''catalyst-generator'''; this package is able to generate fglrx modules packed into pacman compliant packages - most secure and KISS-compatible package in this side-note, although it has to be operated manually. It's described in [[#Catalyst-generator]]<br />
* '''catalyst-hook'''; a systemd service which will automatically update the fglrx module whilst the system shuts down or reboots. It's described in [[#Catalyst-hook]]<br />
<br />
You will find more details about those packages in [[#Tools| Tools section]].<br />
Lastly, both repositories also contain the '''xvba-video''' package, which enables video acceleration, described in [[#Video acceleration]], the '''AMDOverdriveCtrl''' package, which is a GUI to control over- and underclocking, also described in [[#GPU/Mem frequency, Temperature, Fan speed, Overclocking utilities]], and a pack of tools for '''OpenCL/OpenGL developers''', described in [[#OpenCL_and_OpenGL_development]]<br />
<br />
==== Installing from the AUR ====<br />
The last way to install Catalyst is from the [[Arch User Repository|AUR]]. If you want to built the packages specifically for your computer, this is your way to go. Note that this is also the most tedious way to install Catalyst; it requires the most work and also requires manual updates upon every kernel update.<br />
<br />
{{Warning|If you install the Catalyst package from the AUR, you will have to rebuild Catalyst every time the kernel is updated. Otherwise X '''will''' fail to start.}}<br />
{{Warning|The Legacy driver does not support Xorg 1.13 for now. Support should be added by AMD in a century or two, but this could be sooner. Should you want to use this driver, see [[#Xorg repositories]] for instructions on how to roll back to or hold back Xorg 1.12.}}<br />
<br />
All packages mentioned above in Vi0L0's unofficial repository are also available on the [[Arch User Repository|AUR]]:<br />
* {{AUR|Catalyst}};<br />
* {{AUR|Catalyst-utils}};<br />
* {{AUR|Lib32-catalyst-utils}};<br />
* {{AUR|Catalyst-generator}};<br />
* {{AUR|Catalyst-hook}};<br />
* {{AUR|Catalyst-daemon}}.<br />
<br />
The AUR also holds some packages that are '''not''' found in any of the repositories. These packages contain the so-called ''Catalyst-total'' packages and the beta versions:<br />
* {{AUR|Catalyst-total-hd234k}};<br />
* {{AUR|Catalyst-total}};<br />
* {{AUR|Catalyst-test}};<br />
* {{AUR|Lib32-catalyst-test}};<br />
* {{AUR|Catalyst-total-pxp}};<br />
<br />
The ''Catalyst-total'' packages are made to make the lives of AUR users easier. It builds the driver, the kernel utilities and the 32 bit kernel utilities. It also builds the Catalyst-hook package, which is explained above.<br />
<br />
''Catalyst-total-pxp'' builds Catalyst with experimental powerXpress support.<br />
<br />
For more information on building from the AUR, read [[#Installing_from_AUR| Installing from AUR]].<br />
<br />
==== Installing directly from AMD ====<br />
{{Warning|Using the installer from ati.com/amd.com is '''not''' recommended! It may cause file conflicts and X failures and you will miss Arch-specific fixes. You '''must''' be familiar with booting to the command-line if you wish to attempt this.}}<br />
<br />
{{Note|If you have attempted a manual install from the official installer and cannot recover your desktop:<br />
# /usr/share/ati/fglrx-uninstall.sh<br />
}}<br />
<br />
1.) Download the installer from AMD or elsewhere (whereas *-* will be the version): {{ic|ati-driver-installer-*-*-x86.x86_64.run}}<br />
<br />
2.) Make sure it's executable: {{ic|# chmod +x ati-driver*}}<br />
<br />
3.) Ensure you're using a basic video driver like vesa and remove conflicting drivers (i.e. {{ic|xf86-video-ati}}) with pacman.<br />
<br />
4.) Symlink {{ic|/usr/src/linux}} to {{ic|<nowiki>/usr/src/{kernelsource}</nowiki>}}. 64-bit users also symlink{{ic|/usr/lib64}} to {{ic|/usr/lib}}.<br />
<br />
5.) Be sure to have your build environment setup: {{ic|# pacman -Syu base-devel linux-headers}}<br />
<br />
6.) Now run {{ic|# ./ati-driver-installer-*-*-x86.86_64.run}} (Files will extract to a temporary folder and scripts will run...)<br />
<br />
Assuming nothing went horribly wrong...<br />
<br />
7.) Check {{ic|/usr/share/ati/fglrx-install.log}} for issues. There should also be a {{ic|/lib/modules/fglrx/make.{ker_version}.log}}.<br />
<br />
{{Note|If you modify the make scripts, save to a different filename. Otherwise uninstall will not complete successfully.}}<br />
<br />
=== Configuring the driver ===<br />
After you have installed the driver via your chosen method, you will have to configure X to work with Catalyst. Also, you will have to make sure the module gets loaded at boot. Also, one should disable [[KMS|kernel mode setting]].<br />
<br />
==== Configuring X ====<br />
To configure X, you will have to create an xorg.conf file. Catalyst provides its own {{ic|aticonfig}} tool to create and/or modify this file.<br />
It also can configure virtually every aspect of the card for it also accesses the {{ic|/etc/ati/amdpcsdb}} file. For a complete list of {{ic|aticonfig}} options, run:<br />
<br />
# aticonfig --help | less<br />
<br />
{{Warning|Use the --output option before committing to /etc/X11 as an xorg.conf file will override anything in /etc/X11/xorg.conf.d}}<br />
<br />
{{Note|If you want to adhere to the new xorg.conf.d: Append your {{ic|aticonfig}} string with ''--output'' so that you can adapt the Device section to {{ic|/etc/X11/xorg.conf.d/20-radeon.conf}}. The drawback of this is that many {{ic|aticonfig}} options rely on an xorg.conf, and thus will be unavailable.}}<br />
<br />
Now, to configure Catalyst. If you have only one monitor, run this:<br />
<br />
# aticonfig --initial<br />
<br />
{{Note | If you have PowerXpress problem you should probably install {{ic|catalyst-utils-pxp}}}}<br />
<br />
However, if you have two monitors and want to use both of them, you can run the command stated below. Note that this will generate a dual head configuration with the second screen located above the first screen.<br />
<br />
# aticonfig --initial=dual-head --screen-layout=above<br />
<br />
{{Note|See [[#Double Screen (Dual Head / Dual Screen / Xinerama)]] for more information on setting up dual monitors.}}<br />
<br />
You can compare the generated file to one of the [[Xorg#Sample_xorg.conf_Files|Sample Xorg.conf]] examples listed on the Xorg page.<br />
<br />
Although the current Xorg versions auto-detect most options when started, you may want to specify some in case the defaults change between versions.<br />
<br />
Here is an example (with notes) '''for reference'''. Entries with '#' should be required, add entries with '##' as needed:<br />
<br />
{{bc|1=<br />
Section "ServerLayout"<br />
Identifier "Arch"<br />
Screen 0 "Screen0" 0 0 # 0's are necessary.<br />
EndSection<br />
Section "Module"<br />
Load ...<br />
...<br />
EndSection<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
...<br />
EndSection<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "fglrx" # Essential.<br />
BusID "PCI:1:0:0" # Recommended if autodetect fails.<br />
Option "OpenGLOverlay" "0" ##<br />
Option "XAANoOffscreenPixmaps" "false" ##<br />
EndSection<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Viewport 0 0<br />
Depth 24 # Should not change from '24'<br />
Modes "1280x1024" "2048x1536" ## 1st value=default resolution, 2nd=maximum.<br />
Virtual 1664 1200 ## (x+64, y) to workaround potential OGL rect. artifacts/<br />
EndSubSection ## fixed in Catalyst 9.8<br />
EndSection<br />
Section "DRI"<br />
Mode 0666 # May help enable direct rendering.<br />
EndSection<br />
}}<br />
<br />
{{Note|With '''every''' Catalyst update you should remove '''amdpcsdb''' file in this way: kill X, remove {{ic|/etc/ati/amdpcsdb}}, start X and then run {{ic|amdcccle}} - otherwise the version of Catalyst may display wrongly in amdcccle.}}<br />
<br />
''If you need more information on Catalyst, visit [https://bbs.archlinux.org/viewtopic.php?id=57084 this thread].''<br />
<br />
==== Loading the module at boot ====<br />
{{Note|Users of the [community] package do not have to do this, it's automatically done for them when installing the package.}}<br />
We have to blacklist the {{ic|radeon}} module to prevent it from auto-loading. To do so, blacklist ''radeon'' in {{ic|/etc/modprobe.d/modprobe.conf}}. Also, make sure that it is not loaded by any file under {{ic|/etc/modules-load.d/}}. For more information, see [[Modprobe|blacklisting in this article]]. <br />
<br />
Then we will have to make sure that the {{ic|fglrx}} module gets auto-loaded. Either add {{ic|fglrx}} on a new line of an existing module file located under {{ic|/etc/modules-load.d/}}, or create a new file and add {{ic|fglrx}}.<br />
<br />
==== Disable kernel mode setting ====<br />
<br />
Disabling kernel mode setting is important, as the driver doesn't take advantage of [[KMS]] yet. If you do not deactivate KMS, your system might freeze when trying to switch to a tty or even when shutting down via your DE.<br />
<br />
For [[GRUB Legacy|GRUB Legacy]], edit {{ic|menu.lst}} by adding {{ic|nomodeset}} to the kernel parameters. For example:<br />
<br />
kernel /boot/vmlinuz-linux root=/dev/sda1 ro '''nomodeset'''<br />
<br />
For [[GRUB2|GRUB 2]], edit {{ic|/etc/default/grub}} and add ''nomodeset'' to the kernel parameter options, e.g.<br />
<br />
GRUB_CMDLINE_LINUX="nomodeset"<br />
<br />
Then run, as root;<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
For [[Syslinux|Syslinux]], edit {{ic|/boot/syslinux/syslinux.cfg}} and add ''nomodeset'' to the {{ic|APPEND}} line, e.g.:<br />
<br />
APPEND root=/dev/sda2 ro ''nomodeset''<br />
<br />
==== Checking operation ====<br />
<br />
Assuming that a reboot to your login was successful, you can check if fglrx is running properly with the following commands:<br />
<br />
$ lsmod | grep fglrx<br />
$ fglrxinfo<br />
<br />
If you get output, it works. Finally, run X with {{ic|startx}} or by using GDM/KDM and verify that direct rendering is enabled by running the following command in a terminal:<br />
<br />
$ glxinfo | grep "direct rendering"<br />
<br />
If it says "direct rendering: yes" then you're good to go! If the glxinfo command is not found install the {{Pkg|mesa-demos}} package.<br />
<br />
{{Note|You can also use:<br />
$ fgl_glxgears<br />
as the fglrx alternative test to glxgears.<br />
}}<br />
<br />
{{Warning|In recent versions of Xorg, the paths of libs are changed. So, sometimes {{ic|libGL.so}} cannot be correctly loaded even if it's installed. Check this if your GL is not working. Please read "Troubleshooting" section for details.}}<br />
<br />
If you have trouble, see [[#Troubleshooting]].<br />
<br />
=== Custom Kernels ===<br />
<br />
To install catalyst for a custom kernel, you'll need to build your own {{ic|catalyst-$kernel}} package.<br />
<br />
If you are at all uncomfortable or inexperienced with making packages, read up the [[ABS]] wiki page first so things go smoothly.<br />
<br />
# Obtain the {{ic|PKGBUILD}} and {{ic|catalyst.install}} files from [[AUR|Catalyst]].<br />
# Editing the PKGBUILD. Two changes need to be made here:<br />
## Change {{ic|1=pkgname=catalyst}} to {{ic|1=pkgname=catalyst-$kernel_name}}, where $kernel_name is whatever you want (e.g. custom, mm, themostawesomekernelever).<br />
## Change the dependency of {{ic|linux}} to {{ic|$kernel_name}}.<br />
# Build your package and install; run {{ic|makepkg -i}} or {{ic|makepkg}} followed by {{ic|pacman -U pkgname.pkg.tar.gz}}<br />
<br />
{{Note|If you run multiple kernels, you have to install the Catalyst-utils packages for all kernels. They won't conflict with one another.}}<br />
<br />
{{Note|Catalyst-generator is able to build catalyst-{kernver} packages for you so you do not actually need to perform all those steps manually. For more information, see [[#Tools| Tools section]].}}<br />
<br />
=== PowerXpress support ===<br />
<br />
PowerXpress technology allows switching notebooks with dual-graphic capability from integrated graphics (IGP) to discrete graphics either to increase battery life or to achieve better 3D rendering capabilities.<br />
<br />
To use such functionality on Arch you will have to:<br />
* Get and build {{AUR|catalyst-total-pxp}} package from the [[Arch User Repository|AUR]], or<br />
* Install '''catalyst-utils-pxp''' package from the [catalyst] repository (plus additional lib32-catalyst-utils-pxp, if needed).<br />
<br />
To perform a switch into Intel's IGP you will also have to install the '''mesa-libgl''' package and Intel's drivers: '''xf86-video-intel''' and '''intel-dri'''.<br />
<br />
{{Note|'''With the latest version of Catalyst, version 13.1 (not Catalyst legacy) ChrisXY was able to work on the newest xorg-server (version 1.13.1), mesa 9.0.1 and xf86-video-intel 2.20.18'''.<br />
<br />
On any version of Catalyst below 13.1 (and all versions of Catalyst legacy) there are some problems with the new Intel drivers and the '''last noted working version of xf86-video-intel is 2.20.2-2''', so you will probably have to downgrade from the latest version that you have gotten from Arch's repositories (although we recommend to test the newest one before downgrading - there's always some possibility that it will work).<br />
<br />
'''xf86-video-intel 2.20.2-2''' works only with xorg-server 1.12 and so it is a part of the '''xorg112 repository'''. If you want to use it you will have to downgrade xorg-server as well. For information on this, see [[#Xorg repositories]].}}<br />
<br />
Now you can switch between the integrated and the discrete GPU, using these commands:<br />
<br />
{{bc|1=<br />
# aticonfig --px-igpu #for integrated GPU<br />
# aticonfig --px-dgpu #for discrete GPU<br />
}}<br />
<br />
Just remember that fglrx needs /etc/X11/xorg.conf configured for AMD's card with 'fglrx' inside.<br />
<br />
You can also use the '''pxp_switch_catalyst''' switching script that will perform some additional usefull operations:<br />
* Switching xorg.conf - it will rename xorg.conf into xorg.conf.cat (if there's fglrx inside) or xorg.conf.oth (if there's intel inside) and then it will create a symlink to xorg.conf, depending on what you chose.<br />
* Running {{ic|aticonfig --px-Xgpu}}.<br />
* Running {{ic|switchlibGL}}.<br />
* Adding/removing fglrx into/from {{ic|/etc/modules-load.d/catalyst.conf}}.<br />
<br />
Usage:<br />
{{bc|1=<br />
# pxp_switch_catalyst amd<br />
# pxp_switch_catalyst intel<br />
}}<br />
<br />
If you have got problems when you try to run X on Intel's driver you may try to force '''"UXA" acceleration'''; just make sure that your xorg.conf for Intel's GPU got '''Option "AccelMethod" "uxa"''', like here:<br />
{{bc|1=<br />
Section "Device"<br />
Identifier "Intel Graphics"<br />
Driver "intel"<br />
#Option "AccelMethod" "sna"<br />
Option "AccelMethod" "uxa"<br />
#Option "AccelMethod" "xaa"<br />
EndSection<br />
}}<br />
<br />
==== Running two X servers (one using the Intel driver, another one using fglrx) simultaneously ====<br />
Because fglrx is crash-prone (regarding PowerXpress), it could be a good idea to use the Intel driver in the main X server and have a secondary X server using fglrx when 3D acceleration is needed. However, simply switching to the discrete GPU from the integrated GPU using {{ic|aticonfig}} or {{ic|amdcccle}} will cause all sorts of weird bugs when starting the second X.<br />
<br />
To run two X servers at the same time (each using different drivers), you should firstly set up a fully working X with Catalyst and then move its {{ic|xorg.conf}} to a temporary place (for example, {{ic|/etc/X11/xorg.conf.fglrx}}. The next time X is started, it will use the Intel driver by default instead of fglrx.<br />
<br />
To start a second X server using fglrx, simply move {{ic|xorg.conf}} back to the proper place ({{ic|/etc/X11/xorg.conf}}) before starting X. This method even allows you to switch between running X sessions. When you are done using fglrx, move {{ic|xorg.conf}} somewhere else again.<br />
<br />
The only disadvantage of this method is not having 3D acceleration using the Intel driver. 2D acceleration, however, is fully functional. Other than that, this will provide us with a completely stable desktop.<br />
<br />
== Xorg repositories ==<br />
Catalyst is notorious for its slow update process. As such, it is common that a new Xorg version is pushed down from upstream that will break compatibility for Catalyst. This means that Catalyst users either have to hold the Xorg packages from updating, or use a backported repository that only contains the Xorg packages that should be hold back. Vi0L0 has stepped in to fulfil this task and provides several backported repositories. <br />
<br />
If you want to use pacman to hold back packages from updating, see [[pacman|skip package from being upgraded]]. Packages you should hold back, are:<br />
*xorg-server-*<br />
*xf86-input-*<br />
*xf86-video-*<br />
<br />
If you want to use the backported repositories, you have to edit {{ic|/etc/pacman.conf}} and add the information of the repository '''above all other repositories''', even above your Catalyst repository, should you use one.<br />
<br />
===[xorg113]===<br />
Catalyst doesn't support xorg-server 1.14.<br />
<br />
[xorg113]<br />
<nowiki>Server = http://catalyst.wirephire.com/repo/xorg113/$arch</nowiki><br />
<br />
===[xorg112]===<br />
Catalyst < 12.10 doesn't support xorg-server 1.13.<br />
<br />
[xorg112]<br />
<nowiki>Server = http://catalyst.wirephire.com/repo/xorg112/$arch</nowiki><br />
<br />
===[xorg111]===<br />
Catalyst < 12.6 doesn't support xorg-server 1.12.<br />
<br />
[xorg111]<br />
<nowiki>Server = http://catalyst.wirephire.com/repo/xorg111/$arch</nowiki><br />
<br />
== Tools ==<br />
<br />
=== Catalyst-hook ===<br />
[https://aur.archlinux.org/packages.php?ID=40834 Catalyst-hook] is a [[systemd|systemd]] service that will automatically rebuild the fglrx modules while the system shuts down or reboots, but only if it's necessary (e.g. after an update).<br />
<br />
Before using this package make sure that both the {{Grp|base-devel}} group and the {{Pkg|linux-headers}} package (the one specific to the kernel you use) are installed:<br />
<br />
# pacman -S base-devel linux-headers<br />
<br />
To enable the automatic update, enable the {{ic|catalyst-hook.service}}:<br />
<br />
# systemctl enable catalyst-hook<br />
# systemctl start catalyst-hook<br />
<br />
You can also use this package to build the fglrx module manually. Simply run the catalyst_build_module script after the kernel has been updated:<br />
<br />
# catalyst_build_module all<br />
<br />
<br />
'''A few more technical details:'''<br />
<br />
The {{ic|catalyst-hook.service}} is stopping the systemd "river" and is forcing systemd to wait until catalyst-hook finishes its job.<br />
<br />
The {{ic|catalyst-hook.service}} is calling the {{ic|catalyst_build_module check}} function which checks if fglrx rebuilds are really necessary.<br />
<br />
The {{ic|check}} function is checking if the fglrx module exists, if it:<br />
<br />
*doesn't exist, it will build it;<br />
<br />
*does exist, it will compare the two values to be sure that a rebuild is necessary.<br />
<br />
These values are md5sums of the {{ic|/usr/lib/modules/<kernel_version>/build/Module.symvers}} file (because I, Vi0L0, noticed that this file is unique and different for every kernel's release). The first value is the md5sum of the existing {{ic|Module.symvers}} file. The second value is the md5sum of the {{ic|Module.symvers}} file which existed in a moment of the fglrx module creation. This value was compiled into the fglrx module by a catalyst_build_module script.<br />
<br />
If the values are different, it will compile the new fglrx module.<br />
<br />
The check is checking the whole {{ic|/usr/lib/modules/}} directory and building modules for all of the installed kernels if it's necessary. If the build or rebuild isn't necessary, the whole process takes only some milliseconds to complete before it gets killed by systemd.<br />
<br />
'''This is basically the same as catalyst-dkms from [community]... not''' - just to clarify things:<br />
<br />
- catalyst-hook does not need dkms to work, dkms is far more complex than mkinitcpio's hook or systemd's service;<br />
<br />
- catalyst-hook should be safer - because dkms is building modules at system's startup, so right when also X/DM is trying to start<br />
<br />
=== Catalyst-generator ===<br />
<br />
[https://aur.archlinux.org/packages.php?ID=41040 Catalyst-generator] is a package that is able to build and install the fglrx module packed into pacman compliant catalyst-${kernver} packages. The basic difference from Catalyst-hook is that you will have to trigger this command manually, whereas Catalyst-hook will do this automatically at boot when a new kernel got installed.<br />
<br />
It creates catalyst-${kernver} packages using [[makepkg]] and installs them with [[pacman]]. ''${kernver}'' is the kernel version for which each package was built (e.g. catalyst-2.6.35-ARCH package was built for 2.6.35-ARCH kernel).<br />
<br />
To build and install catalyst-${kernver} package for a currently booted kernel as an unprivileged user (non-root; safer way), use {{ic|catalyst_build_module}}. You will be asked for your root password to proceed to package installation.<br />
<br />
A short summary on how to use this package:<br />
<br />
# As root: {{ic|catalyst_build_module remove}}. This will remove all unused {{ic|catalyst-{kernver} }} packages.<br />
# As unprivileged user: {{ic|catalyst_build_module ${kernver}}}, where ${kernver} is the version of the kernel to which you just updated. For example: {{ic|catalyst_build_module 2.6.36-ARCH}}. You can also build catalyst-${kernver} for all installed kernels by using {{ic|catalyst_build_module all}}.<br />
# If you want to remove {{ic|catalyst-generator}}, it's best to run this as root before removing catalyst-generator: {{ic|catalyst_build_module remove_all}}. '''This will remove all catalyst-{kernver} packages from the system.'''<br />
<br />
Catalyst-generator isn't able to remove all those catalyst-{kernver} packages automatically while being removed because there can not be more than one instance of pacman running. If you forget to run {{ic|catalyst_build_module remove_all}} before using {{ic|pacman -R catalyst-generator}} catalyst-generator will tell you which catalyst-{kernver} packages you will have to remove manually after removing catalyst-generator itself.<br />
<br />
Catalyst-generator is most safe and KISS-friendly solution because:<br />
<br />
- you can use unprivileged user to build the package;<br />
<br />
- it's building modules in fakeroot environment;<br />
<br />
- it's not throwing files here and there, package manager always knows where they are;<br />
<br />
... all you have to do is to remember to use it<br />
<br />
{{Note|If you see those warnings:<br />
<br />
'''WARNING:''' Package contains reference to $srcdir<br />
<br />
'''WARNING:''' '.pkg' is not a valid archive extension.<br />
<br />
while building catalyst-{kernver} package, do not be concerned, it's normal.}}<br />
<br />
<br />
=== OpenCL and OpenGL development ===<br />
<br />
Since years AMD is working on tools for OpenCL and OpenGL developement.<br />
<br />
Now under the banner of '''"Heterogeneous Computing"''' AMD is providing even more of them, fortunately most of their computing tools are available also for Linux.<br />
<br />
In the AUR and the [catalyst] repositories you will find packages that represent the most important work from AMD, namely; [https://aur.archlinux.org/packages/amdapp-aparapi amdapp-aparapi], [https://aur.archlinux.org/packages/amdapp-sdk amdapp-sdk] and [https://aur.archlinux.org/packages/amdapp-codexl amdapp-codexl].<br />
<br />
APP shortcut stands for Accelerated Parallel Processing.<br />
<br />
==== amdapp-aparapi ====<br />
AMD's Aparapi is an API for expressing data parallel workloads in Java and a runtime component capable of converting the Java bytecode of compatible workloads into OpenCL so that it can be executed on a variety of GPU devices. If Aparapi can’t execute on the GPU, it will execute in a Java thread pool.<br />
<br />
You can find more information about Aparapi [http://developer.amd.com/tools/heterogeneous-computing/aparapi/ here].<br />
<br />
==== amdapp-sdk (formerly known as amdstream) ====<br />
The AMD APP Software Development Kit (SDK) is a complete development platform created by AMD to allow you to quickly and easily develop applications accelerated by AMD APP technology. The SDK provides samples, documentation and other materials to quickly get you started leveraging accelerated compute using OpenCL, Bolt, or C++ AMP in your C/C++ application.<br />
<br />
Since version 2.8 amdapp-sdk is providing aparapiUtil as well as aparapi's samples. A package is available on the [catalyst] repository; it depends on the amdapp-aparapi package. The AUR's package will let you decide whether you want aparapi's additions or not.<br />
<br />
Version 2.8 does not provide Profiler functionality, it has been moved to CodeXL.<br />
<br />
You can find more information about AMD APP SDK [http://developer.amd.com/tools/heterogeneous-computing/amd-accelerated-parallel-processing-app-sdk/ here].<br />
<br />
==== amdapp-codexl ====<br />
CodeXL is an OpenCL and OpenGL Debugger and Profiler, with a static OpenCL kernel analyzer. It's a GUI application written atop of the well known [https://aur.archlinux.org/packages/gdebugger gDEBugger] and is available only for x86_64 systems.<br />
<br />
You can find more informations about CodeXL [http://developer.amd.com/tools/heterogeneous-computing/codexl/ here].<br />
<br />
== Features ==<br />
<br />
=== Tear Free Rendering ===<br />
<br />
Presented in '''Catalyst 11.1''', the ''Tear Free Desktop'' feature reduces tearing in 2D, 3D and video applications. This likely adds triple-buffering and v-sync. Do note that it requires additional GPU processing.<br />
<br />
To enable 'Tear Free Desktop' run {{ic|amdcccle}} and go to: {{ic|Display Options}} → {{ic|Tear Free}}.<br />
<br />
Or as root run:<br />
<br />
# aticonfig --set-pcs-u32=DDX,EnableTearFreeDesktop,1<br />
<br />
To disable, again use {{ic|amdcccle}} or run as root:<br />
<br />
# aticonfig --del-pcs-key=DDX,EnableTearFreeDesktop<br />
<br />
=== Video acceleration ===<br />
<br />
'''[[wikipedia:Video_Acceleration_API|Video Acceleration API]] (VA API)''' is an open source software library (libVA) and API specification which provides GPU acceleration for video processing on Linux/UNIX based operating systems. The process works by enabling hardware accelerated video decode at various entry-points (VLD, IDCT, Motion Compensation, deblocking) for common encoding standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/WMV3).<br />
<br />
VA-API gained a proprietary backend (in November 2009) called {{AUR|xvba-video}}, that allows VA-API programmed applications to take advantage of AMD Radeons UVD2 chipsets via the [[wikipedia:XvBA|XvBA (X-Video Bitstream Acceleration API designed by AMD)]] library.<br />
<br />
XvBA support and xvba-video is still under development, however it is '''working very well in most cases'''. Build the {{AUR|xvba-video}} package from AUR or soon, install it from [community] and install {{Pkg|mplayer-vaapi}} and {{Pkg|libva}}. Then just set your video player to use vaapi:gl as video output:<br />
<br />
$ mplayer -vo vaapi:gl movie.avi<br />
<br />
These options can be added to your mplayer configuration file, see [[MPlayer]].<br />
<br />
For '''smplayer''':<br />
<br />
Options → Preferences → General → Video (tab) → Output driver: User Defined : vaapi:gl<br />
Options → Preferences → General → Video (tab) → Double buffering '''on'''<br />
Options → Preferences → General → General → Screenshots → Turn screenshots '''off'''<br />
Options → Preferences → Performance → Threads for decoding: '''1''' (to turn off -lavdopts parameter)<br />
<br />
{{Note|If Tear Free Desktop is enabled it's better to use:<br />
Options -> Preferences -> General -> Video (tab) -> Output driver: vaapi<br />
If Video Output '''vaapi:gl''' isn't working - please check:<br />
'''vaapi''', '''vaapi:gl2''' or simply '''xv(0 - AMD Radeon [[wikipedia:Avivo|AVIVO Video]])'''.<br />
}}<br />
<br />
For '''VLC''':<br />
<br />
Tools → Preferences → Input & Codecs → Use GPU accelerated decoding<br />
<br />
It might help to enable v-sync in '''amdcccle''':<br />
<br />
3D → More Settings → Wait for vertical refresh = Always On<br />
<br />
{{Note|If you are using '''Compiz/KWin''', the only way to '''avoid video flickering''' is to watch videos in '''full-screen''' and only when '''Unredirect Fullscreen is off'''.<br />
<br />
In '''compiz''' you need to set '''Redirected Direct Rendering''' in General Options of ccsm. If it is still flickering, try to disable this option in CCSM. It's off by default in '''KWin''', but if you see flickering try to turn "Suspend desktop effects for fullscreen windows" on or off in System Settings → Desktop Effects → Advanced.}}<br />
<br />
=== GPU/Mem frequency, Temperature, Fan speed, Overclocking utilities ===<br />
<br />
You can get the GPU/Mem clocks with: {{ic|$ aticonfig --od-getclocks}}.<br />
<br />
You can get the fan speed with: {{ic|$ aticonfig --pplib-cmd "get fanspeed 0"}}<br />
<br />
You can get the temperature with: {{ic|$ aticonfig --odgt}}<br />
<br />
To set the fanspeed with: {{ic|$ aticonfig --pplib-cmd "set fanspeed 0 50"}} Query Index: 50, Speed in percent<br />
<br />
To overclock and/or underclock it's easier to use a GUI, like '''ATi Overclocking Utility''', which is very simple and requires qt to work. It might be out of date/old, but you can get it [http://kde-apps.org/content/show.php/ATI+Overclock?content=47796 here].<br />
<br />
Another, more complex utility to perform such operations is '''AMDOverdriveCtrl'''. Its homepage is [http://sourceforge.net/projects/amdovdrvctrl here] and you can build an Arch package from [https://aur.archlinux.org/packages.php?ID=45298 AUR] or from Vi0L0's unofficial repositories.<br />
<br />
=== Double Screen (Dual Head / Dual Screen / Xinerama) ===<br />
<br />
==== Introduction ====<br />
<br />
{{Warning| you should know that there isn't one specific solution because each setup differs and needs its own configuration. That's why you will have to adapt the steps below to your own needs. It is possible that you have to try more than once. '''Therefore, you should save your working {{ic|/etc/X11/xorg.conf}} before you start modifying and you must be able to recover from a command-line environment.'''}}<br />
<br />
* In this chapter, we will describe the installation of two different-sized screens on only one graphics card with two different output ports (DVI + HDMI) using a "BIG Desktop" configuration.<br />
<br />
* The Xinerama solution has some inconveniences, especially because it is not compatible with XrandR. For that very reason, you should not use this solution, because XrandR is a must for our later configuration.<br />
<br />
* The Dual Head solution would allow you to have 2 different sessions (one for each screen). It could be what you want, but you will not be able to move windows from one screen to another. If you have only one screen, you will have to define the mouse inside your Xorg session for each of the two sessions inside the Server Layout section.<br />
<br />
[http://support.amd.com/us/kbarticles/Pages/1105-HowCanIConfigureMultip.aspx ATI Documentation]<br />
<br />
==== ATI Catalyst Control Center ====<br />
<br />
The GUI tool shipped by ATI is very useful and we will try to use it as much as we can. To launch it, open a terminal and use the following command:<br />
<br />
$ {kdesu/gksu} amdcccle<br />
<br />
{{Warning|Do '''not''' use sudo directly with a GUI. Sudo gives you admin rights with user account information. Instead, use ''gksu'' (GNOME) or ''kdesu'' (KDE).}}<br />
<br />
==== Installation ====<br />
<br />
Before we start, make sure that your hardware is plugged in correctly, that power is on and that you know your hardware characteristics (screen dimensions, sizes, refreshment rates, etc.) Normally, both screens are recognized during boot time but not necessarily identified properly, especially if you are not using any Xorg base configuration file ({{ic|/etc/X11/xorg.conf}}) but relying on the hot-plugging feature.<br />
<br />
The first step is to make sure that you screens will be recognized by your DE and by X. For this, you need to generate a basic Xorg configuration file for your two screens:<br />
<br />
# aticonfig --initial --desktop-setup=horizontal --overlay-on=1<br />
<br />
or<br />
<br />
# aticonfig --initial=dual-head --screen-layout=left<br />
<br />
{{Note|{{ic|overlay}} is important because it allows you to have 1 pixel (or more) shared between the 2 screens.}}<br />
{{Tip|For the other possible and available options, do not hesitate to type {{ic|aticonfig --help}} inside a terminal to display all available command lines.}}<br />
<br />
Now you should have a basic Xorg configuration file that you can edit to add your screen resolutions. It is important to use the precise resolution, especially if you have screens of different sizes. These resolutions have to be added in the "Screen" section:<br />
<br />
SubSection "Display"<br />
Depth 24<br />
Modes "X-resolution screen 1xY-resolution screen 1" "Xresolution screen 2xY-resolution screen 2"<br />
EndSubSection<br />
<br />
From now on, instead of editing the {{ic|xorg.conf}} file manually, let us use the ATI GUI tool. Restart X to be sure that your two screens are properly supported and that the resolutions are properly recognized (Screens must be independent, not mirrored).<br />
<br />
==== Configuration ====<br />
<br />
Now you will only have to launch the ATI control center with root privileges, go to the display menu and choose how you would like to set your configuration (small arrow of the drop down menu). A last restart of X and you should be done!<br />
<br />
Before you restart X, do not hesitate to verify your new {{ic|xorg.conf}} file. At this stage, inside the "Display" sub-section of the "Screen" section, you should see a "Virtual" command line, of which the resolution should be the sum of both screens. The "Server Layout" section says all the rest.<br />
<br />
== Uninstallation ==<br />
<br />
{{Out of date|This section still references rc.conf, which has been deprecated.}} <br />
<br />
If for any reason this driver is not working for you or you want to try out the open source driver, remove {{ic|catalyst}} and {{ic|catalyst-utils}} packages. Also you should remove {{Aur|catalyst-daemon}}, {{Aur|catalyst-generator}}, {{Aur|catalyst-hook}} and {{Aur|lib32-catalyst-utils}} packages if they have been installed on your system.<br />
<br />
{{Warning|You may need to use {{ic|pacman -Rdd}} to remove {{aur|catalyst-utils}} (and/or {{aur|lib32-catalyst-utils}}) because that package contains ''gl'' related files and many of your installed packages depend on them.<br />
You also have to remove ''/etc/profile.d/ati-flgrx.sh'' (if it exists on your system), otherwise ''r600_dri.so'' will fail to load and you would not have 3D support.}}<br />
<br />
{{Note|You should remove unofficial repositories from your {{ic|/etc/pacman.conf}} and run {{ic|pacman -Syu}}, because those repositories include out-dated Xorg packages to allow use of {{ic|catalyst}} and the {{Pkg|xf86-video-ati}} package needs up-to-date Xorg packages from the [[Official repositories]].}}<br />
<br />
Also follow these steps:<br />
<br />
* If you have the {{ic|/etc/modprobe.d/blacklist-radeon.conf}} file remove it or comment the line {{ic|blacklist radeon}} in that file.<br />
* If you have a file in {{ic|/etc/modules-load.d}} to load the {{ic|fglrx}} module on boot, remove it or comment the line containing {{ic|fglrx}}.<br />
* Make sure to remove or backup {{ic|/etc/X11/xorg.conf}}.<br />
* If you have installed the {{Aur|catalyst-hook}} package, make sure to remove ''fglrx'' from the "HOOKS" array of {{ic|/etc/mkinitcpio.conf}} in case if post-removal script of the package don't work.<br />
* If you have installed the {{Aur|catalyst-generator}} package, make sure to remove "fglrx" from the "MODULES" array of {{ic|/etc/rc.conf}} in case if post-removal script of the package don't work.<br />
* If you have installed the {{Aur|catalyst-daemon}} package, make sure to remove "autofglrx" from the "DAEMONS" array of {{ic|/etc/rc.conf}} in case if post-removal script of the package don't work.<br />
* If you used the "nomodeset" option in your [[Boot Loader#Configuration files|configuration file]] in kernel parameters line and plan to use [[#Kernel mode-setting (KMS)|KMS]], remove it.<br />
* '''Reboot''' before installing another driver.<br />
<br />
== Troubleshooting ==<br />
<br />
If you can still boot to command-line, then the problem probably lies in {{ic|/etc/X11/xorg.conf}}<br />
<br />
You can parse the whole {{ic|/var/log/Xorg.0.log}} or, for clues:<br />
<br />
$ grep '(EE)' /var/log/Xorg.0.log<br />
$ grep '(WW)' /var/log/Xorg.0.log<br />
<br />
If you are still confused about what is going on, search the forums first. Then post a message in the [https://bbs.archlinux.org/viewtopic.php?pid=1166052#p1166052/ thread specific to ATI/AMD]. Provide the information from {{ic|xorg.conf}} and both commands mentioned above.<br />
<br />
=== 3D Wine applications freeze ===<br />
If you use a 3D Wine application and it hangs, you have to disable TLS. To do this, either use {{ic|aticonfig}} or edit {{ic|/etc/X11/xorg.conf}}. To use {{ic|aticonfig}}:<br />
<br />
# aticonfig --tls=off<br />
<br />
Or, to edit {{ic|/etc/X11/xorg.conf}}; first open the file in an editor as root and then add {{ic|Option "UseFastTLS" "off"}} to the ''Device'' section of this file. <br />
<br />
After applying either of the solutions, restart X for it to take effect.<br />
<br />
=== Problems with video colours ===<br />
<br />
You may still use {{ic|vaapi:gl}} to avoid video flickering, but without video acceleration:<br />
<br />
* Run '''mplayer''' without {{ic|-vo vaapi}} switch.<br />
<br />
* Run '''smplayer''' remove {{ic|-vo vaapi}} from Options → Preferences → Advanced → Options for MPlayer → Options: -vo vaapi<br />
<br />
Plus for '''smplayer''' you may now safely turn screenshots on.<br />
<br />
=== KWin and composite ===<br />
<br />
You may use XRender if the rendering with OpenGL is slow. However, XRender might also be slower than OpenGL depending on your card.<br />
XRender also solves artefact issues in some cases, for instance when resizing Konsole.<br />
<br />
=== Black screen with complete lockups and/or hangs after reboot or startx ===<br />
<br />
Ensure you have added the '''nomodeset''' option to the kernel options line in your bootloader (see [[#Disable kernel mode setting]]).<br />
<br />
If you are using the legacy driver (catalyst-hd234k) and get a black screen, try downgrading xorg-server to 1.11 by using the [[#xorg111]] repository.<br />
<br />
==== Faulty ACPI hardware calls ====<br />
It is possible that fglrx doesn't cooperate well with the system's ACPI hardware calls, so it auto-disables itself and there is no screen output.<br />
<br />
If so, try to run this:<br />
<br />
$ aticonfig --acpi-services=off<br />
<br />
=== KDM disappears after logout ===<br />
<br />
If you are running Catalyst proprietary driver and you get a console (tty1) instead of the expected KDM greeting when you log out, you must instruct KDM to restart the X server after each logout:<br />
<br />
$ sudo nano /usr/share/config/kdm/kdmrc<br />
<br />
Uncomment the following line under the section titled {{ic|[X-:*-Core]}}:<br />
<br />
TerminateServer=True<br />
<br />
KDM should now appear when you log out of KDE.<br />
<br />
=== Direct Rendering does not work ===<br />
<br />
This problem may occur when using the proprietary '''Catalyst''' driver.<br />
<br />
{{Warning|This error would also appear if you have not '''rebooted''' your system after the installation or upgrade of catalyst. The system needs to load the fglrx.ko module in order to make the driver work.}}<br />
<br />
If you have problem with direct rendering, run:<br />
<br />
$ LIBGL_DEBUG=verbose glxinfo > /dev/null<br />
<br />
at the command prompt. At the very start of the output, it'll usually give you a nice error message saying why you do not have direct rendering.<br />
<br />
Common errors and their solutions, are:<br />
<br />
libGL error: XF86DRIQueryDirectRenderingCapable returned false<br />
<br />
* Ensure that you are loading the correct agp modules for your AGP chipset before you load the fglrx kernel module. To determine which agp modules you'll need, run {{ic|hwdetect --show-agp}}. Then open your {{ic|fglrx.conf}} file in {{ic|/etc/modules-load.d}} and add the agp module on a line '''before''' the fglrx line.<br />
<br />
libGL error: failed to open DRM: Operation not permitted<br />
libGL error: reverting to (slow) indirect rendering<br />
<br />
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri//fglrx_dri.so<br />
libGL error: dlopen /usr/lib/xorg/modules/dri//fglrx_dri.so failed<br />
(/usr/lib/xorg/modules/dri//fglrx_dri.so: cannot open shared object file: No such file or directory)<br />
libGL error: unable to find driver: fglrx_dri.so<br />
<br />
* Something has not been installed correctly. If the paths in the error message are {{ic|/usr/X11R6/lib/modules/dri/fglrx_dri.so}}, then ensure you've logged completely out of your system, then back in. If you're using a graphical login manager (gdm, kdm, xdm), ensure that {{ic|/etc/profile}} is sourced every time you log in. This is usually accomplished by adding {{ic|source /etc/profile}} into {{ic|~/.xsession}} or {{ic|~/.xinitrc}}, but this may vary between login managers.<br />
<br />
* If the paths above in your error message ''are'' {{ic|/usr/lib/xorg/modules/dri/fglrx_dri.so}}, then something has not been correctly installed. Try reinstalling the {{ic|catalyst}} package.<br />
<br />
Errors such as:<br />
<br />
fglrx: libGL version undetermined - OpenGL module is using glapi fallback<br />
<br />
could be caused by having multiple versions of {{ic|libGL.so}} on your system. Run:<br />
<br />
$ sudo updatedb<br />
$ locate libGL.so<br />
<br />
This should return the following output:<br />
<br />
$ locate libGL.so<br />
/usr/lib/libGL.so<br />
/usr/lib/libGL.so.1<br />
/usr/lib/libGL.so.1.2<br />
<br />
These are the only three libGL.so files you should have on your system. If you have any more (e.g. {{ic|/usr/X11R6/lib/libGL.so.1.2}}), then remove them. This should fix your problem.<br />
<br />
You might not get any error to indicate that this is a problem. If you are using X11R7, make sure you do '''not''' have these files on your system:<br />
<br />
/usr/X11R6/lib/libGL.so.1.2<br />
/usr/X11R6/lib/libGL.so.1<br />
<br />
=== Hibernate/Sleep Issues ===<br />
<br />
==== Video fails to resume from suspend2ram ====<br />
<br />
ATI's proprietary Catalyst driver cannot resume from suspend if the framebuffer is enabled. To disable the framebuffer, add '''vga=0''' to your kernel options in for example, Grub Legacy's {{ic|/boot/grub/menu.lst}}:<br />
<br />
kernel /vmlinuz-linux root=/dev/sda3 resume=/dev/sda2 ro quiet '''vga=0'''<br />
<br />
To see where you need to add this with other bootloaders, see [[#Disable kernel mode setting]].<br />
<br />
=== System Freezes/Hard locks ===<br />
<br />
* The {{ic|radeonfb}} framebuffer drivers have been known in the past to cause problems of this nature. If your kernel has radeonfb support compiled in, you may want to try a different kernel and see if this helps.<br />
<br />
* If you experience system freezes when exiting your DE (shut down, suspend, switching to tty etc.) you probably forgot to deactivate KMS. (See [[#Disable kernel mode setting]])<br />
<br />
=== Hardware Conflicts ===<br />
<br />
Radeon cards used in conjunction with some versions of the nForce3 chipset (e.g. nForce 3 250Gb) won't have 3D acceleration. Currently the cause of this issue is unknown, but some sources indicate that it may be possible to get acceleration with this combination of hardware by booting Windows with the drivers from nVIDIA and then rebooting the system. This can be verified by issuing in a root console the following command:<br />
<br />
$ dmesg | grep agp<br />
<br />
If you get something similar to this (using an nForce3-based system):<br />
<br />
agpgart: Detected AGP bridge 0<br />
agpgart: Setting up Nforce3 AGP.<br />
agpgart: aperture base > 4G<br />
<br />
and also if issuing this command...<br />
<br />
$ tail -n 100 /var/log/Xorg.0.log | grep agp<br />
<br />
...gets something similar to:<br />
<br />
(EE) fglrx(0): [agp] unable to acquire AGP, error "xf86_ENODEV"<br />
<br />
Then you have this bug.<br />
<br />
Some sources indicate that in some situations, downgrading the motherboard BIOS may help, but this cannot be verified in all cases. Also, '''a bad BIOS downgrade can render your hardware useless, so beware.'''<br />
<br />
See [http://bugzilla.kernel.org/show_bug.cgi?id=6350/ this bugreport] for more information and a potential fix.<br />
<br />
=== Temporary hangs when playing video ===<br />
<br />
This problem may occur when using the proprietary Catalyst.<br />
<br />
If you experience temporary hangs lasting from a few seconds to several minutes occuring randomly during playback with mplayer, check /var/log/messages.log for output like:<br />
<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium [<f8bc628c>] ? ip_firegl_ioctl+0x1c/0x30 [fglrx]<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium [<c0197038>] ? vfs_ioctl+0x78/0x90<br />
Nov 28 18:31:56 pandemonium [<c01970b7>] ? do_vfs_ioctl+0x67/0x2f0<br />
Nov 28 18:31:56 pandemonium [<c01973a6>] ? sys_ioctl+0x66/0x70<br />
Nov 28 18:31:56 pandemonium [<c0103ef3>] ? sysenter_do_call+0x12/0x33<br />
Nov 28 18:31:56 pandemonium [<c01c64a6>] ? proc_get_sb+0xc6/0x160<br />
Nov 28 18:31:56 pandemonium =======================<br />
<br />
Adding the nopat kernel option to your kernel options in your bootloader and rebooting fixed the problem at least for me. To see how to do this for different bootloaders, see [[#Disable kernel mode setting]].<br />
<br />
=== "aticonfig: No supported adapters detected" ===<br />
<br />
If when running<br />
<br />
# aticonfig --initial<br />
<br />
you get:<br />
<br />
aticonfig: No supported adaptaters detected<br />
<br />
But you do have an AMD GPU (or APU), it may still be possible to get Catalyst working by manually setting the device in your your {{ic|etc/X11/xorg.conf}} file or by copying an older working /etc/ati/control file (preferred - this also fixes the watermark issue).<br />
<br />
To get an older control file, download a previous version of fglrx from AMD and run it with "--extract driver" parameter. You'll find the control file in driver/common/etc/ati/control. Copy the extracted file over the system file and restart Xorg. You can try different versions of the file.<br />
<br />
To set your model in xorg.conf,edit the device section of {{ic|/etc/X11/xorg.conf}} to:<br />
<br />
Section "Device"<br />
Identifier "ATI radeon '''****'''"<br />
Driver "fglrx"<br />
EndSection<br />
<br />
Where ''****'' should be replaced with your device's marketing number (e.g. 6870 for the HD 6870 and 6310 for the E-350 APU).<br />
<br />
Xorg will start and it is possible to use {{ic|amdcccle}} instead of {{ic|aticonfig}}. There will be an "AMD Unsupported hardware" watermark.<br />
<br />
You can remove this watermark using the following script:<br />
<br />
#!/bin/sh<br />
DRIVER=/usr/lib/xorg/modules/drivers/fglrx_drv.so<br />
for x in $(objdump -d $DRIVER|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do<br />
sed -i "s/$x/\x90\x90\x90\x90\x90/g" $DRIVER<br />
done<br />
<br />
and rebooting.<br />
<br />
=== WebGL support in Chromium ===<br />
<br />
Google has blacklisted Linux's Catalyst driver from supporting webGL in their Chromium/Chrome browsers.<br />
<br />
You can turn webGL on by editing {{ic|/usr/share/applications/chromium.desktop}} file and adding {{ic|--ignore-gpu-blacklist}} flag into the '''Exec''' line so it looks like this:<br />
<br />
Exec=chromium %U --ignore-gpu-blacklist<br />
<br />
You can also run chromium from console with the same {{ic|--ignore-gpu-blacklist}} flag:<br />
<br />
$ chromium --ignore-gpu-blacklist<br />
<br />
{{Warning|Catalyst does not support the GL_ARB_robustness extension, so it is possible that a malicious site could use WebGL to perform a DoS attack on your graphic card. For more info, read [http://www.h-online.com/security/news/item/WebGL-as-a-security-problem-1240567.html/ this].}}<br />
<br />
=== Laggs/freezes when watching flash videos via Adobe's flashplugin ===<br />
<br />
Edit {{ic|/etc/adobe/mms.cfg}} and make it look like this:<br />
<br />
#EnableLinuxHWVideoDecode=1<br />
OverrideGPUValidation=true<br />
<br />
If you are using KDE make sure that "Suspend desktop effects for fullscreen windows" is unchecked under System Settings->Workspace Appearance and Behaviour->Desktop Effects->Advanced.<br />
<br />
=== Laggs/slow windows movement in GNOME3 ===<br />
<br />
You can try this solution out, it's working for many people.<br />
<br />
Add this line into {{ic|~/.profile}} or into {{ic|/etc/profile}}:<br />
<br />
export CLUTTER_VBLANK=none<br />
<br />
Restart X server or reboot your system.<br />
<br />
=== Not using fullscreen resolution at 1920x1080 (underscanning) ===<br />
<br />
Using the amdcccle GUI you can select the display, go to adjustments, and set Underscan to 0% (aticonfig defaults to 15% underscan).<br />
<br />
Alternatively, you can use aticonfig to disable underscanning as well:<br />
<br />
aticonfig --set-pcs-val=MCIL,DigitalHDTVDefaultUnderscan,0<br />
<br />
For newer version (for example, 12.11), if Catalyst control center repeatedly fails to save the overscan setting, edit /etc/ati/amdpcsdb:<br />
<br />
TVEnableOverscan=V0<br />
<br />
Then logout and login.<br />
<br />
=== Dual Screen Setup: general problems with acceleration, OpenGL, compositing, performance ===<br />
Try to disable xinerama and xrandr12. Check out ie. this way:<br />
<br />
As root type those commands:<br />
aticonfig --initial<br />
aticonfig --set-pcs-str="DDX,EnableRandR12,FALSE"<br />
Then reboot your system. In /etc/X11/xorg.conf check that xinerama is disabled, if it's not disable it and reboot your system.<br />
<br />
Next run amdcccle and pick up amdcccle->display manager->multi-display->multidisplay desktop with display(s) 2.<br />
<br />
Reboot again and set up your display layout whatever you desire.<br />
<br />
=== Disabling VariBright Feature ===<br />
As root type command:<br />
aticonfig --set-pcs-u32=MCIL,PP_UserVariBrightEnable,0<br />
<br />
=== Hybrid/PowerXpress: turning off discrete GPU ===<br />
When you are using catalyst-total-pxp or catalyst-utils-pxp and you are switching to integrated GPU you may notice that discrete GPU is still working, consuming power and making your system's temperature higher. <br />
<br />
Sometimes ie. when your integrated GPU is intel's one you can use '''vgaswitcheroo''' to turn the discrete GPU off.<br />
Sometimes unfortunatelly, it's not working.<br />
<br />
Then you may check out [https://aur.archlinux.org/packages/?O=0&K=acpi_call acpi_call]. MrDeepPurple has prepared the script which he's using to perform 'turn off' task, he's calling script via systemd service while booting and resuming his system.<br />
Here's his script:<br />
#!/bin/sh<br />
libglx=$(/usr/lib/fglrx/switchlibglx query)<br />
modprobe acpi_call<br />
if [ "$libglx" = "intel" ]; then<br />
echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call<br />
fi</div>Cinellihttps://wiki.archlinux.org/index.php?title=Ruby_on_Rails&diff=252146Ruby on Rails2013-03-28T08:07:35Z<p>Cinelli: Updated latest ruby version number.</p>
<hr />
<div>[[Category:Web Server]]<br />
[[zh-CN:Ruby on Rails]]<br />
[http://rubyonrails.org/ Ruby on Rails], often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language. It is intended to be used with an Agile development methodology that is used by web developers for rapid development.<br />
<br />
This document describes how to set up the Ruby on Rails Framework on an Arch Linux system.<br />
<br />
Ruby on Rails requires [[Ruby]] to be installed, so read that article first for installation instructions.<br />
<br />
== Option A: Installation via RubyGems (Recommended) ==<br />
<br />
{{Box Note | If this command is run without being root (using sudo or otherwise), the gem will be installed into the home directory of the user.}}<br />
<br />
# gem install rails<br />
<br />
Building the documentation takes a while. If you want to skip it, append the parameters --no-ri --no-rdoc to the install command.<br />
# gem install rails --no-ri --no-rdoc<br />
<br />
=== Updating Gems ===<br />
<br />
gem is a package manager for Ruby modules, somewhat like pacman is to Arch Linux. To update your gems, simply run:<br />
# gem update<br />
<br />
== Option B: Installing via the AUR ==<br />
<br />
{{Warning|This is not recommended, as this might not include the latest Rails version, and additional dependencies may be introduced that may require you to run {{Ic|gem install}} anyway.}}<br />
There is a {{AUR|rails}} package available in the [[AUR]]. Note that this is not in an [[Official Repositories|official repository]], so you will need to [[AUR#Build_the_package|build it manually]].<br />
<br />
== Configuration ==<br />
<br />
Rails is bundled with a basic HTTP server called WeBrick. You can create a test application to test it. First, create an application with the rails command:<br />
<br />
$ rails new testapp_name<br />
<br />
{{Note|If you get an Error message like this:<br />
{{ic|... FetchError: SSL_connect returned&#61;1 errno&#61; 0 state&#61;SSLv2/v3 read server hello A: sslv3 alert handshake<br />
failure (https://s3.amazonaws.com/ production.s3.rubygems.org/gems/rake-10.0.3.gem) }}<br />
try<br />
{{ic|$ pacman -Suy}}<br />
{{ic|$ pacman -S nodejs}}<br />
then try again.}}<br />
<br />
This creates a new folder inside your current working directory. <br />
<br />
$ cd testapp_name<br />
<br />
Next start the web server. It listens on port 3000 by default:<br />
<br />
$ rails server<br />
<br />
Now visit the testapp_name website on your local machine by opening http://localhost:3000 in your browser<br />
{{Note| If ruby complains about not being able to find a JavaScript runtime, do {{ic|# pacman -S nodejs}}.}}<br />
<br />
A test-page should shown greeting you "Welcome aboard".<br />
<br />
== Application servers ==<br />
<br />
While the default Ruby On Rails HTTP server (WeBrick) is convenient for basic development it is not recommended for production use. Generally, you should choose between installing the Phusion Passenger module for your webserver ([[Apache]] or [[Nginx]]), or use a dedicated application-server (such as Mongrel or Unicorn) combined with a separate web-server acting as a reverse proxy.<br />
<br />
=== Mongrel ===<br />
Mongrel is a drop-in replacement for WeBrick, that can be run in precisely the same way, but offers better performance.<br />
<br />
First install the Mongrel gem:<br />
# gem install mongrel<br />
<br />
Then start it using:<br />
# mongrel_rails start<br />
<br />
Alternatively, you can just run "ruby script/server" again, as it replaces WeBrick by default.<br />
<br />
=== Unicorn ===<br />
[http://unicorn.bogomips.org/ Unicorn] is loosely based on Mongrel, and is used by Github. It uses a different architecture that tries harder to find the best child for handling a request. [https://github.com/blog/517-unicorn Explanation of differences between Unicorn and Mongrel].<br />
<br />
Install the Unicorn gem:<br />
# gem install unicorn<br />
<br />
Then create a configuration file for your application in /etc/unicorn/. For example; here is a configuration example (Based on [http://www.warden.pl/2011/01/07/running-redmine-under-unicorn-in-debian/]) for Redmine:<br />
<br />
<pre>working_directory "/srv/http/redmine"<br />
pid "/tmp/redmine.pid"<br />
<br />
preload_app true<br />
timeout 60<br />
worker_processes 4<br />
listen 4000<br />
stderr_path('/var/log/unicorn.log')<br />
<br />
GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true<br />
<br />
after_fork do |server, worker|<br />
#start the worker on port 4000, 4001, 4002 etc...<br />
addr = "0.0.0.0:#{4000 + worker.nr}"<br />
# infinite tries to start the worker<br />
server.listen(addr, :tries => -1, :delay => -1, :backlog => 128)<br />
<br />
#Drop privileges if running as root<br />
worker.user('nobody', 'nobody') if Process.euid == 0<br />
end</pre><br />
<br />
Start it using:<br />
# usr/bin/unicorn -D -E production -c /etc/unicorn/redmine.ru<br />
<br />
=== Apache/Nginx (using Phusion Passenger) ===<br />
<br />
[http://www.modrails.com/ Passenger] also known as {{ic|mod_rails}} is a module available for [[Nginx]] and [[Apache]], that greatly simplifies setting up a Rails server environment. Nginx does not support modules as Apache and has to be compiled with {{ic|mod_rails}} in order to support Passenger; let Passenger compile it for you. As for Apache, let Passenger set up the module for you.<br />
<br />
{{note|The current Nginx package in the official repositories actually is compiled with the Passenger module, so you can install it via pacman. The configuration files are stored in {{ic|/etc/nginx/conf/}}.}}<br />
<br />
Start by installing the 'passenger' gem:<br />
# gem install passenger<br />
<br />
If you are aiming to use [[Apache]], run:<br />
# passenger-install-apache2-module<br />
<br />
For [[Nginx]]:<br />
# passenger-install-nginx-module<br />
<br />
The installer will provide you with any additional information regarding the installation (such as installing additional libraries).<br />
<br />
To serve an application with Nginx, configure it as follows:<br />
<pre><br />
server {<br />
server_name app.example.org;<br />
root path_to_app/public; # Be sure to point to 'public' folder!<br />
passenger_enabled on;<br />
rails_env development; # Rails environment.<br />
}<br />
</pre><br />
<br />
== Databases ==<br />
<br />
Most web applications will need to interact with some sort of database. ActiveRecord (the ORM used by Rails to provide database abstraction) supports several database vendors, the most popular of which are MySQL, SQLite, and PostgreSQL.<br />
<br />
=== SQLite ===<br />
<br />
SQLite is the default lightweight database for Ruby on Rails. To enable SQLite, simply install {{Pkg|sqlite3}}.<br />
<br />
=== PostgreSQL ===<br />
<br />
(Stub.)<br />
<br />
Install {{Pkg|postgresql}}.<br />
<br />
=== MySQL ===<br />
<br />
{{Note|You must first install [[MySQL]] with the appropriate headers in {{ic|/usr/include}} (just installing {{Pkg|mysql}} is fine) before attempting to install the Ruby MySQL extensions.}}<br />
<br />
Please refer to [[MySQL]] on how to install MySQL Server.<br />
<br />
A gem with some native extensions is required, probably best installed as root:<br />
# sudo gem install mysql<br />
<br />
You can generate a rails application configured for MySQL by using the {{Ic|-d}} parameter:<br />
$ rails new testapp_name -d mysql<br />
<br />
You then need to edit config/database.yml. Rails uses different databases for development, testing, production and other environments. Here is an example development configuration for MySQL running on localhost:<br />
<br />
development:<br />
adapter: mysql<br />
database: my_application_database<br />
username: development<br />
password: my_secret_password<br />
<br />
Note that you do not have to actually create the database using MySQL, as this can be done via Rails with:<br />
# rake db:create<br />
<br />
If no errors are shown, then your database has been created and Rails can talk to your MySQL database.<br />
<br />
== Option C: The Perfect Rails Setup ==<br />
<br />
''Phusion Passenger running multiple Ruby versions.''<br />
<br />
* [https://www.archlinux.org/ Archlinux]: A simple, lightweight distribution. ;)<br />
* [http://www.nginx.org/ Nginx]: A fast and lightweight '''web server''' with a strong focus on high concurrency, performance and low memory usage.<br />
* [http://www.modrails.com/ Passenger] (a.k.a. mod_rails or mod_rack): Supports both Apache and Nginx web servers. It makes deployment of Ruby web applications, such as those built on Ruby on Rails web framework, a breeze.<br />
* [http://www.rubyenterpriseedition.com/ Ruby Enterprise Edition] (REE): Passenger allows Ruby on Rails applications to use about 33% less memory, when used in combination with REE.<br />
* [http://rvm.beginrescueend.com/ Ruby Version Manager] (RVM): A command-line tool which allows you to easily install, manage, and work with multiple Ruby environments from interpreters to sets of gems. RVM lets you deploy each project with its own completely self-contained and dedicated environment —from the specific version of ruby, all the way down to the precise set of required gems to run your application—.<br />
* [http://sqlite.org/ SQLite]: The default lightweight '''database''' for Ruby on Rails.<br />
<br />
=== Step 0: SQLite ===<br />
<br />
Easy as:<br />
$ sudo pacman -S sqlite<br />
<br />
{{note|Of course SQLite is not critical in this setup, you can use MySQL and PostgreSQL as well.}}<br />
<br />
=== Step 1: RVM ===<br />
<br />
Make a multi-user [[RVM]] installation as specified [[RVM#Multi-user_installation|here]].<br />
<br />
In the 'adding users to the rvm group' step, do<br />
$ sudo usermod -a -G rvm http<br />
$ sudo usermod -a -G rvm nobody<br />
. http and nobody are the users related to Nginx and Passenger, respectively.<br />
<br />
{{note|Maybe adding the 'nobody' user to the 'rvm' group is not necessary.}}<br />
<br />
=== Step 2: Rubies ===<br />
<br />
Once you have a working RVM installation in your hands, it is time to install the Ruby Enterprise Edition interpreter<br />
{{Note|During the installation of Ruby Enterprise Edition patches will be applied. Consider installing '''base-devel''' beforehand.}}<br />
<br />
$ rvm install ree<br />
. Also take the chance to include other interpreters you want to use, like the last Ruby version<br />
$ rvm install 2.0.0<br />
<br />
==== Advice ====<br />
<br />
There is a documented [https://bugs.ruby-lang.org/issues/6383#note-1 bug] with older versions of Ruby (ie. the 1.8.7 version that REE uses) and the GCC versions 4.6 and up. If you get segmentation fault errors when trying to install gems such as Passenger, remove your install of REE and reinstall with the following:<br />
<br />
$ rvm remove ree<br />
$ CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" rvm install ree<br />
<br />
It is also possible to make it work with older versions of GCC, but that requires considerably more time.<br />
<br />
I have found useful to delete the 'global' gemsets of the environments that have web applications. Their gems were somehow interfering with Passenger. Do not do<br />
$ rvm ree do gemset delete global<br />
$ rvm 2.0.0 do gemset delete global<br />
now, but consider this later if you encounter complications.<br />
<br />
=== Step 3: Nginx with Passenger support ===<br />
<br />
Do not install Nginx via pacman. This web server does not support modules as Apache, so it must be compiled from source with the functionality of ''mod_rails'' (Passenger). Fortunately this is straightforward thanks to the passenger gem. Get it:<br />
$ rvm use ree<br />
$ gem install passenger<br />
. The gem will be put into the 'default' gemset. Now execute the following script:<br />
<br />
{{note|The current nginx package in the official repos actually was compiled with the passenger module. So you can install it via pacman and skip this step. The config files are stored in /etc/nginx/conf/. }}<br />
<br />
$ rvmsudo passenger-install-nginx-module<br />
. It will download the sources of Nginx, compile and install it for you. It will guide you through all the process. (The default location for Nginx is /opt/nginx.)<br />
<br />
{{note|If you encounter a compilation error regarding Boost threads, see [https://bbs.archlinux.org/viewtopic.php?id&#61;139164 this] article.}}<br />
<br />
After completion, the script will require you to add two lines into the 'http block' at {{ic|/opt/nginx/conf/nginx.conf}} that look like:<br />
http { <br />
...<br />
passenger_root /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/passenger-3.0.9;<br />
passenger_ruby /usr/local/rvm/wrappers/ree-1.8.7-2011.03/ruby;<br />
...<br />
}<br />
<br />
If you installed [[Nginx]] from pacman the {{ic|passenger_root}} needs to be changed to:<br />
passenger_root /usr/lib/passenger/;<br />
{{warning|Do not set it to {{ic|/usr/lib/passenger/bin/passenger}} since this will result in [[Nginx]] segfaulting when checking the config}}<br />
<br />
For everything that is not Ruby, use [[Nginx]] as usual to serve static pages, PHP and Python. Check the wiki page for more information.<br />
<br />
To enable the Nnginx service by default at start-up just add {{Ic|nginx}} to the {{Ic|DAEMONS}} array in {{ic|/etc/rc.conf}}:<br />
DAEMONS=(ntpd syslog-ng ... nginx)<br />
<br />
If you are using {{Ic|systemd}} instead of {{Ic|initscripts}}, you must run the following command to have your system run {{Ic|nginx}} on startup<br />
<br />
# systemctl enable nginx.service<br />
<br />
{{note|It is possible that your Nginx installation has not come with an init script; check your /etc/rc.d/ directory for a file called ''nginx'', if that is your case manually create it. Help yourself with [[Nginx/Init_script]]. If you installed nginx to another location, such as /opt/nginx, you will need to edit the init script accordingly.}}<br />
<br />
=== Step 4: Gemsets and Apps ===<br />
<br />
For each Rails application you should have a gemset. Suppose that you want to try [http://refinerycms.com RefineryCMS] against [http://www.browsercms.org BrowserCMS], two open-source Content Management Systems based on Rails. Then you should do:<br />
$ rvm use ree@refinery --create<br />
$ gem install rails -v 3.0.11<br />
$ gem install passenger<br />
$ gem install refinerycms refinerycms-i18n sqlite3<br />
Deploy a RefineryCMS instance called ''refineria'':<br />
$ cd /srv/http/<br />
$ rvmsudo refinerycms refineria<br />
Again:<br />
$ rvm use 2.0.0@browser --create<br />
$ gem install passenger<br />
$ gem install browsercms sqlite3<br />
Deploy a BrowserCMS instance called ''navegador'':<br />
$ cd /srv/http/<br />
$ rvmsudo browsercms demo navegador<br />
$ cd /srv/http/navegador<br />
$ rvmsudo rake db:install<br />
<br />
=== Passenger for Nginx and Passenger Standalone ===<br />
<br />
Observe that the passenger gem was installed three times and with different intentions; in the environments<br />
* ''ree'' => for Nginx,<br />
* ''ree@refinery'' => Standalone, and<br />
* ''2.0.0@browser'' => Standalone.<br />
<br />
The strategy is to combine Passenger for Nginx with Passenger Standalone. One must first identify the Ruby environment (interpreter plus gemset) that one uses the most; in this setup the REE interpreter and the default gemset were selected. One then proceeds with setting up Passenger for Nginx to use that environment (step 3).<br />
* Applications within the chosen environment can be served as in [[Ruby_on_Rails#Apache.2FNginx_.28using_Phusion_Passenger.29|Apache/Nginx (using Phusion Passenger)]], page up in this article.<br />
* All applications that are to use a different Ruby version and/or gemset can be served separately through Passenger Standalone and hook into the main web server via a reverse proxy configuration (step 6).<br />
<br />
=== Step 5: .rvmrc files and ownerships ===<br />
<br />
This step is crucial for the correct behaviour of the setup. RVM seeks for .rvmrc files when changing folders; if it finds one, it reads it. In these files normally one stores a line like<br />
rvm <ruby_version>@<gemset_name><br />
so the specified environment is set at the entrance of applications' root folder.<br />
<br />
Create /srv/http/refineria/.rvmrc doing<br />
sudo sh -c 'echo "rvm ree@refinery" > /srv/http/refineria/.rvmrc'<br />
, and /srv/http/navegador/.rvmrc with<br />
sudo sh -c 'echo "rvm 2.0.0@browser" > /srv/http/navegador/.rvmrc'<br />
You have to enter to both application root folders now, because every first time that RVM finds a .rvmrc it asks you if you trust the given file, consequently you must validate the two files you have just created.<br />
<br />
These files aid the programs involved to find the correct gems.<br />
<br />
Apart, if applications' files and folders are not owned by the right user you will face database write-access problems. The use of rvmsudo produces ''root''-owned archives when generated by Rails; in the other hand, ''nobody'' is the user for Passenger —if you have not changed it—: who will use and should posses them. Fix this doing<br />
$ sudo chown -R nobody.nobody /srv/http/refineria /srv/http/navegador<br />
<br />
=== Step 6: Reverse proxies ===<br />
<br />
You have to start the Passenger Standalone web servers for your applications. So, do<br />
$ cd /srv/http/refineria<br />
$ rvmsudo passenger start --socket tmp/sockets/passenger.socket -d<br />
and<br />
$ cd /srv/http/navegador<br />
$ rvmsudo passenger start --socket tmp/sockets/passenger.socket -d<br />
. The first time that you run a Passenger Standalone it will perform a minor installation.<br />
<br />
Note that you are using ''unix domain'' sockets instead of the commonly-used ''TCP'' sockets; it turns out that unix domain are significantly faster than TCP sockets.<br />
<br />
{{note|If you are experimenting trouble with unix sockets, changing to TCP should work:<br />
rvmsudo passenger start -a 127.0.0.1 -p 3000 -d<br />
}}<br />
<br />
==== Launch Passenger Standalone daemons at system start-up ====<br />
<br />
''Do you have a script? Please post it here.''<br />
<br />
The systemd script below was made for a Typo blog I host at /srv/http/typo. It's located at /etc/systemd/system/passenger_typo.service. I set the Environment= tags (see "man systemd.exec") from the output of "rvm env". The only exception was PATH=, which I had to combine from my regular PATH and the output of rvm env.<br />
<br />
Note: If you don't set the "WorkingDirectory=" variable to your application folder, passenger will fail to find your app and will subsequently shut itself down.<br />
<br />
<pre><br />
[Unit]<br />
Description=Passenger Standalone Script for Typo<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
WorkingDirectory=/srv/http/typo<br />
PIDFile=/srv/http/typo/tmp/pids/passenger.pid<br />
<br />
Environment=PATH=/usr/local/rvm/gems/ruby-2.0.0-p0@typo/bin:/usr/local/rvm/gems/ruby-2.0.0-p0@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p0/bin:/usr/local/rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl<br />
Environment=rvm_env_string=ruby-2.0.0-p0@typo<br />
Environment=rvm_path=/usr/local/rvm<br />
Environment=rvm_ruby_string=ruby-2.0.0-p0<br />
Environment=rvm_gemset_name=typo<br />
Environment=RUBY_VERSION=ruby-2.0.0-p0<br />
Environment=GEM_HOME=/usr/local/rvm/gems/ruby-2.0.0-p0@typo<br />
Environment=GEM_PATH=/usr/local/rvm/gems/ruby-2.0.0-p0@typo:/usr/local/rvm/gems/ruby-2.0.0-p0@global<br />
Environment=MY_RUBY_HOME=/usr/local/rvm/rubies/ruby-2.0.0-p0<br />
Environment=IRBRC=/usr/local/rvm/rubies/ruby-2.0.0-p0/.irbrc<br />
<br />
ExecStart=/bin/bash -c "rvmsudo passenger start --socket /srv/http/typo/tmp/sockets/passenger.socket -d"<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</pre><br />
<br />
=== Step 7: Deployment ===<br />
<br />
== With subdomains ==<br />
<br />
Once again edit /opt/nginx/conf/nginx.conf to include some vital instructions:<br />
<br />
<pre><br />
## RefineryCMS ##<br />
<br />
server {<br />
server_name refinery.domain.com;<br />
root /srv/http/refineria/public;<br />
location / {<br />
proxy_pass http://unix:/srv/http/refineria/tmp/sockets/passenger.socket;<br />
proxy_set_header Host $host;<br />
}<br />
}<br />
<br />
## BrowserCMS ##<br />
<br />
server {<br />
server_name browser.domain.com;<br />
root /srv/http/navegador/public;<br />
location / {<br />
proxy_pass http://unix:/srv/http/navegador/tmp/sockets/passenger.socket;<br />
proxy_set_header Host $host;<br />
}<br />
}<br />
</pre><br />
<br />
{{note|Or if using TCP sockets, configure the ''proxy_pass'' directive like<br />
<pre>proxy_pass http://127.0.0.1:3000;</pre><br />
}}<br />
<br />
== Without subdomains ==<br />
<br />
If you for some reason don't want to host each application on it's own subdomain but rather in a url like: {{ic|site.com/railsapp}} then you could do something like this in your config:<br />
<br />
<pre><br />
server {<br />
server_name site.com;<br />
#Base for the html files etc<br />
root /srv/http/;<br />
<br />
#First application you want hosted under domain site.com/railsapp<br />
location /railsapp {<br />
root /srv/http/railsapp/public;<br />
#you may need to change passenger_base_uri to be the uri you want to point at, ie:<br />
#passenger_base_uri /railsapp;<br />
#but probably only if you're using the other solution with passenger phusion<br />
proxy_pass http://unix:/srv/http/railsapp/tmp/sockets/passenger.socket;<br />
proxy_set_header Host $host;<br />
}<br />
<br />
#Second applicatino you want hosted under domain site.com/anotherapp<br />
location /anotherapp {<br />
root /srv/http/anotherapp/public;<br />
#same thing about the passenger_base_uri here, but with value /anotherapp instead<br />
proxy_pass http://unix:/srv/http/anotherapp/tmp/sockets/passenger.socket;<br />
proxy_set_header Host $host;<br />
}<br />
}<br />
</pre><br />
<br />
At this point you are in conditions to run Nginx with:<br />
<br />
$ sudo rc.d start nginx<br />
<br />
and to access both CMSs through ''refinery.domain.com'' and ''browser.domain.com''.<br />
<br />
=== References ===<br />
<br />
* http://beginrescueend.com/integration/passenger<br />
* http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions<br />
<br />
== See also ==<br />
<br />
* [[Ruby]]<br />
* [[Nginx]]<br />
* [[LAMP]]<br />
* [[MySQL]]<br />
<br />
== References ==<br />
<br />
* Ruby on Rails http://rubyonrails.org/download.<br />
* Mongrel http://mongrel.rubyforge.org.</div>Cinellihttps://wiki.archlinux.org/index.php?title=Ruby_on_Rails&diff=252145Ruby on Rails2013-03-28T08:03:12Z<p>Cinelli: /* Step 2: Rubies */ updated latest ruby version numbeer</p>
<hr />
<div>[[Category:Web Server]]<br />
[[zh-CN:Ruby on Rails]]<br />
[http://rubyonrails.org/ Ruby on Rails], often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language. It is intended to be used with an Agile development methodology that is used by web developers for rapid development.<br />
<br />
This document describes how to set up the Ruby on Rails Framework on an Arch Linux system.<br />
<br />
Ruby on Rails requires [[Ruby]] to be installed, so read that article first for installation instructions.<br />
<br />
== Option A: Installation via RubyGems (Recommended) ==<br />
<br />
{{Box Note | If this command is run without being root (using sudo or otherwise), the gem will be installed into the home directory of the user.}}<br />
<br />
# gem install rails<br />
<br />
Building the documentation takes a while. If you want to skip it, append the parameters --no-ri --no-rdoc to the install command.<br />
# gem install rails --no-ri --no-rdoc<br />
<br />
=== Updating Gems ===<br />
<br />
gem is a package manager for Ruby modules, somewhat like pacman is to Arch Linux. To update your gems, simply run:<br />
# gem update<br />
<br />
== Option B: Installing via the AUR ==<br />
<br />
{{Warning|This is not recommended, as this might not include the latest Rails version, and additional dependencies may be introduced that may require you to run {{Ic|gem install}} anyway.}}<br />
There is a {{AUR|rails}} package available in the [[AUR]]. Note that this is not in an [[Official Repositories|official repository]], so you will need to [[AUR#Build_the_package|build it manually]].<br />
<br />
== Configuration ==<br />
<br />
Rails is bundled with a basic HTTP server called WeBrick. You can create a test application to test it. First, create an application with the rails command:<br />
<br />
$ rails new testapp_name<br />
<br />
{{Note|If you get an Error message like this:<br />
{{ic|... FetchError: SSL_connect returned&#61;1 errno&#61; 0 state&#61;SSLv2/v3 read server hello A: sslv3 alert handshake<br />
failure (https://s3.amazonaws.com/ production.s3.rubygems.org/gems/rake-10.0.3.gem) }}<br />
try<br />
{{ic|$ pacman -Suy}}<br />
{{ic|$ pacman -S nodejs}}<br />
then try again.}}<br />
<br />
This creates a new folder inside your current working directory. <br />
<br />
$ cd testapp_name<br />
<br />
Next start the web server. It listens on port 3000 by default:<br />
<br />
$ rails server<br />
<br />
Now visit the testapp_name website on your local machine by opening http://localhost:3000 in your browser<br />
{{Note| If ruby complains about not being able to find a JavaScript runtime, do {{ic|# pacman -S nodejs}}.}}<br />
<br />
A test-page should shown greeting you "Welcome aboard".<br />
<br />
== Application servers ==<br />
<br />
While the default Ruby On Rails HTTP server (WeBrick) is convenient for basic development it is not recommended for production use. Generally, you should choose between installing the Phusion Passenger module for your webserver ([[Apache]] or [[Nginx]]), or use a dedicated application-server (such as Mongrel or Unicorn) combined with a separate web-server acting as a reverse proxy.<br />
<br />
=== Mongrel ===<br />
Mongrel is a drop-in replacement for WeBrick, that can be run in precisely the same way, but offers better performance.<br />
<br />
First install the Mongrel gem:<br />
# gem install mongrel<br />
<br />
Then start it using:<br />
# mongrel_rails start<br />
<br />
Alternatively, you can just run "ruby script/server" again, as it replaces WeBrick by default.<br />
<br />
=== Unicorn ===<br />
[http://unicorn.bogomips.org/ Unicorn] is loosely based on Mongrel, and is used by Github. It uses a different architecture that tries harder to find the best child for handling a request. [https://github.com/blog/517-unicorn Explanation of differences between Unicorn and Mongrel].<br />
<br />
Install the Unicorn gem:<br />
# gem install unicorn<br />
<br />
Then create a configuration file for your application in /etc/unicorn/. For example; here is a configuration example (Based on [http://www.warden.pl/2011/01/07/running-redmine-under-unicorn-in-debian/]) for Redmine:<br />
<br />
<pre>working_directory "/srv/http/redmine"<br />
pid "/tmp/redmine.pid"<br />
<br />
preload_app true<br />
timeout 60<br />
worker_processes 4<br />
listen 4000<br />
stderr_path('/var/log/unicorn.log')<br />
<br />
GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true<br />
<br />
after_fork do |server, worker|<br />
#start the worker on port 4000, 4001, 4002 etc...<br />
addr = "0.0.0.0:#{4000 + worker.nr}"<br />
# infinite tries to start the worker<br />
server.listen(addr, :tries => -1, :delay => -1, :backlog => 128)<br />
<br />
#Drop privileges if running as root<br />
worker.user('nobody', 'nobody') if Process.euid == 0<br />
end</pre><br />
<br />
Start it using:<br />
# usr/bin/unicorn -D -E production -c /etc/unicorn/redmine.ru<br />
<br />
=== Apache/Nginx (using Phusion Passenger) ===<br />
<br />
[http://www.modrails.com/ Passenger] also known as {{ic|mod_rails}} is a module available for [[Nginx]] and [[Apache]], that greatly simplifies setting up a Rails server environment. Nginx does not support modules as Apache and has to be compiled with {{ic|mod_rails}} in order to support Passenger; let Passenger compile it for you. As for Apache, let Passenger set up the module for you.<br />
<br />
{{note|The current Nginx package in the official repositories actually is compiled with the Passenger module, so you can install it via pacman. The configuration files are stored in {{ic|/etc/nginx/conf/}}.}}<br />
<br />
Start by installing the 'passenger' gem:<br />
# gem install passenger<br />
<br />
If you are aiming to use [[Apache]], run:<br />
# passenger-install-apache2-module<br />
<br />
For [[Nginx]]:<br />
# passenger-install-nginx-module<br />
<br />
The installer will provide you with any additional information regarding the installation (such as installing additional libraries).<br />
<br />
To serve an application with Nginx, configure it as follows:<br />
<pre><br />
server {<br />
server_name app.example.org;<br />
root path_to_app/public; # Be sure to point to 'public' folder!<br />
passenger_enabled on;<br />
rails_env development; # Rails environment.<br />
}<br />
</pre><br />
<br />
== Databases ==<br />
<br />
Most web applications will need to interact with some sort of database. ActiveRecord (the ORM used by Rails to provide database abstraction) supports several database vendors, the most popular of which are MySQL, SQLite, and PostgreSQL.<br />
<br />
=== SQLite ===<br />
<br />
SQLite is the default lightweight database for Ruby on Rails. To enable SQLite, simply install {{Pkg|sqlite3}}.<br />
<br />
=== PostgreSQL ===<br />
<br />
(Stub.)<br />
<br />
Install {{Pkg|postgresql}}.<br />
<br />
=== MySQL ===<br />
<br />
{{Note|You must first install [[MySQL]] with the appropriate headers in {{ic|/usr/include}} (just installing {{Pkg|mysql}} is fine) before attempting to install the Ruby MySQL extensions.}}<br />
<br />
Please refer to [[MySQL]] on how to install MySQL Server.<br />
<br />
A gem with some native extensions is required, probably best installed as root:<br />
# sudo gem install mysql<br />
<br />
You can generate a rails application configured for MySQL by using the {{Ic|-d}} parameter:<br />
$ rails new testapp_name -d mysql<br />
<br />
You then need to edit config/database.yml. Rails uses different databases for development, testing, production and other environments. Here is an example development configuration for MySQL running on localhost:<br />
<br />
development:<br />
adapter: mysql<br />
database: my_application_database<br />
username: development<br />
password: my_secret_password<br />
<br />
Note that you do not have to actually create the database using MySQL, as this can be done via Rails with:<br />
# rake db:create<br />
<br />
If no errors are shown, then your database has been created and Rails can talk to your MySQL database.<br />
<br />
== Option C: The Perfect Rails Setup ==<br />
<br />
''Phusion Passenger running multiple Ruby versions.''<br />
<br />
* [https://www.archlinux.org/ Archlinux]: A simple, lightweight distribution. ;)<br />
* [http://www.nginx.org/ Nginx]: A fast and lightweight '''web server''' with a strong focus on high concurrency, performance and low memory usage.<br />
* [http://www.modrails.com/ Passenger] (a.k.a. mod_rails or mod_rack): Supports both Apache and Nginx web servers. It makes deployment of Ruby web applications, such as those built on Ruby on Rails web framework, a breeze.<br />
* [http://www.rubyenterpriseedition.com/ Ruby Enterprise Edition] (REE): Passenger allows Ruby on Rails applications to use about 33% less memory, when used in combination with REE.<br />
* [http://rvm.beginrescueend.com/ Ruby Version Manager] (RVM): A command-line tool which allows you to easily install, manage, and work with multiple Ruby environments from interpreters to sets of gems. RVM lets you deploy each project with its own completely self-contained and dedicated environment —from the specific version of ruby, all the way down to the precise set of required gems to run your application—.<br />
* [http://sqlite.org/ SQLite]: The default lightweight '''database''' for Ruby on Rails.<br />
<br />
=== Step 0: SQLite ===<br />
<br />
Easy as:<br />
$ sudo pacman -S sqlite<br />
<br />
{{note|Of course SQLite is not critical in this setup, you can use MySQL and PostgreSQL as well.}}<br />
<br />
=== Step 1: RVM ===<br />
<br />
Make a multi-user [[RVM]] installation as specified [[RVM#Multi-user_installation|here]].<br />
<br />
In the 'adding users to the rvm group' step, do<br />
$ sudo usermod -a -G rvm http<br />
$ sudo usermod -a -G rvm nobody<br />
. http and nobody are the users related to Nginx and Passenger, respectively.<br />
<br />
{{note|Maybe adding the 'nobody' user to the 'rvm' group is not necessary.}}<br />
<br />
=== Step 2: Rubies ===<br />
<br />
Once you have a working RVM installation in your hands, it is time to install the Ruby Enterprise Edition interpreter<br />
{{Note|During the installation of Ruby Enterprise Edition patches will be applied. Consider installing '''base-devel''' beforehand.}}<br />
<br />
$ rvm install ree<br />
. Also take the chance to include other interpreters you want to use, like the last Ruby version<br />
$ rvm install 2.0.0<br />
<br />
==== Advice ====<br />
<br />
There is a documented [https://bugs.ruby-lang.org/issues/6383#note-1 bug] with older versions of Ruby (ie. the 1.8.7 version that REE uses) and the GCC versions 4.6 and up. If you get segmentation fault errors when trying to install gems such as Passenger, remove your install of REE and reinstall with the following:<br />
<br />
$ rvm remove ree<br />
$ CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" rvm install ree<br />
<br />
It is also possible to make it work with older versions of GCC, but that requires considerably more time.<br />
<br />
I have found useful to delete the 'global' gemsets of the environments that have web applications. Their gems were somehow interfering with Passenger. Do not do<br />
$ rvm ree do gemset delete global<br />
$ rvm 2.0.0 do gemset delete global<br />
now, but consider this later if you encounter complications.<br />
<br />
=== Step 3: Nginx with Passenger support ===<br />
<br />
Do not install Nginx via pacman. This web server does not support modules as Apache, so it must be compiled from source with the functionality of ''mod_rails'' (Passenger). Fortunately this is straightforward thanks to the passenger gem. Get it:<br />
$ rvm use ree<br />
$ gem install passenger<br />
. The gem will be put into the 'default' gemset. Now execute the following script:<br />
<br />
{{note|The current nginx package in the official repos actually was compiled with the passenger module. So you can install it via pacman and skip this step. The config files are stored in /etc/nginx/conf/. }}<br />
<br />
$ rvmsudo passenger-install-nginx-module<br />
. It will download the sources of Nginx, compile and install it for you. It will guide you through all the process. (The default location for Nginx is /opt/nginx.)<br />
<br />
{{note|If you encounter a compilation error regarding Boost threads, see [https://bbs.archlinux.org/viewtopic.php?id&#61;139164 this] article.}}<br />
<br />
After completion, the script will require you to add two lines into the 'http block' at {{ic|/opt/nginx/conf/nginx.conf}} that look like:<br />
http { <br />
...<br />
passenger_root /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/passenger-3.0.9;<br />
passenger_ruby /usr/local/rvm/wrappers/ree-1.8.7-2011.03/ruby;<br />
...<br />
}<br />
<br />
If you installed [[Nginx]] from pacman the {{ic|passenger_root}} needs to be changed to:<br />
passenger_root /usr/lib/passenger/;<br />
{{warning|Do not set it to {{ic|/usr/lib/passenger/bin/passenger}} since this will result in [[Nginx]] segfaulting when checking the config}}<br />
<br />
For everything that is not Ruby, use [[Nginx]] as usual to serve static pages, PHP and Python. Check the wiki page for more information.<br />
<br />
To enable the Nnginx service by default at start-up just add {{Ic|nginx}} to the {{Ic|DAEMONS}} array in {{ic|/etc/rc.conf}}:<br />
DAEMONS=(ntpd syslog-ng ... nginx)<br />
<br />
If you are using {{Ic|systemd}} instead of {{Ic|initscripts}}, you must run the following command to have your system run {{Ic|nginx}} on startup<br />
<br />
# systemctl enable nginx.service<br />
<br />
{{note|It is possible that your Nginx installation has not come with an init script; check your /etc/rc.d/ directory for a file called ''nginx'', if that is your case manually create it. Help yourself with [[Nginx/Init_script]]. If you installed nginx to another location, such as /opt/nginx, you will need to edit the init script accordingly.}}<br />
<br />
=== Step 4: Gemsets and Apps ===<br />
<br />
For each Rails application you should have a gemset. Suppose that you want to try [http://refinerycms.com RefineryCMS] against [http://www.browsercms.org BrowserCMS], two open-source Content Management Systems based on Rails. Then you should do:<br />
$ rvm use ree@refinery --create<br />
$ gem install rails -v 3.0.11<br />
$ gem install passenger<br />
$ gem install refinerycms refinerycms-i18n sqlite3<br />
Deploy a RefineryCMS instance called ''refineria'':<br />
$ cd /srv/http/<br />
$ rvmsudo refinerycms refineria<br />
Again:<br />
$ rvm use 1.9.3@browser --create<br />
$ gem install passenger<br />
$ gem install browsercms sqlite3<br />
Deploy a BrowserCMS instance called ''navegador'':<br />
$ cd /srv/http/<br />
$ rvmsudo browsercms demo navegador<br />
$ cd /srv/http/navegador<br />
$ rvmsudo rake db:install<br />
<br />
=== Passenger for Nginx and Passenger Standalone ===<br />
<br />
Observe that the passenger gem was installed three times and with different intentions; in the environments<br />
* ''ree'' => for Nginx,<br />
* ''ree@refinery'' => Standalone, and<br />
* ''1.9.3@browser'' => Standalone.<br />
<br />
The strategy is to combine Passenger for Nginx with Passenger Standalone. One must first identify the Ruby environment (interpreter plus gemset) that one uses the most; in this setup the REE interpreter and the default gemset were selected. One then proceeds with setting up Passenger for Nginx to use that environment (step 3).<br />
* Applications within the chosen environment can be served as in [[Ruby_on_Rails#Apache.2FNginx_.28using_Phusion_Passenger.29|Apache/Nginx (using Phusion Passenger)]], page up in this article.<br />
* All applications that are to use a different Ruby version and/or gemset can be served separately through Passenger Standalone and hook into the main web server via a reverse proxy configuration (step 6).<br />
<br />
=== Step 5: .rvmrc files and ownerships ===<br />
<br />
This step is crucial for the correct behaviour of the setup. RVM seeks for .rvmrc files when changing folders; if it finds one, it reads it. In these files normally one stores a line like<br />
rvm <ruby_version>@<gemset_name><br />
so the specified environment is set at the entrance of applications' root folder.<br />
<br />
Create /srv/http/refineria/.rvmrc doing<br />
sudo sh -c 'echo "rvm ree@refinery" > /srv/http/refineria/.rvmrc'<br />
, and /srv/http/navegador/.rvmrc with<br />
sudo sh -c 'echo "rvm 1.9.3@browser" > /srv/http/navegador/.rvmrc'<br />
You have to enter to both application root folders now, because every first time that RVM finds a .rvmrc it asks you if you trust the given file, consequently you must validate the two files you have just created.<br />
<br />
These files aid the programs involved to find the correct gems.<br />
<br />
Apart, if applications' files and folders are not owned by the right user you will face database write-access problems. The use of rvmsudo produces ''root''-owned archives when generated by Rails; in the other hand, ''nobody'' is the user for Passenger —if you have not changed it—: who will use and should posses them. Fix this doing<br />
$ sudo chown -R nobody.nobody /srv/http/refineria /srv/http/navegador<br />
<br />
=== Step 6: Reverse proxies ===<br />
<br />
You have to start the Passenger Standalone web servers for your applications. So, do<br />
$ cd /srv/http/refineria<br />
$ rvmsudo passenger start --socket tmp/sockets/passenger.socket -d<br />
and<br />
$ cd /srv/http/navegador<br />
$ rvmsudo passenger start --socket tmp/sockets/passenger.socket -d<br />
. The first time that you run a Passenger Standalone it will perform a minor installation.<br />
<br />
Note that you are using ''unix domain'' sockets instead of the commonly-used ''TCP'' sockets; it turns out that unix domain are significantly faster than TCP sockets.<br />
<br />
{{note|If you are experimenting trouble with unix sockets, changing to TCP should work:<br />
rvmsudo passenger start -a 127.0.0.1 -p 3000 -d<br />
}}<br />
<br />
==== Launch Passenger Standalone daemons at system start-up ====<br />
<br />
''Do you have a script? Please post it here.''<br />
<br />
The systemd script below was made for a Typo blog I host at /srv/http/typo. It's located at /etc/systemd/system/passenger_typo.service. I set the Environment= tags (see "man systemd.exec") from the output of "rvm env". The only exception was PATH=, which I had to combine from my regular PATH and the output of rvm env.<br />
<br />
Note: If you don't set the "WorkingDirectory=" variable to your application folder, passenger will fail to find your app and will subsequently shut itself down.<br />
<br />
<pre><br />
[Unit]<br />
Description=Passenger Standalone Script for Typo<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
WorkingDirectory=/srv/http/typo<br />
PIDFile=/srv/http/typo/tmp/pids/passenger.pid<br />
<br />
Environment=PATH=/usr/local/rvm/gems/ruby-1.9.3-p194@typo/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl<br />
Environment=rvm_env_string=ruby-1.9.3-p194@typo<br />
Environment=rvm_path=/usr/local/rvm<br />
Environment=rvm_ruby_string=ruby-1.9.3-p194<br />
Environment=rvm_gemset_name=typo<br />
Environment=RUBY_VERSION=ruby-1.9.3-p194<br />
Environment=GEM_HOME=/usr/local/rvm/gems/ruby-1.9.3-p194@typo<br />
Environment=GEM_PATH=/usr/local/rvm/gems/ruby-1.9.3-p194@typo:/usr/local/rvm/gems/ruby-1.9.3-p194@global<br />
Environment=MY_RUBY_HOME=/usr/local/rvm/rubies/ruby-1.9.3-p194<br />
Environment=IRBRC=/usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc<br />
<br />
ExecStart=/bin/bash -c "rvmsudo passenger start --socket /srv/http/typo/tmp/sockets/passenger.socket -d"<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</pre><br />
<br />
=== Step 7: Deployment ===<br />
<br />
== With subdomains ==<br />
<br />
Once again edit /opt/nginx/conf/nginx.conf to include some vital instructions:<br />
<br />
<pre><br />
## RefineryCMS ##<br />
<br />
server {<br />
server_name refinery.domain.com;<br />
root /srv/http/refineria/public;<br />
location / {<br />
proxy_pass http://unix:/srv/http/refineria/tmp/sockets/passenger.socket;<br />
proxy_set_header Host $host;<br />
}<br />
}<br />
<br />
## BrowserCMS ##<br />
<br />
server {<br />
server_name browser.domain.com;<br />
root /srv/http/navegador/public;<br />
location / {<br />
proxy_pass http://unix:/srv/http/navegador/tmp/sockets/passenger.socket;<br />
proxy_set_header Host $host;<br />
}<br />
}<br />
</pre><br />
<br />
{{note|Or if using TCP sockets, configure the ''proxy_pass'' directive like<br />
<pre>proxy_pass http://127.0.0.1:3000;</pre><br />
}}<br />
<br />
== Without subdomains ==<br />
<br />
If you for some reason don't want to host each application on it's own subdomain but rather in a url like: {{ic|site.com/railsapp}} then you could do something like this in your config:<br />
<br />
<pre><br />
server {<br />
server_name site.com;<br />
#Base for the html files etc<br />
root /srv/http/;<br />
<br />
#First application you want hosted under domain site.com/railsapp<br />
location /railsapp {<br />
root /srv/http/railsapp/public;<br />
#you may need to change passenger_base_uri to be the uri you want to point at, ie:<br />
#passenger_base_uri /railsapp;<br />
#but probably only if you're using the other solution with passenger phusion<br />
proxy_pass http://unix:/srv/http/railsapp/tmp/sockets/passenger.socket;<br />
proxy_set_header Host $host;<br />
}<br />
<br />
#Second applicatino you want hosted under domain site.com/anotherapp<br />
location /anotherapp {<br />
root /srv/http/anotherapp/public;<br />
#same thing about the passenger_base_uri here, but with value /anotherapp instead<br />
proxy_pass http://unix:/srv/http/anotherapp/tmp/sockets/passenger.socket;<br />
proxy_set_header Host $host;<br />
}<br />
}<br />
</pre><br />
<br />
At this point you are in conditions to run Nginx with:<br />
<br />
$ sudo rc.d start nginx<br />
<br />
and to access both CMSs through ''refinery.domain.com'' and ''browser.domain.com''.<br />
<br />
=== References ===<br />
<br />
* http://beginrescueend.com/integration/passenger<br />
* http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions<br />
<br />
== See also ==<br />
<br />
* [[Ruby]]<br />
* [[Nginx]]<br />
* [[LAMP]]<br />
* [[MySQL]]<br />
<br />
== References ==<br />
<br />
* Ruby on Rails http://rubyonrails.org/download.<br />
* Mongrel http://mongrel.rubyforge.org.</div>Cinellihttps://wiki.archlinux.org/index.php?title=Netctl&diff=251633Netctl2013-03-22T23:15:00Z<p>Cinelli: /* Installation */ Clarity</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
The {{Pkg|netctl}} package is available in the [[Official Repositories|official repositories]]. Installing {{Pkg|netctl}} will replace {{Pkg|netcfg}}. As of {{Pkg|netctl}} version 0.7, optional dependencies include<br />
*{{Pkg|dialog}}, for menu based WiFi assistance ({{Pkg|wifi-menu}})<br />
*{{Pkg|dhclient}}, for DHCP support<br />
*{{Pkg|dhcpcd}}, for DHCP support (instead of {{Pkg|dhclient}})<br />
*{{Pkg|wpa_supplicant}}, for wireless network support<br />
*{{Pkg|ifplugd}}, for automatic wired connections through {{ic|netctl-ifplugd}}<br />
*{{Pkg|ifenslaved}}, for bond connections<br />
*{{Pkg|bridge-utils}}, for bridge connections<br />
*{{Pkg|ppp}}, for pppoe connection<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
<br />
{{ic|netctl}} may be used to introspect and control the state of the systemd services for the network profile manager. Example configuration files are provided for the user to assist them in configuring their network connection. These example profiles are located in {{ic|/etc/netctl/examples/}}. The common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy one of them from {{ic|/etc/netctl/examples/<profile>}} to {{ic|/etc/netctl/<profile>}} and configure it to your needs:<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/my-wireless-wpa<br />
<br />
Once you have created your profile, make an attempt to establish a connection using the newly created profile by running:<br />
# netctl start <profile><br />
<br />
If issuing the above command results in a failure, then use {{ic|journalctl -xn}} and {{ic|netctl status <profile>}} in order to obtain a more in depth explanation of the failure. Make the needed corrections to the failed configuration and retest.<br />
<br />
Once the profile is started successfully then it can be {{ic|enabled}} using {{ic|netctl enable <profile>}}. This will create the proper symlink for the profile to be used by {{ic|netctl-auto@.service}}.<br />
<br />
{{Note| the systemd service {{ic|netctl-auto@.service}} will need to be enabled in order to allow automatic wireless connection at boot to become functional}}<br />
<br />
{{Note| If there is ever a need to alter a currently enabled profile. {{ic|netctl reenable <profile>}} will have to executed in order to apply the changes.}}<br />
<br />
===Migrating from netcfg===<br />
<br />
{{ic|netctl}} uses {{ic|/etc/netctl}} to store its profiles whereas {{ic|netcfg}} used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
<br />
Users ''not'' wishing to have their passwords stored in ''plain text'' have the option of generating a 256-bit Encrypted PSK.<br />
<br />
If you have not done so already, install {{pkg|wpa_actiond}} from the {{ic|core}} repository using [[pacman]]<br />
# [[pacman]] -Syu {{pkg|wpa_actiond}}<br />
<br />
Next, generate your 256-bit Encrypted PSK using [[WPA_supplicant#Configuration_file|wpa_passphrase]]:<br />
{{hc|Usage: [[WPA_supplicant#Configuration_file|wpa_passphrase]] [ssid] [passphrase]|<br />
2=$ [[WPA_supplicant#Configuration_file|wpa_passphrase]] archlinux freenode|<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
}}<br />
<br />
In a second terminal window copy the example file {{ic|wireless-wpa}} from {{ic|/etc/netctl/examples}} to {{ic|/etc/netctl}}.<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
You will then need to edit {{ic|/etc/netctl/wireless-wpa}} using your favorite text editor and add the ''Encrypted Pre-shared Key'' that was generated early using [[WPA_supplicant#Configuration_file|wpa_passphrase]] to the {{ic|'''Key'''}} variable of this profile.<br />
<br />
Once completed your network profile {{ic|wireless-wpa}} containing a 256-bit Encrypted PSK should resemble:<br />
{{hc|/etc/netctl/wireless-wpa|<br />
2={{Note|1=Make sure to use the '''special non-quoted rules''' for Key= that are explained at the end of netctl.profile(5)}}<br />
Description='A simple WPA encrypted wireless connection using 256-bit Encrypted PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}}<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Cinellihttps://wiki.archlinux.org/index.php?title=Netctl&diff=251593Netctl2013-03-22T13:37:42Z<p>Cinelli: /* Installation */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
The {{Pkg|netctl}} package is available in the [[Official Repositories|official repositories]]. Installing {{Pkg|netctl}} will replace {{Pkg|netcfg}}. As of {{Pkg|netctl}} version 0.7, optional dependencies include<br />
*{{Pkg|dialog}}, for menu based WiFi assistance ({{Pkg|wifi-menu}})<br />
*{{Pkg|dhclient}}, for DHCP support (or {{Pkg|dhcpcd}})<br />
*{{Pkg|dhcpcd}}, for DHCP support (or {{Pkg|dhclient}})<br />
*{{Pkg|wpa_supplicant}}, for wireless network support<br />
*{{Pkg|ifplugd}}, for automatic wired connections through {{ic|netctl-ifplugd}}<br />
*{{Pkg|ifenslaved}}, for bond connections<br />
*{{Pkg|bridge-utils}}, for bridge connections<br />
*{{Pkg|ppp}, for pppoe connection<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
<br />
{{ic|netctl}} may be used to introspect and control the state of the systemd services for the network profile manager. Example configuration files are provided for the user to assist them in configuring their network connection. These example profiles are located in {{ic|/etc/netctl/examples/}}. The common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy one of them from {{ic|/etc/netctl/examples/<profile>}} to {{ic|/etc/netctl/<profile>}} and configure it to your needs:<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/my-wireless-wpa<br />
<br />
Once you have created your profile, make an attempt to establish a connection using the newly created profile by running:<br />
# netctl start <profile><br />
<br />
If issuing the above command results in a failure, then use {{ic|journalctl -xn}} and {{ic|netctl status <profile>}} in order to obtain a more in depth explanation of the failure. Make the needed corrections to the failed configuration and retest.<br />
<br />
Once the profile is started successfully then it can be {{ic|enabled}} using {{ic|netctl enable <profile>}}. This will create the proper symlink for the profile to be used by {{ic|netctl-auto@.service}}.<br />
<br />
{{Note| the systemd service {{ic|netctl-auto@.service}} will need to be enabled in order to allow automatic wireless connection at boot to become functional}}<br />
<br />
{{Note| If there is ever a need to alter a currently enabled profile. {{ic|netctl reenable <profile>}} will have to executed in order to apply the changes.}}<br />
<br />
===Migrating from netcfg===<br />
<br />
{{ic|netctl}} uses {{ic|/etc/netctl}} to store its profiles whereas {{ic|netcfg}} used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
<br />
Users ''not'' wishing to have their passwords stored in ''plain text'' have the option of generating a 256-bit Encrypted PSK.<br />
<br />
If you have not done so already, install {{pkg|wpa_actiond}} from the {{ic|core}} repository using [[pacman]]<br />
# [[pacman]] -Syu {{pkg|wpa_actiond}}<br />
<br />
Next, generate your 256-bit Encrypted PSK using [[WPA_supplicant#Configuration_file|wpa_passphrase]]:<br />
{{hc|Usage: [[WPA_supplicant#Configuration_file|wpa_passphrase]] [ssid] [passphrase]|<br />
2=$ [[WPA_supplicant#Configuration_file|wpa_passphrase]] archlinux freenode|<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
}}<br />
<br />
In a second terminal window copy the example file {{ic|wireless-wpa}} from {{ic|/etc/netctl/examples}} to {{ic|/etc/netctl}}.<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
You will then need to edit {{ic|/etc/netctl/wireless-wpa}} using your favorite text editor and add the ''Encrypted Pre-shared Key'' that was generated early using [[WPA_supplicant#Configuration_file|wpa_passphrase]] to the {{ic|'''Key'''}} variable of this profile.<br />
<br />
Once completed your network profile {{ic|wireless-wpa}} containing a 256-bit Encrypted PSK should resemble:<br />
{{hc|/etc/netctl/wireless-wpa|<br />
2={{Note|1=Make sure to use the '''special non-quoted rules''' for Key= that are explained at the end of netctl.profile(5)}}<br />
Description='A simple WPA encrypted wireless connection using 256-bit Encrypted PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}}<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Cinellihttps://wiki.archlinux.org/index.php?title=Netctl&diff=251591Netctl2013-03-22T13:24:17Z<p>Cinelli: /* Configuration */ Rewrote section</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
<br />
{{ic|netctl}} may be used to introspect and control the state of the systemd services for the network profile manager. Example configuration files are provided for the user to assist them in configuring their network connection. These example profiles are located in {{ic|/etc/netctl/examples/}}. The common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy one of them from {{ic|/etc/netctl/examples/<profile>}} to {{ic|/etc/netctl/<profile>}} and configure it to your needs:<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/my-wireless-wpa<br />
<br />
Once you have created your profile, make an attempt to establish a connection using the newly created profile by running:<br />
# netctl start <profile><br />
<br />
If issuing the above command results in a failure, then use {{ic|journalctl -xn}} and {{ic|netctl status <profile>}} in order to obtain a more in depth explanation of the failure. Make the needed corrections to the failed configuration and retest.<br />
<br />
Once the profile is started successfully then it can be {{ic|enabled}} using {{ic|netctl enable <profile>}}. This will create the proper symlink for the profile to be used by {{ic|netctl-auto@.service}}.<br />
<br />
{{Note| the systemd service {{ic|netctl-auto@.service}} will need to be enabled in order to allow automatic wireless connection at boot to become functional}}<br />
<br />
{{Note| If there is ever a need to alter a currently enabled profile. {{ic|netctl reenable <profile>}} will have to executed in order to apply the changes.}}<br />
<br />
===Migrating from netcfg===<br />
<br />
{{ic|netctl}} uses {{ic|/etc/netctl}} to store its profiles whereas {{ic|netcfg}} used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
<br />
Users ''not'' wishing to have their passwords stored in ''plain text'' have the option of generating a 256-bit Encrypted PSK.<br />
<br />
If you have not done so already, install {{pkg|wpa_actiond}} from the {{ic|core}} repository using [[pacman]]<br />
# [[pacman]] -Syu {{pkg|wpa_actiond}}<br />
<br />
Next, generate your 256-bit Encrypted PSK using [[WPA_supplicant#Configuration_file|wpa_passphrase]]:<br />
{{hc|Usage: [[WPA_supplicant#Configuration_file|wpa_passphrase]] [ssid] [passphrase]|<br />
2=$ [[WPA_supplicant#Configuration_file|wpa_passphrase]] archlinux freenode|<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
}}<br />
<br />
In a second terminal window copy the example file {{ic|wireless-wpa}} from {{ic|/etc/netctl/examples}} to {{ic|/etc/netctl}}.<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
You will then need to edit {{ic|/etc/netctl/wireless-wpa}} using your favorite text editor and add the ''Encrypted Pre-shared Key'' that was generated early using [[WPA_supplicant#Configuration_file|wpa_passphrase]] to the {{ic|'''Key'''}} variable of this profile.<br />
<br />
Once completed your network profile {{ic|wireless-wpa}} containing a 256-bit Encrypted PSK should resemble:<br />
{{hc|/etc/netctl/wireless-wpa|<br />
2={{Note|1=Make sure to use the '''special non-quoted rules''' for Key= that are explained at the end of netctl.profile(5)}}<br />
Description='A simple WPA encrypted wireless connection using 256-bit Encrypted PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}}<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Cinellihttps://wiki.archlinux.org/index.php?title=Arch_Linux_press_coverage&diff=250855Arch Linux press coverage2013-03-15T21:22:54Z<p>Cinelli: /* English */ Added Allan's XX SINFO speech and 2013 category.</p>
<hr />
<div>[[Category:About Arch]]<br />
[[de:Arch in den Medien]]<br />
<!-- A note to contributors of this wikipage: <br />
Please observe the formatting and style guidelines established within this page. Each article should be sorted by date from most recent to oldest, with a bullet asterisk followed directly by the link. The link should include the title text of the article. Outside the link, the author's name, publication, and date should follow. There are slightly different guidelines for PDF, video, and audio files - please look at an example within this page. By following these guidelines, we can produce an informative but brief and consistent wikipage that is easy to read and use. Thank you for your time and effort. --><br />
== English ==<br />
<br />
[[Wikipedia:Arch Linux|Wikipedia Entry for Arch Linux]]<br />
<br />
[http://distrowatch.com/table.php?distribution=arch DistroWatch Listing for Arch Linux]<br />
<br />
=== 2013 ===<br />
*[http://www.youtube.com/watch?v=IIkHpjhpSyA Arch Linux: Succeeding on the Bleeding Edge (YouTube Video)] [https://www.archlinux.org/developers/#allan Allan Mcrae] gives a talk at XX SINFO in Lisbon, Portugal - 2013-03-01<br />
<br />
=== 2012 ===<br />
*[http://www.linuxuser.co.uk/features/under-the-hood-with-arch-and-gentoo/ Under the Hood with Arch and Gentoo] Richard Hillesley - linuxuser.co.uk 2012-10-20 <br />
<br />
*[http://www.engadget.com/2012/08/09/linux-guide-slackware-arch-linux/ linux-guide-slackware-arch-linux] John Browning - engadget.com 2012-08-09 <br />
*[http://www.techrepublic.com/blog/australia/moving-to-arch-linux-from-fedora/1236 Moving to Arch Linux from Fedora] Chris Duckett - techrepublic.com 2012-08-07<br />
*[http://www.h-online.com/open/news/item/Arch-Linux-2012-07-15-drops-AIF-1649722.html Arch Linux 2012.07.15 drops AIF] Chris von Eitzen - h-online.com 2012-07-23<br />
*[http://claudecat.wordpress.com/2012/07/05/arch-linux-not-just-for-geeks/ Arch linux – not just for geeks?] claudecat - claudecat.wordpress.com 2012-07-05<br />
*[http://www.garron.me/linux/kiss-simplicity-arch-linux-review.html KISS simplicity: Arch Linux] Guillermo Garron - www.garron.me 2012-05-21<br />
*[http://lifehacker.com/5904069/five-best-linux-distributions/ Five-best-linux-distributions] Alan Henry - lifehacker.com 2012-04-23<br />
*[http://linuxlibrary.org/command-line/pacman-package-manager/ Pacman Package Manager] Linux Library - linuxlibrary.org 2012-03-21<br />
*[http://www.youtube.com/watch?v=f6mxf_Ca9Ms Arch Linux Review (Early 2012)] InfinitelyGalactic Reviews - youtube.com 2012-01-31<br />
*[http://justinstories.wordpress.com/2012/01/28/arched-in-a-day-a-noob-experience Arch’ed in a day; a noob experience] Justin - justinstories.wordpress.com 2012-01-28<br />
*[http://mikethecoder.com/post/16562751962/on-switching-to-arch-linux On switching to Arch Linux] Mike Crittenden - mikethecoder.com 2012-01-26<br />
*[http://www.geardiary.com/2012/01/26/arch-linux-only-the-hardcore-need-apply/ Arch Linux: Only the Hardcore Need Apply] Joel McLaughlin - geardiary.com 2012-01-26<br />
<br />
=== 2011 ===<br />
*[http://standardsandfreedom.net/index.php/2011/11/06/archlinux-notforthe-elite/ ArchLinux, not just for the elite] Moved by Freedom – Powered by Standards | A weblog by Charles-H. Schulz 2011-11-06<br />
*[http://www.linuxjournal.com/content/arch-tale An Arch Tale] Dave Phillips - Linux Journal 2011-10-04<br />
*[http://www.h-online.com/open/features/Arch-Linux-It-is-what-you-make-it-1343717.html Arch Linux – "It is what you make it"] Richard Hillesley - h-online.com 2011-09-16<br />
*[http://www.linuxfordevices.com/c/a/News/Arch-Linux-updated/?kc=rss Arch Linux moves up to Linux 3.0] Eric Brown - linuxfordevices.com 2011-08-25<br />
*[http://www.linux.com/learn/tutorials/479960-the-six-best-linux-community-server-distributions The Six Best Linux Community Server Distributions] Carla Schroder - linux.com 2011-08-08<br />
*[http://www.thisweekinlinux.com/2011/07/at072711/ Ask TWIL: Best Linux Distribution and What’s Your Favorite Distro?] Jordan Keyes - thisweekinlinux.com 2011-07-27<br />
*[http://www.linuxjournal.com/content/arch-way The Arch Way] Linux Journal - linuxjournal.com 2011-01-13<br />
<br />
=== 2010 ===<br />
*[http://www.jupiterbroadcasting.com/?p=3071 Arch Linux Review] The Linux Action Show - jupiterbroadcasting.com 2010-10-31<br />
*[http://www.youtube.com/watch?v=1ZvCqslpp6M Distro Review: Arch Linux (Video)] This Week on Linux - http://www.thisweekinlinux.com/ 2010-05-19<br />
*[http://lwn.net/Articles/378030/ Rolling with Arch Linux] Ivan Jelic - LWN.net 2010-03-10<br />
*[http://www.osnews.com/story/22692/Arch_Linux_Team Interview: Arch Linux Team] Jordan Spencer Cunningham - OSNews 2010-01-11<br />
<br />
=== 2009 ===<br />
<br />
*[http://www.vgrc.net/2009/11/a-few-days-with-arch-linux.html] Dennis Wyman - Zangaroa Blog 2009-11-13<br />
<br />
*[http://www.phoronix.com/scan.php?page=article&item=arch_200908_benchmarks&num=1 Arch Linux 2009.08 Benchmarks] Michael Larabel - Phoronix.com 2009-08-14<br />
<br />
*[http://www.linux-mag.com/cache/7469/1.html Arch Linux: The Simple, Flexible (and Fast!) Distro] Chris Smart - Linux-Mag.com 2009-08-12<br />
<br />
*[https://www.archlinux.org/news/458/ Arch Linux Magazine] Eduardo Romero, Editor 2009-08<br />
<br />
*[http://tannewt.org/slides/shawcroft-oscon_presentation.pdf Open Source Watershed: Watching Software Flow Downstream (PDF Document)] Scott Shawcroft - OSWatershed.org 2009-07-20<br />
<br />
*Arch User Magazine - Issue #3 - Daniel Griffiths, Editor 2009-06<br />
<br />
*[http://www.lazytechguy.com/2009/05/why-people-resort-to-arch-linux.html Why people resort to Arch Linux] LazyTechGuy.com 2009-05-19<br />
<br />
*Arch Linux - Syahrizal - OpenSourceReview.com 2009-05-11<br />
<br />
*[http://www.techradar.com/news/software/operating-systems/best-linux-distros-for-power-users-gamers-newbies-and-more-596697?artc_pg=4 Best Linux distros for power users, gamers, newbies, and more] TechRadar.com 2009-05-10<br />
<br />
*Arch User Magazine - Issue #2 - Daniel Griffiths, Editor 2009-05<br />
<br />
*Arch Linux 2009.02 - Maurice Lawles - TechieMoe.com 2009-04-28<br />
<br />
*[http://danlynch.org/blog/2009/04/arch/ Distro Review - Arch Linux 2009.02] Dan Lynch - DanLynch.org 2009-04-14<br />
<br />
*Arch User Magazine - Issue #1 - Daniel Griffiths, Editor 2009-04<br />
<br />
*[http://www.go2linux.org/arch-linux-review Arch Linux Review] ggarron - Go2Linux.org 2009-03-21<br />
<br />
*[http://polishlinux.org/linux/arch-linux-a-distro-collectors-pick/ Arch Linux - a distro collector<nowiki>'</nowiki>s pick] Adam M. - PolishLinux.org 2009-03-16<br />
<br />
*[http://bigbrovar.wordpress.com/2009/03/16/archlinux-the-best-way-to-kiss/ Archlinux the best way to K.I.S.S.] Bigbrovar.WordPress.com 2009-03-16<br />
<br />
*[http://linux-exploration.blogspot.com/2009/03/linux-review-11-arch-linux.html Linux Review 11: Arch Linux] Open_N0DE - Linux-Exploration.BlogSpot.com 03-15-2009<br />
<br />
*[http://www.youtube.com/watch?v=BIVcF5t1kZw Installing Arch Linux Part 1 (YouTube Video)] silvernode - YouTube.com 2009-03-10<br />
<br />
*[http://www.youtube.com/watch?v=7l-IZe733a0 Installing Arch Linux Part 2 (YouTube Video)] silvernode - YouTube.com 2009-03-10<br />
<br />
*[http://www.youtube.com/watch?v=zmB3VVA9EGI Installing Arch Linux Part 3 (YouTube Video)] silvernode - YouTube.com 2009-03-10<br />
<br />
*[http://www.phoronix.com/scan.php?page=news_item&px=NzEwMg Arch Linux Revolts Against ATI Catalyst Driver] Michael Larabel - Phoronix.com 2009-03-01<br />
<br />
*[http://archuser.com/downloads/Arch%20User%20Magazine%20-%20Issue%201%20(Preview) Arch User Magazine - Issue #1-Preview (PDF Document)] Daniel Griffiths, Editor 2009-03<br />
<br />
*[http://www.reviewlinux.com/?m=show&id=11648 Arch Linux 2009.02 Review] Josh Goode - ReviewLinux.com 2009-02-19<br />
<br />
*[http://distrowatch.com/?newsid=05336 Distribution Release: Arch Linux 2009.02] DistroWatch.com 2009-02-17<br />
<br />
*[http://distrowatch.com/weekly.php?issue=20090119#feature Arch Linux in review] DistroWatch Weekly - Issue 286 2009-01-19<br />
<br />
*[http://ostatic.com/blog/a-weekend-with-arch A Weekend With Arch] Kristin Shoemaker - Ostatic.com 2009-01-11<br />
<br />
*[http://amca01.wordpress.com/2009/01/10/arch-linux-a-distribution-for-enthusiasts/ Arch Linux – a distribution for enthusiasts] amca01 - WordPress.com 2009-01-10<br />
<br />
*[http://zuttobenkyou.wordpress.com/2009/01/08/arch-linux-first-impressions/ Arch Linux: First Impressions] Shinobu - Zuttobenkyou.WordPress.com 2009-01-08<br />
[http://www.example.com link title]<br />
<br />
=== 2008 ===<br />
<br />
*[http://linuxhelp.blogspot.com/2008/12/review-arch-linux-sleek-fast-linux.html Review: Arch Linux - A sleek, fast Linux distribution] Ravi - LinuxHelp.BlogSpot.com 2008-12-12<br />
<br />
*[http://evilgold.baywords.com/?p=516 Arch Linux - a review] EvilGold - EvilGold.BayWords.com 2008-10-27<br />
<br />
*[http://thesmallerbang.wordpress.com/2008/10/10/life-on-the-cutting-edge-archlinux/ Life on the cutting edge - ArchLinux] Gautham - TheSmallerBang.WordPress.com 2008-10-10<br />
<br />
*[http://www.youtube.com/watch?v=UV0krka1hn4 Arch Linux Installation Walkthrough (YouTube Video)] linuxandfriends - YouTube.com 2008-09-30<br />
<br />
*[http://www.linuxhaxor.net/2008/09/28/live-dvd-for-linux-games/ Live DVD for Linux Games] Paves - LinuxHaxor.net 2009-09-28<br />
<br />
*[http://www.brighthub.com/computing/linux/reviews/7804.aspx Checking Out Arch Linux] MD Weems - BrightHub.com 2008-09-20<br />
<br />
*[http://linuxbasement.com/content/a-quick-review-arch-linux A Quick Review of Arch Linux] yoyoned - LinuxBasement.com 2008-08-23<br />
<br />
*[http://42gems.com/?p=149 A Simple Linux Review] chi - 42Gems.com 2008-08-21<br />
<br />
*[http://video.google.co.uk/videoplay?docid=6213347420565640601 Arch Linux installation guide (Google Video)] miggols99 - video.google.co.uk 2009-07-27<br />
<br />
*[http://www.linux.com/feature/141550 Arch Linux for the DIY Linux user] Mayank Sharma - Linux.com 2008-07-16<br />
<br />
*Linux guru? then switch to Arch Linux! - Anthony Williams - AnthonyWilliams.com 2008-07-13<br />
<br />
*[http://celettu.wordpress.com/2008/06/25/arch-linux-200806-overlord/ Arch Linux 2008.06: Overlord] Celettu's Weblog - Celettu.WordPress.com 2008-06-25<br />
<br />
*[http://distrowatch.com/?newsid=04963 Distribution Release: Arch Linux 2008.06] DistroWatch.com 2008-06-24<br />
<br />
*[http://forum.notebookreview.com/showthread.php?t=246608 Arch Linux Review] blackbird - Forum.NotebookReview.com 2008-05-04<br />
<br />
*[http://www.hardware.no/artikler/aaron_griffin_english/49507/1 Arch Linux: Popular KISS distro] Robin Heggelund Hansen - Hardware.no 2008-03-25<br />
<br />
*[http://distrogue.blogspot.com/2008/01/arch-pros-only-but-not-bad.html Arch: Pros Only, But Not Bad] DJ Gentoo - Distrogue.BlogSpot.com 2008-01-26<br />
<br />
*[http://planetoss.com/detail.php?id=7 PLANETOSS: Arch Linux - Is this really a geek<nowiki>'</nowiki>s distro?] vasanth - PlanetOSS.com 2008-01-17<br />
<br />
*[http://kmandla.wordpress.com/2008/01/05/a-stable-arch-branch/ A Stable Arch Branch?] K. Mandla - KMandla.WordPress.com 2008-01-05<br />
<br />
=== 2007 ===<br />
<br />
*The Linux Link Tech Show - Interview with Aaron Griffin, lead developer of Arch Linux Episode #223 12-12-07<br />
<br />
*[http://tuxtoday.wordpress.com/2007/11/14/arch-linux-really-impressive-even-when-virtualized/ Arch Linux, really impressive. Even when virtualized.] TuxToday.WordPress.com 2007-11-14<br />
<br />
*[http://simplyjat.blogspot.com/2007/11/arch-200708-2-review.html Arch 2007.08-2 Review] OpenReview - SimplyJat.BlogSpot.com 2007-11-14<br />
<br />
*[http://polishlinux.org/linux/arch/archlinux-tools-aur/ Arch Linux Tools: AUR] mikrobart - PolishLinux.org 2007-11-04<br />
<br />
*[http://polishlinux.org/linux/arch/archlinux-tools-pacman/ Arch Linux Tools: pacman] mikrobart - PolishLInux.org 2007-10-26<br />
<br />
*[http://distrowatch.com/?newsid=04513 Distribution Release: Arch Linux 2007.08-2] DistroWatch.com 2007-10-07<br />
<br />
*[http://www.dvd-guides.com/content/view/212/104/ Arch Linux Review] DVD-Guides.com 2007-09-13<br />
<br />
*[http://distrowatch.com/?newsid=04394 Distribution Release: Arch Linux 2007.08] DistroWatch.com 2007-08-05<br />
<br />
*Linux Reality: Podcast Episode 70 - Arch Linux Episode #70 2007-07-11<br />
<br />
*[http://rohrbakn.blogspot.com/2007/06/arch-linux-observational-review.html Arch Linux: An Observational Review] Rohrbakn - Rohrbakn.BlogSpot.com 2007-06-22<br />
<br />
*[http://www.urbanpuddle.com/articles/2007/05/31/ten-things-i-love-about-archlinux Ten Things I Love About ArchLinux] Vince Wadhwani - UrbanPuddle.com 2007-05-31<br />
<br />
*[http://polishlinux.org/linux/arch/archlinux-smooth-and-cuddly/ ArchLinux<nowiki> - </nowiki> smooth and cuddly] riklaumin - PolishLinux.org 2007-05-04<br />
<br />
*[http://distrowatch.com/?newsid=04235 Distribution Release: Arch Linux 2007-05] DistroWatch.com 2007-05-17<br />
<br />
*[http://www.tuxmachines.org/node/15527 Fallen Under the Spell of Arch Voodoo] srlinuxx - TuxMachines.org 2007-04-20<br />
<br />
*[http://distrowatch.com/?newsid=04143 Distribution Release: Arch Linux 0.8] DistroWatch.com 2007-04-01<br />
<br />
*[http://usalug.org/phpBB2/viewtopic.php?t=10256 ArchLinux, The Distro I wish I had found sooner.] crouse - USALug.org 2007-01-10<br />
<br />
*[http://alt.awesometrousers.net/articles/2007-01-03-archlinux-mini-review.html archLinux mini review] eliot - AwesomeTrousers.net 2007-01-03<br />
<br />
*[http://www.ossblog.it/post/1728/intervista-a-judd-vinet-fondatore-del-progetto-archlinux Interview with Judd Vinet, founder of Arch Linux] OSSBlog.it 2007-01-02<br />
<br />
=== 2006 ===<br />
<br />
*[http://karuppuswamy.com/wordpress/2006/11/12/review-arch-linux-072/ Review: Arch Linux 0.7.2] swamytk - KaruppuSwamy.com 2006-11-12<br />
<br />
*[http://www.osnews.com/story/15075 Watching the Evolution of Arch Linux] Eugenia Loli-Queru - OSNews.com 2006-07-03<br />
<br />
*[http://distrowatch.com/?newsid=03456 Distribution Release: Arch Linux 0.7.2] DistroWatch.com 2006-05-23<br />
<br />
*[http://www.linux-magazine.com/issue/64/Arch_Linux_Review.pdf The Simplicity of Arch (PDF Document)] Jon Kent - Linux-Magazine Issue #64 2006-03<br />
<br />
*The Linux Link Tech Show - Interview with Judd Vinet, founder of Arch Linux Episode #122 2006-02-08<br />
<br />
*[http://distrowatch.com/?newsid=03157 Distribution Release: Arch Linux 0.7.1] DistroWatch.com 2006-01-05<br />
<br />
=== 2005 ===<br />
<br />
*The Linux Link Tech Show - Interview with James Rayner, creator of the Archie Live CD Episode #91 2005-07-06<br />
<br />
*[http://www.osnews.com/story/10142 The Big Arch Linux Interview] Eugenia Loli-Queru - OSNews.com 2005-03-29<br />
<br />
*[http://www.osnews.com/story/10047 Arch Linux: Why It Rocks] Eugenia Loli-Queru - OSNews.com 2005-03-21<br />
<br />
*[http://www.osnews.com/story/9836 Make your Arch Linux a Bluetooth Access Point] Eugenia Loli-Queru - OSNews.com 2005-02-27<br />
<br />
*[http://lwn.net/Articles/121784/ Arch Linux for Power Users] Ladislav Bodnar - Linux Weekly News 2005-02-02<br />
<br />
*[http://www.osnews.com/story/9540 A Week in the Life of an Arch Linux Newbie] Andrew Roberts - OSNews.com 2005-01-27<br />
<br />
*[http://distrowatch.com/?newsid=02291 Distribution Release: Arch Linux 0.7] DistroWatch.com 2005-01-25<br />
<br />
=== 2004 ===<br />
<br />
*[http://www.osnews.com/story/8761 Arch Linux Vs Slackware: The Best of All Worlds] Eugenia Loli-Queru - OSNews.com 2004-11-03<br />
<br />
*[http://discuss.extremetech.com/forums/thread/536482008.aspx WRBurns<nowiki>' </nowiki>Review of Arch Linux 0.6] WRBurns - ExtremeTech.com 2004-04-14<br />
<br />
*[http://www.linuxlookup.com/review/arch_linux_version_0_6_widget LinuxLookup: Arch Linux version 0.6 (Widget) Review] Ty - LinuxLookUp.com 2004-03-23<br />
<br />
*[http://distrowatch.com/?newsid=01410 Distribution Release: Arch Linux 0.6] DistroWatch.com 2004-03-01<br />
<br />
*[http://www.osnews.com/story/5971 Arch Linux: An End To My Distro Shuffle?] Andrew Barilla - OSNews.com 2004-02-10<br />
<br />
=== 2003 ===<br />
<br />
*[http://www.osnews.com/story/4827 Arch Linux: A Better Distribution] Ben Mazer - OSNews.com 2003-10-15<br />
<br />
*[http://distrowatch.com/dwres.php?resource=interview-arch Interview with Judd Vinet] Ladislav Bodnar - DistroWatch.com 2003-08-03<br />
<br />
*[http://lwn.net/Articles/42095/ My look at Arch Linux 0.2, 0.3, and 0.4] rabnud - Linux Weekly News 2003-08-01<br />
<br />
*[http://lwn.net/Articles/40952/ A Look at Arch Linux] Ladislav Bodnar - Linux Weekly News 2003-07-23<br />
<br />
*[http://distrowatch.com/?newsid=00870 Distribution Release: Arch Linux 0.5] DistroWatch.com 2003-07-21<br />
<br />
=== 2002 ===<br />
<br />
*[http://distrowatch.com/?newsid=00538 Distribution Release: Arch Linux 0.4] DistroWatch.com 2002-12-18<br />
<br />
*[http://www.osnews.com/story/2264 Introduction to Arch Linux] Jon <nowiki>"Trekboy" </nowiki>- OSNews.com 2002-12-01<br />
<br />
*[http://distrowatch.com/?newsid=00346 Distribution Release: Arch Linux 0.3] DistroWatch.com 2002-08-08<br />
<br />
*[http://distrowatch.com/?newsid=00201 Distribution Release: Arch Linux 0.2] DistroWatch.com 2002-04-18<br />
<br />
== Czech (Česky) ==<br />
<br />
=== 2005 ===<br />
<br />
*[http://www.abclinuxu.cz/clanky/recenze/arch-linux Arch Linux] ABCLinuxu.cz 2005-17-05<br />
<br />
== French (Français) ==<br />
<br />
=== 2009 ===<br />
<br />
*[http://www.frlinux.net/?section=distributions&article=235 ArchLinux 2009.2] FRLinux.net 2009-05-15<br />
<br />
=== 2006 ===<br />
<br />
*[http://www.frlinux.net/?section=distributions&article=176 Arch Linux 0.7.2] FRLinux.net 2006-03-09<br />
<br />
== German (Deutsch) ==<br />
<br />
[http://wiki.archlinux.de/title/Arch_in_den_Medien Arch in den Medien - German Arch Wiki Page]<br />
<br />
=== 2012 ===<br />
<br />
* [http://www.linux-magazin.de/NEWS/Arch-Linux-2012.12.01-mit-Kernel-3.6.8 linux-magazin] Arch Linux 2012.12.01 mit Kernel 3.6.8<br />
<br />
=== 2009 ===<br />
<br />
* [http://www.tecchannel.de/pc_mobile/news/1818880/linux_distribution_arch_linux_200902_steht_bereit/ tecchannel] Linux-Distribution Arch Linux 2009.02 steht bereit<br />
<br />
* [http://www.pro-linux.de/news/2009/13814.html Pro-Linux] Archlinux 2009.02 freigegeben<br />
<br />
* [http://www.heise.de/open/Arch-Linux-2009-02--/news/meldung/132693 Heise] Ankündigung der Installationsmedien 2009.02<br />
<br />
* [http://derstandard.at/?id=1234507285848 derstandard] Arch Linux 2009.02 veröffentlicht<br />
<br />
* [http://www.linux-magazin.de/news/arch_linux_mit_ext_4 linux-magazin] Arch Linux mit Ext 4<br />
<br />
=== 2008 ===<br />
<br />
* [http://freiesmagazin.de/mobil/freiesMagazin-2008-12-bilder.html#08_12_eeepc-archlinux freiesMagazin 12/2008] Arch Linux auf dem Asus Eee PC 901<br />
<br />
*Yalm Magazine 12/2008 Distri-Special: ArchLinux<br />
<br />
* [http://www.freiesmagazin.de/mobil/freiesMagazin-2008-10-bilder.html#08_10_ubuntu-vs-arch freiesMagazin 10/2008] Ubuntu versus Arch Linux - ein Vergleich<br />
<br />
* [http://futurezone.orf.at/hardcore/stories/288773 futurezone.ORF.at] - Arch Linux 2008.06 freigegeben<br />
<br />
* [http://www.pro-linux.de/news/2008/12857.html Pro-Linux] - Arch Linux 2008.06 freigegeben <br />
<br />
=== 2007 ===<br />
<br />
* [http://www.pro-linux.de/news/2007/11890.html Pro-Linux] - Arch Linux mit neuem Projektleiter<br />
<br />
* [http://www.pro-linux.de/news/2007/11829.html Pro-Linux] - Arch Linux 2007.08-2 "Don't Panic" freigegeben<br />
<br />
* [http://www.linux-magazin.de/news/arch_linux_und_zenwalk_in_neuauflage?category=0 Linux-Magazin] Arch Linux und Zenwalk in Neuauflage<br />
<br />
* [http://www.pro-linux.de/news/2007/11555.html Pro-Linux] - Arch Linux 2007.08 fertiggestellt<br />
<br />
* [http://www.linux-user.de/ausgabe/2007/07/905-dvd-arch/ Linux-User] - Arch Linux: Installation und Konfiguration<br />
<br />
* [http://www.linux-magazin.de/news/arch_linux_2007_5_duke_ist_fertig Linux-Magazin] Arch Linux 2007.5 "Duke" ist fertig<br />
<br />
* [http://www.pro-linux.de/berichte/archlinux-0.8.html Pro-Linux] - Erfahrungsbericht Arch Linux 0.8<br />
<br />
* [http://www.pro-linux.de/news/2007/11033.html Pro-Linux] - Arch Linux 0.8 (Voodoo) fertiggestellt<br />
<br />
* [http://www.linux-magazin.de/news/archlinux_erscheint_in_version_0_8 Linux-Magazin] - Archlinux erscheint in Version 0.8<br />
<br />
* [http://www.tecchannel.de/news/themen/linux/466414/index.html tecCHANNEL] - Linux: Voodoo ist fertig<br />
<br />
* [http://www.linux-abos.de/news/2007/04/02/arch-linux-08-voodoo-fertiggestellt/ Linux-Abos] - Arch Linux 0.8 (Voodoo) fertiggestellt<br />
<br />
=== 2006 ===<br />
<br />
* [http://www.tecchannel.de/pc_mobile/linux/454188/index2.html tecCHANNEL] - 32 Linux Distributionen für den Client-Einsatz<br />
<br />
* [http://www.tecchannel.de/server/linux/447420/index2.html tecCHANNEL] - 25 Linux Distributionen für den Server-Einsatz<br />
<br />
=== 2005 ===<br />
<br />
* [http://www.linux-user.de/ausgabe/2005/10/006-archlinux/index.html Linux-User] - Arch Linux: Einfache Handhabung, volle Flexibilität<br />
<br />
== Hebrew (עִבְרִית) ==<br />
<br />
=== 2006 ===<br />
<br />
*[http://linmagazine.co.il/archlinux/noodle ArchLinux] usharf - LinMagazine.co.il 2006-02-04<br />
<br />
== Portuguese (Português) ==<br />
<br />
=== 2009 ===<br />
<br />
*[http://www.guiadopc.com.br/analises/analises-de-softwares/8739/arch-linux-leveza-e-simplicidade.html Arch Linux: Leveza e simplicidade] Paulo Seikishi Higa - GuiadoPC.com.br 2009-21-03<br />
<br />
== Spanish (Español) ==<br />
<br />
=== 2009 ===<br />
<br />
*[http://www.muylinux.com/2009/04/13/infidelidad/ Infidelidad] muylinux.com 2009-04-13<br />
<br />
*[http://www.pctux.com.ar/2009/03/ventajas-y-desventajas-de-arch-linux-frente-a-otras-distribuciones.html Ventajas y Desventajas de Arch Linux frente a otras distribuciones] pctux.com.ar 2009-03-20<br />
<br />
=== 2007 ===<br />
<br />
*[http://skatox.com/blog/2007/04/20/analisis-review-de-archlinux-08-voodoo/ Analisis ( Review ) de Archlinux 0.8 Voodoo] Miguel Useche - Skatox.com 2007-04-20</div>Cinellihttps://wiki.archlinux.org/index.php?title=Systemd/User&diff=250208Systemd/User2013-03-11T09:18:46Z<p>Cinelli: /* Persistent terminal multiplexer */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[es:Systemd/User]]<br />
[[it:Systemd/User]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers how to set up [[systemd]] user sessions.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|systemd}}<br />
{{Article summary end}}<br />
<br />
[[systemd]] offers users the ability to run an instance of [[systemd]] to manage their session and services. This allows users to start, stop, enable, and disable units found within certain directories when systemd is run by the user. This is convenient for daemons and other services that are commonly run as a user other than root or a special user, such as [[mpd]].<br />
<br />
== Setup ==<br />
<br />
=== startx ===<br />
<br />
{{Note|This step is unnecessary if you plan to use autologin.}}<br />
<br />
Users should first set up systemd-logind to manage their session. If [[systemd]] is running as the system init daemon, then this is already happening.<br />
<br />
Next, the user must launch systemd by putting the following in their {{ic|~/.xinitrc}}.<br />
{{bc|systemd --user}}<br />
If the user is not launching the window manager through systemd --user, then {{bc|systemd --user &}} should be used and launched like anything else in {{ic|~/.xinitrc}}, before execing the window manager.<br />
<br />
After starting X, the user can check whether their session is now being managed by systemd-logind with the following command:<br />
<br />
{{bc|<nowiki><br />
$ loginctl --no-pager show-session $XDG_SESSION_ID | grep Active<br />
</nowiki>}}<br />
<br />
If this command prints {{ic|1=Active=yes}}, then the user is now using systemd-logind to manage their session. The user should remove any instances of '''ck-launch-session''' or '''dbus-launch''' from their {{ic|~/.xinitrc}}, as those commands are unneeded.<br />
<br />
=== Display Managers ===<br />
All of the major display managers are now using systemd-logind by default, so the {{ic|loginctl}} command from the previous section should work as stated. A user simply has to add {{ic|systemd --user}} as a program to be started by their desktop environment.<br />
<br />
==== GNOME 3 (using GDM) ====<br />
For users who wish to have GDM/GNOME 3 auto-start their {{ic|systemd --user}} session upon login, they just need to add a special log in session for this:<br />
{{hc|/usr/share/xsessions/gnome-systemd.desktop|<nowiki><br />
[Desktop Entry]<br />
Type=Application<br />
Name=systemd<br />
Comment=Runs 'systemd' as a user instance.<br />
Exec=/usr/lib/systemd/systemd --user<br />
</nowiki>}}<br />
<br />
Make sure to choose the {{ic|systemd}} session option at the GDM login screen.<br />
{{Note|This has only been tested with a pure GDM and GNOME 3 setup. For other set ups, YYMV. This method does not need the systemd user-session scripts installed.}}<br />
<br />
=== Using systemd --user To Manage Your Session ===<br />
<br />
Systemd has many amazing features, one of which is the ability to track programs using cgroups (by running {{ic|systemctl status}}). While awesome for a '''pid 1''' process to do, it is also extremely useful for users, and having it set up and initialize user programs, all the while tracking what is in each cgroup is even more amazing.<br />
<br />
All of your systemd user units will go to {{ic|$HOME/.config/systemd/user}}. These units take precedence over units in other systemd unit directories.<br />
<br />
There are two packages you need to get this working, both currently available from the [[AUR]]: {{AUR|xorg-launch-helper}} and optionally, {{AUR|user-session-units}} if you want to have autologin working. <br />
<br />
Next is setting up your targets. You should set up two, one for window manager and another as a default target. The window manager target should be populated like so:<br />
<br />
{{hc|$HOME/.config/systemd/user/wm.target|<nowiki><br />
[Unit]<br />
Description=Window manager target<br />
Wants=xorg.target<br />
Wants=myStuff.target<br />
Requires=dbus.socket<br />
AllowIsolate=true<br />
<br />
[Install]<br />
Alias=default.target<br />
</nowiki>}}<br />
This will be the target for your graphical interface.<br />
<br />
Put together a second target called {{ic|mystuff.target}}. All services but your window manager should contain a {{ic|WantedBy}} line, under {{ic|[Install]}}, pointing at this unit.<br />
<br />
{{hc|$HOME/.config/systemd/user/mystuff.target|<nowiki><br />
[Unit]<br />
Description=Xinitrc Stuff<br />
Wants=wm.target<br />
<br />
[Install]<br />
Alias=default.target<br />
</nowiki>}}<br />
<br />
Link this unit to {{ic|default.target}}. When you start {{ic|systemd --user}}, it will start this target. <br />
<br />
Next you need to begin writing services. First you should throw together a service for your window manager:<br />
<br />
{{hc|$HOME/.config/systemd/user/YOUR_WM.service|<nowiki><br />
[Unit]<br />
Description=your window manager service<br />
Before=mystuff.target<br />
After=xorg.target<br />
Requires=xorg.target<br />
<br />
[Service]<br />
#Environment=PATH=uncomment:to:override:your:PATH<br />
ExecStart=/full/path/to/wm/executable<br />
Restart=always<br />
RestartSec=10<br />
<br />
[Install]<br />
WantedBy=wm.target<br />
</nowiki>}}<br />
<br />
{{Note|The {{ic|[Install]}} section includes a 'WantedBy' part. When using {{ic|systemctl --user enable}} it will link this as {{ic|$HOME/.config/systemd/user/wm.target.wants/i3.service}}, allowing it to be started at login. Is recommended enabling this service, not linking it manually.}}<br />
<br />
You can fill your user unit directory with a plethora of services, including ones for '''mpd''', '''gpg-agent''', '''offlineimap''', '''parcellite''', '''pulse''', '''tmux''', '''urxvtd''', '''xbindkeys''' and '''xmodmap''' to name a few.<br />
<br />
===Auto-login===<br />
<br />
If you want to have systemd automatically log you in on boot, then you can use the unit in user-session-units to do so. Enabling a screen locker for will stop someone from booting your computer into a nice, logged in session. <br />
<br />
If you installed user-session-units as listed above, then you must copy {{ic|user-session@.service}} to {{ic|/etc/systemd/system}} directory and edit the {{ic|user-session@.service}} (not the {{ic|user-session@yourloginname.service}}) and edit this line: <br />
<br />
{{bc|1=Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket}}<br />
<br />
to this: <br />
<br />
{{bc|1=Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket}}<br />
<br />
{{Note|Notice the subtle change where {{ic|%I}} is replaced by {{ic|%U}}}}<br />
As well as an install section:<br />
<br />
{{bc|1=<br />
[Install]<br />
WantedBy=graphical.target<br />
}}<br />
<br />
or if you have no login manager:<br />
<br />
{{bc|1=<br />
[Install]<br />
WantedBy=getty.target<br />
}}<br />
<br />
You will need to patch systemd to do this, so either using '''systemd-git''' from after [http://cgit.freedesktop.org/systemd/systemd/commit/?id=067d851d30386c553e3a84f59d81d003ff638b91 commit 067d851d] or patch it into systemd with the [[ABS]]. After 197, it should be in the mainline systemd.<br />
<br />
Add this line to {{ic|/etc/pam.d/login}} and {{ic|/etc/pam.d/system-auth}}:<br />
<br />
{{bc|session required pam_systemd.so}}<br />
<br />
Because {{ic|user-session@.service}} starts on tty1, you will need to add {{ic|1=Conflicts=getty@tty1.service}} to the service file.<br />
<br />
One of the most important things you can add to the service files you will be writing is the use of {{ic|1=Before=}} and {{ic|1=After=}} in the {{ic|[Unit]}} section. These two parts will determine the order things are started. Say you have a graphical application you want to start on boot, you would put {{ic|1=After=xorg.target}} into your unit. Say you start '''ncmpcpp''', which requires '''mpd''' to start, you can put {{ic|1=After=mpd.service}} into your ncmpcpp unit. You will eventually figure out exactly how this needs to go either from experience or from reading the systemd manual pages. Starting with [http://www.freedesktop.org/software/systemd/man/systemd.unit.html systemd.unit(5)] is a good idea.<br />
<br />
=== Other use cases ===<br />
<br />
==== Persistent terminal multiplexer ====<br />
<br />
You may wish your user session to default to running a terminal multiplexer, such as [[GNU Screen]] or [[Tmux]], in the background rather than logging you in to a window manager session. Separating login from X login is most likely only useful for those who boot to a TTY instead of to a display manager (in which case you can simply bundle everything you start in with myStuff.target). <br />
<br />
To create this type of user session, procede as above, but instead of creating wm.target, create multiplexer.target:<br />
<br />
{{bc|1=<br />
[Unit]<br />
Description=Terminal multiplexer<br />
Documentation=info:screen man:screen(1) man:tmux(1)<br />
After=cruft.target<br />
Wants=cruft.target<br />
<br />
[Install]<br />
Alias=default.target<br />
}}<br />
<br />
{{ic|cruft.target}}, like myStuff.target above, should start anything you think should run before tmux or screen starts (or which you want started at boot regardless of timing), such as a GnuPG daemon session.<br />
<br />
You then need to create a service for your multiplexer session. Here's a sample service, using tmux as an example and sourcing a gpg-agent session which wrote its information to /tmp/gpg-agent-info. This sample session, when you start X, will also be able to run X programs, since DISPLAY is set.<br />
<br />
{{bc|1=<br />
[Unit]<br />
Description=tmux: A terminal multiplixer Documentation=man:tmux(1)<br />
After=gpg-agent.service<br />
Wants=gpg-agent.service<br />
<br />
[Service]<br />
Type=forking<br />
ExecStart=/usr/bin/tmux start<br />
ExecStop=/usr/bin/tmux kill-server<br />
Environment=DISPLAY=:0<br />
EnvironmentFile=/tmp/gpg-agent-info<br />
<br />
[Install]<br />
WantedBy=multiplexer.target<br />
}}<br />
<br />
Once this is done, {{ic|systemctl --user enable}} {{ic|tmux.service}}, {{ic|multiplexer.target}} and any services you created to be run by {{ic|cruft.target}} and you should be set to go! Activated {{ic|user-session@.service}} as described above, but be sure to remove the {{ic|1=Conflicts=getty@tty1.service}} from {{ic|user-session@.service}}, since your user session will not be taking over a TTY. Congratulations! You have a running terminal multiplexer and some other useful programs ready to start at boot!<br />
<br />
===== Starting X =====<br />
<br />
You've probably noticed that, since the terminal multiplexer is now {{ic|default.target}}, X will not start automatically at boot. To start X, procede as above, but do not activate or manually link to {{ic|default.target}} {{ic|wm.target}}. Instead, assuming you're booting to a terminal, we'll simply be using a hackish workaround and masking {{ic|/usr/bin/startx}} with a shell alias:<br />
<br />
{{bc|1=alias startx='systemctl --user start wm.target'}}<br />
<br />
== User Services ==<br />
Users may now interact with units located in the following directories just as they would with system services (ordered by ascending precedence):<br />
* {{ic|/usr/lib/systemd/user/}}<br />
* {{ic|/etc/systemd/user/}}<br />
* {{ic|~/.config/systemd/user/}}<br />
To control the systemd instance, the user must use the command {{ic|systemctl --user}}.<br />
=== Installed by packages ===<br />
A unit installed by a package that is meant to be run by a [[systemd]] user instance should install the unit to {{ic|/usr/lib/systemd/user/}}. The system adminstration can then modify the unit by copying it to {{ic|/etc/systemd/user/}}. A user can then modify the unit by copying it to {{ic|~/.config/systemd/user/}}.<br />
=== Example ===<br />
The following is an example of a user version of the mpd service.<br />
{{hc|mpd.service|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon<br />
<br />
[Service]<br />
ExecStart=/usr/bin/mpd --no-daemon<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
=== Example with variables ===<br />
The following is an example of a user version of {{ic|sickbeard.service}}, which takes into account variable home directories where SickBeard can find certain files:<br />
{{hc|sickbeard.service|<nowiki><br />
[Unit]<br />
Description=SickBeard Daemon<br />
<br />
[Service]<br />
ExecStart=/usr/bin/env python2 /opt/sickbeard/SickBeard.py --config %h/.sickbeard/config.ini --datadir %h/.sickbeard<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
<br />
As detailed in {{ic|man systemd.unit}}, the {{ic|%h}} variable is replaced by the home directory of the user running the service. There are other variables that can be taken into account in the [[systemd]] manpages.<br />
<br />
== See also ==<br />
* [http://blog.gtmanfred.com/?p=26 gtmanfred's guide - the original guide]<br />
* [https://bitbucket.org/KaiSforza/systemd-user-units/wiki/Home KaiSforza's bitbucket wiki]<br />
* [https://github.com/grawity/systemd-user-units Collection of useful systemd user units]<br />
* [https://bitbucket.org/KaiSforza/systemd-user-units More systemd user units]</div>Cinellihttps://wiki.archlinux.org/index.php?title=Systemd/User&diff=250163Systemd/User2013-03-11T00:43:53Z<p>Cinelli: /* Auto-login */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[es:Systemd/User]]<br />
[[it:Systemd/User]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers how to set up [[systemd]] user sessions.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|systemd}}<br />
{{Article summary end}}<br />
<br />
[[systemd]] offers users the ability to run an instance of [[systemd]] to manage their session and services. This allows users to start, stop, enable, and disable units found within certain directories when systemd is run by the user. This is convenient for daemons and other services that are commonly run as a user other than root or a special user, such as [[mpd]].<br />
<br />
== Setup ==<br />
<br />
=== startx ===<br />
<br />
{{Note|This step is unnecessary if you plan to use autologin.}}<br />
<br />
Users should first set up systemd-logind to manage their session. If [[systemd]] is running as the system init daemon, then this is already happening.<br />
<br />
Next, the user must launch systemd by putting the following in their {{ic|~/.xinitrc}}.<br />
{{bc|systemd --user}}<br />
If the user is not launching the window manager through systemd --user, then {{bc|systemd --user &}} should be used and launched like anything else in {{ic|~/.xinitrc}}, before execing the window manager.<br />
<br />
After starting X, the user can check whether their session is now being managed by systemd-logind with the following command:<br />
<br />
{{bc|<nowiki><br />
$ loginctl --no-pager show-session $XDG_SESSION_ID | grep Active<br />
</nowiki>}}<br />
<br />
If this command prints {{ic|1=Active=yes}}, then the user is now using systemd-logind to manage their session. The user should remove any instances of '''ck-launch-session''' or '''dbus-launch''' from their {{ic|~/.xinitrc}}, as those commands are unneeded.<br />
<br />
=== Display Managers ===<br />
All of the major display managers are now using systemd-logind by default, so the {{ic|loginctl}} command from the previous section should work as stated. A user simply has to add {{ic|systemd --user}} as a program to be started by their desktop environment.<br />
<br />
==== GNOME 3 (using GDM) ====<br />
For users who wish to have GDM/GNOME 3 auto-start their {{ic|systemd --user}} session upon login, they just need to add a special log in session for this:<br />
{{hc|/usr/share/xsessions/gnome-systemd.desktop|<nowiki><br />
[Desktop Entry]<br />
Type=Application<br />
Name=systemd<br />
Comment=Runs 'systemd' as a user instance.<br />
Exec=/usr/lib/systemd/systemd --user<br />
</nowiki>}}<br />
<br />
Make sure to choose the {{ic|systemd}} session option at the GDM login screen.<br />
{{Note|This has only been tested with a pure GDM and GNOME 3 setup. For other set ups, YYMV. This method does not need the systemd user-session scripts installed.}}<br />
<br />
=== Using systemd --user To Manage Your Session ===<br />
<br />
Systemd has many amazing features, one of which is the ability to track programs using cgroups (by running {{ic|systemctl status}}). While awesome for a '''pid 1''' process to do, it is also extremely useful for users, and having it set up and initialize user programs, all the while tracking what is in each cgroup is even more amazing.<br />
<br />
All of your systemd user units will go to {{ic|$HOME/.config/systemd/user}}. These units take precedence over units in other systemd unit directories.<br />
<br />
There are two packages you need to get this working, both currently available from the [[AUR]]: {{AUR|xorg-launch-helper}} and optionally, {{AUR|user-session-units}} if you want to have autologin working. <br />
<br />
Next is setting up your targets. You should set up two, one for window manager and another as a default target. The window manager target should be populated like so:<br />
<br />
{{hc|$HOME/.config/systemd/user/wm.target|<nowiki><br />
[Unit]<br />
Description=Window manager target<br />
Wants=xorg.target<br />
Wants=myStuff.target<br />
Requires=dbus.socket<br />
AllowIsolate=true<br />
<br />
[Install]<br />
Alias=default.target<br />
</nowiki>}}<br />
This will be the target for your graphical interface.<br />
<br />
Put together a second target called {{ic|mystuff.target}}. All services but your window manager should contain a {{ic|WantedBy}} line, under {{ic|[Install]}}, pointing at this unit.<br />
<br />
{{hc|$HOME/.config/systemd/user/mystuff.target|<nowiki><br />
[Unit]<br />
Description=Xinitrc Stuff<br />
Wants=wm.target<br />
<br />
[Install]<br />
Alias=default.target<br />
</nowiki>}}<br />
<br />
Link this unit to {{ic|default.target}}. When you start {{ic|systemd --user}}, it will start this target. <br />
<br />
Next you need to begin writing services. First you should throw together a service for your window manager:<br />
<br />
{{hc|$HOME/.config/systemd/user/YOUR_WM.service|<nowiki><br />
[Unit]<br />
Description=your window manager service<br />
Before=mystuff.target<br />
After=xorg.target<br />
Requires=xorg.target<br />
<br />
[Service]<br />
#Environment=PATH=uncomment:to:override:your:PATH<br />
ExecStart=/full/path/to/wm/executable<br />
Restart=always<br />
RestartSec=10<br />
<br />
[Install]<br />
WantedBy=wm.target<br />
</nowiki>}}<br />
<br />
{{Note|The {{ic|[Install]}} section includes a 'WantedBy' part. When using {{ic|systemctl --user enable}} it will link this as {{ic|$HOME/.config/systemd/user/wm.target.wants/i3.service}}, allowing it to be started at login. Is recommended enabling this service, not linking it manually.}}<br />
<br />
You can fill your user unit directory with a plethora of services, including ones for '''mpd''', '''gpg-agent''', '''offlineimap''', '''parcellite''', '''pulse''', '''tmux''', '''urxvtd''', '''xbindkeys''' and '''xmodmap''' to name a few.<br />
<br />
===Auto-login===<br />
<br />
If you want to have systemd automatically log you in on boot, then you can use the unit in user-session-units to do so. Enabling a screen locker for will stop someone from booting your computer into a nice, logged in session. <br />
<br />
If you installed user-session-units as listed above, then you must copy {{ic|user-session@.service}} to {{ic|/etc/systemd/system}} directory and edit the {{ic|user-session@.service}} (not the {{ic|user-session@yourloginname.service}}) and edit this line: <br />
<br />
{{bc|1=Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket}}<br />
<br />
to this: <br />
<br />
{{bc|1=Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket}}<br />
<br />
{{Note|Notice the subtle change where {{ic|%I}} is replaced by {{ic|%U}}}}<br />
As well as an install section:<br />
<br />
{{bc|1=<br />
[Install]<br />
WantedBy=graphical.target<br />
}}<br />
<br />
or if you have no login manager:<br />
<br />
{{bc|1=<br />
[Install]<br />
WantedBy=getty.target<br />
}}<br />
<br />
You will need to patch systemd to do this, so either using '''systemd-git''' from after [http://cgit.freedesktop.org/systemd/systemd/commit/?id=067d851d30386c553e3a84f59d81d003ff638b91 commit 067d851d] or patch it into systemd with the [[ABS]]. After 197, it should be in the mainline systemd.<br />
<br />
Add this line to {{ic|/etc/pam.d/login}} and {{ic|/etc/pam.d/system-auth}}:<br />
<br />
{{bc|session required pam_systemd.so}}<br />
<br />
Because {{ic|user-session@.service}} starts on tty1, you will need to add {{ic|1=Conflicts=getty@tty1.service}} to the service file.<br />
<br />
One of the most important things you can add to the service files you will be writing is the use of {{ic|1=Before=}} and {{ic|1=After=}} in the {{ic|[Unit]}} section. These two parts will determine the order things are started. Say you have a graphical application you want to start on boot, you would put {{ic|1=After=xorg.target}} into your unit. Say you start '''ncmpcpp''', which requires '''mpd''' to start, you can put {{ic|1=After=mpd.service}} into your ncmpcpp unit. You will eventually figure out exactly how this needs to go either from experience or from reading the systemd manual pages. Starting with [http://www.freedesktop.org/software/systemd/man/systemd.unit.html systemd.unit(5)] is a good idea.<br />
<br />
=== Other use cases ===<br />
<br />
==== Persistent terminal multiplexer ====<br />
<br />
You may wish your user session to default to running a terminal multiplexer, such as [[GNU Screen]] or [[Tmux]], in the background rather than logging you in to a window manager session. Separating login from X login is most likely only useful for those who boot to a TTY instead of to a display manager (in which case you can simply bundle everything you start in with myStuff.target). <br />
<br />
To create this type of user session, procede as above, but instead of creating wm.target, create multiplexer.target:<br />
<br />
{{bc|1=<br />
[Unit]<br />
Description=Terminal multiplexer<br />
Documentation=info:screen man:screen(1) man:tmux(1)<br />
After=cruft.target<br />
Wants=cruft.target<br />
<br />
[Install]<br />
Alias=default.target<br />
}}<br />
<br />
{{ic|cruft.target}}, like myStuff.target above, should start anything you think should run before tmux or screen starts (or which you want started at boot regardless of timing), such as a GnuPG daemon session.<br />
<br />
You then need to create a service for your multiplexer session. Here's a sample service, using tmux as an example and sourcing a gpg-agent session which wrote its information to /tmp/gpg-agent-info. This sample session, when you start X, will also be able to run X programs, since DISPLAY is set.<br />
<br />
{{bc|1=<br />
[Unit]<br />
Description=tmux: A terminal multiplixer Documentation=man:tmux(1)<br />
After=gpg-agent.service<br />
Wants=gpg-agent.service<br />
<br />
[Service]<br />
Type=forking<br />
ExecStart=/usr/bin/tmux start<br />
ExecStop=/usr/bin/tmux kill-server<br />
Environment=DISPLAY=:0<br />
EnvironmentFile=/tmp/gpg-agent-info<br />
<br />
[Install]<br />
WantedBy=multiplexer.target<br />
}}<br />
<br />
Once this is done, {{ic|systemctl --user activate}} {{ic|tmux.service}}, {{ic|multiplexer.target}} and any services you created to be run by {{ic|cruft.target}} and you should be set to go! Activated {{ic|user-session@.service}} as described above, but be sure to remove the {{ic|1=Conflicts=getty@tty1.service}} from {{ic|user-session@.service}}, since your user session will not be taking over a TTY. Congratulations! You have a running terminal multiplexer and some other useful programs ready to start at boot!<br />
<br />
===== Starting X =====<br />
<br />
You've probably noticed that, since the terminal multiplexer is now {{ic|default.target}}, X will not start automatically at boot. To start X, procede as above, but do not activate or manually link to {{ic|default.target}} {{ic|wm.target}}. Instead, assuming you're booting to a terminal, we'll simply be using a hackish workaround and masking {{ic|/usr/bin/startx}} with a shell alias:<br />
<br />
{{bc|1=alias startx='systemctl --user start wm.target'}}<br />
<br />
== User Services ==<br />
Users may now interact with units located in the following directories just as they would with system services (ordered by ascending precedence):<br />
* {{ic|/usr/lib/systemd/user/}}<br />
* {{ic|/etc/systemd/user/}}<br />
* {{ic|~/.config/systemd/user/}}<br />
To control the systemd instance, the user must use the command {{ic|systemctl --user}}.<br />
=== Installed by packages ===<br />
A unit installed by a package that is meant to be run by a [[systemd]] user instance should install the unit to {{ic|/usr/lib/systemd/user/}}. The system adminstration can then modify the unit by copying it to {{ic|/etc/systemd/user/}}. A user can then modify the unit by copying it to {{ic|~/.config/systemd/user/}}.<br />
=== Example ===<br />
The following is an example of a user version of the mpd service.<br />
{{hc|mpd.service|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon<br />
<br />
[Service]<br />
ExecStart=/usr/bin/mpd --no-daemon<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
=== Example with variables ===<br />
The following is an example of a user version of {{ic|sickbeard.service}}, which takes into account variable home directories where SickBeard can find certain files:<br />
{{hc|sickbeard.service|<nowiki><br />
[Unit]<br />
Description=SickBeard Daemon<br />
<br />
[Service]<br />
ExecStart=/usr/bin/env python2 /opt/sickbeard/SickBeard.py --config %h/.sickbeard/config.ini --datadir %h/.sickbeard<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
<br />
As detailed in {{ic|man systemd.unit}}, the {{ic|%h}} variable is replaced by the home directory of the user running the service. There are other variables that can be taken into account in the [[systemd]] manpages.<br />
<br />
== See also ==<br />
* [http://blog.gtmanfred.com/?p=26 gtmanfred's guide - the original guide]<br />
* [https://bitbucket.org/KaiSforza/systemd-user-units/wiki/Home KaiSforza's bitbucket wiki]<br />
* [https://github.com/grawity/systemd-user-units Collection of useful systemd user units]<br />
* [https://bitbucket.org/KaiSforza/systemd-user-units More systemd user units]</div>Cinellihttps://wiki.archlinux.org/index.php?title=Systemd/User&diff=250162Systemd/User2013-03-11T00:42:47Z<p>Cinelli: /* Auto-login */ fixed wording in note for %I %U change</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[es:Systemd/User]]<br />
[[it:Systemd/User]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers how to set up [[systemd]] user sessions.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|systemd}}<br />
{{Article summary end}}<br />
<br />
[[systemd]] offers users the ability to run an instance of [[systemd]] to manage their session and services. This allows users to start, stop, enable, and disable units found within certain directories when systemd is run by the user. This is convenient for daemons and other services that are commonly run as a user other than root or a special user, such as [[mpd]].<br />
<br />
== Setup ==<br />
<br />
=== startx ===<br />
<br />
{{Note|This step is unnecessary if you plan to use autologin.}}<br />
<br />
Users should first set up systemd-logind to manage their session. If [[systemd]] is running as the system init daemon, then this is already happening.<br />
<br />
Next, the user must launch systemd by putting the following in their {{ic|~/.xinitrc}}.<br />
{{bc|systemd --user}}<br />
If the user is not launching the window manager through systemd --user, then {{bc|systemd --user &}} should be used and launched like anything else in {{ic|~/.xinitrc}}, before execing the window manager.<br />
<br />
After starting X, the user can check whether their session is now being managed by systemd-logind with the following command:<br />
<br />
{{bc|<nowiki><br />
$ loginctl --no-pager show-session $XDG_SESSION_ID | grep Active<br />
</nowiki>}}<br />
<br />
If this command prints {{ic|1=Active=yes}}, then the user is now using systemd-logind to manage their session. The user should remove any instances of '''ck-launch-session''' or '''dbus-launch''' from their {{ic|~/.xinitrc}}, as those commands are unneeded.<br />
<br />
=== Display Managers ===<br />
All of the major display managers are now using systemd-logind by default, so the {{ic|loginctl}} command from the previous section should work as stated. A user simply has to add {{ic|systemd --user}} as a program to be started by their desktop environment.<br />
<br />
==== GNOME 3 (using GDM) ====<br />
For users who wish to have GDM/GNOME 3 auto-start their {{ic|systemd --user}} session upon login, they just need to add a special log in session for this:<br />
{{hc|/usr/share/xsessions/gnome-systemd.desktop|<nowiki><br />
[Desktop Entry]<br />
Type=Application<br />
Name=systemd<br />
Comment=Runs 'systemd' as a user instance.<br />
Exec=/usr/lib/systemd/systemd --user<br />
</nowiki>}}<br />
<br />
Make sure to choose the {{ic|systemd}} session option at the GDM login screen.<br />
{{Note|This has only been tested with a pure GDM and GNOME 3 setup. For other set ups, YYMV. This method does not need the systemd user-session scripts installed.}}<br />
<br />
=== Using systemd --user To Manage Your Session ===<br />
<br />
Systemd has many amazing features, one of which is the ability to track programs using cgroups (by running {{ic|systemctl status}}). While awesome for a '''pid 1''' process to do, it is also extremely useful for users, and having it set up and initialize user programs, all the while tracking what is in each cgroup is even more amazing.<br />
<br />
All of your systemd user units will go to {{ic|$HOME/.config/systemd/user}}. These units take precedence over units in other systemd unit directories.<br />
<br />
There are two packages you need to get this working, both currently available from the [[AUR]]: {{AUR|xorg-launch-helper}} and optionally, {{AUR|user-session-units}} if you want to have autologin working. <br />
<br />
Next is setting up your targets. You should set up two, one for window manager and another as a default target. The window manager target should be populated like so:<br />
<br />
{{hc|$HOME/.config/systemd/user/wm.target|<nowiki><br />
[Unit]<br />
Description=Window manager target<br />
Wants=xorg.target<br />
Wants=myStuff.target<br />
Requires=dbus.socket<br />
AllowIsolate=true<br />
<br />
[Install]<br />
Alias=default.target<br />
</nowiki>}}<br />
This will be the target for your graphical interface.<br />
<br />
Put together a second target called {{ic|mystuff.target}}. All services but your window manager should contain a {{ic|WantedBy}} line, under {{ic|[Install]}}, pointing at this unit.<br />
<br />
{{hc|$HOME/.config/systemd/user/mystuff.target|<nowiki><br />
[Unit]<br />
Description=Xinitrc Stuff<br />
Wants=wm.target<br />
<br />
[Install]<br />
Alias=default.target<br />
</nowiki>}}<br />
<br />
Link this unit to {{ic|default.target}}. When you start {{ic|systemd --user}}, it will start this target. <br />
<br />
Next you need to begin writing services. First you should throw together a service for your window manager:<br />
<br />
{{hc|$HOME/.config/systemd/user/YOUR_WM.service|<nowiki><br />
[Unit]<br />
Description=your window manager service<br />
Before=mystuff.target<br />
After=xorg.target<br />
Requires=xorg.target<br />
<br />
[Service]<br />
#Environment=PATH=uncomment:to:override:your:PATH<br />
ExecStart=/full/path/to/wm/executable<br />
Restart=always<br />
RestartSec=10<br />
<br />
[Install]<br />
WantedBy=wm.target<br />
</nowiki>}}<br />
<br />
{{Note|The {{ic|[Install]}} section includes a 'WantedBy' part. When using {{ic|systemctl --user enable}} it will link this as {{ic|$HOME/.config/systemd/user/wm.target.wants/i3.service}}, allowing it to be started at login. Is recommended enabling this service, not linking it manually.}}<br />
<br />
You can fill your user unit directory with a plethora of services, including ones for '''mpd''', '''gpg-agent''', '''offlineimap''', '''parcellite''', '''pulse''', '''tmux''', '''urxvtd''', '''xbindkeys''' and '''xmodmap''' to name a few.<br />
<br />
===Auto-login===<br />
<br />
If you want to have systemd automatically log you in on boot, then you can use the unit in user-session-units to do so. Enabling a screen locker for will stop someone from booting your computer into a nice, logged in session. <br />
<br />
If you installed user-session-units as listed above, then you must copy {{ic|user-session@.service}} to {{ic|/etc/systemd/system}} directory and edit the {{ic|user-session@.service}} (not the {{ic|user-session@yourloginname.service}}) and edit this line: <br />
<br />
{{bc|1=Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket}}<br />
<br />
to this: <br />
<br />
{{bc|1=Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket}}<br />
<br />
{{Note|Notice the subtle change where {{ic|%I}} is replaced by {{ic|%U}})}}<br />
As well as an install section:<br />
<br />
{{bc|1=<br />
[Install]<br />
WantedBy=graphical.target<br />
}}<br />
<br />
or if you have no login manager:<br />
<br />
{{bc|1=<br />
[Install]<br />
WantedBy=getty.target<br />
}}<br />
<br />
You will need to patch systemd to do this, so either using '''systemd-git''' from after [http://cgit.freedesktop.org/systemd/systemd/commit/?id=067d851d30386c553e3a84f59d81d003ff638b91 commit 067d851d] or patch it into systemd with the [[ABS]]. After 197, it should be in the mainline systemd.<br />
<br />
Add this line to {{ic|/etc/pam.d/login}} and {{ic|/etc/pam.d/system-auth}}:<br />
<br />
{{bc|session required pam_systemd.so}}<br />
<br />
Because {{ic|user-session@.service}} starts on tty1, you will need to add {{ic|1=Conflicts=getty@tty1.service}} to the service file.<br />
<br />
One of the most important things you can add to the service files you will be writing is the use of {{ic|1=Before=}} and {{ic|1=After=}} in the {{ic|[Unit]}} section. These two parts will determine the order things are started. Say you have a graphical application you want to start on boot, you would put {{ic|1=After=xorg.target}} into your unit. Say you start '''ncmpcpp''', which requires '''mpd''' to start, you can put {{ic|1=After=mpd.service}} into your ncmpcpp unit. You will eventually figure out exactly how this needs to go either from experience or from reading the systemd manual pages. Starting with [http://www.freedesktop.org/software/systemd/man/systemd.unit.html systemd.unit(5)] is a good idea.<br />
<br />
=== Other use cases ===<br />
<br />
==== Persistent terminal multiplexer ====<br />
<br />
You may wish your user session to default to running a terminal multiplexer, such as [[GNU Screen]] or [[Tmux]], in the background rather than logging you in to a window manager session. Separating login from X login is most likely only useful for those who boot to a TTY instead of to a display manager (in which case you can simply bundle everything you start in with myStuff.target). <br />
<br />
To create this type of user session, procede as above, but instead of creating wm.target, create multiplexer.target:<br />
<br />
{{bc|1=<br />
[Unit]<br />
Description=Terminal multiplexer<br />
Documentation=info:screen man:screen(1) man:tmux(1)<br />
After=cruft.target<br />
Wants=cruft.target<br />
<br />
[Install]<br />
Alias=default.target<br />
}}<br />
<br />
{{ic|cruft.target}}, like myStuff.target above, should start anything you think should run before tmux or screen starts (or which you want started at boot regardless of timing), such as a GnuPG daemon session.<br />
<br />
You then need to create a service for your multiplexer session. Here's a sample service, using tmux as an example and sourcing a gpg-agent session which wrote its information to /tmp/gpg-agent-info. This sample session, when you start X, will also be able to run X programs, since DISPLAY is set.<br />
<br />
{{bc|1=<br />
[Unit]<br />
Description=tmux: A terminal multiplixer Documentation=man:tmux(1)<br />
After=gpg-agent.service<br />
Wants=gpg-agent.service<br />
<br />
[Service]<br />
Type=forking<br />
ExecStart=/usr/bin/tmux start<br />
ExecStop=/usr/bin/tmux kill-server<br />
Environment=DISPLAY=:0<br />
EnvironmentFile=/tmp/gpg-agent-info<br />
<br />
[Install]<br />
WantedBy=multiplexer.target<br />
}}<br />
<br />
Once this is done, {{ic|systemctl --user activate}} {{ic|tmux.service}}, {{ic|multiplexer.target}} and any services you created to be run by {{ic|cruft.target}} and you should be set to go! Activated {{ic|user-session@.service}} as described above, but be sure to remove the {{ic|1=Conflicts=getty@tty1.service}} from {{ic|user-session@.service}}, since your user session will not be taking over a TTY. Congratulations! You have a running terminal multiplexer and some other useful programs ready to start at boot!<br />
<br />
===== Starting X =====<br />
<br />
You've probably noticed that, since the terminal multiplexer is now {{ic|default.target}}, X will not start automatically at boot. To start X, procede as above, but do not activate or manually link to {{ic|default.target}} {{ic|wm.target}}. Instead, assuming you're booting to a terminal, we'll simply be using a hackish workaround and masking {{ic|/usr/bin/startx}} with a shell alias:<br />
<br />
{{bc|1=alias startx='systemctl --user start wm.target'}}<br />
<br />
== User Services ==<br />
Users may now interact with units located in the following directories just as they would with system services (ordered by ascending precedence):<br />
* {{ic|/usr/lib/systemd/user/}}<br />
* {{ic|/etc/systemd/user/}}<br />
* {{ic|~/.config/systemd/user/}}<br />
To control the systemd instance, the user must use the command {{ic|systemctl --user}}.<br />
=== Installed by packages ===<br />
A unit installed by a package that is meant to be run by a [[systemd]] user instance should install the unit to {{ic|/usr/lib/systemd/user/}}. The system adminstration can then modify the unit by copying it to {{ic|/etc/systemd/user/}}. A user can then modify the unit by copying it to {{ic|~/.config/systemd/user/}}.<br />
=== Example ===<br />
The following is an example of a user version of the mpd service.<br />
{{hc|mpd.service|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon<br />
<br />
[Service]<br />
ExecStart=/usr/bin/mpd --no-daemon<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
=== Example with variables ===<br />
The following is an example of a user version of {{ic|sickbeard.service}}, which takes into account variable home directories where SickBeard can find certain files:<br />
{{hc|sickbeard.service|<nowiki><br />
[Unit]<br />
Description=SickBeard Daemon<br />
<br />
[Service]<br />
ExecStart=/usr/bin/env python2 /opt/sickbeard/SickBeard.py --config %h/.sickbeard/config.ini --datadir %h/.sickbeard<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
<br />
As detailed in {{ic|man systemd.unit}}, the {{ic|%h}} variable is replaced by the home directory of the user running the service. There are other variables that can be taken into account in the [[systemd]] manpages.<br />
<br />
== See also ==<br />
* [http://blog.gtmanfred.com/?p=26 gtmanfred's guide - the original guide]<br />
* [https://bitbucket.org/KaiSforza/systemd-user-units/wiki/Home KaiSforza's bitbucket wiki]<br />
* [https://github.com/grawity/systemd-user-units Collection of useful systemd user units]<br />
* [https://bitbucket.org/KaiSforza/systemd-user-units More systemd user units]</div>Cinellihttps://wiki.archlinux.org/index.php?title=Package_Maintainers&diff=248569Package Maintainers2013-02-26T18:49:25Z<p>Cinelli: cinelli added... fixed connor's alphabetical order fail.</p>
<hr />
<div>[[Category:Arch development]]<br />
[[fr:TU]]<br />
The [https://www.archlinux.org/trustedusers/ Trusted Users] serve the following purposes:<br />
# Maintain {{Ic|[community]}} as an intermediary between Arch Linux's [[Official Repositories]] and the unsupported package collection in the [[AUR]].<br />
# Maintain, manage, and watch over the operation of the [[AUR]].<br />
<br />
== How to become TU? ==<br />
The ''minimum'' requirements to becoming a TU are as follows:<br />
* know basic shell scripting<br />
* maintain a few packages in AUR with clean, high-quality PKGBUILDs<br />
* basic community involvement (mailing list, forums, IRC)<br />
* know Google-Fu<br />
* a general idea of the kind of packages you want to maintain (basically, why do you want to become TU?)<br />
<br />
<br />
Even though you could become a TU by merely fulfilling those minimum requirements, the people judging you [https://aur.archlinux.org/trusted-user/TUbylaws.html#SVP during voting] might expect more of you. Such as:<br />
* involvement in the bug tracker (reporting, research, info)<br />
* patches for Arch projects<br />
* involvement in a few open-source projects (even if they are your own)<br />
<br />
<br />
In case you still feel up to becoming TU after reading these lists, you should find another TU to sponsor you and write a witty application signed with your GPG key to the aur-general mailing list.<br />
<br />
For more information, please see [https://aur.archlinux.org/trusted-user/TUbylaws.html Trusted User Bylaws] and [[AUR Trusted User Guidelines]].<br />
<br />
== Active Trusted Users ==<br />
{|<br />
|- style="border-bottom:solid 2px"<br />
|style="font-weight: bold;padding-right:120px"|Nick<br />
|style="font-weight: bold;padding-right:200px"|Name<br />
|style="font-weight: bold;"|E-Mail<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Alucryd&SeB=m Alucryd]||Maxime Gauduin||alucryd at gmail dot com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Atsutane&SeB=m Atsutane]||Thorsten Töpper||atsutane {0x40} freethoughts {0x2E} de<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Barthalion&SeB=m Barthalion]||Bartłomiej Piotrowski||spam@bpiotrowski.pl<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=BlackIkeEagle&SeB=m BlackIkeEagle]||[[User:BlackEagle|Ike Devolder]]||ike DOT devolder AT gmail DOT com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=bluewind&SeB=m Bluewind]||Florian Pritz|| bluewind@xinu.at<br />
|- <br />
|[https://aur.archlinux.org/packages/?K=Cinelli&SeB=m cinelli] ||Federico Cinelli||[mailto:cinelli.federico@gmail.com cinelli.federico@gmail.com]<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=City-busz&SeB=m City-busz]||György Balló||ballogyor+arch at gmail dot com<br />
|-<br />
||[https://aur.archlinux.org/packages.php?K=ConnorBehan&SeB=m ConnorBehan]||Connor Behan||connor.behan@gmail.com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=cryptocrack&SeB=m cryptocrack]||Lukas Fleischer||archlinux at cryptocrack dot de<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Daenyth&SeB=m Daenyth]||Daenyth Blank||Daenyth+Arch gmail com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Dragonlord&SeB=m Dragonlord]||[[User:Dragonlord|Jaroslav Lichtblau]]||tu dragonlord cz<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=faidoc&SeB=m Faidoc]||Alexandre Filgueira||alexfilgueira [at] cinnarch [dot] com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=falconindy&SeB=m falconindy]||Dave Reisner||d[at]falconindy[dot]com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=felixonmars&SeB=m felixonmars]||Felix Yan||felixonmars[at]gmail[dot]com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=foutrelis&SeB=m foutrelis]||Evangelos Foutras||evangelos@foutrelis.com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=giniu&SeB=m giniu]||[[User:giniu|Andrzej Giniewicz]]||gginiu@gmail.com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=gtmanfred&SeB=m gtmanfred]||Daniel Wallace||danielwallace gtmanfred com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=heftig&SeB=m heftig]||Jan Steffens||jan.steffens@student.kit.edu<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=jelly&SeB=m jelly]||Jelle van der Waa|| jelle vdwaa nl<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=jsteel&SeB=m jsteel]||Jonathan Steel||mail at jsteel dot org<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=lordheavy&SeB=m Lordheavy]||[[User:Lordheavy|Laurent Carlier]]||lordheavym at gmail com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=mtorromeo&SeB=m mtorromeo]||Massimiliano Torromeo||massimiliano.torromeo@gmail.com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=petelewis&SeB=m petelewis]||Peter Lewis||plewis at aur dot archlinux dot org<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=PirateJonno&SeB=m PirateJonno]||Jonathan Conder||jonno dot conder at gmail dot com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=pressh&SeB=m pressh]||Ronald van Haren||ronald.archlinux.org<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=schivmeister&SeB=m schivmeister]||[[User:Schivmeister|Ray Rashif]]||schiv archlinux org<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=schuay&SeB=m schuay]||Jakob Gruber||jakob.gruber@gmail.com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=seblu&SeB=m seblu]||Sébastien Luttringer||s e b l u '''+''' a r c h # s e b lu ''dot'' n e t<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=sergej&SeB=m sergej]||[[User:Sergej|Sergej Pupykin]]||pupykin.s+arch@gmail.com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=speps&SeB=m speps]||SpepS||dreamspepser at yahoo dot it<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=stativ&SeB=m stativ]||Lukas Jirkovsky||l.jirkovsky strange_curved_character gmail.com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=svenstaro&SeB=m svenstaro]||[[User:svenstaro|Sven-Hendrik Haase]]||sh@lutzhaase.com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=td123&SeB=m td123]||Thomas Dziedzic||gostrc at gmail<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=thestinger&SeB=m thestinger]||Daniel Micay||[mailto:danielmicay@gmail.com danielmicay@gmail.com]<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=tredaelli&SeB=m tredaelli]||Timothy Redaelli||timothy.redaelli@gmail.com<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Xyne&SeB=m Xyne]||Xyne||ca . archlinux @ xyne, in reverse order<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=xyproto&SeB=m xyproto]||Alexander Rødseth||rodseth@gmail.com<br />
|}<br />
<br />
== Inactive Trusted Users ==<br />
{|<br />
|- style="border-bottom:solid 2px"<br />
|style="font-weight: bold;padding-right:120px"|Nick<br />
|style="font-weight: bold;padding-right:200px"|Name<br />
|style="font-weight: bold;"|E-Mail<br />
|style="font-weight: bold;"|Comments/Reference<br />
|}<br />
<br />
== Some Past Trusted Users ==<br />
{|<br />
|- style="border-bottom:solid 2px"<br />
|style="font-weight: bold;padding-right:120px"|Nick<br />
|style="font-weight: bold;padding-right:200px"|Name<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=abhidg&SeB=m abhidg]||Abhishek Dasgupta<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Allan&SeB=m Allan]||Allan McRae<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=anders&SeB=m anders]||Anders Bergh<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=angvp&SeB=m angvp]||[[User:Angvp|Angel Velásquez]]<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=bardo&SeB=m bardo]||Corrado Primier<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=abhidg&SeB=m abhidg]||Andrea Scarpino<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=bfinch&SeB=m bfinch]||Bob Finch<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=brain0&SeB=m brain0]||Thomas Bächler<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=bjorn&SeB=m bjorn]||[[User:Bjørn|Bjørn Lindeijer]]<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=codemac&SeB=m codemac]||Jeff Mickey<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=cmb&SeB=m cmb]||Chris Brannon<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=DaNiMoTh&SeB=m DaNiMoTh]||JJ. DaNiMoTh<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=dejari&SeB=m dejari]||Leslie P. Polzer<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=dsa&SeB=m dsa]||Douglas Soares de Andrade<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=dtw&SeB=m dtw]||Phil Dillon-Thiselton<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=elasticdog&SeB=m elasticdog]||Aaron Bull Schaefer<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=encelo&SeB=m encelo]||Angelo Theodorou<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=even&SeB=m even] ||Kessia Pinheiro<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=filoktetes&SeB=m filoktetes]||Robert Emil Berge<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=firmicus&SeB=m firmicus]||François Charette<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=ganja_guru&SeB=m ganja_guru]||Varun Acharya<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=gcarrier&SeB=m gcarrier]||Geoffroy Carrier<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Ghost1227&SeB=m Ghost1227]||Dan Griffiths<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=gummibaerchen&SeB=m gummibaerchen]||Timm Preetz<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=hdoria&SeB=m hdoria]||Hugo Doria<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=iphitus&SeB=m iphitus]||James Rayner<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=itsbrad212&SeB=m itsbrad212]||Brad Fanella<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=kaitocracy&SeB=m kaitocracy]||Kaiting Chen<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=louipc&SeB=m louipc]||Loui Chang<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=mOLOk&SeB=m mOLOk]||Alessio Bolognino<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=nesl247&SeB=m nesl247]||Alex Heck<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Neverth&SeB=m Neverth]||Mikko Seppälä<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Partition&SeB=m Partition]||Mateusz Herych<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=phrakture&SeB=m phrakture]||Aaron Griffin<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Pierre&SeB=m Pierre]||Pierre Schmitz<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=pizzapunk&SeB=m pizzapunk]||Alexander Fehr<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=pjmattal&SeB=m pjmattal]||Paul Mattal<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Ranguvar&SeB=m Ranguvar]||Devin Cofer<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Romashka&SeB=m Romashka]||Roman Kyrylych<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=shastry&SeB=m shastry]||Vinay S Shastry<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Snowman&SeB=m Snowman]||Eric Bélanger<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=shinlun&SeB=m shinlun]||Shinlun Hsieh<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=StefanHusmann&SeB=m StefanHusmann]||Stefan Husmann<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=STiAT&SeB=m STiAT]||Georg Grabler<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=swiergot&SeB=m swiergot]||Jaroslaw Swierczynski<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=tardo&SeB=m tardo]||Shehzad Qureshi<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=thotypous&SeB=m thotypous]||Paulo Matias<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=vegai&SeB=m vegai]||Vesa Kaihlavirta<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=voidnull&SeB=m voidnull]||Giovanni Scafora<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=wizzomafizzo&SeB=m wizzomafizzo]||Callan Barrett<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=wonder&SeB=m wonder]|| Ionut Biru<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=Xilon&SeB=m Xilon]||Sebastian Nowicki<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=xterminus&SeB=m xterminus]||Charles Mauch<br />
|-<br />
|[https://aur.archlinux.org/packages.php?K=zeus&SeB=m zeus]||Zhukov Pavel<br />
|}</div>Cinellihttps://wiki.archlinux.org/index.php?title=Netctl&diff=248483Netctl2013-02-26T04:04:37Z<p>Cinelli: Cleaned up.</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
<br />
==Intro==<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
Netctl uses simple text profiles. Example profiles are provided for users to use as a template under {{ic|/etc/netctl/examples}}. Common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy it to {{ic|/etc/netctl/<profile>}} and edit:<br />
# cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-network<br />
<br />
===For Users Migrating from Netcfg===<br />
Netctl uses {{ic|/etc/netctl}} to store its profiles whereas netcfg used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
Users ''not'' wishing to have their passwords stored in ''plain text'' have the option of generating a 256-bit Encrypted PSK.<br />
<br />
If you have not done so already, install {{pkg|wpa_actiond}} from the {{ic|core}} repository using [[pacman]]<br />
$ [[pacman]] -Syu {{pkg|wpa_actiond}}<br />
<br />
Next, generate your 256-bit Encrypted PSK using [[WPA_supplicant#Configuration_file|wpa_passphrase]]:<br />
{{hc|Usage: [[WPA_supplicant#Configuration_file|wpa_passphrase]] [ssid] [passphrase]|<br />
2=$ [[WPA_supplicant#Configuration_file|wpa_passphrase]] archlinux freenode|<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
}}<br />
<br />
In a second terminal window copy the example file {{ic|wireless-wpa}} from {{ic|/etc/netctl/examples/}} to {{ic|/etc/netctl/}}.<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
You will then need to edit {{ic|/etc/netctl/wireless-wpa}} using your favorite text editor and add the ''Encrypted Pre-shared Key'' that was generated early using [[WPA_supplicant#Configuration_file|wpa_passphrase]] to the {{ic|'''Key'''}} variable of this profile.<br />
<br />
Once completed your network profile {{ic|wireless-wpa}} containing a 256-bit Encrypted PSK should resemble:<br />
{{hc|/etc/netctl/wireless-wpa|<br />
2={{Note|1=Make sure to use the '''special non-quoted rules''' for Key= that are explained at the end of netctl.profile(5)}}<br />
Description='A simple WPA encrypted wireless connection using 256-bit Encrypted PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}}<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Cinellihttps://wiki.archlinux.org/index.php?title=Netctl&diff=248481Netctl2013-02-26T03:28:29Z<p>Cinelli: /* Password Encryption (256-bit PSK) */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
<br />
==Intro==<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
Netctl uses simple text profiles. Example profiles are provided for users to use as a template under {{ic|/etc/netctl/examples}}. Common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy it to {{ic|/etc/netctl/<profile>}} and edit:<br />
# cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-network<br />
<br />
===For Users Migrating from Netcfg===<br />
Netctl uses {{ic|/etc/netctl}} to store its profiles whereas netcfg used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
Users not wishing to have their passwords stored in plain text have the option of generating a 256-bit PSK. In order to do so generate the 256-bit PSK using [[WPA_supplicant#Configuration_file|wpa_passphrase]]:<br />
{{hc|$ [[WPA_supplicant#Configuration_file|wpa_passphrase]] archlinux freenode|<br />
2=network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
}}<br />
Next, copy example file {{ic|wireless-wpa}} from {{ic|/etc/netctl/examples/}} to {{ic|/etc/netctl/}}:<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
Finally, edit {{ic|/etc/netctl/wireless-wpa}} in your favorite text editor and add the Encrypted Pre-shared Key that was generated early using [[WPA_supplicant#Configuration_file|wpa_passphrase]] to the {{ic|'''Key'''}} variable using the '''special non-quoted rules''' explained at the end of {{ic|netctl.profile(5)}}.<br />
<br />
In the end your network profile {{ic|wireless-wpa}} containing a 256-bit encrypted PSK should look something like this:<br />
{{hc|/etc/netctl/wireless-wpa|<br />
2=Description='A simple WPA encrypted wireless connection using 256-bit PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}}<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Cinellihttps://wiki.archlinux.org/index.php?title=Security&diff=248475Security2013-02-26T02:49:58Z<p>Cinelli: fixed where to define auth from /etc/pam.d/login to /etc/pam.d/system-login</p>
<hr />
<div>[[Category:Security]]<br />
[[Category:File systems]]<br />
[[Category:Networking]]<br />
[[ru:Security]]<br />
{{expansion}}<br />
<br />
Instructions on how to harden and secure an Arch Linux system.<br />
<br />
==Concepts==<br />
*It ''is'' possible to tighten the security so much as to make your system unusable. The trick is to secure it without overdoing it.<br />
*There are many other things that can be done to heighten the security, but the biggest threat is, and will always be, the user himself. When you think security, you have to think layers. When one layer is breached, another should stop the attack. But you can never make the system 100% secure unless you unplug the machine from all networks, lock it in a safe and never use it.<br />
*Be a little paranoid. It helps. And be suspicious. If anything sounds too good to be true, it probably is!<br />
*[[Wikipedia:Principle of least privilege|Principle of least privilege]]<br />
<br />
==Physical security==<br />
{{Note|You can ignore this section if you just want to secure your computer against remote threats.}}<br />
Physical access to a computer is basically root access, but you can stop an attacker from having access without removing your hard drive (also see [[#Disk encryption]]) or resetting your BIOS settings (both of which involve opening the computer). <br />
<br />
===Locking down BIOS===<br />
<br />
Adding a password to the BIOS prevents someone from booting into removable media, which is basically the same as having root access to your computer. You should make sure your drive is first in the boot order and disable the other drives from being bootable if you can.<br />
<br />
===Bootloader password===<br />
<br />
It's highly important to protect your bootloader. There's a magic kernel parameter called {{ic|1=init=/bin/sh}}. This makes any user/login restrictions totally useless.<br />
<br />
Good (strong) passwords can be obtained with ease, through the use of the apg package, or Automated Password Generator. <br />
<br />
====GRUB====<br />
''See: [[GRUB#Security]]''<br />
<br />
=== Automatic logout on VCs (and SSH) ===<br />
If you are using Bash or Zsh, you can set TMOUT, so you will never forget open shell on VC (where xscreensaver is not protecting you):<br />
<br />
{{hc|/etc/profile.d/shell-timeout.sh|<br />
2=TMOUT="$(( 60*10 ))";<br />
[ -z "$DISPLAY" ] && export TMOUT;<br />
case $( /usr/bin/tty ) in<br />
/dev/tty[0-9]*) export TMOUT;;<br />
esac<br />
}}<br />
<br />
if you really want EVERY Bash/Zsh prompt (even within X) to timeout, use:<br />
<br />
$ export TMOUT="$(( 60*10 ))";<br />
<br />
Note that this will not work if there's some command running in the shell (eg.: an SSH session or other shell without TMOUT support). But if you are using VC mostly for restarting frozen GDM/Xorg as root, then this is very usefull.<br />
<br />
==Partitions==<br />
<br />
The kernel now prevents security issues related to hardlinks and symlinks if the {{ic|fs.protected_hardlinks}} and {{ic|fs.protected_symlinks}} sysctl switches are enabled, so there is no longer a major security benefit from separating out world-writable directories.<br />
<br />
Partitions containing world-writable directories can still be kept separate as a coarse way of limiting the damage from disk space exhaustion. However, filling a partition like {{ic|/var}} or {{ic|/tmp}} is enough to take down services. More flexible mechanisms for dealing with this concern exist (like quotas), and some filesystems include related features themselves (btrfs has quotas on subvolumes).<br />
<br />
===Mount options===<br />
<br />
Following the principle of least privilege, partitions should be mounted with the most restrictive mount options possible (without losing functionality).<br />
<br />
====Relevant mount options====<br />
<br />
*'''nodev:''' Do not interpret character or block special devices on the file system.<br />
*'''nosuid:''' Do not allow set-user-identifier or set-group-identifier bits to take effect.<br />
*'''noexec:''' Do not allow direct execution of any binaries on the mounted filesystem.<br />
<br />
====Potential usage====<br />
<br />
{{Note|Data partitions should always be mounted with {{ic|nodev}}, {{ic|nosuid}}, {{ic|noexec}}.}}<br />
<br />
{|<br />
| align="center" style="background:#f0f0f0;"|'''Partition'''<br />
| align="center" style="background:#f0f0f0;"|'''nodev'''<br />
| align="center" style="background:#f0f0f0;"|'''nosuid'''<br />
| align="center" style="background:#f0f0f0;"|'''noexec'''<br />
|-<br />
| /var||yes||yes||yes<br />
|- style="background:#e4e4e4"<br />
| /home||yes||yes||yes, if you do not code or use wine<br />
|-<br />
| /dev/shm||yes||yes||yes<br />
|- style="background:#e4e4e4"<br />
| /tmp||yes||yes||maybe, breaks compiling packages and various other things<br />
|-<br />
| /boot||yes||yes||yes<br />
|-<br />
|}<br />
<br />
==Filesystem permissions==<br />
The default filesystem permissions allow read access to almost everything and changing the permissions can hide valuable information from an attacker who gains access to a non-root account such as the http or nobody users.<br />
<br />
For example:<br />
<br />
# chmod 700 /boot /etc/{iptables,arptables}<br />
<br />
==Disk encryption==<br />
You should know that encryption is the only way for protecting your data against people that have physical access to your computer. But once you mount an encrypted volume you have to be sure that you are the only person having physical or root access to the machine (nothing in the system is safe against root).<br />
<br />
See [[Disk Encryption]] for detailed information.<br />
<br />
==User setup==<br />
After installation make a normal user for daily use. Don't use the root user for daily use.<br />
Pick a secure password. Do not to use a dictionary word or something like your dog's name.<br />
A password should be at least eight characters long. Contain a mix of upper and lower case letters. It should include at least one number and/or one special character.<br />
<br />
If you have a good memory for passwords then you can use a program like {{ic|pwgen}} to create a bunch of passwords and print them on the screen. Then just pick one to use.<br />
Alternately you can make a password using the first characters from every word in a sentence.<br />
Take for instance “the girl is walking down the rainy street” could be translated to “t6!WdtR5”. This approach could make it easier to remember a password.<br />
<br />
==Restricting su==<br />
See [[Su#Security]] for details.<br />
<br />
==No root login at the console==<br />
Changing the configuration to disallow root to login from the console makes it harder for an intruder to gain access to the system. The intruder would have to guess both a user-name that exists on the system and that users password. When root is allowed to log in via the console, an intruder only need to guess a password.<br />
Blocking root login at the console is done by commenting out the tty lines in {{ic|/etc/securetty}}.<br />
{{hc|/etc/securetty|<br />
#tty1<br />
}}<br />
<br />
Repeat for any tty you wish to block.<br />
To check the effect of this change, start by commenting out only one line and go to that particular console and try to login as root. You will be greeted by the message {{ic|"Login incorrect"}}. Now that we're sure it works, go back and comment out the rest of the tty lines.<br />
<br />
==Lockout user after three failed login attempts==<br />
To further heighten the security it is possible to lockout a user after a specified number of failed login attempts. The user account can either be locked until the root user unlocks it, or automatically be unlocked after a set time.<br />
To lockout a user for ten minutes after three failed login attempts you have to modify {{ic|/etc/pam.d/system-login}}:<br />
<br />
{{hc|/etc/pam.d/system-login|<br />
2=auth required pam_tally.so deny=2 unlock_time=600 onerr=succeed file=/var/log/faillog<br />
#auth required pam_tally.so onerr=succeed file=/var/log/faillog<br />
}}<br />
<br />
If you don't comment the second line every failed login attempt will be counted twice. That's all there's to it. If you feel adventurous, make three failed login attempts. Then you can see for yourself what happens. To unlock a user manually do:<br />
<br />
# pam_tally --user --reset<br />
<br />
If you want to permanently lockout a user after 3 failed login attempts remove the {{ic|unlock_time}} part of the line. The user can then not login until root unlocks the account.<br />
<br />
==Use sudo for system commands==<br />
To make a user run some system commands as root it is advisable to use sudo to give that user the needed authority. It wouldn't be good to hand out the root password to just anyone.<br />
Even if you are the only user on the system, using sudo is a good idea to keep from using a root console too much. Sometimes you just forget to logout again.<br />
<br />
Setting up sudo is quite easy. Just use {{ic|visudo}} to bring up the configuration file in the editor. The file already includes some examples you can use. To mount Samba shares from a server as a regular user, add the following using {{ic|visudo}}:<br />
<br />
%users ALL=/sbin/mount.cifs,/sbin/umount.cifs<br />
<br />
This allows all users who are members of the group users to run the commands {{ic|/sbin/mount.cifs}} and {{ic|/sbin/umount.cifs}} from any machine (ALL).<br />
<br />
{{Tip|To use {{ic|nano}} instead of {{ic|vi}}, edit {{ic|/etc/sudoers}}. This should be done using {{ic|visudo}}:<br />
<br />
{{hc|/etc/sudoers|<br />
2=Defaults editor=/usr/bin/nano<br />
}}<br />
Exporting {{ic|1=# EDITOR=nano visudo}} is regarded as a severe security risk since everything can be used as an {{ic|EDITOR}}.<br />
}}<br />
<br />
==Password hashes==<br />
The default Arch hash [[SHA_password_hashes|sha512]] is very strong and there's no need to change it.<br />
<br />
==Access control==<br />
*[[AppArmor]] (pathname)<br />
*[[SELinux]] (labels)<br />
*[[Tomoyo]] (pathname)<br />
*[[grsecurity]]<br />
<br />
==Firewall==<br />
*See [[Simple stateful firewall]] for a guide on setting up an netfilter (iptables) firewall.<br />
*See [[Firewalls]] for other ways of setting up netfilter.<br />
*See [[iptables]] for general info.<br />
<br />
==TCP/IP stack hardening==<br />
<br />
[[Sysctl#TCP/IP stack hardening|TCP/IP stack hardening]]<br />
<br />
==Kernel hardening==<br />
[[grsecurity]]<br />
<br />
==Authenticating packages==<br />
Package signing is enabled (and required) by default and relies on a web of trust from 5 trusted master keys. See [[pacman-key]] for details.<br />
<br />
==See also==<br />
* ArchWiki's Current list of security applications: [https://wiki.archlinux.org/index.php/List_of_Applications/Security Lists of Applications: Security]<br />
* [http://www.puschitz.com/SecuringLinux.shtml Securing and Hardening Red Hat Linux Production Systems]<br />
* [http://www.ibm.com/developerworks/linux/tutorials/l-harden-desktop/index.html Hardening the linux desktop]<br />
* [http://www.ibm.com/developerworks/linux/tutorials/l-harden-server/index.html Hardening the linux server]<br />
* [http://www.faqs.org/docs/securing/index.html Securing and Optimizing Linux]<br />
* [http://www.auscert.org.au/5816 UNIX and Linux Security Checklist v3.0]</div>Cinellihttps://wiki.archlinux.org/index.php?title=Netctl&diff=248235Netctl2013-02-23T17:49:44Z<p>Cinelli: /* Password Encryption (256-bit PSK) */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
<br />
==Intro==<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
Netctl uses simple text profiles. Example profiles are provided for users to use as a template under {{ic|/etc/netctl/examples}}. Common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy it to {{ic|/etc/netctl/<profile>}} and edit:<br />
# cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-network<br />
<br />
===For Users Migrating from Netcfg===<br />
Netctl uses {{ic|/etc/netctl}} to store its profiles whereas netcfg used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
Users not wishing to have their passwords stored in plain text have the option of generating a 256-bit PSK. In order to do so generate the 256-bit PSK using {{ic|wpa_passphrase}}:<br />
{{Note| wpa_passphrase <ssid> [passphrase]}}<br />
$ wpa_passphrase archlinux freenode<br />
<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
<br />
Next, copy example file {{ic|wpa-wireless}} from {{ic|/etc/netctl/examples/}} to {{ic|/etc/netctl/wireless-wpa}}:<br />
# cp /etc/netctl/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
Next, edit {{ic|/etc/netctl/wireless-wpa}} in your favorite text editor and add the output psk that was generated from {{ic|wpa_passphrase}} into the {{ic|Key}} section. Once completed the file should look something like this:<br />
# /etc/netctl/wireless-wpa<br />
<br />
Description='A simple WPA encrypted wireless connection using 256-bit PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Cinellihttps://wiki.archlinux.org/index.php?title=Netctl&diff=248234Netctl2013-02-23T17:48:45Z<p>Cinelli: Adjusted to use Key=\" instead of wpa-configsection</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
<br />
==Intro==<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
Netctl uses simple text profiles. Example profiles are provided for users to use as a template under {{ic|/etc/netctl/examples}}. Common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy it to {{ic|/etc/netctl/<profile>}} and edit:<br />
# cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-network<br />
<br />
===For Users Migrating from Netcfg===<br />
Netctl uses {{ic|/etc/netctl}} to store its profiles whereas netcfg used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
Users not wishing to have their passwords stored in plain text have the option of generating a 256-bit PSK. In order to do so generate the 256-bit PSK using {{ic|wpa_passphrase}}:<br />
{{Note| wpa_passphrase <ssid> [passphrase]}}<br />
$ wpa_passphrase archlinux freenode<br />
<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
<br />
Next, copy example file {{ic|wpa-wireless}} from {{ic|/etc/netctl/examples/}} to {{ic|/etc/netctl/wireless-wpa}}:<br />
# cp /etc/netctl/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
Next, edit {{ic|/etc/netctl/wireless-wpa}} in your favorite text editor and add the output psk that was generated from {{ic|wpa_passphrase}} into the {{ic|Key}} section. Once completed the file should look something like this:<br />
# cat /etc/netctl/wireless-wpa-psk<br />
<br />
Description='A simple WPA encrypted wireless connection using 256-bit PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Cinellihttps://wiki.archlinux.org/index.php?title=Netctl&diff=248209Netctl2013-02-23T07:06:14Z<p>Cinelli: = broke template. fixed</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
<br />
==Intro==<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
Netctl uses simple text profiles. Example profiles are provided for users to use as a template under {{ic|/etc/netctl/examples}}. Common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy it to {{ic|/etc/netctl/<profile>}} and edit:<br />
# cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-network<br />
<br />
===For Users Migrating from Netcfg===<br />
Netctl uses {{ic|/etc/netctl}} to store its profiles whereas netcfg used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
Users not wishing to have their passwords stored in plain text have the option of generating a 256-bit PSK. In order to do so generate the 256-bit PSK using {{ic|wpa_passphrase}}:<br />
{{Note| wpa_passphrase <ssid> [passphrase]}}<br />
$ wpa_passphrase archlinux freenode<br />
<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
<br />
Next, copy example file {{ic|wpa-wireless-configsection}} from {{ic|/etc/netctl/examples/}} to {{ic|/etc/netctl/wireless-wpa-psk}}:<br />
# cp /etc/netctl/wireless-wpa-configsection /etc/netctl/wireless-wpa-psk<br />
<br />
Next, edit {{ic|/etc/netctl/wireless-wpa-psk}} in your favorite text editor and add the output that was generated from {{ic|wpa_passphrase}} into the {{ic|WPAConfigSection}} array. Once completed the file should look something like this:<br />
# cat /etc/netctl/wireless-wpa-psk<br />
<br />
Description='A simple WPA encrypted wireless connection using 256-bit PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa-configsection<br />
IP=dhcp<br />
WPAConfigSection=(<br />
'ssid="archlinux"'<br />
'key_mgmt=WPA-PSK'<br />
'psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a'<br />
)<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Cinellihttps://wiki.archlinux.org/index.php?title=Netctl&diff=248208Netctl2013-02-23T07:05:12Z<p>Cinelli: Added 256-bit PSK for password security</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
<br />
==Intro==<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
Netctl uses simple text profiles. Example profiles are provided for users to use as a template under {{ic|/etc/netctl/examples}}. Common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy it to {{ic|/etc/netctl/<profile>}} and edit:<br />
# cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-network<br />
<br />
===For Users Migrating from Netcfg===<br />
Netctl uses {{ic|/etc/netctl}} to store its profiles whereas netcfg used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
Users not wishing to have their passwords stored in plain text have the option of generating a 256-bit PSK. In order to do so generate the 256-bit PSK using {{ic|wpa_passphrase}}:<br />
{{Note| wpa_passphrase <ssid> [passphrase]}}<br />
$ wpa_passphrase archlinux freenode<br />
<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
<br />
Next, copy example file {{ic|wpa-wireless-configsection}} from {{ic|/etc/netctl/examples/}} to {{ic|/etc/netctl/wireless-wpa-psk}}:<br />
# cp /etc/netctl/wireless-wpa-configsection /etc/netctl/wireless-wpa-psk<br />
<br />
Next, edit {{ic|/etc/netctl/wireless-wpa-psk}} in your favorite text editor and add the output that was generated from {{ic|wpa_passphrase}} into the {{ic|WPAConfigSection=()}} array. Once completed the file should look something like this:<br />
# cat /etc/netctl/wireless-wpa-psk<br />
<br />
Description='A simple WPA encrypted wireless connection using 256-bit PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa-configsection<br />
IP=dhcp<br />
WPAConfigSection=(<br />
'ssid="archlinux"'<br />
'key_mgmt=WPA-PSK'<br />
'psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a'<br />
)<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Cinellihttps://wiki.archlinux.org/index.php?title=E17&diff=245606E172013-01-29T21:45:54Z<p>Cinelli: /* startx */</p>
<hr />
<div>[[Category:Desktop environments]]<br />
[[cs:E17]]<br />
[[de:Enlightenment]]<br />
[[es:E17]]<br />
[[fr:E17]]<br />
[[it:E17]]<br />
[[lt:E17]]<br />
[[pl:E17]]<br />
[[ru:E17]]<br />
[[zh-CN:E17]]<br />
{{Article summary start}}<br />
{{Article summary text|The Enlightenment project provides useful libraries, a graphical environment and other applications as well as development tools for creating such applications. This article covers its installation, configuration, and troubleshooting.}}<br />
{{Article summary text|E17 uses the [[Elementary]] toolkit.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Graphical user interface overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Enlightenment}}<br />
{{Article summary end}}<br />
<br />
From the [http://trac.enlightenment.org/e/wiki/Enlightenment Enlightenment wiki]:<br />
<br />
:''The Enlightenment desktop shell provides an efficient yet breathtaking window manager based on the Enlightenment Foundation Libraries along with other essential desktop components like a file manager, desktop icons and widgets. It boasts an unprecedented level of theme-ability while still being capable of performing on older hardware or embedded devices.''<br />
<br />
E17 is the development release 17 (DR17) of the [[Enlightenment]] [[Desktop Environment]]. It comprises both the Enlightenment [[window manager]] and Enlightenment Foundation Libraries (EFL), which provide additional desktop environment features such as a toolkit, object canvas, and abstracted objects. E17 has been under development since 2005, but in February 2011 the core EFLs saw their first stable 1.0 release. Enlightenment the window manager was released December 21st 2012, along with the 1.7.4 release of the EFL libraries. Many people currently use E17 as a day-to-day desktop environment without problems.<br />
<br />
== Installing E17 ==<br />
<br />
=== From the extra repository ===<br />
<br />
To install e17, install the {{Pkg|enlightenment17}} package.<br />
<br />
You might also want to install additional [[Fonts]]. You need at least 1 True Type Font.<br />
<br />
If you need/want an e17 package which is not (yet) available in [extra], see if it is available in the [[AUR]].<br />
<br />
=== From the AUR ===<br />
<br />
SVN PKGBUILDs which download and install the very latest development code are available in the [[AUR]] as {{AUR|enlightenment17-svn}} and it's dependencies. Be aware that they need to be built in a certain order, which is posted in the comments of the relevant PKGBUILDs.<br />
<br />
=== Compiling with easy_e17.sh ===<br />
{{Warning|Scripts like easy_e17.sh will not only compile e17, but also the efl libraries (eina, eet, evas etc.). Since the release of these libraries, and e17 itself, it's no longer necessary and even discouraged to build from svn. Large changes are taking place in the svn source (all libraries are being merged into one library called efl), so building scripts will need to be actively maintained and will still be broken from time to time. "Unless you're developing E or willing to live bleeding edge, stay away from trunk."([http://sourceforge.net/mailarchive/message.php?msg_id&#61;30310890 source])}}<br />
{{ic|easy_e17.sh}} compiles E17 from source and installs it in {{ic|/opt/e17}}. It does not create packages and therefore does not install dependencies automatically.<br />
<br />
# Get it from the [[AUR]]: {{AUR|easy-e17}}.<br />
# Edit {{ic|/etc/easy_e17.conf}} if you want.<br />
# Run it as user, so it downloads to ~/e17_src and builds as user, to install E17 (the script will immediately ask for your password so it can install in the end): {{bc|# easy_e17.sh -i}}<br />
# Put {{ic|/opt/e17/bin}} in your {{ic|PATH}} by editing {{ic|/etc/profile}}. For example, you can add this line at the end of the file: {{bc|1=PATH="$PATH:/opt/e17/bin"}}<br />
# If, after completing the install, xinitrc complains that it cannot find enlightenment upon starting, you may need to add these lines to the end of /etc/profile as well:{{bc|1=PYTHONPATH=":$PYTHONPATH"}}{{bc|1=LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/e17/lib"}}<br />
<br />
If you encounter any errors while trying to install E17, first check to make sure it is not a dependency problem. If it is, install the dependency and continue installing e17.<br />
<br />
To update all installed EFL/E17 components, run this command:<br />
# easy_e17.sh -u<br />
<br />
== Starting E17 ==<br />
=== startx ===<br />
If you use {{ic|startx}} or a simple [[Display Manager]] like XDM or [[SLiM]], add or uncomment the following command in [[xinitrc]]:<br />
{{bc|<br />
# ~/.xinitrc<br />
exec enlightenment_start<br />
}}<br />
<br />
=== Entrance ===<br />
Nowadays E17 has a new display manager called Entrance, you can download it from AUR {{AUR|entrance-svn}}.<br />
Entrance is quite sophisticated and its configuration is controlled by {{ic|/etc/entrance.conf}}.<br />
To use Entrance : <br />
<br />
# systemctl enable entrance.service<br />
<br />
=== Other ===<br />
More advanced display managers like [[GDM]] and [[KDM]] will automatically detect E17 thanks to the {{ic|/usr/share/xsessions/enlightenment.desktop}} file provided by the {{pkg|enlightenment17}} package.<br />
<br />
== Configuring the Network ==<br />
<br />
=== ConnMan ===<br />
<br />
E17's preferred network manager is [[Connman|ConnMan]]. It is available from the [community] repository as the {{Pkg|connman}} package. For extended configuration with E17's default Network module, you may also install EConnman (available in AUR as {{AUR|econnman-svn}}) and it's associated dependencies.<br />
<br />
Finally, configure systemd to start the ConnMan daemon at startup:<br />
<br />
systemctl enable connman.service<br />
<br />
ConnMan loads very quickly and appears to handle DHCP quite nicely. If you have installed [[Wpa_supplicant]], ConnMan latches onto that shows all available wireless connections.<br />
<br />
=== NetworkManager ===<br />
<br />
You can also use {{Pkg|networkmanager}} to manage your network connections.<br />
<br />
pacman -S networkmanager<br />
<br />
Follow the instructions on [[NetworkManager]] to do the configuration. You may also need {{Pkg|network-manager-applet}} to help with your settings.<br />
<br />
pacman -S network-manager-applet<br />
<br />
You may want to add it to the start up programs so every time your E17 starts it appears on systray.<br />
<br />
Settings -> Settings Panel -> Apps -> Startup Applications -> System -> Network<br />
<br />
== Installing Themes ==<br />
<br />
More themes to customize the look of e17 are available from:<br />
* [http://exchange.enlightenment.org/ exchange.enlightenment.org], for which you can use the {{AUR|e17-themes}} [[AUR]] package<br />
* [http://www.e17-stuff.org e17-stuff.org]<br />
* [http://relighted.c0n.de/#100 relighted.c0n.de] for the default theme in 200 different colors<br />
* [http://trac.enlightenment.org/e/browser/trunk/THEMES svn trunk] (svn checkout the theme you like, run 'make' and you end up with a .edj theme file)<br />
<br />
You can install the themes (coming in .edj format) using the theme configuration dialog or by moving them to {{ic|~/.e/e/themes}}. <br />
<br />
{{Note|During 2010 there was a change in how themes work, so older themes will not work unless they were updated. There used to be an edje_convert tool to do this, but that has been dropped long ago (see: [http://trac.enlightenment.org/e/changeset/56156 trac.enlightenment.org])}}<br />
<br />
== Modules and Gadgets ==<br />
;Module:Name used in enlightenment to refer to the "backing" code for a gadget. <br />
;Gadget:Front-end or user interface that should help the end users of [[E17]] do something.<br />
<br />
Many Modules provide Gadgets that can be added to your desktop or on a shelf. Some Modules (such as CPUFreq) only provide a single Gadget while others (such as Composite) provide additional features without any gadgets. Note that certain gadgets such as Systray can only be added to a shelf while others such as Moon can only be loaded on the desktop. <br />
<br />
=== Compositing ===<br />
E17 offers two modules for compositing, '''''Composite''''' and '''''Ecomorph''''', depending on your hardware and preference.<br />
<br />
==== Composite ====<br />
The ''Composite'' module is the standard compositing manager provided in enlightenment. It provides some minimal compositing effects such as transparency, fade and shadow. Composite provides the more stable module and is supported on most hardware through either OpenGL or compositing software rendering. When the configuration is messed up and the settings windows can no longer be approached, configuration for the comp module can be reset by the hardcoded keybinding {{ic|Ctrl + Alt + Shift + Home}}.<br />
<br />
==== Ecomorph ====<br />
The ''Ecomorph'' module is a full-featured compositing manager which was ported from [[Compiz]] for E17. It can be downloaded from AUR {{AUR|ecomorph-git}}. Some experience instability with Ecomorph while others use it without a problem. Ecomorph requires 3D acceleration, while Composite does not. Development of ecomorph has been discontinued in favor of the official composite module, although some maintenance and bug fixing may still be done ([http://code.google.com/p/itask-module/wiki/Stuff source]).<br />
<br />
{{Note|The ability to unload the Composite module and load Ecomorph has been removed in the latest development code. Starting with the e18 release, Ecomorph will be officially dead.}}<br />
<br />
=== "Extra" modules ===<br />
{{Warning|These are 3rd party modules and not officially supported by the Enlightenment developers. They are also pulled directly from SVN, so they are development code that may or may not work at any time. Use at your own risk.}}<br />
These modules are available from the AUR, either as part of {{AUR|e-modules-extra-svn}} or as individual packages.<br />
<br />
==== Places ====<br />
From the current source code [http://trac.enlightenment.org/e/browser/trunk/E-MODULES-EXTRA/places/README README] for Places: ''This module manage the volumes device attached to the system.''<br />
<br />
In other words, Places is a gadget that will help you browse files on various devices you might plug into your computer, like phones, cameras, or other various storage devices you might plug into the usb port.<br />
<br />
Available from {{AUR|e17-places-svn}}<br />
{{Note|This module is no longer required for auto-mounting external devices in e17}}<br />
<br />
==== Scale Windows ====<br />
The ''Scale Windows'' module, which requires compositing to be enabled, adds several features. The scale windows effect shrinks all open windows and brings them all into view. The scale pager effect zooms out and shows all desktops as a wall, like the compiz expo plugin. Both can be added to the desktop as a gadget or bound to a key binding, mouse binding or screen edge binding. <br />
<br />
Some people like to change the standard window selection key binding {{ic|ALT + Tab}} to use Scale Windows to select windows. To change this setting, you navigate to {{ic|Menu > Settings > Settings Panel > Input > Keys}}. From here, you can set any key binding you would like. <br />
<br />
To replace the window selection key binding functionality with Scale Windows, scroll through the left panel until you find the "ALT" section and then find and select {{ic|ALT + Tab}}. Then, scroll through the right panel looking for the "Scale Windows" section and choose either {{ic|Select Next}} or {{ic|Select Next (All)}} depending on whether you would like to see windows from only the current desktop or from all desktops and click "Apply" to save the binding.<br />
<br />
Available from {{AUR|comp-scale-svn}}<br />
<br />
==== Engage ====<br />
Engage is CairoDock/GLX-Dock style docking bar for both application launchers and open applications. It requires compositing to be enabled and has full controls for transparency, size, zoom levels, and more.<br />
<br />
Available from {{AUR|engage-svn}}<br />
<br />
== Gnome Keyring integration ==<br />
<br />
It is possible to use gnome-keyring in e17. However at the time of writing you need a small hack to make it work in full.<br />
First you must tell e17 to autostart gnome-kering. For that you should go to {{ic|Settings Panel > Apps > Startup Applications}} and activate "Certificate and Key Storage", "GPG Password Agent", "SSH Key Agent" and "Secret Storage Service".<br />
After this you should edit your {{ic|~/.profile}} and add the following:<br />
<br />
if [ -n "$GNOME_KEYRING_PID" ]; then<br />
eval $(gnome-keyring-daemon --start)<br />
export SSH_AUTH_SOCK<br />
export GNOME_KEYRING_CONTROL<br />
export GPG_AGENT_INFO<br />
fi<br />
<br />
This should export the variables you need for your key management at your next login.<br />
<br />
== Troubleshooting ==<br />
<br />
If you find some unexpected behavior, there are a few things you can do:<br />
# try to see if the same behavior exists with the default theme<br />
# disable any 3rd party modules you may have installed<br />
# backup {{ic|~/.e}} and remove it (e.g. {{ic|mv ~/.e ~/.e.back}})<br />
<br />
If you are sure you found a bug please report it directly upstream. http://trac.enlightenment.org/e/report<br />
<br />
=== Screen unlocking does not work ===<br />
<br />
If screenlock does not accept your password add the following to {{ic|/etc/pam.d/enlightenment}}:<br />
auth required pam_unix_auth.so<br />
<br />
=== Unreadable fonts ===<br />
<br />
If fonts are too small and your screen is unreadable, be sure the right font packages are installed:<br />
pacman -S ttf-dejavu ttf-bitstream-vera<br />
<br />
=== Failure in mounting internal partitions ===<br />
Check if user is in storage group:<br />
{{bc|# groups <user>}}<br />
<br />
If user is not in storage group:<br />
{{bc|# groupadd storage <br />
# gpasswd -a <user> storage}}<br />
<br />
Then create this file as root:<br />
{{bc|# nano /etc/polkit-1/localauthority/50-local.d/10-storage-group-mount-override.pkla}}<br />
<br />
And write into the file:<br />
<br />
[storage group mount override]<br />
Identity=unix-group:storage<br />
Action=org.freedesktop.udisks2.filesystem-mount-system<br />
ResultAny=yes<br />
ResultInactive=yes<br />
ResultActive=yes<br />
<br />
For more information, see:<br />
http://bbs.archbang.org/viewtopic.php?id=2720<br />
<br />
== External Links ==<br />
<br />
* [http://exchange.enlightenment.org/ exchange.enlightenment.org]<br />
* [http://e17-stuff.org/ e17-stuff.org]<br />
* [http://www.bodhilinux.com/e17guide/e17guideEN/ Bodhi Guide to Enlightenment]<br />
* [https://lists.sourceforge.net/lists/listinfo/enlightenment-users E-Users mail list]<br />
* irc://irc.freenode.net#e</div>Cinellihttps://wiki.archlinux.org/index.php?title=Steam&diff=242909Steam2013-01-03T21:46:25Z<p>Cinelli: /* Segfault */</p>
<hr />
<div>[[Category:Gaming]]<br />
[[Category:Wine]]<br />
[[ja:Steam]]<br />
[[zh-CN:Steam]]<br />
{{Article summary start}}<br />
{{Article summary text|[http://store.steampowered.com/about/ Steam] is a content delivery system made by Valve Software. It is best known as the platform needed to play Source Engine games (e.g. Half-Life 2, Counter-Strike). Today it offers many games from many other developers.}}<br />
<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Wine}}<br />
{{Article summary end}}<br />
<br />
See the [[Wikipedia:Steam_(software)|project Wiki page]] and the page in the [http://appdb.winehq.org/objectManager.php?sClass=version&iId=19444 Application Database] for more info.<br />
<br />
== Native Steam on Linux ==<br />
<br />
{{Note|Arch Linux is not [https://support.steampowered.com/kb_article.php?ref&#61;1504-QHXN-8366 officially supported].}}<br />
<br />
{{Note|Some games may need additional dependencies.}}<br />
<br />
{{Note|Because the Steam client is a 32-bit application, you need to enable [[Multilib]] in pacman '''if you have a pure 64-bit installation'''. It may also make sense to install multilib-devel to provide some important multilib libraries. You also most likely need to install the 32-bit version of your graphics driver to run Steam. Also look [[#Steam on x64 Systems|here]].}}<br />
<br />
Install {{aur|steam}} from the [[AUR]].<br />
(Current licensing prevents steam from being put in the community/multilib repository, see the [https://mailman.archlinux.org/pipermail/arch-dev-public/2012-November/024046.html mailing list thread])<br />
<br />
Steam makes heavy usage of the Arial font. To make fonts look better, you may wish to install the {{aur|ttf-microsoft-arial}} or {{aur|ttf-ms-fonts}} package from the [[AUR]].<br />
<br />
===Fixes/Bugs/Error Messages===<br />
<br />
{{Note|Steam installs library dependencies of a game to a library directory, but some are missing at the moment. Report bugs involving missing libraries on Valve's tracker before adding workarounds here, and then provide a link to the bug so it can be removed as the issues are fixed. Libraries like {{pkg|libglu}} and {{pkg|libtxn_dxtn}} are exceptions to this, as they are just part of the implementation of the open drivers.}}<br />
<br />
Steam is ''beta software'' which is '''not supported''' on this distribution. As such some fixes are needed on the users part to get things functioning properly. Several games have dependencies which may be missing from your system. If a game fails to launch (often without error messages) then make sure all of the libraries listed below that game are installed. (Please help us expand on this list)<br />
<br />
{{Note|In addition to being documented here, any Fix/Bug/Error message should be, if not already, reported on Valve's bug tracker on their GIT page: https://github.com/ValveSoftware/steam-for-linux.}}<br />
<br />
====GUI problems with KDE====<br />
<br />
If you are using KDE and you have problems with the GUI (such as lag or random crashes) modify the compositing type to OpenGL/Raster. So don't use the XRender!<br />
<br />
====Mouse Cursor Overwritten ====<br />
Steam overwrites the [[Cursor Themes|X11 Cursor theme]] when it launches. This is a problem with Gnome and other WMs/DMs that do not set a cursor theme. You can overcome this for Gnome by setting a mouse cursor theme.<br />
<br />
To fix this issue, become root and put the following into {{ic|/usr/share/icons/default/index.theme}} (creating the directory {{ic|/usr/share/icons/default}} if necessary):<br />
{{hc|/usr/share/icons/default/index.theme|<nowiki><br />
[Icon Theme]<br />
Inherits=Adwaita<br />
</nowiki>}}<br />
<br />
Note: Instead of "Adwaita", you can choose another cursor theme (e.g. Human).<br />
Alternatively, you can install {{AUR|gnome-cursors-fix}} from the [[AUR]].<br />
<br />
Alternatively, you can create a symlink {{ic|~/.icons/default}} that points to the entry for your cursor in {{ic|/usr/share/icons}}, for example:<br />
<br />
mkdir -p ~/.icons<br />
ln -sT /usr/share/icons/Neutral_Plus ~/.icons/default<br />
<br />
If the cursor gets stuck pointing in the wrong direction after exiting Steam, a workaround is to run <code>xsetroot -cursor_name left_ptr</code> (From [http://awesome.naquadah.org/wiki/FAQ#How_to_change_the_cursor_theme.3F the awesomewm wiki]).<br />
<br />
If a cursor theme is set and Steam is still causing cursor problems then your cursor theme may not have the cursors under the names that Steam is looking at, for example KDE's cursor theme, Oxygen_White, the file for the cursor is 'left_ptr' but Steam is looking for 'arrow'. The simplest solution is to make symlinks to the appropriate cursor files.<br />
<br />
cd /usr/share/icons/Oxygen_White/cursors/<br />
ln -s ./left_ptr ./arrow<br />
ln -s ./size_fdiag ./bottom_right_corner<br />
ln -s ./size_fdiag ./top_left_corner<br />
ln -s ./size_bdiag ./bottom_left_corner<br />
ln -s ./size_bdiag ./top_right_corner<br />
ln -s ./size_hor ./left_side<br />
ln -s ./size_hor ./right_side<br />
ln -s ./size_ver ./top_side<br />
ln -s ./size_ver ./bottom_side<br />
<br />
The above should work for any KDE compatible cursor theme, but may not work for other ones if the cursor theme uses different names than size_fdiag, size_bdiag, size_hor, and size_ver.<br />
<br />
====Steam on x64 Systems====<br />
{{Note|Steam is currently targeting 32-bit environments, therefore you have to install the missing lib32 graphics driver for your current system setup, too.}}<br />
If you are running Steam on a x64 system check the optional dependencies of the [https://aur.archlinux.org/packages/steam/ steam] package with<br />
pacman -Qi steam<br />
On a notebook with Nvidia Optimus chip you install the [https://aur.archlinux.org/packages/lib32-nvidia-utils-bumblebee/ lib32-nvidia-utils-bumblebee] package e.g.<br />
<br />
=====Steam won't start on x64 with Intel HD Graphics=====<br />
If you have '''/home/username/.local/share/Steam/steam.sh: line 287''' error and you running 64-bit linux with Intel HD Graphics just install {{pkg|lib32-intel-dri}}<br />
<br />
=====Tray Icon missing with Gnome Shell=====<br />
If you miss the tray icon of Steam in Gnome Shell (x64) you have to install [https://aur.archlinux.org/packages/lib32-libappindicator/ lib32-libappindicator] package.<br />
<br />
=====Bumblebee=====<br />
If you are running Bumblebee on a x64 system you have to install the [https://aur.archlinux.org/packages/lib32-nvidia-utils-bumblebee/ lib32-nvidia-utils-bumblebee] package, too.<br />
<br />
====Amnesia: The Dark Descent====<br />
=====Dependencies=====<br />
<br />
* {{pkg|lib32-freealut}}<br />
* {{pkg|lib32-glu}}<br />
* {{pkg|lib32-libxmu}}<br />
* {{pkg|lib32-sdl_ttf}}<br />
<br />
=====Troubleshooting=====<br />
======Segfault======<br />
If you are using open source drivers you will need {{pkg|lib32-libtxc_dxtn}} . See [http://www.frictionalgames.com/forum/thread-10924.html official forum] for details<br />
<br />
======Running from steam displays empty window======<br />
${install_dir}/run_steam.sh uses `arch` to check if the system is 32 or 64 bit. Replace `arch` with `uname -m`.<br />
<br />
====And Yet It Moves====<br />
=====Dependencies=====<br />
* {{aur|lib32-libtheora}}<br />
* {{aur|lib32-libjpeg6}}<br />
* {{aur|lib32-libtiff4}}<br />
<br />
=====Compatibility=====<br />
Game refuses to launch and following message can be observed on console<br />
readlink: extra operand ‘Yet’<br />
Try 'readlink --help' for more information.<br />
To fix this, open {{ic|~/.steam/root/SteamApps/common/And Yet It Moves/AndYetItMovesSteam.sh}} in text editor and replace line<br />
ayim_dir="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"<br />
with<br />
<br />
ayim_dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"<br />
<br />
====FTL: Faster than Light====<br />
=====Dependencies=====<br />
Libraries are downloaded and and placed in the game's data directory for both architectures. As long as you run FTL by the launcher script (or via the shortcut in Steam) you should not need to download any further libraries.<br />
<br />
=====Compatibility=====<br />
After installation, FTL may fail to run due to a 'Text file busy' error (characterised in Steam by your portrait border going green then blue again). The easiest way to mend this is to just reboot your system. Upon logging back in FTL should run.<br />
<br />
The Steam overlay in FTL does not function as it is not a 3D accelerated game. Because of this the desktop notifications will be visible. If playing in fullscreen, therefore, these notifications in some systems may steal focus and revert you back to windowed mode with no way of going back to fullscreen without relaunching. The binaries for FTL on Steam have no DRM and it is possible to run the game ''without'' Steam running, so in some cases that may be optimum - just ensure that you launch FTL via the launcher script in {{ic|~/.steam/root/SteamApps/common/FTL Faster than Light/data/}} rather than the FTL binary in the $arch directory.<br />
<br />
====Harvest: Massive Encounter====<br />
=====Dependencies=====<br />
* {{pkg|gtk2}} or {{pkg|lib32-gtk2}}<br />
* {{pkg|libvorbis}} or {{pkg|lib32-libvorbis}}<br />
* {{pkg|nvidia-cg-toolkit}} or {{aur|lib32-nvidia-cg-toolkit}}<br />
* {{aur|libjpeg6}} or {{aur|lib32-libjpeg6}}<br />
<br />
=====Compatibility=====<br />
Game refuses to launch and throws you to library installer loop. Just edit {{ic| ~/.steam/root/SteamApps/common/Harvest Massive Encounter/run_harvest}} and remove everything but<br />
#!/bin/bash<br />
INSTDIR="`dirname $0`" ; cd "${INSTDIR}" ; INSTDIR="`pwd`"<br />
export LD_LIBRARY_PATH=${INSTDIR}/bin:~/.steam/bin<br />
exec ./Harvest<br />
<br />
====Killing Floor====<br />
=====Troubleshooting=====<br />
======screen resolution======<br />
Killing Floor runs pretty much from scratch, although you might have to change in-game resolution screen as the default one is '''800x600''' and a '''4:3''' screen format.<br />
If you try to modify screen resolution in-game, it might crash your desktop enviroment.<br />
To fix this, please set the desired resolution screen size by modifing your {{ic|~/.killingfloor/System/KillingFloor.ini}} with your prefered editor.<br />
{{hc|# nano ~/.killingfloor/System/KillingFloor.ini|<nowiki><br />
...<br />
<br />
[WinDrv.WindowsClient]<br />
WindowedViewportX=????<br />
WindowedViewportY=????<br />
FullscreenViewportX=????<br />
FullscreenViewportY=????<br />
MenuViewportX=???<br />
MenuViewportY=???<br />
<br />
...<br />
<br />
[SDLDrv.SDLClient]<br />
WindowedViewportX=????<br />
WindowedViewportY=????<br />
FullscreenViewportX=????<br />
FullscreenViewportY=????<br />
MenuViewportX=????<br />
MenuViewportY=????<br />
<br />
...<br />
</nowiki>}}<br />
{{Note|Replace all the '''????''' with the corresponding numbers according the desired resolution. If you have an 1366x768 screen and want to use it at it's fullest, change all the Viewport fields to something like '''ViewportX&#61;1366''' and '''ViewportY&#61;768''' in the corresponding areas.}}<br />
{{Note| The dots in the middle indicate that there are more fields in that .ini file. But for screen resolution troubleshooting, you don't need to modify anything else.}}<br />
<br />
Save the file and restart the game, it should work now.<br />
<br />
====== Windowed Mode ======<br />
<br />
Uncheck fullscreen in the options menu, and use Ctrl-G to stop mouse capturing (that was non obvious to discover..). This way you can easily minimize it and do other other things..and let your WM handle things.<br />
<br />
====Penumbra: Overture====<br />
=====Dependencies=====<br />
(Taken from {{aur|penumbra-collection}} and {{aur|penumbra-overture-ep1-demo}})<br />
* {{pkg|lib32-openal}}<br />
* {{pkg|lib32-sdl_ttf}}<br />
* {{pkg|lib32-libvorbis}}<br />
* {{pkg|lib32-libxft}}<br />
* {{pkg|lib32-glu}}<br />
* {{pkg|lib32-sdl_image}}<br />
<br />
=====Troubleshooting=====<br />
======Segfault after intro video======<br />
The game crashes with a segfault after the intro video due to incompatibility with the version of libvorbis in [extra] (or lib32-libvorbis in [multilib] if you're on x86_64). To fix this you have to use the libvorbis.so.0 shipped with the game:<br />
<br />
cd ~/.local/share/Steam/SteamApps/common/Penumbra\ Overture/lib<br />
cp all/libvorbis.so.0 libvorbis.so.0<br />
<br />
After this you should be able to play.<br />
<br />
======Windowed Mode======<br />
There is no in-game option to change to the windowed mode, you will have to edit {{ic|~/.frictionalgames/Penumbra/Overture/settings.cfg}} to activate it.<br />
Find {{ic|FullScreen&#61;"true"}} and change it to {{ic|FullScreen&#61;"false"}}, after this the game should start in windowed mode.<br />
<br />
====Serious Sam 3: BFE====<br />
=====Dependencies=====<br />
<br />
* {{aur|lib32-pciutils}} - Useless as now SS3 uses lspci in a recent beta release (From [http://steamcommunity.com/app/41070/discussions/0/828924672560153011/ SteamCommunity]).<br />
<br />
====Steel Storm: Burning Retribution====<br />
=====Troubleshooting=====<br />
======Start with black screen======<br />
The game tries to launch in 1024x768 resolution with fullscreen mode by default. It is impossible on some devices.<br />
(for example laptop Samsung Series9 with intel hd4000 video).<br />
But you can try to launch the game in windowed mode. <br />
<br />
Open game Properties in Steam, in General tab select "Set launch options..." and type "-window".<br />
<br />
Then you can change a resolution in game.<br />
<br />
======No English fonts======<br />
If you use intel video card, just disable S3TC in DriConf.<br />
<br />
====Superbrothers: Sword & Sworcery EP====<br />
<br />
=====Dependencies=====<br />
<br />
* {{aur|lib32-curl}} ([https://github.com/ValveSoftware/steam-for-linux/issues/251 known bug])<br />
* {{Pkg|lib32-glu}}<br />
<br />
====Team Fortress 2 ====<br />
=====Dependencies=====<br />
<br />
* {{pkg|lib32-libtxc_dxtn}}<br />
<br />
=====Troubleshooting=====<br />
======No audio======<br />
It happens if there is no PulseAudio in your system.<br />
If you want to use Alsa, you need to launch the Steam or game directly with {{ic|SDL_AUDIODRIVER&#61;alsa}} <br />
(From [http://steamcommunity.com/app/221410/discussions/0/882966056462819091/#c882966056470753683 SteamCommunity]).<br />
<br />
======glGetError message on startup======<br />
If you're getting the following message when trying to launch Team Fortress 2:<br />
<br />
<nowiki>Could not find required OpenGL entry point ‘glGetError’! Either your video card is unsupported, or your OpenGL driver needs to be updated.</nowiki><br />
<br />
It is possible you are still using the '''libgl''' package for OpenGL instead of your drivers. Make sure you've uninstalled other drivers like '''nouveau'''. If you are sure you've done that, try reinstalling your graphics drivers to see if it asks you to replace the '''libgl''' package, and confirm. If you are on a ''x64'' system, it could also be the '''lib32-libgl''' package that is causing the issue, since it may be possible that the game is trying to run itself under ''x86''. For NVidia users, make sure that you install the '''lib32-nvidia-utils''' package. Make sure it replaces '''lib32-libgl'''.<br />
<br />
====The Book of Unwritten Tales====<br />
If the game does not start, go to Properties --> Uncheck "Enable Steam Community In-Game".<br />
<br />
The game may segfault upon clicking the Setting menu and possibly during or before gameplay. This is a known issue and you will unfortunately have to wait for a fix from the developer.<br />
=====Dependencies=====<br />
* {{aur|lib32-libxaw}}<br />
* {{aur|lib32-jasper}}<br />
<br />
====The Clockwork Man====<br />
=====Dependencies=====<br />
* {{pkg|lib32-libidn}}<br />
<br />
====Trine 2====<br />
=====Dependencies=====<br />
<br />
* {{pkg|lib32-glu}}<br />
* {{pkg|lib32-libxxf86vm}}<br />
<br />
=====Troubleshooting=====<br />
<br />
* If colors are wrong with FOSS drivers (r600g at least), try to run the game in windowed mode, rendering will be corrected.<br />
<br />
===Skins for Steam===<br />
<br />
The Steam interface can be fully customized by copying its various interface files in its skins directory and modifying them.<br />
<br />
====Steam Skin Manager====<br />
<br />
The process of applying a skin to Steam can be greatly simplified using {{aur|steam-skin-manager}} from the AUR. The package also comes with a hacked version of the Steam launcher which allows the window manager to draw its borders on the Steam window.<br />
<br />
As a result, skins for Steam will come in two flavors, one with and on without window buttons. The skin manager will prompt you whether you use the hacked version or not, and will automatically apply the theme corresponding to your GTK theme if it is found. You can of course still apply another skin if you want.<br />
<br />
The package ships with two themes for the default Ubuntu themes, Ambiance and Radiance. A Faience theme is under development and already has its own package on the AUR {{aur|steam-skin-faience-git}}.<br />
<br />
== Steam on Wine ==<br />
<br />
Install {{Pkg|wine}} from the official repositories and follow the instructions provided in the [[Wine|article]].<br />
<br />
Install the required Microsoft fonts {{AUR|ttf-microsoft-tahoma}} and {{AUR|ttf-ms-fonts}} from the [[AUR]] or through {{AUR|winetricks-svn}}.<br />
{{Note|If you have access to Windows discs, you may want to install {{AUR|ttf-win7-fonts}} instead.}}<br />
<br />
If you have an old Wine prefix ({{ic|~/.wine}}), you should remove it and let Wine create a new one to avoid problems (you can transfer over anything you want to keep to the new Wine prefix).<br />
<br />
===Installation===<br />
<br />
Download and run the Steam installer from [http://store.steampowered.com/about/ steampowered.com]. It is no longer an {{ic|.exe}} file so you have to start it with {{ic|msiexec}}: <br />
$ msiexec /i SteamInstall.msi<br />
<br />
===Starting Steam===<br />
<br />
On x86:<br />
$ wine ~/.wine/drive_c/Program\ Files/Steam/Steam.exe<br />
<br />
On x86_64 (with steam installed to a clean wine prefix):<br />
$ wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe<br />
<br />
Alternatively, you may use this method:<br />
<br />
$ wine "C:\\Program Files\\Steam\\steam.exe" <br />
<br />
You should consider making an alias to easily start steam (and put it in your shell's rc file), example:<br />
alias steam='wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe >/dev/null 2>&1 &'<br />
<br />
{{Note|If you are using an nvidia card through bumblebee, you should prefix those commands with {{ic|optirun}}.}}<br />
<br />
===Tips===<br />
<br />
====Performance====<br />
<br />
Consider disabling wine debugging output by adding this to your shell rc file:<br />
export WINEDEBUG=-all<br />
or, just add it to your steam alias to only disable it for steam:<br />
alias steam='WINEDEBUG=-all wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe >/dev/null 2>&1 &'<br />
Additionally, Source games rely on a paged pool memory size specification for audio, and WINE by default does not have this set. To set it:<br />
wine reg add "HKLM\\System\\CurrentControlSet\\Control\\Session Manager\\Memory Management\\" /v PagedPoolSize /t REG_DWORD /d 402653184 /f<br />
<br />
==== Application Launch Options ====<br />
Go to "Properties" -> "Set Launch Options", e.g.:<br />
{{bc|-console -dxlevel 90 -width 1280 -height 1024<br />
}}<br />
* {{ic|console}}<br />
Activate the console in the application to change detailed applications settings.<br />
* {{ic|dxlevel}}<br />
Set the application's DirectX level, e.g. 90 for DirectX Version 9.0. It is recommended to use the video card's DirectX version to prevent crashes. See the official Valve Software Wiki http://developer.valvesoftware.com/wiki/DirectX_Versions for details.<br />
* {{ic|width}} and {{ic|height}}<br />
Set the screen resolution. In some cases the graphic settings are not saved in the application and the applications always starts in the default resolution.<br />
Please refer to http://developer.valvesoftware.com/wiki/Launch_options for a complete list of launch options.<br />
<br />
==== Using a Pre-Existing Steam Install ====<br />
<br />
If you have a shared drive with Windows, or already have a Steam installation somewhere else, you can simply symlink the Steam directory to {{ic|~/.wine/drive_c/Program Files/Steam/}} . However, be sure to do '''all''' the previous steps in this wiki. Confirm Steam launches and logs into your account, ''then'' do this:<br />
<br />
cd ~/.wine/drive_c/Program\ Files/ <br />
mv Steam/ Steam.backup/ (or you can just delete the directory)<br />
ln -s /mnt/windows_partition/Program\ Files/Steam/<br />
<br />
{{Note|If you have trouble starting Steam after symlinking the entire Steam folder, try linking only the {{ic|steamapps}} subdirectory in your existing wine steam folder instead.}}<br />
<br />
{{Note|If you still have trouble starting games, use {{ic|sudo mount --bind /path/to/SteamApps ~/.local/share/Steam/SteamApps -ouser&#61;your-user-name }}, this is the only thing that worked for me with {{ic|TF2}}}}<br />
<br />
====Running Steam in a second X Server====<br />
<br />
Assuming you are using the script above to start Steam, make a new script, called {{ic|x.steam.sh}}. You should run this when you want to start Steam in a new X server, and {{ic|steam.sh}} if you want Steam to start in the current X server. <br />
<br />
If due to misconfiguration a black screen is shown, you could always close down the second X server by pressing {{Keypress|Ctrl}} + {{Keypress|Alt}} + {{Keypress|Backspace}}.<br />
<br />
{{bc|1=<br />
#!/bin/bash <br />
<br />
DISPLAY=:1.0<br />
<br />
xinit $HOME/steam.sh $* -- :1<br />
}}<br />
<br />
Now you can use {{Keypress|Ctrl}} + {{Keypress|Alt}} + {{Keypress|F7}} to get to your first X server with your normal desktop, and {{Keypress|Ctrl}} + {{Keypress|Alt}} + {{Keypress|F8}} to go back to your game. <br />
<br />
Because the second X server is ''only'' running the game and the first X server with all your programs is backgrounded, performance should increase. In addition, it is much more convenient to switch X servers while in game to access other resources, rather than having to exit the game completely or {{Keypress|Alt}}-{{Keypress|Tab}} out. Finally, it is useful for when Steam or WINE goes haywire and leaves a bunch of processes in memory after Steam crashes. Simply {{Keypress|Ctrl}} + {{Keypress|Alt}} + {{Keypress|Backspace}} on the second X server to kill that X and all processes on that desktop will terminate as well. <br />
<br />
'''If you get errors that look like "Xlib: connection to ":1.0" refused by server" when starting the second X''': You will need to adjust your X permissions.<br />
<br />
'''If you lose the ability to use the keyboard while using Steam''': This is an odd bug that does not happen with other games. A solution is to use a WM in the second X as well. Thankfully, you do not need to run a large WM. Openbox and icewm have been confirmed to fix this bug (evilwm, pekwm, lwm ''do not'' work), but the icewm taskbar shows up on the bottom of the game, thus it's recommended to use [[Openbox]]. Install {{Pkg|openbox}} from the [[official repositories]], then add {{Ic|openbox &}} to the top of your {{ic|steam.sh}} file. Note you can run other programs (ex. Teamspeak &) or set X settings (ex. xset, xmodmap) before the WINE call as well.<br />
<br />
====Steam Links in Firefox, Chrome, Etc====<br />
To make steam:// urls in your browser connect with steam in wine, there are several things you can do. One involves making steam url-handler keys in gconf, another involves making protocol files for kde, others involve tinkering with desktop files or the Local State file for chromium. These seem to only work in firefox or under certain desktop configurations. One way to do it that works more globally is using mimeo, a tool made by Xyne (an Arch TU) which follows. For another working and less invasive (but firefox-only) way, see the first post [http://ubuntuforums.org/showthread.php?t=433548 here] .<br />
<br />
* Make {{ic| /usr/bin/steam}} with your favorite editor and paste:<br />
<br />
{{bc|<br />
#!/bin/sh<br />
#<br />
# Steam wrapper script<br />
#<br />
exec wine "c:\\program files\\steam\\steam.exe" "$@"<br />
}}<br />
<br />
* Make it executable.<br />
<br />
# chmod +x /usr/bin/steam<br />
<br />
* Install {{AUR|mimeo}} and {{AUR|xdg-utils-mimeo}} from AUR. You will need to replace the existing {{pkg|xdg-utils}} if installed. In XFCE, you will also need {{pkg|xorg-utils}}.<br />
<br />
* Create {{ic|~/.config/mimeo.conf}} with your favorite editor and paste:<br />
<br />
{{bc|<br />
/usr/bin/steam %u<br />
^steam://<br />
}}<br />
<br />
* Lastly, open {{ic|/usr/bin/xdg-open}} in your favorite editor. Go to the {{ic|detectDE()}} section and change it to look as follows:<br />
<br />
{{bc|<nowiki><br />
detectDE()<br />
{<br />
#if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;<br />
#elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;<br />
#elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;<br />
#elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;<br />
#elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;<br />
#else DE=""<br />
#fi<br />
DE=""<br />
}<br />
</nowiki>}}<br />
<br />
* Restart the browser and you should be good to go. In chromium, you cannot enter a {{ic|steam://}} link in the url box like you can with firefox. The forum link above has a {{ic|steam://open/friends}} link to try if needed.<br />
<br />
{{Note|If you have any problems with file associations after doing this, simply revert to regular xdg-utils and undo your changes to {{ic|/usr/bin/xdg-open}}.}}<br />
{{Note|Those on other distributions that stumble upon this page, see the link above for firefox specific instructions. No easy way to get it working on Chromium on other distros exists.}}<br />
<br />
====No text rendered problem====<br />
If there is no text/font rendered when starting steam you should try to start steam with the parameter {{ic|-no-dwrite}}. Read more in [https://bbs.archlinux.org/viewtopic.php?id=146223 the forum thread about it.]<br />
{{bc|wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe -no-dwrite}}</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=233003General troubleshooting2012-11-01T13:25:29Z<p>Cinelli: /* Collect information */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
<br />
<br />
== Attention To Detail ==<br />
<br />
In order to resolve an issue that you're having with [[Main_Page|Archlinux]], it is ''absolutely crucial'' to have a firm understanding of how that specific system functions. How it works, and what does it need to run without error? If you cannot comfortably answer these question then it is strongly advised that you review the [[Main_Page|Archwiki]] article for the application/service that you are having troubles with.Once you feel like you've understood the specific system, it will be easier for you to pin-point the problem. Saying, ''"Program X doesn't work"'' is unacceptable. Precision is key.<br><br />
<br><br />
The following gives a number of questions for you to ask yourself whenever dealing with a malfunctioning system. Under each question there are notes explaining how you should be answering each question, followed by some light examples on how to easily gather data output and what tools can be used to review logs and the journal.<br><br />
<br />
<br />
== Questions / Checklist ==<br />
<br />
;1. What <u>is</u> the issue(s)?:Be ''<u>as precise as possible</u>''. This will help you not get confused and/or side-tracked when looking up specific information.<br />
;2. Are there error messages? (if any):Copy and paste <u>''full outputs''</u> that contain '''error messages''' related to your issue into a separate file. $HOME/issue.log<br><br />
# To forward the output of the following [[mkinitcpio]] command to '''$HOME/issue.log''' :<br />
$ mkinitcpio -p linux >> $HOME/issue.log'' <br />
;3. Can you reproduce the issue?:If so, give ''exact'' '''step-by-step''' instructions/commands needed to do so.<br><br />
;4. When did you first encounter these issues and what was changed between then and when the system was operating without error?:If it occurred right after an update then, list '''<u>all packages that were updated</u>'''. Include ''version numbers'', also, paste the entire update from [[pacman]].log ('''/var/log/pacman.log'''). Also Take note of the status' of ''any'' service(s) needed to support the malfunctioning application(s) using [[systemd]]'s [[systemd#Basic_command_usage_examples|systemctl]] tools.<br />
# To forward the output of the following [[Systemd#Basic_command_usage_examples|systemd]] command to '''$HOME/issue.log'''<br />
$ [[Systemd#Basic_command_usage_examples|systemctl]] status dhcpcd@eth0.service >> '''$HOME/issue.log'''<br />
'''Note:''' Using "'''>>'''" will ensure any previous text in '''issue.log''' will not be overwritten.<br />
<br />
<br />
== Remember ==<br />
<br />
; When attempting to resolve an issue, '''never''' approach it as:Application '''X''' does not work.<br />
; Instead, look at it in its entirety:Application '''X''' produces '''Y''' error(s) when performing '''Z''' tasks under conditions '''A''' and '''B'''<br />
<br />
<br />
== Additional Support ==<br />
<br />
With all the information in front of you. You should have a good idea as to what is going on with the system.<br><br />
And you can now start working on a proper fix.<br><br />
<br><br />
If you require any additional support, it can be found at irc.freenode.net #archlinux<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
''Example:'' After an every-day routine update or following the installation of a package you are given the following error:<br />
# file: could not find any magic files!<br />
This will most likely leave your system crippled. And, any attempts made to recompile/reinstall the package(s) responsible for the breakage will fail. Also, any attempts made to try to rebuild the [[mkinitcpio|initramfs]] will result in the following:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to '''/etc/ld.so.conf''' which are now invalid.<br><br />
#Boot into the Archlinux Live CD / Installation Media.<br><br />
#Mount your '''root (/)''' partition to '''/mnt''' and using [[Change_Root#Change_root|arch-chroot]], [[Change_Root|chroot]] into your system.<br />
{{Note|[[Change_Root#Change_root|arch-chroot]] leaves mounting the '''/boot''' partition up to the user.}}<br />
#Examine '''/etc/ld.so.conf''' and remove any invalid lines found.<br><br />
#Examine the files located inside the directory '''/etc/ld.so.conf.d/''' and remove all invalid files.<br><br />
#Rebuild the [[initramfs]].<br><br />
# mkinitcpio -p linux<br />
#Reboot back to your installed system. <br><br />
#Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br><br />
# pacman -S <package><br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=232946General troubleshooting2012-11-01T08:41:38Z<p>Cinelli: /* file: could not find any magic files! */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
== Collect information ==<br />
Before you can solve a problem, you must be aware of what the problem is. Try to find:<br />
<br />
* What are the symptoms?<br />
* Is there any error message?<br />
* Under what conditions does the problem appear?<br />
* What has changed in the time between now and when everything last worked perfectly?<br />
<br />
you should try to understand the problem as specifically as possible; instead of saying:<br />
Program A doesn't work<br />
you should think of it as<br />
Program A produces Result B when I try to perform Task C under Condition D.<br />
<br />
Once you are able to accurately fill in the variables, you will have a more concrete understanding of the situation than if you try to deal with the problem more abstractly.<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
''Example:'' After an every-day routine update or following the installation of a package you are given the following error:<br />
# file: could not find any magic files!<br />
This will most likely leave your system crippled. And, any attempts made to recompile/reinstall the package(s) responsible for the breakage will fail. Also, any attempts made to try to rebuild the [[mkinitcpio|initramfs]] will result in the following:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to '''/etc/ld.so.conf''' which are now invalid.<br><br />
#Boot into the Archlinux Live CD / Installation Media.<br><br />
#Mount your '''root (/)''' partition to '''/mnt''' and using [[Change_Root#Change_root|arch-chroot]], [[Change_Root|chroot]] into your system.<br />
{{Note|[[Change_Root#Change_root|arch-chroot]] leaves mounting the '''/boot''' partition up to the user.}}<br />
#Examine '''/etc/ld.so.conf''' and remove any invalid lines found.<br><br />
#Examine the files located inside the directory '''/etc/ld.so.conf.d/''' and remove all invalid files.<br><br />
#Rebuild the [[initramfs]].<br><br />
# mkinitcpio -p linux<br />
#Reboot back to your installed system. <br><br />
#Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br><br />
# pacman -S <package><br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=232944General troubleshooting2012-11-01T08:17:05Z<p>Cinelli: /* Solution */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
== Collect information ==<br />
Before you can solve a problem, you must be aware of what the problem is. Try to find:<br />
<br />
* What are the symptoms?<br />
* Is there any error message?<br />
* Under what conditions does the problem appear?<br />
* What has changed in the time between now and when everything last worked perfectly?<br />
<br />
you should try to understand the problem as specifically as possible; instead of saying:<br />
Program A doesn't work<br />
you should think of it as<br />
Program A produces Result B when I try to perform Task C under Condition D.<br />
<br />
Once you are able to accurately fill in the variables, you will have a more concrete understanding of the situation than if you try to deal with the problem more abstractly.<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
Once after update or installation some package you geting this error:<br />
# file: could not find any magic files!<br />
<br />
And after this your system can be completely broken.<br />
Any time you try to reinstall or recompile for example:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to /etc/ld.so.conf which are now invalid.<br><br />
#Boot the system with Archlinux Live CD / Installation Media.<br><br />
#Mount your '''root (/)''' partition to '''/mnt''' and [[Change_Root#Change_root|chroot]] into the system.<br />
{{Note|arch-chroot leaves mounting the /boot partition up to the user.}}<br />
#Examine /etc/ld.so.conf and remove any invalid lines found.<br><br />
#Examine the files located inside the directory /etc/ld.so.conf.d/ and remove all invalid files.<br><br />
#Rebuild the [[initramfs]].<br><br />
$ mkinitcpio -p linux<br />
#Reboot back to your installed system. <br><br />
#Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br><br />
$ pacman -S <package><br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=232943General troubleshooting2012-11-01T08:00:12Z<p>Cinelli: /* file: could not find any magic files! */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
== Collect information ==<br />
Before you can solve a problem, you must be aware of what the problem is. Try to find:<br />
<br />
* What are the symptoms?<br />
* Is there any error message?<br />
* Under what conditions does the problem appear?<br />
* What has changed in the time between now and when everything last worked perfectly?<br />
<br />
you should try to understand the problem as specifically as possible; instead of saying:<br />
Program A doesn't work<br />
you should think of it as<br />
Program A produces Result B when I try to perform Task C under Condition D.<br />
<br />
Once you are able to accurately fill in the variables, you will have a more concrete understanding of the situation than if you try to deal with the problem more abstractly.<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
Once after update or installation some package you geting this error:<br />
# file: could not find any magic files!<br />
<br />
And after this your system can be completely broken.<br />
Any time you try to reinstall or recompile for example:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to /etc/ld.so.conf which are now invalid.<br><br />
#Boot the system with Archlinux Live CD / Installation Media.<br><br />
#Mount any partitions and [https://wiki.archlinux.org/index.php/Change_Root Chroot] into your broken installation.<br><br />
#Examine /etc/ld.so.conf and remove any invalid lines found.<br><br />
#Examine the files located inside the directory /etc/ld.so.conf.d/ and remove all invalid files. <br><br />
#Reboot back to your installed system. <br><br />
#Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br><br />
::{{ic|pacman -S <package>}}<br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=232942General troubleshooting2012-11-01T07:57:39Z<p>Cinelli: /* Solution */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
== Collect information ==<br />
Before you can solve a problem, you must be aware of what the problem is. Try to find:<br />
<br />
* What are the symptoms?<br />
* Is there any error message?<br />
* Under what conditions does the problem appear?<br />
* What has changed in the time between now and when everything last worked perfectly?<br />
<br />
you should try to understand the problem as specifically as possible; instead of saying:<br />
Program A doesn't work<br />
you should think of it as<br />
Program A produces Result B when I try to perform Task C under Condition D.<br />
<br />
Once you are able to accurately fill in the variables, you will have a more concrete understanding of the situation than if you try to deal with the problem more abstractly.<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
Once after update or installation some package you geting this error:<br />
# file: could not find any magic files!<br />
<br />
And after this your system can be completely broken.<br />
Any time you try to reinstall or recompile for example:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to /etc/ld.so.conf which are now invalid.<br><br />
#Boot the system with Archlinux Live CD / Installation Media.<br><br />
#Mount any partitions and [https://wiki.archlinux.org/index.php/Change_Root Chroot] into your broken installation.<br><br />
#Examine /etc/ld.so.conf and remove any invalid lines found.<br><br />
#Examine the files located inside the directory /etc/ld.so.conf.d/ and remove all invalid files. <br><br />
#Reboot back to your installed system. <br><br />
#Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br><br />
::{{ic|pacman -S package_file}}<br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=232941General troubleshooting2012-11-01T07:57:10Z<p>Cinelli: /* Solution */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
== Collect information ==<br />
Before you can solve a problem, you must be aware of what the problem is. Try to find:<br />
<br />
* What are the symptoms?<br />
* Is there any error message?<br />
* Under what conditions does the problem appear?<br />
* What has changed in the time between now and when everything last worked perfectly?<br />
<br />
you should try to understand the problem as specifically as possible; instead of saying:<br />
Program A doesn't work<br />
you should think of it as<br />
Program A produces Result B when I try to perform Task C under Condition D.<br />
<br />
Once you are able to accurately fill in the variables, you will have a more concrete understanding of the situation than if you try to deal with the problem more abstractly.<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
Once after update or installation some package you geting this error:<br />
# file: could not find any magic files!<br />
<br />
And after this your system can be completely broken.<br />
Any time you try to reinstall or recompile for example:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to /etc/ld.so.conf which are now invalid.<br><br />
#Boot the system with Archlinux Live CD / Installation Media.<br><br />
#Mount any partitions and [https://wiki.archlinux.org/index.php/Change_Root Chroot] into your broken installation.<br><br />
#Examine /etc/ld.so.conf and remove any invalid lines found.<br><br />
#Examine the files located inside the directory /etc/ld.so.conf.d/ and remove all invalid files. <br><br />
#Reboot back to your installed system. <br><br />
#Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br><br />
;{{ic|pacman -S package_file}}<br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=232940General troubleshooting2012-11-01T07:56:26Z<p>Cinelli: /* Solution */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
== Collect information ==<br />
Before you can solve a problem, you must be aware of what the problem is. Try to find:<br />
<br />
* What are the symptoms?<br />
* Is there any error message?<br />
* Under what conditions does the problem appear?<br />
* What has changed in the time between now and when everything last worked perfectly?<br />
<br />
you should try to understand the problem as specifically as possible; instead of saying:<br />
Program A doesn't work<br />
you should think of it as<br />
Program A produces Result B when I try to perform Task C under Condition D.<br />
<br />
Once you are able to accurately fill in the variables, you will have a more concrete understanding of the situation than if you try to deal with the problem more abstractly.<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
Once after update or installation some package you geting this error:<br />
# file: could not find any magic files!<br />
<br />
And after this your system can be completely broken.<br />
Any time you try to reinstall or recompile for example:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to /etc/ld.so.conf which are now invalid.<br><br />
<br><br />
#Boot the system with Archlinux Live CD / Installation Media.<br><br />
#Mount any partitions and [https://wiki.archlinux.org/index.php/Change_Root Chroot] into your broken installation.<br><br />
#Examine /etc/ld.so.conf and remove any invalid lines found.<br><br />
#Examine the files located inside the directory /etc/ld.so.conf.d/ and remove all invalid files. <br><br />
#Reboot back to your installed system. <br><br />
#Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br><br />
{{ic|pacman -S package_file}}<br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=232939General troubleshooting2012-11-01T07:55:30Z<p>Cinelli: /* Solution */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
== Collect information ==<br />
Before you can solve a problem, you must be aware of what the problem is. Try to find:<br />
<br />
* What are the symptoms?<br />
* Is there any error message?<br />
* Under what conditions does the problem appear?<br />
* What has changed in the time between now and when everything last worked perfectly?<br />
<br />
you should try to understand the problem as specifically as possible; instead of saying:<br />
Program A doesn't work<br />
you should think of it as<br />
Program A produces Result B when I try to perform Task C under Condition D.<br />
<br />
Once you are able to accurately fill in the variables, you will have a more concrete understanding of the situation than if you try to deal with the problem more abstractly.<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
Once after update or installation some package you geting this error:<br />
# file: could not find any magic files!<br />
<br />
And after this your system can be completely broken.<br />
Any time you try to reinstall or recompile for example:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to /etc/ld.so.conf which are now invalid.<br><br />
<br><br />
#Boot the system with Archlinux Live CD / Installation Media.<br><br />
#Mount any partitions and [https://wiki.archlinux.org/index.php/Change_Root Chroot] into your broken installation.<br><br />
#Examine /etc/ld.so.conf and remove any invalid lines found.<br><br />
#Examine the files located inside the directory /etc/ld.so.conf.d/ and remove all invalid files. <br><br />
#Reboot back to your installed system. <br><br />
#Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br><br />
{{ic | pacman -S package_file }}<br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=232938General troubleshooting2012-11-01T07:54:11Z<p>Cinelli: /* Solution */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
== Collect information ==<br />
Before you can solve a problem, you must be aware of what the problem is. Try to find:<br />
<br />
* What are the symptoms?<br />
* Is there any error message?<br />
* Under what conditions does the problem appear?<br />
* What has changed in the time between now and when everything last worked perfectly?<br />
<br />
you should try to understand the problem as specifically as possible; instead of saying:<br />
Program A doesn't work<br />
you should think of it as<br />
Program A produces Result B when I try to perform Task C under Condition D.<br />
<br />
Once you are able to accurately fill in the variables, you will have a more concrete understanding of the situation than if you try to deal with the problem more abstractly.<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
Once after update or installation some package you geting this error:<br />
# file: could not find any magic files!<br />
<br />
And after this your system can be completely broken.<br />
Any time you try to reinstall or recompile for example:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to /etc/ld.so.conf which are now invalid.<br><br />
<br><br />
#Boot the system with Archlinux Live CD / Installation Media.<br><br />
#Mount any partitions and [https://wiki.archlinux.org/index.php/Change_Root Chroot] into your broken installation.<br><br />
#Examine /etc/ld.so.conf and remove any invalid lines found.<br><br />
#Examine the files located inside the directory /etc/ld.so.conf.d/ and remove all invalid files. <br><br />
#Reboot back to your installed system. <br><br />
#Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br><br />
{{# | pacman -S package_file }}<br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=232937General troubleshooting2012-11-01T07:48:21Z<p>Cinelli: /* Solution */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
== Collect information ==<br />
Before you can solve a problem, you must be aware of what the problem is. Try to find:<br />
<br />
* What are the symptoms?<br />
* Is there any error message?<br />
* Under what conditions does the problem appear?<br />
* What has changed in the time between now and when everything last worked perfectly?<br />
<br />
you should try to understand the problem as specifically as possible; instead of saying:<br />
Program A doesn't work<br />
you should think of it as<br />
Program A produces Result B when I try to perform Task C under Condition D.<br />
<br />
Once you are able to accurately fill in the variables, you will have a more concrete understanding of the situation than if you try to deal with the problem more abstractly.<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
Once after update or installation some package you geting this error:<br />
# file: could not find any magic files!<br />
<br />
And after this your system can be completely broken.<br />
Any time you try to reinstall or recompile for example:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to /etc/ld.so.conf which are now invalid.<br><br />
<br><br />
1. Boot the system with Archlinux Live CD / Installation Media.<br><br />
2. Mount any partitions and [https://wiki.archlinux.org/index.php/Change_Root Chroot] into your broken installation.<br><br />
3. Examine /etc/ld.so.conf and remove any invalid lines found.<br><br />
4. Examine the files located inside the directory /etc/ld.so.conf.d/ and remove all invalid files. <br><br />
5. Reboot back to your installed system. <br><br />
6. Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br><br />
# pacman -S package_file<br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=General_troubleshooting&diff=232935General troubleshooting2012-11-01T07:46:49Z<p>Cinelli: /* Solution */</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:System recovery]]<br />
{{stub}}<br />
<br />
This article explains some methods for general troubleshooting. For application specific issues, please reference the particular wiki page for that program.<br />
<br />
== Collect information ==<br />
Before you can solve a problem, you must be aware of what the problem is. Try to find:<br />
<br />
* What are the symptoms?<br />
* Is there any error message?<br />
* Under what conditions does the problem appear?<br />
* What has changed in the time between now and when everything last worked perfectly?<br />
<br />
you should try to understand the problem as specifically as possible; instead of saying:<br />
Program A doesn't work<br />
you should think of it as<br />
Program A produces Result B when I try to perform Task C under Condition D.<br />
<br />
Once you are able to accurately fill in the variables, you will have a more concrete understanding of the situation than if you try to deal with the problem more abstractly.<br />
<br />
==Session permissions==<br />
<br />
{{Note|You must be using [[systemd]] as your init system for local sessions to work - which includes ACLs for various devices (see {{ic|/usr/lib/udev/rules.d/70-uaccess.rules}}) along with polkit permissions.}}<br />
<br />
First, make sure you have a valid local session within X:<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
This should contain {{ic|1=Remote=no}} and {{ic|1=Active=yes}} in the output. See [[xinitrc#Preserving the session]] for troubleshooting if it does not.<br />
<br />
A dbus session should also be started along with X, in a way that exports a single {{ic|DBUS_SESSION_BUS_ADDRESS}} for every application in your session. If you use a desktop environment this will be handled for you, otherwise you can copy the code from {{ic|/etc/skel/.xinitrc}} that runs files in {{ic|/etc/X11/xinit/xinitrc.d}} to your {{ic|~/.xinitrc}}, and avoid using {{ic|dbus-launch}} or {{ic|ck-launch-session}}.<br />
<br />
==Single user mode==<br />
If you cannot boot due to errors caused by a daemon, display manager or Xorg, you may be able use the single user [[Runlevels|runlevel]]:<br />
{{poor writing}}<br />
#Boot to single user mode by appending 1 or s to kernel line in grub. <br />
#Then edit the daemons array in rc.conf and remove the daemon which caused the problem. <br />
#telinit 3 to go back to multi user mode .<br />
#Then try to track down the issue by running the daemon manually.<br />
<br />
==file: could not find any magic files!==<br />
{{Poor writing}}<br />
Once after update or installation some package you geting this error:<br />
# file: could not find any magic files!<br />
<br />
And after this your system can be completely broken.<br />
Any time you try to reinstall or recompile for example:<br />
# mkinitcpio -p linux<br />
==> Building image from preset: 'default'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img<br />
file: could not find any magic files!<br />
==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
==> Building image from preset: 'fallback'<br />
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect<br />
file: could not find any magic files!<br />
@==> ERROR: invalid kernel specifier: `/boot/vmlinuz-linux'<br />
<br />
===Solution===<br />
Typically a previously installed application had placed a configuration file within /etc/ld.so.conf.d/ or it had made changes to /etc/ld.so.conf which are now invalid.<br />
<br />
1. Boot the system with Archlinux Live CD / Installation Media.<br />
2. Mount any partitions and [https://wiki.archlinux.org/index.php/Change_Root Chroot] into your broken installation.<br />
3. Examine /etc/ld.so.conf and remove any invalid lines found.<br />
4. Examine the files located inside the directory /etc/ld.so.conf.d/ and remove all invalid files. <br />
5. Reboot back to your installed system. <br />
6. Once booted, reinstall the package that was responsible for leaving your system inoperable using:<br />
# pacman -S package_file<br />
<br />
==See also==<br />
*[[Step By Step Debugging Guide]]<br />
*[http://www.maximumpc.com/article/features/linux_troubleshooting_guide_fix_most_common_problems Fix the Most Common Problems]</div>Cinellihttps://wiki.archlinux.org/index.php?title=KEYMAP&diff=227740KEYMAP2012-10-09T10:05:48Z<p>Cinelli: edited for consistancy with: man vconsole.conf</p>
<hr />
<div>[[Category:Internationalization]]<br />
[[es:KEYMAP]]<br />
[[pt:KEYMAP]]<br />
[[tr:Klavye_düzeni]]<br />
[[zh-CN:KEYMAP]]<br />
The '''KEYMAP''' variable is specified in the [[Systemd#Console_and_keymap|{{ic|/etc/vconsole.conf}}]] file ({{ic|/etc/rc.conf}} using the legacy rc.conf format). It defines what keymap the keyboard is in the virtual consoles. Keytable files are provided by the {{Pkg|kbd}} package.<br />
<br />
==Keyboard layouts==<br />
This is the list of known keymap settings to work for the corresponding keyboard layouts. Most keymaps can be found in the {{ic|/usr/share/kbd/keymaps/i386/''layout''}} (''layout''=qwerty, azerty, dvorak, etc.) directory.<br />
<br />
Less common but nonetheless useful keymaps for Arch Linux are found in the {{ic|/usr/share/kbd/keymaps/''architecture''}} (''architecture''=mac, sun, etc.) directory.<br />
<br />
{{Note|In an X session, you can use setxkbmap to instantly apply keyboard layout: {{Ic|setxkbmap -layout dvorak}}}}<br />
<br />
{{Note|If these keymaps do not work for you, make sure the keymap file exists in {{ic|/usr/share/kbd/keymaps/}} using {{Ic|find}}: {{Ic|find /usr/share/kbd/keymaps/ -name "*[your desired keymap]*"}}}}<br />
<br />
{| class="wikitable" border="1"<br />
|-<br />
! Keyboard<br />
! Keymap setting<br />
|-<br />
|Belgian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>be-latin1}}<br />
|-<br />
|Brazilian Portuguese<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>br-abnt2}}<br />
|-<br />
|Canadian-French<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>cf}}<br />
|-<br />
|Canadian Multilingual (''in [[Arch User Repository|AUR]]'') <br />
|{{Ic|KEYMAP<nowiki>=</nowiki>ca_multi}}<br />
|-<br />
|Colemak ''(US)''<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>colemak}}<br />
|-<br />
|Croatian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>croat}}<br />
|-<br />
|Czech<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>cz-lat2}}<br />
|-<br />
|Dvorak<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>dvorak}}<br />
|-<br />
|French<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>fr-latin9}}<br />
|-<br />
|German<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>de-latin1}}<br />
|-<br />
|German ''(no dead keys)''<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>de-latin1-nodeadkeys}}<br />
|-<br />
|Italian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>it}}<br />
|-<br />
|Lithuanian ''(qwerty)''<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>lt.baltic}}<br />
|-<br />
|Norwegian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>no-latin1}}<br />
|-<br />
|Polish<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>pl}}<br />
|-<br />
|Portuguese<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>pt-latin9}}<br />
|-<br />
|Romanian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>ro_win}}<br />
|-<br />
|Russian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>ru4}}<br />
|-<br />
|Singapore<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>sg-latin1}}<br />
|-<br />
|Slovene<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>slovene}}<br />
|-<br />
|Swedish<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>sv-latin1}}<br />
|-<br />
|Swiss-French<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>fr_CH-latin1}}<br />
|-<br />
|Swiss-German<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>de_CH-latin1}}<br />
|-<br />
|Spanish<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>es}}<br />
|-<br />
|Spanish Latinoamerican<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>la-latin1}}<br />
|-<br />
|Turkish<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>tr_q-latin5}}<br />
|-<br />
|Ukrainian<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>ua}}<br />
|-<br />
|United Kingdom<br />
|{{Ic|KEYMAP<nowiki>=</nowiki>uk}}<br />
|}<br />
<br />
==Configuring the Console Keymap==<br />
<br />
#{{ic|cd}} to {{ic|/usr/share/kbd/keymaps/i386/qwerty}}<br />
#Copy your default keymap ({{ic|us.map.gz}}) to a new file {{ic|personal.map.gz}}<br />
#{{ic|gunzip}} the new map file<br />
#Edit {{ic|personal.map}} using your favorite editor. Examples:<br />
#*'''Make the Right Alt key same as Left Alt key (Emacs)'''<br>change the line {{ic|include "linux-with-alt-and-altgr"}} to {{ic|include "linux-with-two-alt-keys"}}<br />
#*'''Swap CapsLock with Escape (Vim)'''<br>make {{ic|keycode 1 <nowiki>=</nowiki> Caps_Lock}} and {{ic|keycode 58 <nowiki>=</nowiki> Escape}}<br />
#*'''Make CapsLock another Control key'''<br>change the line {{ic|keycode 58 <nowiki>=</nowiki> Caps_Lock}} to {{ic|keycode 58 <nowiki>=</nowiki> Control}}<br />
#*'''Swap CapsLock with Left Control key'''<br>make {{ic|keycode 29 <nowiki>=</nowiki> Caps_Lock}} and {{ic|keycode 58 <nowiki>=</nowiki> Control}}<br />
#{{ic|gzip}} the map file<br />
#Change the default keyboard layout file that will be used by editing {{ic|/etc/vconsole.conf}} (you might have to create this file) and changing the line that says {{ic|KEYMAP<nowiki>=</nowiki>us}} to {{ic|KEYMAP<nowiki>=</nowiki>personal}}<br />
#Reboot to use your keymap the way nature intended (or run "loadkeys personal")<br />
{{Note| Prior to using {{ic|/etc/vconsole.conf}}, {{ic|KEYMAP<nowiki>=</nowiki>us}} was declared in {{ic|/etc/rc.conf}}.}}</div>Cinellihttps://wiki.archlinux.org/index.php?title=Official_Installation_Guide_(%C4%8Cesky)&diff=226606Official Installation Guide (Česky)2012-10-03T03:46:49Z<p>Cinelli: </p>
<hr />
<div>[[Category:Getting and installing Arch (Česky)]]<br />
[[Category:HOWTOs (Česky)]]<br />
[[Category:Accessibility (Česky)]]<br />
[[Category:Česky]]<br />
<br />
[[bg:Official Installation Guide]]<br />
[[en:Official Installation Guide]]<br />
[[es:Official Installation Guide]]<br />
[[fr:Guide officiel de l'installation]]<br />
[[it:Official Installation Guide]]<br />
[[ja:Official Installation Guide]]<br />
[[ko:Official Installation Guide]]<br />
[[nl:Official Installation Guide]]<br />
[[pl:Official Installation Guide]]<br />
[[pt:Official Installation Guide]]<br />
[[ro:Ghid de instalare oficial]]<br />
[[ru:Official Installation Guide]]<br />
[[sk:Official Installation Guide]]<br />
[[sr:Official Installation Guide]]<br />
[[uk:Official Installation Guide]]<br />
[[zh-CN:Official Installation Guide]]<br />
[[zh-TW:Official Installation Guide]]<br />
{{Article summary start|Shrnutí}}<br />
{{Article summary text| 1=<br />
<p>Všeobecná instalační dokumentace pro distribuci Arch Linux.</p><br />
<br />
<p>Tento průvodce je platný pouze pro vydání 2010.05 nebo novější. <strong>Tento průvodce reflektuje podstatné změny v konfiguraci, ke kterým došlo po vydání instalačního obrazu 2010.5 do srpna 2011 a až na detaily odpovídá i vydání 2011.08.19.</strong> Protože instalátor Arch Linuxu (AIF) je pouze v angličině, jsou pro orientaci některé termíny - zejména položky menu - uvedeny v závorce "v původním znění" :-). Tento průvodce se v některých bodech od anglického originálu liší, a to zejména tam, kde obsahuje nastavení doporučená pro české národní prostředí a tam, kde došlo ke změnám ve struktuře konfiguračních souborů, které anglický originál zatím nereflektuje.</p><br />
<br />
<p>Originální anglická verze je udržována v [http://projects.archlinux.org/?p=aif.git aif gitu] a je též dostupná ve složce /usr/share/aif/docs directory na instalačních médiích.</p>}}<br />
{{Article summary heading|Související články}}<br />
{{Article summary wiki|Průvodce začátečníka}} (Pokud s Arch Linuxem začínáte)<br />
{{Article summary end}}<br />
<br />
<h1>Úvod</h1><br />
<br />
<h2>Co je Arch Linux?</h2><br />
<br />
<p>Arch Linux je nezávisle vyvíjená linuxová distribuce optimalizovaná pro procesorové architektury i686 a x86_64, která původně vycházela z myšlenek distribuce CRUX. <br /><br />
Vývoj Arch Linuxu je zaměřen na rovnováhu jednoduchosti, elegantnosti, korektnosti kódu a nejnovějšího softwaru. <br /><br />
Jeho odlehčenost a jednoduchý návrh ho dělá snadno rozšiřitelným a tvarovatelným pro jakýkoliv druh systému, jenž budujete.</p><br />
<br />
<h2>Licence</h2><br />
<br />
<p>Arch Linux a jeho skripty jsou pod copyrightem</p><br />
<br />
<p>2002-2007 Judd Vinet</p><br />
<p>2007-2010 Aaron Griffin</p><br />
<br />
<p>a jsou licencovány pod licencí GNU GPL.</p><br />
<br />
<h1>Před instalací</h1><br />
<br />
<h2>Architektury</h2><br />
<br />
<p>Arch Linux je optimalizován pro procesory i686 a x86_64 a proto nepoběží na jakékoliv<br />
nižší nebo nekompatibilní generaci procesorů x86 (i386, i486 nebo i586).<br />
Je vyžadováno alespoň Pentium Pro, Pentium II nebo AMD Athlon (K7). (Technicky vzato jsou procesory bez instrukce cmov, jakými jsou AMD K6 a Via C3, také procesory i686, ale my používáme gcc a gcc zase používá instrukce cmov.)<br />
Před instalací Arch Linuxu byste se měli rozhodnout, jakou instalační metodu chcete použít.</p><br />
<br />
<h2>Dostupné obrazy</h2><br />
<br />
<p>Arch Linux poskytuje pro instalaci obrazy ISO, které mohou být zapsány na CD nebo na pevné či Flash disky.</p><br />
<br />
<p>Instalační obrazy ISO (dále jim budeme raději říkat instalační media, i když samozřejmě nemusí být vypálena) používají zavaděč Isolinux. Každé instalační médium má dvě varianty, které se liší pouze v tom, jaké obsahují balíčky.</p><br />
<br />
<ul><br />
<li><p>Instalační média "core" obsahují tzv. "snapshot" hlavních balíčků distribuce.<br /><br />
Tato média jsou nejvhodnější pro lidi, kteří mají pomalé nebo obtížně nastavitelné internetové připojení.</p></li><br />
<li><p>Instalační média "net" neobsahují vůbec žádné balíčky, balíčky budou staženy ze sítě.<br /><br />
Tuto variantu instalace upřednostňujeme, protože získáte zcela aktuální systém. Tento postup je vhodný pro lidi s rychlým připojením k Internetu.</p></li><br />
</ul><br />
<br />
<p>U obou těchto variant instalačních médií můžete instalátoru nařídit, aby stáhnul aktuální balíčky z Internetu nebo jakékoliv jiné sítě. Všechna instalační média mohou být použity i jako jako plně funkční prostředí pro obnovu systému. <br /><br />
Systém se spuští z instalačních médií stejně jako "normální" instalace Arch Linuxu.<br /><br />
Ve skutečnosti se liší je tím, že jsou na CD nebo Flash disku místo na pevném disku.br /><br />
Instalační média obsahují celou "základní" sadu balíčků (base), jakož i rozličné síťové nástroje a ovladače a instalační nástroj AIF.<br /><br />
Pokud budete při instalaci potřebovat ještě cokoliv dalšího, stačí spustit<br />
připojení k Internetu a nainstalovat pomocí pacmana.<br /><br />
Stručná příručka příkazů pacmana se nachází na konci tohoto dokumentu.</p><br />
<br />
<p>Obě varianty instalačních medií existují ve verzi pro platformu i686 a x86_64 a také "duální", která obsahuje obě dvě architektury a umožní výběr architektury při spuštění.</p><br />
<br />
<h2>Instalační nástroj AIF</h2><br />
<br />
<p>Arch Linux pro instalaci systému používá AIF (Arch Linux Installation Framework).<br /><br />
Tento nástroj &mdash; napsaný v bashi &mdash; sestává z několika funkcí, které provádí základní akce (instalace balíčků, nastavení disků atd.) a několika <br />
procedur, které využívají dílčí funkce k usnadnění instalace. Obvykle můžete použít tyto procedury:</p><br />
<br />
<ul><br />
<li><p>'''interactive:''' Interaktivní instalační procedura, získá od vás informace, provede vás instalací krok za krokem a pomůže vám<br />
zkonfigurovat systém, protože automaticky provede některá nastavení v cílovém systému (např. v nastavení sítě).<br /><br />
Po instalaci bude systém obsahovat jen základní sadu balíčků (base) a některé nástroje a ovladače umožňující připojení k internetu.<br /><br />
Po spuštění nainstalovaného systému spustíte úplný upgrade systému a nainstalujete jakékoliv další balíčky chcete.</p><br />
<br />
Interaktivní instalace se spustí zadáním příkazu: {{Ic|1=/arch/setup}}<br />
<br />
</li><br />
<li><p>'''automatic:''' Automatizovaná instalační procedura navržená pro nízkou nebo nulovou interaktivitu.<br /><br />
Pro konfiguraci cílového systému používá profily.<br /><br />
Ukázkové soubory profilů najdete v adresáři {{Ic|1=/usr/share/aif/examples/}}.<br />
Tyto ukázky implementují obecné scénáře instalace, ale můžete je pozměnit tak, abyste tak získali zvláštní balíčky<br />
nebo provedli změny v konfiguraci atd. <br />
</p></li><br />
<li><p>'''base:''' Instalace základní sady balíků (base) s nízkou interaktivitou a běžnými předdefinovanými hodnotami.<br /><br />
Tato funkce je základem pro ostatní instalační procedury a NENÍ určena pro přímé použití koncovými uživateli.<br />
</p></li><br />
<li><p>'''partial-configure-network:''' Toto je samostatně dostupná funkce pro konfiguraci sítě z interaktivní instalační procedury. Pomocí ní je možné nastavit síť při použití instalačního média jako tzv. "live" prostředí (např. pro obnovu apod.)).<br />
</p></li><br />
<li><p>'''partial-disks:''' Totéž jako výše, ale pro konfiguraci diskového subsystému.</p></li><br />
<li><p>'''partial-keymap:''' Fuknce pro změnu nastavení klávesnice nebo písma v konzoli.</p></li><br />
<br />
Spustí se příkazem {{Ic|1=km}}<br />
<br />
</ul><br />
<br />
<p>Výhodou funkcí jako jsou partial-keymap a partial-configure-network proti prostému použití standardních nástrojů jako jsou loadkeys nebo ifconfig je, že při následném spuštění interaktivní instalace budete dotázáni, zda chcete tato nastavení uplatnit i na konfiguraci cílového systému.</p><br />
<br />
<p>Pokud chcete zajít dále, můžete také:</p><br />
<br />
<ul><br />
<li>napsat své vlastní procedury "na zelené louce" nebo přepsat části hotových procedur,</li><br />
<li>napsat své vlastní fuknce, které poskytnou novou znovupoužitelnou funkcionalitu,</li><br />
<li>vytvořit vlastní konfigurace procedur, které to podporují (např. automatizovaná instalace).</li><br />
</ul><br />
<br />
<p>Pro více získáte v souboru readme AIF.</p><br />
<br />
<h2>Získání Arch Linuxu</h2><br />
<br />
<ul><br />
<li><p>Arch Linux si můžete stáhnout z jakéhokoliv zrcadla na [http://www.archlinux.org/download/ této stránce].</p></li><br />
<li><p>Můžete si též od Archux, OSDisc nebo LinuxCD zakoupit instalační CD a nechat ho poslat kamkoliv na světě.</p></li><br />
</ul><br />
<br />
<h2>Příprava instalačního média</h2><br />
<br />
<ul><br />
<li><p>Stáhněte si své vybrané médium pomocí torrent klienta (doporučeno) nebo ze svého oblíbeného zrcadla.</p></li><br />
<li><p>Stáhněte iso/<vydání>/sha1sums.txt</p></li><br />
<li><p>Ověřte integritu .iso obrazu pomocí sha1sum:</p><br />
<br />
sha1sum --check sha1sums.txt<br />
<br />
<p>archlinux-XXX.iso: OK</p></li><br />
<li><p>Vypalte ISO obraz na CD-R nebo CD-RW softwarem vlastního výběru. Pokud chcete použít zařízení USB Mass Storage standardu, jakým je např. flash disk, nahrajte na něj instalační obraz pomocí příkazu {{Ic|1=dd}} nebo podobného přímo zapisujícího softwaru:</p></li><br />
<br />
dd if=archlinux-XXX.iso of=/dev/sdX<br />
<br />
</ul><br />
<br />
<p>Ujistěte se, že používáte /dev/sdX a ne /dev/sdX1. <br /><br />
Tento příkaz nezvratně smaže veškeré soubory na vašem USB disku, takže se předem ujistěte, že na něm nemáte žádné důležité soubory.</p><br />
<br />
<h1>Instalace Arch Linuxu</h1><br />
<br />
<h2>Instalace z instalačního média</h2><br />
<br />
<h3>Před spuštěním</h3><br />
<br />
<p>Ujistěte se, že je váš BIOS nastaven tak, aby umožnil bootování z vaší<br />
CD-ROM nebo USB jednotky.<br /><br />
Restartujte svůj počítač s instalačním CD Arch Linuxu v jednotce nebo USB diskem<br />
zastrčeným v portu. Systém se začne spouštět z instalačního média a objeví se logo Arch Linuxu<br />
a obrazovka GRUBu, která čeká na váš výběr.<br /><br />
Zde můžete obvykle jen stisknout enter (výchozí volba). <br /><br />
Pokud se GRUB "zasekne", jste jedním z těch pár nešťastníků, kterým CD-ROM jednotka<br />
s GRUBem nefunguje, a v tom případě byste měli vyzkoušet obraz s IsoLinuxem.</p><br />
<br />
<h3>Po spuštění</h3><br />
<br />
<p>Na konci bootovacího procesu by se před vámi měla na obrazovce objevit výzva k přihlášení<br />
se základními pokyny. Přihlašte se jako root (heslo není vyžadováno).<br /><br />
Nyní můžete, je-li to třeba, ještě před zahájením instalace:</p><br />
<br />
<ul><br />
<li><p>- změnit rozložení kláves; pokud potřebujete už během instalace jiné než americké rozložení kláves nebo jiné písmo v konzoli změňte je příkazem:</p><br />
<br />
km<br />
<br />
</li><br />
<li><p>- získat přístup k internetu; pokud z nějakého důvodu potřebujete přístup k síti už před spuštěním instalátoru (interaktivní procedura vám později umožní zkonfigurovat síť), použijte příkaz:</p><br />
<br />
aif -p partial-configure-network<br />
<br />
</li><br />
</ul><br />
<br />
<p>Pokud následně sputíte interaktivní instalaci, dříve uvedená nastavení se zapamatují a případně mohou být uplatněna i na nainstalovaný systém.</p><br />
<br />
{{Tip| Výše se nastavuje rozložení pro instalační program, který je anglicky. I když instalujeme český systém, měnit rozložení kláves v této fázi není třeba.}}<br />
<br />
<p>Je také možné se přihlásit po účtem {{Ic|1=arch}}. To se může hodit, pokud chcete dělat cokoli pod neprivilegovaným uživatelem.<br /><br />
Většina uživatelů to nepotřebuje.</p><br />
<br />
{{Tip| Všechny informace potřebné k instalaci (tj. anglickou verzi této příručky, README pro aif,<br />
reference pro často používané běžné procedury aif) můžete najít v adresáři {{Ic|1=/arch}} instalačního média.}}<br />
<br />
<h2>Instalace ze sítě pomocí PXE</h2><br />
<br />
<h3>Nastavení serveru</h3><br />
<br />
<p>Na jiném stroji, kde běží (Arch) Linux (tzv. "live medium" nebo běžná instalace), <br /><br />
je třeba nainstalovat a konfigurovat démona ''dhcp'' a ''tftpd''.<br />
Dobrou volbou je instalace ''Dnsmasq'', čímž získáte obojí. <br /><br />
Také budete potřebovat démona ''nbd'' (network block device).</p><br />
<br />
<p>Více informací získáte zde na wiki: <br />
[[Archiso as pxe server|Live Arch Linux jako PXE server]]</p><br />
<br />
<p>''(tento oddíl by měl být podrobnější)''</p><br />
<br />
<h3>Klient</h3><br />
<br />
<p>Nastavte klientský systém, aby se pokoušel nejprve spustit ze sítě (pxe). Často to bývá výchozím nastavením.<br />
Klient získá ze serveru IP adresu a stáhne automaticky potřebné soubory po síti. Pak můžete pokračovat v instalaci jako obvykle.</p><br />
<br />
<h2>Instalace systému</h2><br />
<br />
<p>Můžete zvolit automatickou nebo interaktivní instalaci. <br /><br />
Viz kapitola [#Instala.C4.8Dn.C3.AD_n.C3.A1stroj_AIF 2.3 Instalační nástroj AIF]<br />
nebo soubor readme instalátoru AIF readme.</p><br />
<br />
<h3>Interaktivní instalace</h3><br />
<br />
<p>Interaktivní instalaci spustíte příkazem:</p><br />
<br />
/arch/setup<br />
<br />
<p>nebo:</p><br />
<br />
aif -p interactive<br />
<br />
<p>Po uvítací obrazovce se ocitnete v hlavní instalační nabídce. Pro pohyb v menu <br />
použijte klávesy NAHORU a DOLU. Mezi tlačítky přepínejte klávesou TAB a volbu potvrzujte <br />
stiskem ENTER. Ve kterémkoli bodě instalace se můžete přepnout do sedmé virtuální konzole <br />
(ALT-F7), kde uvidíte výpis aktuálně běžících příkazů. Pro návrat do první konzole, kde běží <br />
instalátor použijte ALT-F1. Můžete použít i kteroukoli z dalších konzolí ALT-F2 až ALT-F6, <br />
pokud to budete potřebovat.</p><br />
<br />
<h4>Výběr zdroje instalace (Select source)</h4><br />
<br />
<p>Nejprve je třeba zvolit zdroj, odkud se bude instalovat ''(Select source)''. Pokud máte rychlé internetové připojení, měli byste zvolit síťovou - ''NET (FTP/HTTP)'' instalaci. Tím získáte nejnovější instalační balíky, zatímco obsah instalačního obrazu CD nebo USB nemusí být aktuální. Instalujete-li z "NET" instalačního obrazu nemáte samozřejmě na výběr ;-).</p><br />
<br />
<h5>CD-ROM nebo JINÝ ZDROJ instalace</h5><br />
<br />
<p>Zvolíte-li instalaci Z CD-ROM nebo JINÉHO ZDROJE (''CD-ROM ot OTHER SOURCE''), budete moci instalovat pouze balíky z těchto zdrojů, a ty mohou být zastaralé, nebo balíky z jiných medií, která lze připojit ručně do souborového systému (např. DVD, USB flash disk a podobně). Výhodou ovšem je, že nebudete potřebovat k instalaci internetové připojení. Tato metoda je tedy doporučena pro lidi s vytáčeným připojením nebo pro toho, kdo nemůže nebo nechce stahovat velké objemy dat.</p><br />
<br />
<h5>Síťová instalace - NET (FTP/HTTP)</h5><br />
<br />
<h6>Nastavení sítě (''Setup Network'')</h6><br />
<br />
<p>Nejprve otevřete nastavení sítě, kde nastavte síťová rozhraní. <br />
<br />
{{Warning|Pokud ovšem používáte bezdrátovou síť, budete muset nastavit síť ručně pomocí obvyklých nástrojů (v jiné konzoli) a instalátor vám nebude moc platný.}}<br />
<br />
Zobrazí se seznam dostupných síťových rozhraní. Není-li dostupné žádné ethernetové<br />
zařízení nebo není zobrazeno zařízení, které chcete použít, přepněte se do jiné <br />
konzole a zaveďte potřebný modul ručně. Pokud ani pak nemůžete nastavit síťovou kartu, <br />
ujistěte se, že je síťová karta fyzicky správně instalována či připojena a je podporována <br />
linuxovým jádrem.</p><br />
<br />
<p>Když je nahrán správný modul a v seznamu vypsána požadovaná síťová karta, vyberte síťové zařízení, které chcete nastavit, a instalátor vám nabídne možnost nastavit síť s DHCP. Pokud máte v síti DHCP server, vyberte ''YES'' a nechte zbytek na instalátoru. Vyberete-li ''NO'', instalátor vás požádá o ruční konfiguraci sítě. Tak či onak, připojení k síti by mělo být správně nastaveno <br />
a můžete funkci ověřit v jiné konzoli pomocí standardních nástrojů, jako např. ''ping''.</p><br />
<br />
<h6>Výběr zrcadla (''Choose Mirror'')</h6><br />
<br />
<p>Následuje volba zrcadla, umožňuje zvolit server, ze kterého budete během instalace Arch Linuxu stahovat balíčky. V zájmu rychlejšího stahování byste měli zvolit zrcadlo, které není geograficky vzdálené. Ke konci instalace se vás pak instalátor dotáže, zda chcete toto zrcadlo použít jako výchozí i pro aktualizace čerstvě nainstalovaného systému.</p><br />
<br />
{{Note| Server {{Ic|1=ftp.archlinux.org}} je omezen na 50 KB/s.}}<br />
<br />
<p>Výše uvedené položky menu jsou pochopitelně dostupné, jen pokud jste vybrali instalaci ''NET (FTP/HTTP)''. Tímto končí přípravné kroky. Vraťte se (''RETURN'') do hlavního menu.</p><br />
<br />
<h4>Nastavení času (''Set Clock'')</h4><br />
<br />
<p>Volba Nastavení času umožňuje nastavení systémového data a času. <br />
Především je třeba vědět, jestli váš hardwarový čas je a má být nastaven na UTC <br />
nebo jako místní čas. Doporučeno je nastavit jako UTC, ale pokud máte nainstalovaný<br />
jiný další OS, který nepodporuje správně nastavení hodin v BIOSu na UTC (typicky MS Windows), <br />
budete zde muset zvolit místní čas. Dalším krokem je volba země a časového pásma <br />
(''Select region and timezone'') a nastavení data a času (''Set time and date''). <br />
Pokud jste již připojeni k Internetu, můžete po nastavení času použít [http://www.ntp.org/ NTP server].</p><br />
<br />
<h4>Příprava pevného disku (''Prepare Hard Drive'')</h4><br />
<br />
<p>Rozdělení pevného disku (''Prepare Hard Drive(s)''). Instalátor nabízí dvě varianty přípravy <br />
cílového pevného disku, umožňuje vrátit zpět případné změny.</p><br />
<br />
<ul><br />
<li>Automatické rozdělení (''Auto-prepare''). Na jednom pevném disku, který vyberete, automaticky <br />
vytvoří oddíly, přičemž se použije celý tento disk. Instalátor vytvoří jednoduchou strukturu <br />
diskových oddílů: /boot, swap, / a /home. Budete však moci nastavit některé parametry oddílů, jako velikost a typ každého souborového systému.</li><br />
<li>Pokud potřebujete či chcete mít větší kontrolu nad rozdělením pevného disku, případně máte více pevných disků, můžete rozdělit pevný ručně disk (''Manually partition Hard Drives'') a pak pro každý oddíl vybrat souborový systém a body připojení (''Manually configure block devices''). Zde také můžete použít například ''lvm'' nebo ''dm_crypt''.</li><br />
<li>Volba vrátit změny (''Rollback last filesystem changes'') vrací zpět jen ty změny souborového systému, které provedl instalační program při kterémkoli z uvedených postupů. Připojené diskové oddíly budou odpojeny, zruší se případně vytvořené lvm či dm_crypt svazky. Tuto možnost využijete, budete-li potřebovat zrušit nebo opakovat některé kroky. V nutném případě vám instalátor vrácení změn připomene.</li><br />
</ul><br />
<br />
<p>Poznámky:</p><br />
<ul><br />
<li>AIF umí vytvořit dm_crypt nebo lvm svazky ale nikoli software raid.</li><br />
<li>AIF zatím nedokáže vytvořit svazky složené z více fyzických disků (je-li to třeba použijte ''vgcreate'')</li><br />
<li>AIF umí využít existují souborový systém jen v případě, že dokáže najít bloková zařízení. Pokud chcete použít <br />
existující souborový systém nad lvm, dm_crypt nebo softraid budete mu muset konfiguraci oddílů předložit sami.</li><br />
</ul><br />
<br />
<h5>Automatické rozdělení (''Auto-Prepare'')</h5><br />
<p>Automatické rozdělení disku automaticky vytvoří na vybraném pevném disku oddíly <br />
''/boot'', ''swap'', kořenový oddíl (/) a ''/home'', vytvoří všem oddílům souborové systémy. <br />
Oddíly budou automaticky připojeny na správná místa. Tato volba, přesně řečeno, vytvoří oddíly takto:</p><br />
<br />
<ul><br />
<li>32 MB ext2 /boot oddíl se zavaděčem</li><br />
<li>256 MB swap oddíl pro ''swap''</li><br />
<li>7.5 GB root kořenový oddíl</li><br />
<li>/home domovský oddíl ze zbývajícího prostoru na pevném disku</li><br />
</ul><br />
<br />
<p>Velikosti oddílů můžete změnit podle vašich požadavků, ale oddíl /home vždy využije veškerý zbývající prostor na pevném disku. Můžete zvolit souborový systém, který se použije pro oddíl /boot a případně jiný souborový systém, který se použije jak pro kořenový oddíl (/) tak pro domovský oddíl /home.</p><br />
<br />
{{Warning|AUTOMATICKÉ ROZDĚLENÍ SMAŽE VŠECHNA DATA NA VYBRANÉM PEVNÉM DISKU!}}<br />
<br />
<h5>Ruční rozdělení pevného disku (''Manually Partition Hard Drives'')</h5><br />
<br />
<p>Po výběru disku, který budete rozdělovat, se spustí nástroj ''cfdisk'', kde lze jakkoli vytvářet a měnit diskové oddíly. Vytvořenou konfiguraci oddílů zapíšete na disk stiskem [Write], cfdisk ukončíte stiskem [Quit]. Pro pokračování instalace potřebujete vytvořit alespoň kořenový oddíl (/).</p><br />
<br />
{{Warning| Některé nástroje pro práci s diskovými oddíly (např. GParted) umožňují vytvářet oddíly "zarovnané" na MiB a ne na stopy (cylindry). Máme-li na disku předem vytvořené oddíly zarovnané na MiB, cfdisk se odmítne spustit. I v tomto lze ovšem spustit automatické rozdělení disku, vytvořit oddíly a pak použít znovu cfdisk pro ruční rozdělení.}}<br />
<br />
<h5>Ruční nastavení blokových zařízení, připojení a souborových systémů (''Manually configure block devices...'')</h5><br />
<br />
<p>Tato volba nejprve zobrazí všechny rozpoznané diskové oddíly, které můžeme použít pro vytvoření souborového systému. Je třeba mít na paměti následující:</p><br />
<br />
<ul><br />
<li>Vždy se pohybujeme na určité úrovni abstrakce reprezentace, všechno bude zapsáno, až akci potvrdíte.</li><br />
<li>Ne všechna bloková zařízení podporují všechny souborové systémy (např. nemůžete vytvořit LVM svazek nad ničím jiným než nad LVM fyzickým oddílem). Instalátor automaticky zobrazuje jen použitelné souborové systémy, v případě jediné použitelné možnosti ji sám vybere.</li><br />
<li>Vytvoření některých souborových systémů způsobí i vytvoření blokových zařízení. To je případ dm_crypt a lvm svazků.<br />
Objeví se v modelu odpovídajícímu blokovým zařízením a můžete nad nimi vytvořit požadovaný souborový systém.</li><br />
<li>Je-li třeba předat nástroji ''mkfs'' nějaké parametry, zapište je přesně jako byste volali přímo mkfs. Například, pro vypnutí žurnálu u souborového systému ext:<br />
<ul><br />
<li>nikoli: {{Ic|1=^has_journal}}></li><br />
<li>ale raději: {{Ic|1=-O ^has_journal}}</li><br />
</ul></li><br />
</ul><br />
<br />
<p>Když je nastavení souborových systémů hotovo, zvolte ''Done''. <br />
Proběhne kontrola na kritické chyby (jako například neexistence kořenového oddílu) a <br />
mohou být zobrazena varování, která lze i ignorovat (jako neexistující swap). <br />
Případně se můžete vrátit zpět a opravit, co je třeba, nebo pokračovat s tím,<br />
že vše je tak, jak jste chtěli.</p><br />
<br />
<p>Například když chcete nastavit LVM svazek nad dm_crypt:</p><br />
<ul><br />
<li>ujistěte se, že máte dva oddíly: malý oddíl pro nešifrovaný oddíl /boot (cca 100MB) a druhý oddíl pro celý šifrovaný systém.<br />
Použijte volbu Ruční rozdělení disků ('Manually partition hard drives')</li><br />
<li>na prvním oddílu /dev/sdX1 vytvořte souborový systém ext2 a připojte jako /boot</li><br />
<li>na druhém oddílu /dev/sdX2 vytvořte dm_crypt oddíl s popisem ('label') sdX2crypt (nebo jiným, jaký chcete)</li><br />
<li>získáte tak zařízení /dev/mapper/sdX2crypt, na kterém vytvořte fyzický LVM oddíl</li><br />
<li>tím vytvoříte /dev/mapper/sdX2crypt+. To je tedy reprezentace vytvořeného fyzického oddílu. Na něm vytvoříme skupinu svazeků (volume group) pojmenovanou např. cryptpool.</li><br />
<li>získáme tak /dev/mapper/cryptpool, kde lze již vytvořit několik logických oddílů. Vytvořte např. 2:<br />
<ul><br />
<li>první o velikosti 5GB: pojmenujte ho cryptroot</li><br />
<li>druhý o velikosti 10GB: pojmenujte ho crypthome</li><br />
</ul></li><br />
<li>a máe dva nové oddíly:<br />
<ul><br />
<li>/dev/mapper/cryptpool-cryptroot: na tomto blokovém zařízení vytvořte souborový systém pro <br />
kořenový oddíl a připojte jako /.</li><br />
<li>/dev/mapper/cryptpool-crypthome je blokové zařízení, kde vytvořte souborový sytém pro /home.</li><br />
</ul></li><br />
<li>Chcete-li swap, umístěte ho na další logický oddíl, který vytvoříte.</li><br />
<li>To je vše! Zvolte 'done' a zpracuje se celý definovaný model a na disku se provedou všechny potřebné operace. Výhodou je, že lze začít s malými malými diskovými oddíly. Bude-li později třeba více prostoru, lze snadno zvětšit logické oddíly i nad nimi definované souborové systémy.</li><br />
</ul><br />
<br />
<h5>Volba vrátit změny (''Rollback last filesystem changes'')</h5><br />
<br />
<p>Fuknce ''rollback'' zajistí všechny potřebné kroky k vrácení změn, které provedete pomocí ručního <br />
nastavení (''Manually configure block devices, filesystems and mountpoints'') i automatického rozdělení <br />
(''Auto-Prepare'') tak, že je možné začít zcela znovu.</p><br />
<br />
<p>Provede:</p><br />
<ul><br />
<li>odpojení připojených souborových systémů</li><br />
<li>zruší/odebere lvm a dm_crypt svazky.</li><br />
</ul><br />
<br />
<p>Co neudělá:</p><br />
<ul><br />
<li>nezruší 'nízkoúrovňové' rozdělení pevného disku na oddíly ('partitions')</li><br />
<li>neodebere 'jednoduché' souborové systémy jako jsou ext3, xfs, swap atd.</li><br />
</ul><br />
<br />
<p>Důvod tohoto omezení je jednoduchý: ruší se jen věci, které mohou zamezit následné přípravě pevného disku.</p><br />
<br />
<h4>Výběr balíčků (''Select Packages'')</h4><br />
<br />
<p>Zde můžete vybrat balíčky, které si přejete nainstalovat z media CD či USB nebo, při síťové (''NET'') instalaci, ze zvoleného zrcadla. Máte možnost vybrat celé skupiny balíčků, které budete na obecné rovině potřebovat a pak upřesnit instalaci výběrem jednotlivých balíčků. Výběr se provádí stiskem mezerníku (space). Je doporučeno instalovat v této fázi pouze všechny balíčky ze skupiny 'base' a nic dalšího. Výjimkou z tohoto pravidla jsou jen balíčky potřebné pro zprovoznění připojení k internetu.</p><br />
<br />
<p>Pokud jste vybrali potřebné balíčky, opusťte seznam balíčků a skupin a pokračujte dalším krokem.</p><br />
<br />
<h4>Instalace balíčků (''Install Packages'')</h4><br />
<br />
<p>Funkce nainstaluje balíčky ze skupiny base a další balíčky, které jste zvolili, a vyřeší závislosti mezi balíčky.</p><br />
<br />
<h4>Nastavení systému (''Configure System'')</h4><br />
<br />
<p>Fuknce ''Configure System'' provede automaticky několik kroků:</p><br />
<br />
<ul><br />
<li>automaticky upraví některé konfigurační soubory (např. {{ic|menu.lst}} zavaděče grub,<br />
tzv. HOOKS pro {{ic|mkinitcpio.conf}}, nastavení keymap v rc.conf, nastaví zrcadla pro pacman atd...);</li><br />
<li>další změny konfigurace nabídne ke schválení (např. nastavení sítě);</li><br />
<li>umožní vám ručně změnit hlavní konfigurační soubory instalovaného systému, budete dotázáni na volbu editoru, přičemž můžete zvolit mezi nano, joe a vi;</li><br />
<li>umožní vám změnit heslo uživatele root instalovaného systému.</li><br />
</ul><br />
<br />
<p><strong>Konfigurační soubory</strong></p><br />
<br />
<p>Toto jsou hlavní konfigurační soubory Archlinuxu. Pokud budete potřebovat nastavit specifickou <br />
službu, přečtěte si příslušné manuálové stránky nebo jakoukoli dokumentaci na internetu. Většinou najdete pomoc na [[Main Page|Arch Linux wiki]] nebo [http://bbs.archlinux.org/ diskusním fóru].</p><br />
<br />
<ul><br />
<li>/etc/rc.conf</li><br />
<li>[[Fstab|/etc/fstab]]</li><br />
<li>/etc/mkinitcpio.conf</li><br />
<li>/etc/modprobe.d/modprobe.conf</li><br />
<li>/etc/resolv.conf</li><br />
<li>/etc/hosts</li><br />
<li>/etc/hosts.deny</li><br />
<li>/etc/hosts.allow</li><br />
<li>/etc/locale.gen</li><br />
<li>/etc/pacman.d/mirrorlist</li><br />
<li>/etc/pacman.conf</li><br />
</ul><br />
<br />
<p><strong>Tento průvodce konfigurací reflektuje podstatné změny v konfiguračních souborech, ke kterým došlo po vydání instalačního obrazu 2010.5 do srpna 2011.</strong></p><br />
<br />
<p><strong>{{ic|/etc/rc.conf}}</strong></p><br />
<br />
<p>Toto je hlavní konfigurační soubor Arch linuxu. Zde se nastaví klávesnice, časová zóna, název systému (hostname), síť, potřebné démony a moduly jádra, které je třeba zavést při spuštění, profily a další.</p><br />
<br />
<p><strong>LOCALE:</strong> Nastavuje jazyk systému; nastavení bude použito všemi aplikacemi podporujícími i18n-. Viz. příkaz locale.gen níže pro další možnosti. Výchozí nastavení je vhodné pro uživatele pracující v americké angličtině.</p><br />
<br />
{{Tip| Pro české prostředí je vhodné.: {{Ic|1=LOCALE="cs_CZ.utf8"}}.}}<br />
<br />
<p><strong>HARDWARECLOCK:</strong> Má být ''UTC'', pokud je v BIOSu nastaven čas na UTC nebo ''localtime'' pokud je v BIOSu nastaven místní čas. Máte-li nainstalován další OS, který nepodporuje nastavení UTC v BIOSu, jako je MS Windows, nastavte zde ''localtime'', jinak je doporučeno nastavit na ''UTC'', čímž se mimo jiné vyhnete problémům se změnami letního a zimního času.</p><br />
<br />
<p><strong>USEDIRECTISA:</strong> <s>If set to "yes" it tells hwclock to use explicit I/O<br />
instructions to access the hardware clock. Otherwise, hwclock will try to use<br />
the /dev/rtc device it assumes to be driven by the rtc device driver. This<br />
setting's default "no" is fine for people not using an ISA machine</s>. V aktuálním rc.conf se již nevyskytuje.</p><br />
<br />
<p><strong>TIMEZONE:</strong> Určuje vaše časové pásmo. Použitelné zóny jsou uložen v relativní cestě vůči adresáři <br />
/usr/share/zoneinfo. Například: časové pásmo Německa má být Europe/Berlin, takže odpovídající soubor zóny je<br />
/usr/share/zoneinfo/Europe/Berlin. Pokud nyní neznáte přesný název vaší časové zóny, nechte to na později.</p><br />
<br />
{{Tip| Pro čechy je to: {{Ic|1=TIMEZONE="Europe/Prague"}}.}}<br />
<br />
<p><strong>KEYMAP:</strong> Nastavuje mapu kláves, která se zavede pomocí loadkeys při spuštění systému.<br />
Použitelné mapy kláves najdete v /usr/share/kbd/keymaps. Uvědomte si, že toto nastavení je platné pouze <br />
pro konzole a nikoli pro grafické rozhraní nebo X windows. Výchozí nastavení je opět pro američany!</p><br />
<br />
{{Tip| Pro Čechy např.: {{Ic|1=KEYMAP=cz-qwertz}}.}}<br />
<br />
<p><strong>CONSOLEFONT:</strong> Nastavuje písmo konzole, které zavádí setfont při spuštění systému. Použitelná písma najdete v /usr/share/kbd/consolefonts.</p><br />
<br />
{{Tip| Pro počeštěnou konzoli můžete použít např.: {{Ic|1=CONSOLEFONT=lat2-16}}.}}<br />
<br />
<p><strong>CONSOLEMAP:</strong> Nastavuje pro konzoli mapování znaků. Zavádí setfont při spuštění. <br />
Použitelná mapování najdete zde: /usr/share/kbd/consoletrans. Pokud používáte v LOCALE UTF-8 kódování a všechny konzolové aplikace produkují 8bitový výstup, můžete nastavit vhodnou národní znakovou mapu (například 8859-1 pro Latin1). Pokud používáte pouze aplikace běžící pod X windows, nebojte sem nastavení ovlivní jen programy běžící v konzoli.</p><br />
<br />
{{Tip| Pro češtinu nastavte: {{Ic|1=CONSOLEMAP=8859-2}}.}}<br />
<br />
<p><strong>USECOLOR:</strong> Zapne nebo vypne obarvený výstup pro zprávy během spouštění systému.</p><br />
<br />
<p><strong>MOD_AUTOLOAD:</strong> <s>Je-li nastaveno na "yes", udev může při spuštění systému automaticky zavádět potřebné moduly. Co je to "no", všichni víme :-).</s> V aktuálním rc.conf se již nevyskytuje, moduly vždy zavádí udev automaticky, konkrétní moduly lze explicitně zakázat.</p><br />
<br />
<p><strong>MODULES:</strong> V tomto textovém poli můžete specifikovat jména jaderných modulů, které chcete zavést při spuštění, aniž byste je museli svázat s konkrétním zařízením v modprobe.conf. Jednoduše zde zapište jméno modulu, případně doplňte potřebná nastavení do modprobe.conf. Zakázání zmodulů prefixem vykřičníku před jménem modulu ('!') již není podporováno; místo toho v adresáři {{ic|/etc/modprobe.d}} vytvořte konfigurační soubor pojmenovaný například {{ic|blacklist.conf}} a do něj zapište:</p><br />
<br />
blacklist jméno_modulu<br />
<br />
<p><strong>USELVM:</strong> Nastavení na "yes" spustí během sysinit ''vgchange'', takže se aktivují všechny LVM groups</p><br />
<br />
<p><strong>HOSTNAME:</strong> Zde nastavte jméno systému (''hostname''), bez jeho doménové "přípony". Volba je zcela na vás, pokud se budete držet písmen, číslic a několika málo speciálních znaků jako je pomlčka.</p><br />
<br />
<p><strong>INTERFACES:</strong> Zde nastavte vaše síťová rozhraní. Výchozí nastavení a přidružené komentáře v rc.conf jsou dostatečně informativní. Pokud používáte DHCP na jednom /prvním síťovém rozhraní (eth0), stačí odkomentovat ukázkový kód:</p><br />
<br />
# DHCP example<br />
interface=eth0<br />
address=<br />
netmask=<br />
broadcast=<br />
gateway=<br />
<br />
<p>Případně nastavit odpovídající interface (např. eth1).</p><br />
<br />
<p>Pokud nepoužíváte DHCP, mějte jen na mysli, že název proměnné odpovídá názvu rozhraní, jak je vrací příkaz {{Ic|1=ifconfig -a}} (např. eth0), a uložená hodnota přesně odpovídá textu, který by následoval příkaz ifconfig, kdybychom rozhraní konfigurovali ručně v shellu (např. tedy: eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255").</p><br />
<br />
<p><strong>ROUTES:</strong> Zde můžete nastavit "statické routy" a definovat jejich názvy. Vizte příklad pro výchozí bránu uvedený v rc.conf. Obecně, text v uvozovkách odpovídá tomu, co zapíšete ručně za příkaz ''route'', takže doporučujeme přečíst manuálové stránky tohoto příkazu nebo to jednoduše nechat, jak to je.</p><br />
<br />
<p><strong>[NET_PROFILES]:</strong> Povoluje více síťových profilů při <br />
spuštění systému. Síťové profily jsou pohodlnou metodou správy více síťových konfigurací a v tomto smyslu nahrazují standardní konfiguraci pomocí ''INTERFACES/ROUTES''. Pro systémy s jedinou síťovou konfigurací je ovšem doporučena standardní metoda. Pokud bude váš počítač migrovat mezi různými sítěmi (typicky notebook), pak bude třeba nastavit v adresáři /etc/network-profiles síťové profily. Pro vytvoření síťového profilu zde najdete vhodnou šablonu. V současné době vyžadují síťové profily balíček ''netcfg''.</p><br />
<br />
{{Tip| Dnes je ovšem obvyklejší v takovém případě použít jinou správu sǐťových připojení, např. [[NetworkManager]].}}<br />
<br />
<p><strong>DAEMONS:</strong> Toto textové pole jednoduše obsahuje seznam názvů skriptů (démonů) uložených v adresáři /etc/rc.d/, které je třeba spustit během spouštění systému. Démon s prefixem vykřičníku (!) je zakázán a nebude spuštěn. Pokud má název démonu prefix "zavináče" (@), bude spuštěn na pozadí, tj. spouštěcí sekvence nebude čekat na jeho dokončení. Pokud jde o běh systému, tak zde obvykle není třeba nic měnit, ale jakmile budete chtít automaticky spouštět další služby, jako je třeba sshd, konfiguraci démonů v rc.conf se nevyhnete.</p><br />
<br />
<p><strong>[[Fstab|{{ic|/etc/fstab}}]]</strong></p><br />
<br />
<p>Zde se nastavují parametry souborových systémů a body připojení. Potřebnou konfiguraci by zde měl vytvořit instalační program. Ujistěte se, že je správná a přesná.</p><br />
<br />
<p><strong>{{ic|/etc/mkinitcpio.conf}}</strong></p><br />
<br />
<p>Tento konfigurační soubor umožňuje doladění tzv. ''initial ramdisku''. Ramdisk je uložen <br />
jako obraz (image) souborového systému zabalený pomocí gzip a jádro jej načítá na začátku<br />
spuštění systému. Účelem ramdisku je uvést systém do stavu, aby mohl načíst kořenový souborový systém. To znamená, že musí obsahovat některé moduly, potřebné k tomu aby jádro 'vidělo' IDE, SCSI nebo SATA disky (nebo i USB/firewire disky, pokud z nich spouštíte systém). Jakmile jsou pomocí ramdisku zavedeny potřebné moduly, ať už pomocí udev nebo ručně, pokračuje start systému z kořenového souborového systému. 'Initial ramdisk' by tedy měl obsahovat jen moduly potřebné pro přístup ke kořenovému souborovému systému. Ostatní moduly budou zavedeny později pomocí udev.</p><br />
<br />
<p>Výchozí konfigurací mkinitcpio.conf je automatická detekce modulů potřebných pro <br />
IDE, SCSI a SATA řadiče pomocí tzv. "''HOOKS''" (háčků? :-), budeme používat "hook" - pozn. překl.) Pokud je třeba zavést i další moduly, jako jsou např. ''crypt'', ''lvm'', ''keymap'' nebo ''usbinput'', instalační program sám konfiguraci mkinitcpio.conf. To znamená, že výchozí konfigurace by měla fungovat téměř každému. Nepotřebné "hooks" některých subsystémů (tj. např. některý z IDE, SCSI, RAID, USB, atd..) je možné odebrat. Můžete jít v konfiguraci ještě dále a v poli MODULES= specifikovat přímo konkrétní jaderné moduly a pak odstranit odpovídající subsystém z HOOKS=, ale vždy musíte vědět, co děláte.</p><br />
<br />
<p>Je-li kořenový systém na RAID poli, musí být někde ke konci pole HOOKS= uvedeno i ''raid''. Pro další informaci čtěte stránku o RAID zde na wiki a stránku o [[Mkinitcpio|mkinitcpio]]. Máte-li neamerickou klávesnici měli byste do pole HOOKS= doplnit i ''keymap'' respektive ''usbinput'', používáte-li klávesici připojenou k USB.</p><br />
<br />
<p><strong>{{ic|/etc/modprobe.d/modprobe.conf}}</strong></p><br />
<br />
<p>Tento konfigurační soubor určuje, které jaderné moduly budou zavedeny pro která zařízení systému, umožňuje nastavit jejich parametry. Například, jádro má zavést modul pro síťovou kartu Realtek 8139 na rozhraní eth0:</p><br />
<br />
alias eth0 8139too<br />
<br />
<p>Většinou není potřeba tento konfigurační soubor měnit, stačí uvést moduly v rc.conf nebo se spolehnout na udev. Obvykle se tady zakazuje ipv6, nastavuje se tu pořadí zvukových karet, když jich je více, a podobně.</p><br />
<br />
<p><strong>{{ic|/etc/resolv.conf}}</strong></p><br />
<br />
<p>Zde se ručně nastavují preferované jmenné servery (DNS servery). Jednoduše by zde mělo být něco jako toto:</p><br />
<br />
search domain.tld<br />
nameserver 192.168.0.1<br />
nameserver 192.168.0.2<br />
<br />
<p>Kde domain.tld a je výchozí doména ip adresy jsou adresy jmenných serverů. Tzv. výchozí doména se automaticky doplňuje k neúplným (nekvalifikovaným) hostname. Tzn. příkaz ''ping kukacka'' se provede jako ''ping kukacka.domain.tld'' <br />
Tato nastavení obvykle nejsou příliš důležitá a často se nechávají, jak jsou. Kromě toho pokud používáte DHCP tak se stejně zde uvedená nastavení automaticky nahradí správnými hodnotami při spuštění sítě (z DHCP serveru) a v tom případě můžete tuto konfiguraci ignorovat.</p><br />
<br />
<p><strong>{{ic|/etc/hosts}}</strong></p><br />
<br />
<p>Soubor hosts slouží ke statickému převodu jmen počítačů v síti (hostname) na jejich ip adresy. Obsah souboru host má <strong>přednost před odpovědmi DNS serveru</strong>, takže pomocí zápisu v hosts lze jmény odkazovat i na počítače, které nemají vlastní DNS záznam. Obvykle tu není třeba nic měnit, jen v některých případech je sem třeba zapsat hostname a hostname + doménovou příponu místního počítače, kvůli správné konfiguraci některých služeb (např. postfixu). Pokud nevíte, co děláte, soubor neměňte, dokud si nepřečtete manuál {{Ic|1=man hosts}}.</p><br />
<br />
<p><strong>{{ic|/etc/hosts.deny}}</strong></p><br />
<br />
<p>Zde se nastavují omezení přístupu k síťovým službám místního počítače.Výchozím nastavením je, že je přístup ke všem službám zakázán.</p><br />
<br />
ALL: ALL: DENY<br />
<br />
<p><strong>/etc/hosts.allow</strong></p><br />
<br />
<p>Zde se naopak povoluje přístupk síťovým službám místního počítače. Sem zadejte služby, ke kterým chcete umožnit přístup, např.:</p><br />
<br />
sshd: ALL: ALLOW<br />
<br />
<p>tato konfigurace umožní přístup všem počítačům v síti k místnímu SSH serveru.</p><br />
<br />
{{Note| Mějte na paměti, že direktiva v hosts.allow přepisuje nastavení v hosts.deny. Rovněž si uvědomte, že jsou služby, které spolu komunikují po síti v rámci místního počítače (localhost), takže například nastavení:<br />
<br />
mysqld : 127.0.0.1 : allow<br />
<br />
umožní přístup k serveru MySQL (pouze z místního počítače). Obvykle ovšem dojde k odpovídající změně v konfiguraci automaticky a do těchto souborů není nutno zasahovat.}}<br />
<br />
<p><strong>{{ic|/etc/locale.gen}}</strong></p><br />
<br />
<p>Tento soubor obsahuje všechny dostupné národní a znakové sady. Zde je třeba povolit přinejmenším znakové sady odpovídající nastavení {{Ic|1=LOCALE}} v souboru {{ic|/etc/rc.conf}}. V aktuální verzi instalátoru (2010.05) '''již není třeba spuštět ručně příkaz {{Ic|1=locale-gen}}'''; o to se postará instalační program. Pokud ovšem upravíte tento soubor po skončení instalace, budete muset spustit příkaz {{Ic|1=locale-gen}} ručně.</p><br />
<br />
{{Tip| Pro češtinu odkomentujte:<br />
<br />
cs_CZ.UTF-8 UTF-8 <br />
cs_CZ ISO-8859-2<br />
}}<br />
<br />
<p><strong>{{ic|/etc/pacman.d/mirrorlist}}</strong></p><br />
<br />
<p>Tento soubor obsahuje seznam zrcadel oficiální repozitářů Arch Linuxu, ze kterých může pacman stahovat balíčky. Je-li povoleno více zrcadel, pcaman je zkouší v pořadí, v jakém jsou zapsány. Do proměnné {{Ic|1=$repo}} pacman automaticky doplní potřebný ({{Ic|core}}, {{Ic|extra}}, {{Ic|community}} nebo {{Ic|testing}}).</p><br />
<br />
<p>Zrcadlo, které jste zvolili při síťové instalaci, se zapíše na začátek seznamu zrcadel, takže bude použito jako výchozí zrcadlo repozitářů nainstalovaného systému.</p><br />
<br />
<p><strong>{{ic|/etc/pacman.conf}}</strong></p><br />
<br />
<p>Zde můžete nastavit, které repozitáře bude {{Ic|1=pacman}} používat. Repozitáře, které se nepoužívají jsou "zakomentovány" znakem #, například:</p><br />
<br />
#[community]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
<p>Potřebujete-li povolit repozitář community, smažte prostě znak #.</p> <br />
<br />
<p>Pokud instalujete 64 bitový systém, budete pravděpodobě potřebovat repozitář {{Ic|1=multilib}}:</p><br />
<br />
[multilib]<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
<p><strong>Nastavení hesla roota</strong></p><br />
<br />
<p>Nyní musíte nastavit heslo uživatele '''root'''. Heslo volte obezřetně, doporučujeme použít písmena, číslice i zvláštní znaky. Toto heslo bude chránit životně důležité části vašeho systému.</p><br />
<br />
<p>Nyní jste s konfigurací hotovi, stiskněte '''Return''' a vraťte se do hlavního menu. Instalátor vygeneruje init ramdisk podle konfigurace uvedené v {{ic|mkinitcpio.conf}}.</p><br />
<br />
<h4>Instalace zavaděče (''Install Bootloader'')</h4><br />
<br />
<p>Fuknce ''Install Bootloader'' nainstaluje na váš pevný disk zavaděč systému. Můžete zvolit ''GRUB'' nebo <br />
žádný (''NONE'') v případě, že již máte instalován a chcete použít jiný zavaděč. Pokud zvolíte GRUB, <br />
instalační program vás požádá ověření a potvrzení jeho konfigurace.</p><br />
<br />
<p><strong>{{ic|/boot/grub/menu.lst}}</strong></p><br />
<br />
<p>Pokud jste zvolili zavaděč GRUB, zde můžete revidovat jeho konfiguraci. V případě jiného zavaděče musíte upravit konfiguraci ručně v konzoli. Konfiguraci GRUBu instalátor předpřipravil s užitím UUID odkazů, které může být nutné upravit, pokud jste během konfigrace učinili změny v souboru {{ic|/etc/fstab}}.</p><br />
<br />
{{Warning| '''Problém s předposlední verzí instalačních médií 2010.5 a kernelem 3.0. V aktuálních instalačních médiích - 2011.08.19, by měl být problém opraven!'''. Pokud provádíte čistě síťovou instalaci nebo instalaci z instalačních médií ''core'', ale balíky stahujete z internetu, dojde během instalace k aktualizaci jádra operačního systému (kernelu) na verzi 3.0. V tom případě instalátor AIF nevygeneruje v souboru {{ic|/boot/grub/menu.lst}} správnou konfiguraci zavaděče, protože s aktualizací kernelu došlo ke změně názvů souborů kernelu a init ramdisku a po ukončení instalace systém nelze spustit. V takovém případě je třeba ručně změnit konfiguraci zavaděče v souboru {{ic|menu.lst}}.<br />
<br />
Původní {{ic|menu.lst}}:<br />
<br />
{{hc|/boot/grub/menu.lst|2=<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/disk/by-uuid/a6a... atd...<br />
initrd /kernel26.img<br />
<br />
# (1) Arch Linux<br />
title Arch Linux Fallback<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/disk/by-uuid/a6a... atd...<br />
initrd /kernel26-fallback.img<br />
}}<br />
<br />
by měl vypadat takto:<br />
<br />
{{hc|/boot/grub/menu.lst|2=<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/disk/by-uuid/a6a... atd...<br />
initrd /initramfs-linux.img<br />
<br />
# (1) Arch Linux<br />
title Arch Linux Fallback<br />
root (hd0,0)<br />
kernel /vmlinuz-linux root=/dev/disk/by-uuid/a6a... atd...<br />
initrd /initramfs-linux-fallback.img<br />
}}<br />
<br />
}}<br />
<br />
<p>Když zkontrolujete konfiguraci zavaděče, budete dotázáni na jeho umístění. Pokud nepoužíváte současně nějaký další zavaděč, měli byste jako umístění zvolit MBR (master boot record) pevného disku. Tomu odpovídá název blokového zařízení bez číselné přípony, to je například '''/dev/sda''' nikoli /dev/sda1).</p><br />
<br />
<h4>Konec instalace</h4><br />
<br />
<p>Takto ukončíte instalátor, pak vyjměne instalační médium, napište příkaz:</p><br />
<br />
reboot<br />
<br />
<p>A držte si palce!</p><br />
<br />
<h3>Automatizovaná instalace (''Automatic Installation Procedure'')</h3><br />
<br />
<p>Pomocí automatizované instalace lze provést automatickou instalaci systému. Příklady konfigurace instalačních profilů naleznete v adresáři {{Ic|1=/usr/share/aif/examples}}. K instalaci systému je stačí jen minimálně upravit.</p><br />
<br />
<h4>Dostupné profily:</h4><br />
<br />
*'''generic-install-on-sda'''<br />
čili obecná instalace na {{Ic|1=/dev/sda}}; tato konfigrace demonstruje, co všechno je možné jako součást instalačního profilu nastavit (doplnění o další balíčky, nastavení časové zóny, aktualizace konfiguračních souborů atd.). Výsledkem je instalační profil obvyklé instalace systému, kde výsledná struktura pevného disku na {{Ic|1=/dev/sda}} je podobná tomu, co navrhne automatické rozdělení disku při interaktivní instalaci.<br />
<br />
*'''fancy-install-on-sda'''<br />
čili "vychytaná" instalace na /dev/sda je velmi podobná obecné instalaci výše, ale vytvoří na {{Ic|1=/dev/sda}} šifrovaný souborový systém pomocí {{Ic|1=dm_crypt}} nad LVM svazkem.<br />
<br />
<p>mějte na paměti, že konfigurační soubory profilů jsou bash skripty, tekže, takže například definici {{Ic|1=SYNC_URL}} musíte uzavřít do apostrofů, aby bash automaticky nedoplnil obsah proměnné {{Ic|1=$repo}}.<br />
<br />
<p>Automatizovanou instalaci spustíte:</p><br />
<br />
aif -p automatic -c /cesta/k_vasi/konfiguraci_instalace<br />
<br />
<p>Oba instalační profily předpokládájaí instalaca na {{Ic|1=dev/sda}}, takže pokud instalujete jinam, nezapomeňte v konfiguraci profilu změnit přinejmenší cílový disk.</p><br />
<br />
<h4>Syntaxe konfiguračního souboru</h4><br />
<br />
<p>Takto vypadá konfigurace automatizované instalace '''generic-install-on-sda'''. Chybí v ní jen oddíl týkající se rozdělení disků, který je uveden níže.</p><br />
<br />
<p>Konfigurační soubor bude použit jako součást bash skriptu, takže jeho obsah musí být syntakticky platným bash skriptem.</p><br />
<br />
{{hc|/usr/share/aif/examples/generic-install-on-sda|2=<br />
SOURCE=cd<br />
FILE_URL=file:///src/core/pkg<br />
SYNC_URL=<br />
HARDWARECLOCK=localtime<br />
TIMEZONE=Canada/Pacific<br />
# Do you want to have additional pacman repositories or packages available at runtime (during installation)?<br />
# RUNTIME_REPOSITORIES = array like this ('name1' 'location of repo 1' ['name2' 'location of repo2',..])<br />
RUNTIME_REPOSITORIES=<br />
# space separated list<br />
RUNTIME_PACKAGES=<br />
<br />
# packages to install<br />
TARGET_GROUPS=base # all packages in this group will be installed (defaults to base if no group and no packages are specified)<br />
TARGET_PACKAGES_EXCLUDE= # Exclude these packages if they are member of one of the groups in TARGET_GROUPS. example: 'nano reiserfsprogs' (they are in base)<br />
TARGET_PACKAGES=openssh # you can also specify separate packages to install (this is empty by default)<br />
<br />
# you can optionally also override some functions...<br />
worker_intro () {<br />
inform "Automatic procedure running the generic-install-on-sda example config. THIS WILL ERASE AND OVERWRITE YOUR /DEV/SDA. IF YOU DO NOT WANT THIS PRESS CTRL+C WITHIN 10 SECONDS"<br />
sleep 10<br />
}<br />
<br />
worker_configure_system () {<br />
prefill_configs<br />
sed -i 's/^HOSTNAME="myhost"/HOSTNAME="arch-generic-install"/' $var_TARGET_DIR/etc/rc.conf<br />
}<br />
}}<br />
<p>Význam většiny nastavení je jasný z kontextu.</p><br />
<br />
<p><strong>Rozdělení disku</strong> Zde se defunuje, jak se během automatizované instalace vytvoří diskové oddíly a jak se pak oddíly připojí.</p><br />
<br />
<p>Dotyčný kousek {{Ic|1=/usr/share/aif/examples/generic-install-on-sda}} vypadá takto:</p><br />
<br />
{{hc|/usr/share/aif/examples/generic-install-on-sda|2=<br />
# These variables are mandatory<br />
<br />
GRUB_DEVICE=/dev/sda<br />
PARTITIONS='/dev/sda 100:ext2:+ 512:swap *:ext4'<br />
BLOCKDATA='/dev/sda1 raw no_label ext2;yes;/boot;target;no_opts;no_label;no_params<br />
/dev/sda2 raw no_label swap;yes;no_mountpoint;target;no_opts;no_label;no_params<br />
/dev/sda3 raw no_label ext4;yes;/;target;no_opts;no_label;no_params'<br />
}}<br />
<br />
<p>Kde:</p><br />
* {{Ic|1=GRUB_DEVICE=}} -> kam se zapíše zavaděč<br />
*{{Ic|1=PARTITIONS=}} -> určuje, jak se vytvoří diskové oddíly, je to proměnná typu řetězec, takže uzavřená do apostrofů, jednotlivé oddíly jsou oddělené '''mezerami''', parametry každého oddílu jsou oddělené dvojtečkami. Na začátku řádku je určení zařízení na kterém se oddíly vytvoří. V tomto případě:<br />
** {{Ic|1=/dev/sda}} -> s jakým blokový zařízením se pracuje<br />
** {{Ic|1=100:ext2:+}} -> první oddíl: velikost v MiB (100 MiB), souborový systém (ext2), příznak boot (+)<br />
** {{Ic|1=512:swap}} -> druhý oddíl: velikost (512MiB), souborový systém (swap), bez příznaku<br />
** {{Ic|1=*:ext4}} -> třetí oddíl: velikost '''zbytek disku''' (*), souborový systém (ext4)<br />
* {{Ic|1=BLOCKDATA=}} -> určuje připojení vytvořených blokových zařízení; je to víceřádková proměnná uzavřená do apostrofů, každý bod připojení je na vlastním řádku, parametry připojení se tentokrát oddělují '''středníky'''. Přesný význam všech parametrů není nikde popsán, z kontextu lze usoudit, že podstatné volby jsou:<br />
** {{Ic|1=/dev/sdaX}} -> blokové zařízení, které se připojuje<br />
** {{Ic|1=ext2}}, {{Ic|1=swap}}, {{Ic|1=ext4}} -> souborový systém<br />
** {{Ic|1=/boot}}, {{Ic|1=/}} nebo {{Ic|1=no_mountpoint}} --> bod připojení<br />
<br />
<h3>Změny instalačního programu</h3><br />
<br />
<p>Máte-li dostatek zkušeností, můžete napsat vlastní instalační procedury, dílčí funkce nebo konfigurační soubory. Všechny knihovny instalátoru AIF jsou vám k dispozici (viz. {{Ic|1=/usr/lib/aif}}. Instalátor se neustále vyvíjí, více informací najdete v souboru readme AIF.</p><br />
<br />
<h1>Váš nový systém</h1><br />
<br />
<p>Pokud se všechno povedlo, můžete restartovat svůj počítač (ujistěte se, že<br />
nenabootujete znova z USB disku nebo CD mechaniky) a spustí se váš nový systém.</p><br />
<br />
<p>Během tzv. "early userspace", to je po spuštění zavaděče, by mělo dojít k zavedení "hooks" (definovaných v {{ic|mkinitcpio.conf}}), potřebných pro přístup ke kořenovému souborovému systému. Používáte li lvm spustí se lvm "hook", používáte-li šifrování, spustí se také keymap a dmcrypt, abyste mohli zadat heslo a odemknout encrypt hooks so you can enter your password to decrypt the<br />
odemknout přístup ke kořenovému oddílu.</p><br />
<br />
<p>Jakmile systém nabootuje, přihlašte se jako root. Ve výchozím nastavení<br />
je jeho heslo prázdné, ale v interaktivní instalační proceduře je možné ho změnit.</p><br />
<br />
<h1>Více informací</h1><br />
<br />
<h2>Správa balíčků</h2><br />
<br />
<p>Pacman je správce balíčků, který eviduje veškerý software nainstalovaný<br />
na vašem systému. Má podporu pro jednoduché závislosti a pro všechny balíčky<br />
používá standardní formát archivu xz (v minulosti se používal gzip).<br />
Některé běžné úkony, které můžete potřebovat v průběhu instalace, jsou<br />
i s jejich příslušnými příkazy vysvětleny níže. Pro širší vysvětlení voleb<br />
pacmana si přečtěte jeho manuálovou stránku nebo se podívejte na článek<br />
[[Pacman%20(Česky)|o pacmanovi na wiki Arch Linuxu]].<br />
</p><br />
<br />
<p><strong>Typické úkony (vždy je uvedena dlouhá a zkrácená verze stejných příkazů):</strong></p><br />
<br />
*'''Obnovení seznamu balíčků'''<br />
<br />
# pacman --sync --refresh<br />
<br />
# pacman -Sy<br />
<br />
Tímto se obdrží čerstvý seznam balíčků z repozitářů určených v souboru<br />
/etc/pacman.conf a rozbalí do místní databáze.<br />
<br />
*'''Vyhledání balíčku v repozitářích'''<br />
<br />
# pacman --sync --search <regexp><br />
<br />
# pacman -Ss <regexp><br />
<br />
Vyhledá v místní databázi všechny balíčky, jejichž název nebo popis<br />
se shoduje s regulárním výrazem.<br />
<br />
*'''Zobrazení informací o balíčku z databáze repozitářů'''<br />
<br />
# pacman --sync --info balicek<br />
<br />
# pacman -Si balicek<br />
<br />
Zobrazí informace z databáze repozitářů ohledně balíčku "balicek" (velikost, datum sestavení, závislosti, konflikty atp.)<br />
<br />
*'''Instalace balíčku nebo balíčků z repozitářů'''<br />
<br />
# pacman --sync balicek <br />
<br />
# pacman -S balicek<br />
<br />
nebo více balíčků najednou<br />
<br />
# pacman -S balicek1 balicek2<br />
<br />
Stáhne a nainstaluje balíček nebo balíčky, kompletně se všemi závislostmi, které vyžaduje.<br />
Před použitím jakékoliv "sync" volby se ujistěte, že jste obnovili seznam balíčků.<br />
<br />
*'''Výpis nainstalovaných balíčků'''<br />
<br />
# pacman --query<br />
<br />
# pacman -Q<br />
<br />
Zobrazí seznam všech balíčků nainstalovaných do systému.<br />
<br />
*'''Ověření, zda je nainstalován určitý balíček'''<br />
<br />
# pacman --query balicek<br />
<br />
# pacman -Q balicek<br />
<br />
Pokud je balíček "balicek" nainstalován, tento příkaz zobrazí jeho jméno a verzi, v opačném případě nezobrazí nic.<br />
<br />
*'''Zobrazení informací o daném balíčku'''<br />
<br />
# pacman --query --info balicek<br />
<br />
# pacman -Qi balicek<br />
<br />
Zobrazí informace ohledně nainstalovaného balíčku "balicek" (velikost, datum instalace, datum sestavení, závislosti, konflikty atp.)<br />
<br />
*'''Zobrazení seznamu souborů obsažených v balíčku'''<br />
<br />
# pacman --query --list balicek<br />
<br />
# pacman -Ql balicek<br />
<br />
Vypíše všechny soubory patřící k balíčku "balicek".<br />
<br />
*'''Zjištění, ke kterému balíčku patří daný soubor'''<br />
<br />
# pacman --query --owns /cesta/k/souboru<br />
<br />
# pacman -Qo /cesta/k/souboru<br />
<br />
Tento dotaz zobrazí jméno a verzi balíčku, který obsahuje soubor zadaný v parametru.<br />
<br />
<h2>DODATEK</h2><br />
<br />
<p>Pro některé související informace, které mohou ocenit nováčci, vizte [[Official_Arch_Linux_Install_Guide_Appendix|Dodatek oficiálního průvodce instalací Arch Linuxu (anglicky)]].</p></div>Cinellihttps://wiki.archlinux.org/index.php?title=Fonts&diff=226446Fonts2012-10-01T23:54:17Z<p>Cinelli: /* Examples */</p>
<hr />
<div>[[Category:Fonts]]<br />
[[Category:Graphics and desktop publishing]]<br />
[[cs:Fonts]]<br />
[[es:Fonts]]<br />
[[it:Fonts]]<br />
[[ru:Fonts]]<br />
[[tr:Yazıtipleri]]<br />
[[zh-CN:Fonts]]<br />
[[zh-TW:Fonts]]<br />
From [[Wikipedia:Computer font|Wikipedia]]:<br />
:''A computer font (or font) is an electronic data file containing a set of glyphs, characters, or symbols such as dingbats.''<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Covers the selection and installation of fonts on Arch Linux}}<br />
{{Article summary heading|Legal}}<br />
{{Article summary text|Certain font licenses may impose some legal limitations}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Font Configuration}}: Font setup and beautification<br />
{{Article summary wiki|Java Runtime Environment Fonts}}: Fonts specific to Sun's Java machine<br />
{{Article summary wiki|MS Fonts}}: Adding Microsoft fonts and mimicking Windows' font settings<br />
{{Article summary end}}<br />
<br />
== Font formats ==<br />
<br />
Most computer fonts used today are in either ''bitmap'' or ''outline'' data formats. <br />
;Bitmap fonts: Consist of a matrix of dots or pixels representing the image of each glyph in each face and size.<br />
;Outline or ''vector'' fonts: Use Bézier curves, drawing instructions and mathematical formulae to describe each glyph, which make the character outlines scalable to any size.<br />
<br />
=== Common extensions ===<br />
<br />
* {{ic|bdf}} and {{ic|bdf.gz}} – bitmap fonts, ''b''itmap ''d''istribution ''f''ormat and gzip compressed {{ic|bdf}}<br />
* {{ic|pcf}} and {{ic|pcf.gz}} – bitmaps, ''p''ortable ''c''ompiled ''f''ont and gzip compressed {{ic|pcf}}<br />
* {{ic|psf}}, {{ic|psfu}}, {{ic|psf.gz}} and {{ic|psfu.gz}} – bitmaps, ''P''C ''s''creen ''f''ont, ''P''C ''s''creen ''f''ont ''U''nicode and the gzipped versions (not compatible with X.Org)<br />
* {{ic|pfa}} and {{ic|pfb}} – outline fonts, ''P''ostScript ''f''ont ''A''SCII and ''P''ostScript ''f''ont ''b''inary. PostScript fonts carry built-in printer instructions.<br />
* {{ic|ttf}} – outline, ''T''rue''T''ype ''f''ont. Originally designed as a replacement for the PostScript fonts.<br />
* {{ic|otf}} – outline, ''O''pen''T''ype ''f''ont. TrueType with PostScript typographic instructions.<br />
<br />
For most purposes, the technical differences between TrueType and OpenType can be ignored, some fonts with a {{ic|ttf}} extension are actually OpenType fonts.<br />
<br />
=== Other formats ===<br />
<br />
The typesetting application, ''TeX,'' and its companion font software, ''Metafont,'' render characters using their own methods. Some of the file extensions used for fonts by these two programs are {{ic|*pk}}, {{ic|*gf}}, {{ic|mf}} and {{ic|vf}}.<br />
<br />
''FontForge,'' a font editing application, can store fonts in its native text-based format, {{ic|sfd}}, ''s''pline ''f''ont ''d''atabase.<br />
<br />
The [http://www.w3.org/TR/SVG/fonts.html SVG] format also has its own font description method.<br />
<br />
== Installation ==<br />
<br />
There are various methods for installing fonts.<br />
<br />
=== Pacman ===<br />
<br />
Fonts and font collections in the enabled repositories can be installed using [[Pacman|pacman]]. Available fonts may be found by using:<br />
$ pacman -Ss font<br />
Or to search for {{ic|ttf}} fonts only:<br />
$ pacman -Ss ttf<br />
<br />
Some fonts like terminus are installed in {{ic|/usr/share/fonts/local}}, which is not added to the font path by default. By adding the following lines to {{ic|~/.xinitrc}} the fonts can be used in X11:<br />
{{bc|<br />
xset +fp /usr/share/fonts/local<br />
xset fp rehash<br />
}}<br />
<br />
=== Creating a package ===<br />
<br />
If you want to give pacman the ability to manage your fonts, you can create an Arch package. These can also be shared with the community in the [[AUR]]. Here is an example of how to create a basic package. To learn more about building packages, read [[PKGBUILD]].<br />
<br />
{{bc|<nowiki><br />
pkgname=ttf-fontname<br />
pkgver=1.0<br />
pkgrel=1<br />
depends=('fontconfig' 'xorg-font-utils')<br />
pkgdesc="custom fonts"<br />
arch=('any')<br />
source=(http://someurl.org/$pkgname.tar.bz2)<br />
install=$pkgname.install<br />
<br />
build()<br />
{<br />
mkdir -p $pkgdir/usr/share/fonts/TTF<br />
cp $srcdir/$pkgname/*.ttf $pkgdir/usr/share/fonts/TTF<br />
}<br />
</nowiki>}}<br />
<br />
This PKGBUILD assumes the fonts are TrueType. An install file ({{ic|ttf-fontname.install}}) will also need to be created to update the font cache:<br />
<br />
{{bc|<nowiki><br />
post_install() {<br />
echo -n "Updating font cache... "<br />
fc-cache -fs >/dev/null<br />
mkfontscale /usr/share/fonts/TTF /usr/share/fonts/Type1<br />
mkfontdir /usr/share/fonts/TTF /usr/share/fonts/Type1<br />
echo "done"<br />
}<br />
<br />
post_upgrade() {<br />
post_install<br />
}<br />
</nowiki>}}<br />
<br />
=== Manual installation ===<br />
<br />
The recommended way of adding fonts that are not in the repositories to your system is described in [[#Creating a package]]. This gives pacman the ability to remove or update them at a later time. Fonts can alternately be installed manually as well.<br />
<br />
To install fonts system-wide (available for all users), move the folder to the {{ic|/usr/share/fonts/}} directory. To install fonts for only a single user, use {{ic|~/.fonts/}} instead.<br />
<br />
Also you may need to update {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/xorg.conf}} with the new directory. Search for {{ic|FontPath}} to find the correct location within the file to add your new path. See [[#Fonts with X.Org]] for more detail.<br />
<br />
Then update the fontconfig font cache:<br />
<br />
$ fc-cache -vf<br />
<br />
==== Older applications ====<br />
<br />
With older applications that do not support fontconfig (e.g. GTK+ 1.x applications, and {{ic|xfontsel}}) the index will need to be created in the font directory:<br />
<br />
$ mkfontscale<br />
$ mkfontdir<br />
<br />
Or to include more than one folder with one command:<br />
<br />
$ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash<br />
<br />
At times the X server may fail to load the fonts directory and you will need to rescan all the {{ic|fonts.dir}} files:<br />
<br />
# xset +fp /usr/share/fonts/misc # Inform the X server of new directories<br />
# xset fp rehash # Forces a new rescan<br />
<br />
To check that the font(s) is included:<br />
<br />
$ xlsfonts | grep fontname<br />
<br />
=== Pango Warnings ===<br />
When [http://www.pango.org/ Pango] is in use on your system it will read from [http://www.freedesktop.org/wiki/Software/fontconfig fontconfig] to sort out where to source fonts.<br />
<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common'<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'<br />
<br />
If you are seeing errors similar to this and/or seeing blocks instead of characters in your application then you need to add fonts and update the font cache. This example uses the {{Pkg|ttf-liberation}} fonts to illustrate the solution and runs as root to enable them system-wide.<br />
<br />
# pacman -S ttf-liberation<br />
-- output abbreviated, assumes installation succeeded -- <br />
<br />
# fc-cache -vfs<br />
/usr/share/fonts: caching, new cache contents: 0 fonts, 3 dirs<br />
/usr/share/fonts/TTF: caching, new cache contents: 16 fonts, 0 dirs<br />
/usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs<br />
/usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs<br />
/usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs<br />
/var/cache/fontconfig: cleaning cache directory <br />
fc-cache: succeeded<br />
<br />
You can test for a default font being set like so:<br />
<br />
# fc-match<br />
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"<br />
<br />
=== Fonts with X.Org ===<br />
<br />
In order for [[Xorg]] to find and use your newly installed fonts, you must add the font paths to {{ic|/etc/X11/xorg.conf}} (another X.Org configuration file may work too).<br />
<br />
Here is an example of the section that must be added to {{ic|/etc/X11/xorg.conf}}. Add or remove paths based on your particular font requirements.<br />
# Let X.Org know about the custom font directories<br />
Section "Files"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/cantarell"<br />
FontPath "/usr/share/fonts/cyrillic"<br />
FontPath "/usr/share/fonts/encodings"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/truetype"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/util"<br />
EndSection<br />
<br />
==Font packages==<br />
This is a selective list that includes many font packages from the [[AUR]] along with those in the official repositories. Fonts are tagged "Unicode" if they have wide Unicode support, see the project or Wikipedia pages for detail.<br />
<br />
===Braille===<br />
*{{Pkg|ttf-ubraille}} - Font containing Unicode symbols for ''braille''<br />
<br />
===International users===<br />
<br />
====Arabic====<br />
*{{AUR|ttf-sil-lateef}} - Unicode Arabic font from SIL ''(AUR)''<br />
*{{AUR|ttf-sil-scheherazade}} - Unicode Arabic font from SIL ''(AUR)''<br />
*{{AUR|ttf-arabeyes-fonts}} - Collection of free Arabic fonts ''(AUR)''<br />
<br />
====Birman====<br />
*{{AUR|ttf-myanmar3}} - Font for Myanmar/Burmese script ''(AUR)''<br />
<br />
====Chinese, Japanese, Korean, Vietnamese====<br />
<br />
=====(Mainly) Chinese=====<br />
*{{AUR|ttf-tw}} - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan ''(AUR)''.<br />
*{{AUR|wqy-microhei}} - A Sans-Serif style high quality CJK outline font. ''(AUR)''<br />
*{{Pkg|wqy-zenhei}} - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).<br />
*{{Pkg|ttf-arphic-ukai}} - ''Kaiti'' (brush stroke) Unicode font (enabling anti-aliasing is suggested)<br />
*{{Pkg|ttf-arphic-uming}} - ''Mingti'' (printed) Unicode font<br />
*{{Pkg|opendesktop-fonts}} - ''New Sung'' font, previously is ttf-fireflysung package<br />
*{{Pkg|wqy-bitmapfont}} - Bitmapped Song Ti (serif) Chinese font<br />
*{{Pkg|ttf-hannom}} - Chinese and Vietnamese TrueType font<br />
<br />
=====Japanese=====<br />
*{{AUR|otf-ipafont}} - Formal style Japanese Gothic (san-serif) and Mincho (serif) fonts set; one of the highest quality open source font. Default of openSUSE-ja. ''(AUR)''<br />
*{{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux ''(AUR)''<br />
*{{AUR|ttf-mplus}} - Modern Gothic style Japanese outline fonts. It includes all of Japanese Hiragana/Katakana, Basic Latin, Latin-1 Supplement, Latin Extended-A, IPA Extensions and most of Japanese Kanji, Greek, Cyrillic, Vietnamese with 7 weights (proportional) or 5 weights (monospace).<br />
*{{AUR|ttf-ipa-mona}}, {{AUR|ttf-monapo}} - Japanese fonts to show [http://en.wikipedia.org/wiki/2channel_Shift_JIS_art 2channel Shift JIS art] properly. ''(AUR)''<br />
*{{Pkg|ttf-sazanami}} - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environment.<br />
<br />
=====Korean=====<br />
*{{Pkg|ttf-baekmuk}} - Collection of Korean TrueType fonts<br />
*{{AUR|ttf-alee}} - Set of free Hangul TrueType fonts (''AUR'')<br />
*{{AUR|ttf-unfonts-core}} - Un fonts (default Baekmuk fonts may be unsatisfactory) (''AUR'')<br />
*{{AUR|ttf-nanum}} - Nanum series TrueType fonts (''AUR'')<br />
*{{AUR|ttf-nanumgothic_coding}} - Nanum series fixed width TrueType fonts (''AUR'')<br />
<br />
====Cyrillic====<br />
''Also see [[#Monospace]], [[#Sans]] and [[#Serif]]''<br />
*{{AUR|font-arhangai}} - Mongolian Cyrillic (''AUR'')<br />
*{{AUR|ttf-pingwi-typography}} - PingWi Typography (PWT) fonts (''AUR'')<br />
<br />
====Greek====<br />
Almost all Unicode fonts contain the Greek character set (polytonic included). Some additional font packages, which might not contain the complete Unicode set but utilize high quality Greek (and Latin, of course) typefaces are:<br />
*{{AUR|otf-gfs}} - Selection of OpenType fonts from the Greek Font Society ''(AUR)''<br />
*{{AUR|ttf-mgopen}} - Professional TrueType fonts from Magenta ''(AUR)''<br />
<br />
====Hebrew====<br />
*{{AUR|culmus}} - Nice collection of free Hebrew fonts<br />
<br />
====Indic====<br />
*{{Pkg|ttf-freebanglafont}} - Font for Bangla<br />
*{{Pkg|ttf-indic-otf}} - Indic OpenType Fonts collection (containing ttf-freebanglafont)<br />
:(This one contains a "look of disapproval" that might be more to your liking than the {{Pkg|bdf-unifont}} one mentioned elsewhere in this document)<br />
* {{Pkg|lohit-font}} - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more) ''(AUR)''<br />
<br />
====Khmer====<br />
*{{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language<br />
*[http://code.google.com/webfonts/family?family=Hanuman&subset=khmer Hanuman] ({{AUR|ttf-google-webfonts}})<br />
<br />
====Sinhala====<br />
*{{AUR|ttf-lklug}} - Sinhala Unicode font (''AUR'')<br />
<br />
====Tamil====<br />
*{{AUR|ttf-tamil}} - Tamil Unicode fonts (''AUR'')<br />
<br />
====Thai====<br />
*{{Pkg|ttf-thai}} - Font covering glyphs for Thai<br />
====Tibetan====<br />
*{{Pkg|ttf-tibetan-machine}} - Tibetan Machine TTFont<br />
<br />
===Math===<br />
*{{Pkg|font-mathematica}} - Mathematica fonts by Wolfram Research, Inc.<br />
*{{AUR|ttf-mathtype}} - MathType fonts ''(AUR)''<br />
*{{AUR|ttf-computer-modern-fonts}} - ''(AUR)''<br />
<br />
===Microsoft fonts===<br />
See [[MS Fonts]].<br />
<br />
===Apple Mac OS X fonts===<br />
*{{AUR|ttf-mac}} - Mac OS X TrueType fonts. ''(AUR)''<br />
<br />
===Monospaced===<br />
Here are some suggestions. Every user has their own favorite, so experiment to find yours. <br />
If you're in a hurry, you read Dan Benjamin's blog post: [http://hivelogic.com/articles/top-10-programming-fonts ''Top 10 Programming Fonts''].<br />
<br />
Here's a long list of fonts by Trevor Lowing: http://www.lowing.org/fonts/.<br />
<br />
====TrueType====<br />
* [[Wikipedia:Andalé Mono|Andalé Mono]] ({{AUR|ttf-ms-fonts}})<br />
* Anka/Coder ({{AUR|ttf-anka-coder}})<br />
* Anonymous Pro ({{AUR|ttf-anonymous-pro}}, included in {{AUR|ttf-google-webfonts}})<br />
* [[Wikipedia:Bitstream Vera|Bitstream Vera Mono]] ({{Pkg|ttf-bitstream-vera}})<br />
* [[Wikipedia:Consolas|Consolas]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:Courier New|Courier New]] ({{AUR|ttf-ms-fonts}})<br />
* Cousine ({{AUR|ttf-google-webfonts}}) - Chrome/Chromium OS replacement for Courier New (metric-compatible)<br />
* [[Wikipedia:DejaVu fonts|DejaVu Sans Mono]] ({{Pkg|ttf-dejavu}}) - Unicode<br />
* [[Wikipedia:Droid (font)|Droid Sans Mono]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-webfonts}})<br />
* Envy Code R ({{AUR|ttf-envy-code-r}})<br />
* [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}})<br />
* [[Wikipedia:Inconsolata|Inconsolata-g]] ({{AUR|ttf-inconsolata-g}}) - adds some programmer-friendly modifications<br />
* [[Wikipedia:Liberation fonts|Liberation Mono]] ({{Pkg|ttf-liberation}}) - Alternative to Courier New (metric-compatible)<br />
* [[Wikipedia:Lucida Console|Lucida Console]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{Pkg|jre}})<br />
* [[Wikipedia:Monaco (typeface)|Monaco]] ({{Pkg|monaco-linux-font}})<br />
* Monofur ({{AUR|ttf-monofur}})<br />
<br />
====Bitmap====<br />
*Default 8x16<br />
*Dina ({{Pkg|dina-font}})<br />
*Lime ({{Pkg|artwiz-fonts}})<br />
*[[Wikipedia:ProFont|ProFont]] ({{Pkg|profont}})<br />
*[[Wikipedia:Proggy Programming Fonts|Proggy Programming Fonts]] ({{AUR|proggyfonts}})<br />
*Proggy opti cyrillic ({{AUR|proggyopticyr-font}})<br />
*Tamsyn ({{AUR|tamsyn-font}})<br />
*[[Wikipedia:Terminus (typeface)|Terminus]] ({{Pkg|terminus-font}})<br />
*Unifont (glyphs like (look of disapproval)) ({{Pkg|bdf-unifont}})<br />
<br />
===Sans-serif===<br />
<br />
*[http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=andika Andika] ({{AUR|ttf-andika}}, included in {{AUR|ttf-sil-fonts}})<br />
*[[Wikipedia:Arial|Arial]] ({{AUR|ttf-ms-fonts}})<br />
*[[Wikipedia:Arial Black|Arial Black]] ({{AUR|ttf-ms-fonts}})<br />
*Arimo ({{AUR|ttf-google-webfonts}}) - Chrome/Chromium OS replacement for Arial (metric-compatible)<br />
*[[Wikipedia:Calibri|Calibri]] ({{AUR|ttf-vista-fonts}})<br />
*[[Wikipedia:Candara|Candara]] ({{AUR|ttf-vista-fonts}})<br />
*[[Wikipedia:Constantia (typeface)|Constantia]] ({{AUR|ttf-vista-fonts}})<br />
*[[Wikipedia:Corbel (typeface)|Corbel]] ({{AUR|ttf-vista-fonts}})<br />
*[[Wikipedia:DejaVu fonts|DejaVu Sans]] ({{Pkg|ttf-dejavu}}) - Unicode<br />
*[[Wikipedia:Droid (font)|Droid Sans]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-webfonts}})<br />
*[[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode<br />
*[[Wikipedia:Impact (typeface)|Impact]] ({{AUR|ttf-ms-fonts}})<br />
*[[Wikipedia:Liberation fonts|Liberation Sans]] ({{Pkg|ttf-liberation}}, improved/reworked Cyrillic: {{Pkg|ttf-liberastika}}) - Alternative to Arial (metric-compatible)<br />
*[[Wikipedia:Liberation fonts|Liberation Sans Narrow]] ({{Pkg|ttf-liberation}}) - Alternative to Arial Narrow (metric-compatible)<br />
*[[Wikipedia:Linux Libertine|Linux Biolinum]] ({{Pkg|ttf-linux-libertine}})<br />
*[[Wikipedia:Lucida Sans|Lucida Sans]] ({{AUR|ttf-ms-fonts}})<br />
*[[Wikipedia:Microsoft Sans Serif|Microsoft Sans Serif]] ({{AUR|ttf-ms-fonts}})<br />
*[[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google-webfonts}}) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic<br />
*[[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}})<br />
*[[Wikipedia:Trebuchet MS|Trebuchet]] ({{AUR|ttf-ms-fonts}})<br />
*[[Wikipedia:Ubuntu-Title|Ubuntu-Title]] ({{AUR|ttf-ubuntu-title}})<br />
*[[Wikipedia:Ubuntu Font Family|Ubuntu Font Family]] ({{Pkg|ttf-ubuntu-font-family}})<br />
*[[Wikipedia:Verdana|Verdana]] ({{AUR|ttf-ms-fonts}})<br />
<br />
===Script===<br />
<br />
*[[Wikipedia:Comic Sans|Comic Sans]] ({{AUR|ttf-ms-fonts}})<br />
<br />
===Serif===<br />
*[[Wikipedia:Cambria (typeface)|Cambria]] ({{AUR|ttf-vista-fonts}})<br />
*[[Wikipedia:Charis SIL|Charis]] ({{AUR|ttf-charis}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Cyrillic<br />
*[[Wikipedia:DejaVu fonts|DejaVu Serif]] ({{Pkg|ttf-dejavu}}) - Unicode<br />
*[[Wikipedia:Doulos SIL|Doulos]] ({{AUR|doulos-sil}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Cyrillic<br />
*[[Wikipedia:Droid (font)|Droid Serif]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-webfonts}})<br />
*[[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode<br />
*[[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet<br />
*[[Wikipedia:Georgia (typeface)|Georgia]] ({{AUR|ttf-ms-fonts}})<br />
*[[Wikipedia:Liberation fonts|Liberation Serif]] ({{Pkg|ttf-liberation}}) - Alternative to Times New Roman (metric-compatible)<br />
*[[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode: Latin, Greek, Cyrillic, Hebrew<br />
*[[Wikipedia:Times New Roman|Times New Roman]] ({{AUR|ttf-ms-fonts}})<br />
*Tinos ({{AUR|ttf-google-webfonts}}) - Chrome/Chromium OS replacement for Times New Roman (metric-compatible)<br />
<br />
===Unsorted===<br />
<!--This section should be absorbed into the Monospace/Serif/Sans-Serif structure--><br />
*{{AUR|ttf-google-webfonts}} and {{AUR|ttf-google-webfonts-hg}} — a huge collection of free fonts (including ubuntu, inconsolata, droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added ''(AUR)''<br />
*{{Pkg|ttf-mph-2b-damase}} — Covers full plane 1 and several scripts<br />
*{{AUR|ttf-symbola}} — Provides emoji and many many other symbols. ''(AUR)''<br />
*{{AUR|ttf-sil-fonts}} — Gentium, Charis, Doulos, Andika and Abyssinica from SIL ''(AUR)''<br />
*{{Pkg|font-bh-ttf}} — X.Org Luxi fonts<br />
*{{Pkg|ttf-cheapskate}} — Font collection from ''dustismo.com''<br />
*{{Pkg|ttf-isabella}} — Calligraphic font based on the ''Isabella Breviary'' of 1497<br />
*{{Pkg|ttf-junicode}} — Junius font containing almost complete medieval latin script glyphs<br />
*arkpandorafonts {{AUR|ttf-arkpandora}} — Alternative to Arial and Times New Roman fonts ''(AUR)''<br />
*{{Pkg|xorg-fonts-type1}} — IBM Courier and Adobe Utopia sets of [[Wikipedia:PostScript fonts|PostScript fonts]]<br />
<br />
==Console fonts==<br />
<br />
The console, meaning a terminal running with no ''X'' Window System, uses the ASCII character set as the default. This font and the keymap used are easily changed.<br />
<br />
A console font is limited to either 256 or 512 characters. The fonts are found in {{ic|/usr/share/kbd/consolefonts/}}.<br />
<br />
''Keymaps, ''the connection between the key pressed and the character used by the computer, are found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}.<br />
<br />
=== Previewing and testing ===<br />
<br />
An organized library of images for previewing is available at http://alexandre.deverteuil.net/consolefonts/consolefonts.html.<br />
<br />
Moreover, the user can use {{ic|setfont}} to temporarily change the font and be able to consider its use as the default. The available ''glyphs ''or letters in the font can also be viewed as a table with the command {{ic|showconsolefont}}.<br />
<br />
If the newly changed font is not suitable, a return to the default font is done by issuing the command {{ic|setfont}} without any arguments. If the console display is totally unreadable, this command will still work—the user just types in {{ic|setfont}} while "working blind."<br />
<br />
Note that {{ic|setfont}} only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.<br />
<br />
==== Examples ====<br />
<br />
Change the font. This example is distinctive:<br />
$ setfont /usr/share/kbd/consolefonts/gr737b-9x16-medieval.psfu.gz<br />
<br />
Or change the font to one with 512 glyphs and set the keymap to ''ISO 8859-5'' using the {{ic|-m}} option:<br />
$ setfont /usr/share/kbd/consolefonts/LatArCyrHeb-16.psfu.gz -m 8859-5<br />
<br />
Then issue commands that send text to the display, perhaps view a ''manpage'' and try ''vi'' or ''nano'', and view the table of glyphs with the command, {{ic|showconsolefont}}.<br />
<br />
Return to the default font with:<br />
$ setfont<br />
<br />
=== Changing the default font ===<br />
<br />
To change the default font, the {{ic|FONT<nowiki>=</nowiki>}} and {{ic|FONT_MAP<nowiki>=</nowiki>}} settings in {{ic|/etc/vconsole.conf}} (this file may need to be created) must be altered. Again, the fonts can be found in {{ic|/usr/share/kbd/consolefonts/}} directory and keymaps can be found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}.<br />
<br />
==== Examples ====<br />
For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}:<br />
FONT=lat2-16<br />
It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values like lat2-08...16. For the regions determined by 8859 specification, look at the [http://en.wikipedia.org/wiki/ISO/IEC_8859#The_Parts_of_ISO.2FIEC_8859 Wikipedia]. You can use a Terminus font which is recommended if you work a lot in console without X server. ter-216b for example is latin-2 part, size 16, bold. ter-216n is the same but normal weight. Terminus fonts have sizes up to 32.<br />
<br />
Now, set the proper keymap, for lat2-16 it will be:<br />
FONT_MAP=8859-2<br />
<br />
To use the specified font in early userspace, that is, early in the bootup process, add the {{ic|consolefont}} hook to {{ic|/etc/mkinitcpio.conf}}:<br />
HOOKS="base udev autodetect pata scsi sata filesystems '''consolefont''' '''keymap'''"<br />
<br />
Then rebuild the image:<br />
# mkinitcpio -p linux<br />
<br />
{{Note|The above steps must be repeated for each kernel if more than one kernel package is installed.}}<br />
<br />
See [[Mkinitcpio#HOOKS]] for more information.<br />
<br />
If the fonts seems to not change on boot, or change only temporarily, it is most likely that they got reset when graphics driver was initialized and console was switched to framebuffer. To avoid this, load your graphics driver earlier. See for example [[KMS#Early_KMS_start]] or other ways to setup your framebuffer before {{ic|/etc/vconsole.conf}} gets applied.<br />
<br />
==== Boot Error ====<br />
<br />
If "Loading Console Font" fails at boot time, this is probably because you didn't choose a valid font during your Arch Linux install.<br />
<br />
To get rid of this message, simply empty the {{ic|CONSOLEFONT}} variable in {{ic|/etc/rc.conf}}. It will fallback on default font at boot.<br />
<br />
== Fallback font order with X11 ==<br />
Fontconfig automatically chooses a font that matches the current requirement. That is to say, if one is looking at a window containing English and Chinese for example, it will switch to another font for the Chinese text if the default one doesn't support it.<br />
<br />
Fontconfig lets every user configure the order they want via {{ic|~/.fonts.conf}}.<br />
If you want a particular Chinese font to be selected after your favorite Serif font, your file would look like this:<br />
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Your favorite Latin Serif font name</family><br />
<family>Your Chinese font name</family><br />
</prefer><br />
</alias><br />
</fontconfig><br />
<br />
You can add a section for Sans-serif and monospaced as well. For more informations, have a look at the fontconfig manual.<br />
<br />
== Font alias ==<br />
In Linux there are several font aliases which represent other fonts in order that applications may use similar fonts. The most common aliases are: {{ic|serif}} for a font of the serif type (e.g. DejaVu Serif); {{ic|sans-serif}} for a font of the sans-serif type (e.g. DejaVu Sans); and {{ic|monospace}} for a monospaced font (e.g. DejaVu Sans Mono). However, the fonts which these aliases represent may vary and the relationship is often not shown in font management tools such as those found in KDE and other desktop environments.<br />
<br />
To reverse an alias and find which font it is representing, run:<br />
$ fc-match monospace<br />
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"<br />
<br />
In this case DejaVuSansMono.ttf is the font represented by the monospace alias.</div>Cinellihttps://wiki.archlinux.org/index.php?title=Locale&diff=226444Locale2012-10-01T21:38:48Z<p>Cinelli: /*note locale.conf must be created*/</p>
<hr />
<div>[[Category:Internationalization]]<br />
[[cs:Locale]]<br />
[[de:Locale]]<br />
[[es:Locale]]<br />
[[fr:Locale]]<br />
[[it:Locale]]<br />
[[ko:Locale]]<br />
[[nl:Locale]]<br />
[[ru:Locale]]<br />
[[uk:Locale]]<br />
[[zh-CN:Locale]]<br />
Locales are used in Linux to define which language the user uses. As the locales define the character sets being used as well, setting up the correct locale is especially important if the language contains non-ASCII characters.<br />
<br />
Locale names are defined using the following format:<br />
<lang>_<territory>.<codeset>[@<modifiers>]<br />
<br />
==Enabling necessary locales==<br />
Before a locale can be used on the system, it has to be enabled first. To list all available locales, use:<br />
$ locale -a<br />
To enable a locale, uncomment the name of the locale in the file {{ic|/etc/locale.gen}}. This file contains all the available locales that can be used on the system. Revert the process to disable a locale. After the necessary locales are enabled, the system needs to be updated with the new locales:<br />
# locale-gen<br />
<br />
To display the locales now currently in use, use:<br />
$ locale<br />
<br />
{{Tip| Though it's most likely that just one language is used use on your computer, it can be helpful or even necessary to enable other locales as well. If you're running a multi-user system with users that do not speak en_US, their individual locale should at least be supported by your system.}}<br />
<br />
===US English example===<br />
<br />
First uncomment the following locales in {{ic|/etc/locale.gen}}:<br />
en_US.UTF-8 UTF-8<br />
<br />
Then update the system as root:<br />
# locale-gen<br />
<br />
==Setting system-wide locale==<br />
To define the system-wide locale used on the system, set {{ic|LANG}} in {{ic|locale.conf}}:<br />
{{Note|/etc/locale.conf does not exist by default it created manually.}}<br />
{{hc|/etc/locale.conf|2=<br />
LANG="en_US.UTF-8"}}<br />
<br />
An advanced example configuration would be:<br />
<br />
{{hc|/etc/locale.conf|2=<br />
# Enable UTF-8 with Australian settings.<br />
LANG="en_AU.UTF-8"<br />
<br />
# Keep the default sort order (e.g. files starting with a '.'<br />
# should appear at the start of a directory listing.)<br />
LC_COLLATE="C"<br />
<br />
# Set the short date to YYYY-MM-DD (test with "date +%c")<br />
LC_TIME="en_DK.UTF-8"}}<br />
<br />
To use them, the locales need to be specified in {{ic|locale.gen}} and generated using the {{ic|locale-gen}} command:<br />
<br />
{{hc|/etc/locale.gen|<br />
en_AU.UTF-8 UTF-8<br />
en_DK.UTF-8 UTF-8<br />
en_US.UTF-8 UTF-8}}<br />
<br />
# locale-gen<br />
<br />
They will take effect after rebooting the system and will be set for individual sessions at login.<br />
<br />
==Setting fallback locales==<br />
Programs which use gettext for translations respect the {{Ic|LANGUAGE}} option in addition to the usual variables. This allows users to specify a [http://www.gnu.org/software/gettext/manual/gettext.html#The-LANGUAGE-variable list] of locales that will be used in that order. If a translation for the preferred locale is unavailable, another from a similar locale will be used instead of the default. For example, an Australian user might want to fall back to British rather than US spelling:<br />
{{hc|/etc/locale.conf|2=<br />
LANG="en_AU.UTF-8"<br />
export LANGUAGE="en_AU:en_GB:en"<br />
}}<br />
<br />
==Setting per user locale==<br />
As we mentioned earlier, some users might want to define a different locale than the system-wide locale. To do this, export the variable {{Ic|LANG}} with the specified locale in the {{ic|~/.bashrc}} file. For example, to use the {{Ic|en_AU.UTF-8}} locale:<br />
export LANG=en_AU.UTF-8<br />
<br />
The locales will be updated next time {{ic|~/.bashrc}} is sourced. To update, either re-login or source it manually:<br />
$ source ~/.bashrc<br />
<br />
==Setting collation==<br />
Collation, or sorting, is a little different. Sorting is a goofy beast and different locales do things differently. To get around potential issues, Arch used to set {{ic|1=LC_COLLATE="C"}} in {{ic|/etc/profile}}. However, this method is now deprecated. To enable this behavior, simply add the following to {{ic|/etc/locale.conf}}:<br />
LC_COLLATE="C"<br />
<br />
Now the ls command will sort dotfiles first, followed by uppercase and lowercase filenames. Note that without a {{ic|LC_COLLATE}} setting, locale aware apps sort by {{ic|LC_ALL}} or {{ic|LANG}}, but {{ic|LC_COLLATE}} settings will be overridden if {{ic|LC_ALL}} is set. If this is a problem, ensure that LC_ALL is not set by adding the following to {{ic|/etc/profile}} instead:<br />
export LC_ALL=<br />
Note that LC_ALL is the only LC variable which '''cannot''' be set in {{ic|/etc/locale.conf}}.<br />
<br />
==Setting the first day of the week==<br />
In many countries the first day of the week is Monday. To adjust this, change or add the following lines in the {{ic|LC_TIME}} section in {{ic|/usr/share/i18n/locales/<your_locale>}}:<br />
<br />
week 7;19971130;5<br />
first_weekday 2<br />
first_workday 2<br />
<br />
And then update the system:<br />
<br />
# locale-gen<br />
<br />
{{Tip| If you experience some kind of problems with your system and would like to ask for help on the forum, mailing list or otherwise, please include the output from the misbehaving program with {{ic|export LC_MESSAGES&#61;C}} before posting. It will set the output messages (errors and warnings) to English, thus enabling more people to understand what the problem might be. This is not relevant if you are posting on a non-English forum.}}<br />
<br />
==Troubleshooting==<br />
===My terminal doesn't support UTF-8===<br />
Unfortunately some terminals do not support UTF-8. In this case, you have to use a different terminal. Here are some terminals that have support for UTF-8:<br />
<br />
* vte-based terminals<br />
* gnustep-terminal<br />
* konsole<br />
* [[mlterm]]<br />
* rxvt-unicode<br />
* xterm<br />
<br />
====Xterm doesn't support UTF-8====<br />
xterm only supports UTF-8 if you run it as {{Ic|uxterm}} or {{Ic|xterm -u8}}.<br />
<br />
====Gnome-terminal or rxvt-unicode doesn't support UTF-8====<br />
You need to launch these applications from a UTF-8 locale or they will drop UTF-8 support. Enable the {{ic|en_US.UTF-8}} locale (or your local UTF-8 alternative) per the instructions above and set it as the default locale, then reboot.<br />
<br />
==See also==<br />
* [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]<br />
* [http://www.gentoo-wiki.info/Locales Gentoo Wiki Archives: Locales]<br />
* [http://demo.icu-project.org/icu-bin/locexp?_=en_US&x=col ICU's interactive collation testing]<br />
* [http://www.openi18n.org/ Free Standards Group Open Internationalisation Initiative]<br />
* [http://pubs.opengroup.org/onlinepubs/007908799/xbd/locale.html ''The Single UNIX Specification'' definition of Locale] by The Open Group<br />
* [https://help.ubuntu.com/community/EnvironmentVariables#Locale_setting_variables Locale environment variables]</div>Cinellihttps://wiki.archlinux.org/index.php?title=User_talk:Cinelli&diff=218480User talk:Cinelli2012-08-18T09:11:42Z<p>Cinelli: /* Df */</p>
<hr />
<div>Hi Cinelli, please address the concerns I had regarding the reason for my edit. You have specifically deleted the section that warns users to a decision that must be made early on (during partitioning) to ensure compatibility of GRUB(2). Am I overlooking the warning directed at users who follow the tutorial and intend on using GRUB(2)?<br />
Please advise or I plan on rolling back your edit in the absence of a reason.<br />
<br />
Best,<br />
DF<br />
<br />
== Df ==<br />
<br />
Df, the reason for my removal of the note was because there is no need for the 2mb partition or partition gab that was stated to be required when using an MBR partition tables. I have never had to setup the "needed" partition gap with this type of table and other Archlinux community helpers within the #archlinux @ freenode.net community seemed to agree with that. Only when using GPT tables is there specific instructions needed. With MBR you could setup the entire system on one large partition if desired. With that being said, there was no need for the note. It seemed to just confuse people and increase inquiries in #archlinux <br />
<br />
-F. Cinelli<br />
<br />
-- Cinelli --<br />
<br />
Hi Cinelli, thanks for your response. I still contend that warning users earlier on in the tutorial about this partition gap as described in https://wiki.archlinux.org/index.php/GRUB#GPT_specific_instructions regarding GRUB2 and BIOS-GPT is useful for people like me who overlooked this. I wanted to use GPT for its mentioned advantages and didn't choose to use MBR since I don't use windows. I'll admit that my note wasn't perhaps as clear as it could have been so I'm hoping you can do a better job of including a note mentioning this special case. If you and the Archlinux community on irc have figured out how to avoid needing a 2MB partition with BIOS-GPT and GRUB2 then please update GRUB and beginners tutorials. I'll join up on irc if I don't see a note simply warning users about this special case while also making it clear that it doesn't apply to syslinux, GRUB with MBR and GRUB with UEFI-GPT.<br />
<br />
I realize this is a special case, but I still feel as though beginners should be warned about it.<br />
<br />
Thanks, <br />
DF<br />
<br />
-- DF --<br />
<br />
The NOTE that was removed was A.) irrelivant to using fdisk. and B.) completely unrelated to the boot loader chosen to be installed. The section right before the note that was removed speaks about manually partitioning a MBR partition table. And then your not (listed right here) <br />
<br />
{{Note|If you plan on using [[GRUB]](2) instead of [[Syslinux]] or [[GRUB_Legacy]], be aware that you must create a 2MiB partition on your hard disk (with filesystem flag 'EF02') located before the partition that contains /boot as mentioned in [[GRUB]](2). Please note that the bootloader installation instructions below are for [[GRUB]](2).}}<br />
<br />
Is 100% irrelivant and also incorrect. Boot loader has nothing to do with what style partition table your going to run, and this whole mess of words can be easily avoided by just adding a note after each command showing "if your using syslinux" then it would be this." then thee's less documents to fish through for an answer, much less repetition, and far less confusion. It's removal is completely justified and I plan on removing it once again since now there's CFdisk back in the mix of things and fdisk and GPT and MBR all thgrown together in a simple manual partition wiki.<br />
<br />
and also, in your reply to my first response you said that i me and the irc community had possibly found a way around the GPT gap ... I never stated that, never said anything about GPT partitions, simply stated that MBRs DO NOT NEED A GAP PARTITION and ONLY GPTs do .. and GPARTED only does GPT while FDISK only does MBR and PARTED does both.. CFDISK is not a good tool to use that's why we don't use it ever.<br />
r<br />
It's fussy about partitions ending on cylinder boundaries, and it seems to come up with its own ideas about what CHS geometry to simulate which don't necessarily correspond with what Linux would come up with given the drive in a blank state.<br />
<br />
So expect my revisions to be reapplied since your the only that i've heard say anything about them and most of the questions regarding partitioning and the gap partition and such have slowed in the channel compairing to when peoeple would come in completely confused asking if ther ehas to be a MBR gap when using a normal styled partition table like always.<br />
<br />
Thanks for you time</div>Cinellihttps://wiki.archlinux.org/index.php?title=Beginners%27_guide&diff=218044Beginners' guide2012-08-15T20:50:11Z<p>Cinelli: /* Manually partition hard drives */</p>
<hr />
<div><noinclude><br />
[[Category:Getting and installing Arch]]<br />
[[Category:About Arch]]<br />
[[da:Beginners' Guide/Installation]]<br />
[[es:Beginners' Guide/Installation]]<br />
[[hr:Beginners' Guide/Installation]]<br />
[[hu:Beginners' Guide/Installation]]<br />
[[it:Beginners' Guide/Installation]]<br />
[[ko:Beginners' Guide/Installation]]<br />
[[nl:Beginners' Guide/Installatie]]<br />
[[pt:Beginners' Guide/Installation]]<br />
[[ru:Beginners' Guide/Installation]]<br />
[[sr:Beginners' Guide/Installation]]<br />
[[zh-CN:Beginners' Guide/Installation]]<br />
{{Tip|This is part of a multi-page article for The Beginners' Guide. '''[[Beginners' Guide|Click here]]''' if you would rather read the guide in its entirety.}}<br />
</noinclude><br />
==Installation==<br />
After booting, the installation media automatically logs in as '''root''' and uses a US keyboard layout.<br />
<br />
===Changing the keymap===<br />
<br />
If you have a non-US keyboard layout you can interactively choose your keymap/console font with the command:<br />
{{bc|# loadkeys ''layout''}}<br />
where ''layout'' is your keyboard layout such as {{ic|fr}}, {{ic|uk}} or {{ic|be-latin1}}<br />
<br />
Keymaps are available for many countries and keyboard types. The keymap files can be found in {{ic|/usr/share/kbd/keymaps/}} (you can omit the keymap path and file extension when using {{ic|loadkeys}}).<br />
<br />
===Setup network in the live installation environment===<br />
The installer need network connection to download and install packages. So network have to be setup first. <br />
<br />
==== Automatic setup ====<br />
The installer will try to automatically configure a wired connection if available. You may check this was successful by using {{ic|/bin/ping}}:<br />
# ping -c 3 www.google.com<br />
<br />
If you get an answer that looks like this:<br />
PING www.l.google.com (74.125.132.105) 56(84) bytes of data.<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=1 ttl=50 time=17.0 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=2 ttl=50 time=18.2 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=3 ttl=50 time=16.6 ms<br />
<br />
--- www.l.google.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2003ms<br />
rtt min/avg/max/mdev = 16.660/17.320/18.254/0.678 ms<br />
<br />
then the network and Internet access have been properly configured. You may continue to [[#Prepare_hard_drive]]. Otherwise, if you get:<br />
ping: unknown host www.google.com<br />
you will need to set up the network manually, as explained below.<br />
<br />
====Set up a wired connection====<br />
Follow this procedure if your computer is connected to an Ethernet network. In most cases, you will have one interface, called {{ic|eth0}}. If you have additional ethernet interfaces (which may be additional cards or integrated to the motherboard), their name will follow the sequence {{ic|eth1}}, {{ic|eth''X''}},...<br />
<br />
=====Dynamic IP (DHCP)=====<br />
Assuming a wired Ethernet connection and access to a DHCP server (e.g. using a router), run:<br />
# dhcpcd<br />
to get a lease.<br />
If you have several interfaces (such as several Ethernet cards), you may specify the interface with {{ic|dhcpcd <interface>}}, e.g:<br />
# dhcpcd eth0<br />
Verify your connection as explained [[#Automatic_setup|above]] and if successful jump to [[#Prepare_hard_drive]].<br />
<br />
=====Static IP=====<br />
If you do not have access or are not using DHCP, you need to assign a static IP address.<br />
You need to know these settings:<br />
* Static IP address,<br />
* Subnet mask,<br />
* Gateway's IP address,<br />
* Name servers' (DNS) IP addresses,<br />
* Domain name (unless a local LAN, in which case you can make it up).<br />
<br />
Activate the connected ethernet interface, e.g. for {{ic|eth0}}:<br />
# ip link set eth0 up<br />
Add the address:<br />
# ip addr add <ip address>/<subnetmask> dev <interface><br />
For example:<br />
# ip addr add 192.168.1.2/24 dev eth0<br />
<br />
For more options, see: {{ic|man ip}}<br />
<br />
Add your gateway like so:<br />
# ip route add default via <ip address><br />
(Substitute your own gateway's IP address)<br />
<br />
For example:<br />
# ip route add default via 192.168.1.1<br />
<br />
Edit your {{ic|/etc/resolv.conf}} like this, substituting your name servers' IP addresses and your local domain name:<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com<br />
<br />
{{Note|Currently, you may include a maximum of 3 {{ic|nameserver}} lines.}}<br />
{{Note|For more in-depth information on network configration, visit [[configuring network]].}}<br />
<br />
{{Tip|If you do not need to configure ADSL or wireless, you may proceed to [[#Prepare_hard_drive|Prepare hard drive]].}}<br />
<br />
====Setup wireless network====<br />
Follow this procedure if you need wireless connectivity (WiFi) during the installation process.<br />
<br />
The wireless drivers and utilities are now available to you in the live environment of the installation media. A good knowledge of your wireless hardware will be of key importance to successful configuration. Note that the following quick-start procedure ''executed at this point in the installation'' will initialize your wireless hardware for use ''in the live environment of the installation media''. These steps (or some other form of wireless management) '''must be repeated from the actual installed system after booting into it'''.<br />
<br />
Also note that these steps are optional if wireless connectivity is unnecessary at this point in the installation; wireless functionality may always be established later.<br />
<br />
{{Note|The following examples use {{ic|wlan0}} for the interface and {{ic|linksys}} for the ESSID. Remember to change these values according to your setup.}}<br />
<br />
The basic procedure will be:<br />
* (optional) Identify the wireless interface:<br />
{{bc|<nowiki># lspci | grep -i net</nowiki>}}<br />
or, if using a USB adapter:<br />
{{bc|<nowiki># lsusb </nowiki>}}<br />
* Ensure udev has loaded the driver, and that the driver has created a usable wireless kernel interface with {{ic|/usr/sbin/iwconfig}}:<br />
<br />
{{hc|# iwconfig|<nowiki> lo no wireless extensions.<br />
eth0 no wireless extensions.<br />
wlan0 unassociated ESSID:""<br />
Mode:Managed Channel=0 Access Point: Not-Associated<br />
Bit Rate:0 kb/s Tx-Power=20 dBm Sensitivity=8/0<br />
Retry limit:7 RTS thr:off Fragment thr:off<br />
Power Management:off<br />
Link Quality:0 Signal level:0 Noise level:0<br />
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0<br />
Tx excessive retries:0 Invalid misc:0 Missed beacon:0<br />
</nowiki>}}<br />
{{ic|wlan0}} is the available wireless interface in this example. <br />
<br />
{{Note|If you do not see output similar to this, then your wireless driver has not been loaded. If this is the case, you must load the driver yourself. Please see [[Wireless Setup]] for more detailed information.}}<br />
<br />
* Bring the interface up with:<br />
{{bc|# ip link set wlan0 up}}<br />
<br />
A small percentage of wireless chipsets also require firmware, in addition to a corresponding driver. If the wireless chipset requires firmware, you are likely to receive this error when bringing the interface up:<br />
<br />
{{hc|# ip link set wlan0 up|SIOCSIFFLAGS: No such file or directory}}<br />
<br />
If unsure, invoke {{ic|/usr/bin/dmesg}} to query the kernel log for a firmware request from the wireless chipset. <br />
<br />
Example output from an Intel chipset which requires and has requested firmware from the kernel at boot:<br />
<br />
{{hc|<nowiki>$ dmesg | grep firmware</nowiki>|firmware: requesting iwlwifi-5000-1.ucode}}<br />
<br />
If there is no output, it may be concluded that the system's wireless chipset does not require firmware.<br />
<br />
{{Warning|Wireless chipset firmware packages (for cards which require them) are pre-installed under {{ic|/usr/lib/firmware}} in the live environment (on CD/USB stick) '''but must be explicitly installed to your actual system to provide wireless functionality after you reboot into it!''' Package installation is covered later in this guide. Ensure installation of both your wireless module and firmware before rebooting! See [[Wireless Setup]] if you are unsure about the requirement of corresponding firmware installation for your particular chipset. This is a very common error.}}<br />
<br />
* If the ESSID has been forgotten or is unknown, use {{ic|iwlist <interface> scan}} to scan for nearby networks:<br />
{{hc|# iwlist wlan0 scan|<nowiki><br />
Cell 01 - Address: 04:25:10:6B:7F:9D<br />
Channel:2<br />
Frequency:2.417 GHz (Channel 2)<br />
Quality=31/70 Signal level=-79 dBm <br />
Encryption key:off<br />
ESSID:"dlink"<br />
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s<br />
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s<br />
36 Mb/s; 48 Mb/s; 54 Mb/s<br />
</nowiki>}}<br />
<br />
* If using WPA encryption:<br />
<br />
Using WPA encryption requires that the key be encrypted and stored in a file, along with the ESSID, to be used later for connection via {{ic|wpa_supplicant}}. Thus, a few extra steps are required:<br />
<br />
For the purpose of simplifying and backup, rename the default {{ic|wpa_supplicant.conf}} file:<br />
{{bc|# mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf.original}}<br />
<br />
Using {{ic|wpa_passphrase}}, provide your wireless network name and WPA key to be encrypted and written to {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}.<br />
<br />
The following example encrypts the key "my_secret_passkey" of the "linksys" wireless network, generates a new configuration file ({{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}), and subsequently redirects the encrypted key, writing it to the file:<br />
{{bc|# wpa_passphrase linksys "my_secret_passkey" > /etc/wpa_supplicant/wpa_supplicant.conf}}<br />
{{Note|If the above fails with a {{ic|bash: event not found}} error, it may be due to special characters (e.g. {{ic|!}}) used in your wireless network name. In that case try the following:<br />
{{bc|# tee /etc/wpa_supplicant/wpa_supplicant.conf < <(wpa_passphrase linksys "passphrase")}}<br />
And if you are still having problems because of special characters in your network name or passphrase, you may try the following, where ({{ic|~/mykey}}) is a temporary text file containing only your passphrase:<br />
{{bc|# cat ~/mykey <nowiki>|</nowiki> wpa_passphrase linksys > /etc/wpa_supplicant/wpa_supplicant.conf}}<br />
Also, for security reasons, you may want to remove this file ({{ic|~/mykey}}) after you setup your ({{ic|/etc/wpa_supplicant.conf}}) file.}}<br />
<br />
Check [[WPA Supplicant]] for more information and troubleshooting.<br />
<br />
{{Note|{{ic|/etc/wpa_supplicant/wpa_supplicant.conf}} is stored in plain text format. This is not risky in the installation environment, but when you reboot into your new system and reconfigure WPA, remember to change the permissions on {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}} (e.g. {{ic|chmod 0600 /etc/wpa_supplicant/wpa_supplicant.conf}} to make it readable by root only).}}<br />
<br />
* Associate your wireless device with the access point you want to use. Depending on the encryption (none, WEP, or WPA), the procedure may differ. You need to know the name of the chosen wireless network (ESSID).<br />
<br />
{| border="1"<br />
! Encryption || Command<br />
|-<br />
| No Encryption || {{ic|iwconfig wlan0 essid "linksys"}}<br />
|-<br />
| WEP w/ Hex Key || {{ic|iwconfig wlan0 essid "linksys" key "0241baf34c"}}<br />
|-<br />
| WEP w/ ASCII passphrase || {{ic|iwconfig wlan0 essid "linksys" key "s:pass1"}}<br />
|-<br />
| WPA || {{ic|wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf}}<br />
|}<br />
<br />
{{Note|The network connection process may be automated later by using the default Arch network daemon, [[netcfg]], [[wicd]], or another network manager of your choice.}}<br />
{{Note|If connection to a wireless network is required, remember to select and install the {{Pkg|wireless_tools}} package. Some wireless interfaces also need [[Wireless Setup#ndiswrapper|'''ndiswrapper''']] and/or a specific [[Wireless Setup#Drivers and firmware|'''firmware''']]. If you plan to use WPA encryption, you will need [[WPA Supplicant|'''wpa_supplicant''']]. The [[Wireless Setup]] page will help you choose the correct packages for your wireless device. Also strongly consider installing '''[[netcfg]]''', which will help you set up your network connection and profiles after you reboot into your new system.}}<br />
{{Note|If you are booting from a live environment and have chrooted into your regular installation, you can start networkmanager from the commandline with {{ic|/etc/rc.d/dbus start}} and {{ic|/etc/rc.d/networkmanager start}}, list available connections with {{ic|nmcli con list}} and use a connection with {{ic|nmcli con up id NAME}} where NAME is the name of the connection.}}<br />
<br />
* After utilizing the appropriate association method outlined above, wait a few moments and confirm you have successfully associated to the access point before continuing, e.g.:<br />
{{bc|# iwconfig wlan0}}<br />
Output should indicate the wireless network is associated with the interface.<br />
* Request an IP address with {{ic|/sbin/dhcpcd <interface>}}, e.g.:<br />
{{bc|# dhcpcd wlan0}}<br />
<br />
You should now have a working network connection. If you do not, check the detailed [[Wireless Setup]] page.<br />
<br />
====Set up Direct Modem Connection====<br />
=====xDSL (PPPoE)=====<br />
Follow this procedure if you have a modem or router in bridge mode to connect to your ISP.<br />
<br />
Invoke:<br />
{{bc|# pppoe-setup}}<br />
<br />
If everything is well configured in the end, you can connect to your ISP with:<br />
{{bc|# pppoe-start}}<br />
<br />
=====Analog Modem, ISDN=====<br />
See [[Direct Modem Connection]] for detailed instructions.<br />
<br />
====Proxy Server====<br />
If you are behind a proxy server, you will need to export the {{Ic|http_proxy}} and {{Ic|ftp_proxy}} environment variables. '''[[Proxy|Click here]]''' for more information.<br />
<br />
==== Test network connection ====<br />
Lastly, ensure you can route using {{ic|/bin/ping}}:<br />
{{hc|# ping -c 3 www.google.com|<nowiki><br />
PING www.l.google.com (74.125.132.105) 56(84) bytes of data.<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=1 ttl=50 time=17.0 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=2 ttl=50 time=18.2 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=3 ttl=50 time=16.6 ms<br />
<br />
--- www.l.google.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2003ms<br />
rtt min/avg/max/mdev = 16.660/17.320/18.254/0.678 ms<br />
</nowiki>}}<br />
<br />
===Prepare hard drive===<br />
<br />
{{Warning|Partitioning hard drives can destroy data. You are '''strongly''' cautioned and advised to backup any critical data before proceeding.}}<br />
<br />
{{Note|Use any partitioning tool you prefer, such as [http://gparted.sourceforge.net/download.php GParted] or other available tools. The current install media includes the disk partitioning tools '''fdisk''', '''gdisk''', and '''parted'''.}}<br />
<br />
<br />
If you have already partitioned your hard disk, verify current disk identities and layout by invoking {{ic|/sbin/fdisk}} with the {{ic|-l}} (lower-case L) switch.<br />
<br />
At the root prompt enter:<br />
{{bc|# fdisk -l}}<br />
Take note of the disk(s) and/or partition(s) to utilize for the Arch installation. Each partition is identified with a number suffix. Example: {{ic|sda1}} specifies the first partition of a drive while {{ic|sda}} designates the entire drive. You may now proceed to [[#Configure_block_devices.2C_filesystems.2C_and_mountpoints|Configure block devices, filesystems, and mountpoints]].<br />
<br />
{{Note|If you are installing to a USB flash key, see [[Installing Arch Linux on a USB key]].}}<br />
<br />
{{Note|If you are not dual booting with windows then it is advisable to use [[GPT]] instead of [[MBR]]. GPT partitioning can only be done with '''gdisk''' or '''parted'''. Read [[GPT]] for list of advantages.}}<br />
<br />
The remainder of this section shows an example configuration for a beginner's Arch installation and uses the '''fdisk''' partitioning tool. You are not required to use this configuration or this tool; it is presented here only as an example.<br />
<br />
For more information on partitioning your hard disk, see [[Partitioning]].<br />
<br />
For more information on possible file system types, see [[File Systems]].<br />
<br />
====Manually partition hard drives====<br />
<br />
{{Note| The current install media includes the disk partitioning tools [[Wikipedia:fdisk|fdisk]], [[Wikipedia:gdisk|gdisk]], and [[Wikipedia:parted|parted]]. {{ic|gdisk}} supports only [[GPT]] partition tables, {{ic|fdisk}} supports only [[Master_Boot_Record|MBR]] partition tables and {{ic|parted}} supports both. This example uses '''fdisk''', but can also easily be followed substituting in '''gdisk''' for fdisk to allow use of the newer [[GPT]] partitioning.}}<br />
<br />
Use '''fdisk''' to open the selected target disk for manual partitioning (if you have an [[SSD]] drive other choices like [[GUID_Partition_Table|gdisk]] or [http://www.gnu.org/software/parted/manual/html_mono/parted.html GNU Parted] will be needed). This example uses the first hard disk, designated '''sda''':<br />
<br />
# fdisk /dev/sda<br />
<br />
The example system will contain a 15GB root ({{ic|/}}) partition, a 1GB {{ic|swap}} partition, and a {{ic|/home}} partition for the remaining disk space. It is emphasized again that partitioning is a personal choice and this example is only for illustration.<br />
<br />
Choose '''N'''ew -> 'Primary' and enter the desired size (15.44 GB in this example) for the '''root''' ({{ic|/}}) filesystem. The partition will be put at the beginning of the disk. Select the '''T'''ype and designate it as {{ic|83 Linux}}. The created {{ic|/}} partition will appear as {{ic|sda1}}. Thereafter select "Bootable" to flag root as bootable. <br />
<br />
Next, create a second partition for ''swap''. Select an appropriate size (~1 GB here) and specify the '''T'''ype as {{ic|82 (Linux swap / Solaris)}}. The created swap partition will appear as {{ic|sda2}}.<br />
<br />
The remaining space is used to create a third partition for the {{ic|/home}} directory. Identify it as a primary partition and set the size. Select the '''T'''ype as {{ic|83 Linux}}. The created {{ic|/home}} partition will appear as {{ic|sda3}}.<br />
<br />
This is how the example will look:<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux 15440 #root<br />
sda2 Primary Linux swap / Solaris 1024 #swap<br />
sda3 Primary Linux 133000 #/home<br />
<br />
Be aware that this operation will destroy data on your disk so double check all of your work and make sure you are happy with the partition sizes as well as the partition table layout before continuing. If you would like to start over, you can simply select '''Q'''uit to quit without saving changes and then restart fdisk.<br />
<br />
Once satisfied choose '''W'''rite to finalize and write the partition table to the disk. After the partition table is written it will automatically exit fdisk.<br />
<br />
For more information on partitioning your hard disk, see [[Partitioning]]. <br />
<br />
{{Note|Since the latest developments of the Linux kernel which include the libata and PATA modules, all IDE, SATA and SCSI drives have adopted the sd''x'' naming scheme. This is perfectly normal and should not be a concern.}}<br />
{{Note|If you are using (U)EFI you will most probably need another partition to host the UEFI System partition. Read [[Unified_Extensible_Firmware_Interface#Create_an_UEFI_System_Partition_in_Linux|this article]].}}<br />
<br />
=== Configure block devices, filesystems, and mountpoints ===<br />
Use the {{ic|mkfs}} utility to format the partitions into filesystems. In this example configuration, we are using the ext4 filesystem for both root and home partitions.<br />
<br />
# mkfs.ext4 /dev/sda1<br />
# mkfs.ext4 /dev/sda3<br />
<br />
Format and activate the swap partition:<br />
<br />
# mkswap /dev/sda2 && swapon /dev/sda2<br />
<br />
For more information on possible file system types, see [[File Systems]].<br />
<br />
=== Mount the partitions ===<br />
Mount the root partition on {{ic|/mnt}}.<br />
# mount /dev/sda1 /mnt<br />
<br />
Create a directory for the /home partition and mount it: <br />
<br />
# mkdir /mnt/home && mount /dev/sda3 /mnt/home<br />
<br />
===Select installation mirror===<br />
Before installing, you may want to edit {{ic|/etc/pacman.d/mirrorlist}} such that your preferred mirror is first. This copy of the mirrorlist will be installed on your new system by {{ic|pacstrap}} as well, so it's worth getting it right.<br />
{{Note|ftp.archlinux.org is throttled to 50KB/s.}}<br />
<br />
=== Install the base system ===<br />
The base system is installed using the [https://github.com/falconindy/arch-install-scripts/blob/master/pacstrap.in pacstrap] script. A minimal system requires the '''base''' package group; also installing the '''base-devel''' package group at this time is highly recommended. If you require other packages at this time, simply add them to the pacstrap command.<br />
<br />
# pacstrap /mnt base base-devel<br />
<br />
* {{Grp|base}}: Software packages from the [core] repo to provide the minimal base environment.<br />
* {{Grp|base-devel}}: Extra tools from [core] such as {{ic|make}}, and {{ic|automake}}. Most beginners should choose to install it, as it will likely be needed to expand your new system. The ''base-devel'' group will be required to install software from the [[Arch User Repository]].<br />
<br />
This will give you a basic Arch system. Other packages can be installed later using [[pacman]].<br />
<br />
{{Note|If pacman fails to verify your packages, check your system time. If the system date is invalid (e.g. it shows year 2010), signing keys will be considered expired (or invalid), signature checks on packages will fail and installation will be interrupted. Make sure to correct the system time, either by doing so manually, or with ntp client, and retry running the pacstrap command. Refer to [[Time|Time]] page for more information on correcting system time. }}<br />
<br />
=== Generate fstab ===<br />
Generate an [[fstab]] file with the following command. (If you prefer to use UUIDs or labels, add the {{ic|-U}} or {{ic|-L}} option, respectively.)<br />
# genfstab -p /mnt >> /mnt/etc/fstab<br />
<br />
{{Note|It is a good idea to check the auto-generated fstab file ({{ic|/mnt/etc/fstab}}) before continuing. If you encounter errors running genfstab or later in the install process, do '''not''' run genfstab again; just edit the fstab file. Also, only the "/" partition needs "1" for the last field. Everything else should have "2" or "0" (see [https://wiki.archlinux.org/index.php/Fstab#Field_definitions #Field definitions]).}}<br />
<br />
=== Chroot into system ===<br />
Next we [[chroot]] into our newly installed system.<br />
# arch-chroot /mnt<br />
<br />
{{Tip|If you forgot to install packages with the pacstrap script, you may install them after the chroot with '''pacman -S <package>'''}}<br />
<br />
===Configure the system===<br />
<br />
{{Tip|Closely following and understanding these steps is of key importance to ensure a properly configured system.}}<br />
<br />
At this stage of the installation, you will configure the primary configuration files of your Arch Linux base system.<br />
<br />
====Configuration files====<br />
<br />
{{ic|/etc/rc.conf}} is the configuration file for Arch's initscripts, and in the past used to also contain configurations for other parts of the system. Unless you are using an alternate init system like [[systemd]], {{ic|/etc/rc.conf}} configures which daemons to start during boot-up and some networking and storage information.<br />
<br />
{{Note|Using the legacy configuration options in {{ic|/etc/rc.conf}} for system configuring still works (for now) with the default init system, but the new configuration files take precedence and using them is recommended. The new files will also work for configuring [[systemd]].}}<br />
<br />
{| class="wikitable"<br />
|-<br />
! scope="col"| Configuration<br />
! scope="col"| Configuration file(s)<br />
! scope="col"| Legacy {{ic|/etc/rc.conf}} section<br />
|-<br />
| align="center"|Hostname<br />
| align="left"|{{ic|/etc/hostname}}<br />
{{ic|/etc/hosts}}<br />
| align="center"|{{ic|NETWORKING}}<br />
|-<br />
| align="center"|Console fonts and Keymap<br />
| align="left"|{{ic|/etc/vconsole.conf}}<br />
| align="center"|{{ic|LOCALIZATION}}<br />
|-<br />
| align="center"|Locale<br />
| align="left"|{{ic|/etc/locale.conf}}<br />
{{ic|/etc/locale.gen}}<br />
| align="center"|{{ic|LOCALIZATION}}<br />
|-<br />
| align="center"|Timezone<br />
| align="left"|{{ic|/etc/timezone}}<br />
{{ic|/etc/localtime}}<br />
| align="center"|{{ic|LOCALIZATION}}<br />
|-<br />
| align="center"|Hardware clock<br />
| align="left"|{{ic|/etc/adjtime}}<br />
| align="center"|{{ic|LOCALIZATION}}<br />
|-<br />
| align="center"|Kernel modules<br />
| align="left"|{{ic|/etc/modules-load.d/}}<br />
| align="center"|{{ic|HARDWARE}}<br />
|-<br />
| align="center"|Daemons<br />
| align="left"|{{ic|/etc/rc.conf}}<br />
| align="center"|{{ic|DAEMONS}}<br />
|-<br />
| align="center"|Wired Network<br />
| align="left"|{{ic|/etc/rc.conf}}<br />
| align="center"|{{ic|NETWORKING}}<br />
|}<br />
<br />
Configuration files can simply be created if they do not exist already and you wish to change the defaults. During this procedure you use the editor [[nano]]. For example to edit your hostname file in {{ic|/etc/hostname}} you'll type:<br />
<br />
# nano /etc/hostname<br />
<br />
you press {{keypress|F2}} to either save changes or close the file. When prompted to save changes, press {{keypress|y}} or {{keypress|n}}, and {{keypress|enter}} to write the file<br />
<br />
==== Hostname ====<br />
<br />
Add your ''hostname'' in {{ic|/etc/hostname}}. '''Example:'''<br />
<br />
myhostname<br />
<br />
Set it to your liking. This is the name of your computer.<br />
<br />
Add also your ''hostname'' in {{ic|/etc/hosts}}, coinciding with the one specified in {{ic|/etc/hostname}} as an alias, so that it looks like this:<br />
<br />
127.0.0.1 localhost.localdomain localhost '''myhostname'''<br />
::1 localhost.localdomain localhost '''myhostname'''<br />
<br />
{{Note|::1 is the IPv6 equivalent of 127.0.0.1}}<br />
<br />
{{Warning |This format, '''including the "localhost" and your actual host name''', is required for program compatibility. Errors in this entry may cause poor network performance and/or certain programs to open very slowly, or not work at all.}}<br />
<br />
If you use a static IP, add another line using the syntax: <static-IP> <hostname.domainname.org> <hostname> e.g.:<br />
<br />
192.168.1.100 '''myhostname'''.domain.org '''myhostname'''<br />
<br />
{{Tip|For convenience, you may also use {{ic|/etc/hosts}} aliases for hosts on your network, and/or on the Web, e.g.:<br />
<br />
192.168.1.90 media<br />
192.168.1.88 data<br />
<br />
The above example would allow you access a media and data server on your network by name and without the need for typing out their respective IP addresses.}}<br />
<br />
==== Console fonts and keymap ====<br />
Edit {{ic|/etc/vconsole.conf}}.<br />
:; KEYMAP: The available keymaps are in {{ic|/usr/share/kbd/keymaps}}. Please note that this setting is only valid for your TTYs, not any graphical window managers or '''X'''.<br />
:; FONT : Available alternate console fonts reside in {{ic|/usr/share/kbd/consolefonts/}}. The default (blank) is safe.<br />
:; FONT_MAP : Defines the console map to load with the setfont program at boot. Possible maps are found in {{ic|/usr/share/kbd/consoletrans}}, if needed. The default (blank) is safe.<br />
<br />
'''Example:'''<br />
KEYMAP=us<br />
FONT=<br />
FONT_MAP=<br />
<br />
{{Note|For more information see: [[Fonts#Console_fonts|Console fonts]] and {{ic|man vconsole.conf}}.}}<br />
<br />
==== Timezone ====<br />
Available time zones and subzones can be found in the {{ic|/usr/share/zoneinfo/<Zone>/<SubZone>}} directories. <br />
<br />
To view the available <Zone>, check the directory {{ic|/usr/share/zoneinfo/}}:<br />
<br />
# ls /usr/share/zoneinfo/<br />
<br />
Similarly, you can check the contents of directories belonging to a <SubZone>:<br />
<br />
# ls /usr/share/zoneinfo/Europe<br />
<br />
Create a symbolic link {{ic|/etc/localtime}} to your zone file {{ic|/usr/share/zoneinfo/<Zone>/<SubZone>}} using this command:<br />
<br />
# ln -s {{ic|/usr/share/zoneinfo/<Zone>/<SubZone>}} /etc/localtime<br />
<br />
'''Example:'''<br />
<br />
# ln -s /usr/share/zoneinfo/Europe/Minsk /etc/localtime<br />
<br />
If you are using systemd's timedated, you might wish to also edit the file {{ic|/etc/timezone}} and write your {{ic|Zone}}/{{ic|Subzone}}.<br />
<br />
'''Example:'''<br />
Europe/Minsk<br />
Read {{ic|man 5 timezone}} for more options.<br />
<br />
The need for {{ic|/etc/timezone}} might go away in the future [http://cgit.freedesktop.org/systemd/systemd/commit/?id=9cb48731b29f508178731b45b0643c816800c05e].<br />
<br />
==== Locale ====<br />
=====Enable locales===== <br />
The {{ic|/usr/sbin/locale-gen}} command reads from {{ic|/etc/locale.gen}} to generate specific locales. They can then be used by '''glibc''' and any other locale-aware program or library for rendering text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards:<br />
<br />
# nano /etc/locale.gen<br />
<br />
By default {{ic|/etc/locale.gen}} is an empty file with commented documentation. Once edited, the file remains untouched. {{ic|locale-gen}} runs on every '''glibc''' upgrade, generating all the locales specified in {{ic|/etc/locale.gen}}.<br />
<br />
Choose the locale(s) you need by removing the # in front of the lines you want, e.g.:<br />
<br />
en_US.UTF-8 UTF-8<br />
<br />
{{Note|1=see the list of the locales and what they stand for here [http://www.greendesktiny.com/support/knowledgebase_detail.php?ref=EUH-483].}}<br />
<br />
Then run:<br />
<br />
# locale-gen<br />
<br />
=====Setting up system-wide locale=====<br />
<br />
Set [[Locale#Setting_system-wide_locale | locale]] preferences in {{ic|/etc/locale.conf}}.<br />
<br />
'''Example:'''<br />
<br />
{{hc|/etc/locale.conf|2=<br />
LANG=en_US.UTF-8<br />
LC_TIME=en_GB.UTF-8<br />
}}<br />
<br />
Setting only {{ic|LANG}} should be enough. It acts as the default value for all other locale settings.<br />
<br />
You can override parts of a locale using {{ic|LC_*}} variables – for example, setting {{ic|LC_COLLATE&#61;C}} disables locale-aware sorting, but keeps all other features. You can see all {{ic|LC_*}} variables by running {{ic|locale}}.<br />
<br />
{{ic|LC_ALL}} overrides ''all'' other settings. Because of that, you cannot set it from {{ic|locale.conf}}. It is recommended that you use {{ic|LC_ALL}} only when needed – do not put it in your default environment.<br />
<br />
For the ramdisk creation that will follow later, you should now set the {{ic|LANG}} variable. '''Example:'''<br />
# export LANG=en_US.UTF-8<br />
<br />
==== Hardware clock time ====<br />
This is set in {{ic|/etc/adjtime}}. Set the hardware clock mode uniformly between your operating systems on the same machine. Otherwise, they will overwrite the time and cause clock shifts (which can cause time drift correction to be miscalibrated).<br />
<br />
You can generate {{ic|/etc/adjtime}} automatically by using one of the following commands.<br />
<br />
{{Note|Make sure HARDWARECLOCK in {{ic|/etc/rc.conf}} is not set when using this method.}}<br />
<br />
* [[Wikipedia:Coordinated Universal Time|UTC]] (recommended)<br />
<br />
# hwclock --systohc --utc<br />
<br />
{{Note|Using UTC for the hardware clock does not mean time will be displayed in UTC in software.}}<br />
<br />
* '''localtime''' (discouraged) - Used by default in Windows<br />
<br />
# hwclock --systohc --localtime<br />
<br />
{{Warning|Using ''localtime'' may lead to several known and unfixable bugs. However, there are no plans to drop support for ''localtime''.}}<br />
<br />
=====Setting time in a Windows dual boot setup=====<br />
<br />
If you are setting up a dual-boot with Windows on your system, you have two options:<br />
<br />
* Recommended: Set both Arch Linux and Windows to use UTC (a quick registry fix is needed, see [https://help.ubuntu.com/community/UbuntuTime#Make_Windows_use_UTC this page] for instructions). Also, be sure to prevent Windows from synchronizing the time with the Internet, as it will make the hardware clock use ''localtime'' again. If you want such functionality (NTP sync), you should use [[ntpd]] on your Arch Linux installation instead.<br />
<br />
* Not recommended: Set Arch Linux to ''localtime'' and later (in [[#Configure the system|Configure the system]]) remove {{ic|hwclock}} from the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}} (Windows will take care of hardware clock corrections).<br />
<br />
==== Kernel modules ====<br />
{{Tip|Normally all needed modules are automatically loaded by udev, so you will rarely need to add something here. Only add modules that you know are missing.}}<br />
Edit {{ic|/etc/modules-load.d/}} to configure kernel modules to load during boot in a static list. Each configuration file is named in the style of {{ic|/etc/modules-load.d/<program>.conf}}. The configuration files should simply contain a list of kernel module names to load, separated by newlines. Empty lines and lines whose first non-whitespace character is {{ic|#}} or {{ic|;}} are ignored. Example:<br />
{{hc|/etc/modules-load.d/virtio-net.conf|<nowiki><br />
# Load virtio-net.ko at boot<br />
virtio-net</nowiki>}}<br />
<br />
====Daemons====<br />
{{Tip| The daemons line need not be changed at this time, but it is useful to explain what daemons are, as they will be addressed later in this guide. }}<br />
<br />
[[Wikipedia:Daemon (computing)|Daemons]] are programs that run in the background, waiting for events to occur and offering services. A good example is a web server that waits for a request to deliver a page (e.g.: {{ic|httpd}}) or an SSH server waiting for a user login (e.g.: {{ic|sshd}}). While these are full-featured applications, there are also daemons whose work is not that visible. Examples are a daemon which writes messages into a log file (e.g. {{ic|syslog}}, {{ic|metalog}}), and a daemon which provides a graphical login (e.g.: {{ic|gdm}}, {{ic|kdm}}).<br />
<br />
These programs can be added to the DAEMONS line in {{ic|/etc/rc.conf}} and will be started when the system boots. The DAEMONS array simply list the names of those scripts contained in {{ic|/etc/rc.d/}} which are to be started during the boot process, and the order in which they start. <br />
<br />
DAEMONS=(network @syslog-ng netfs @crond)<br />
<br />
* If a script name is prefixed with a bang ({{ic|!}}), it is not run.<br />
* If a script is prefixed with an &quot;at&quot; symbol ({{ic|@}}), it is run in the background; the startup sequence will not wait for successful completion of this daemon before continuing to the next (this may shorten system boot time). Do not background daemons that are needed by other daemons. For example {{ic|mpd}} depends on {{ic|network}}, so backgrounding {{ic|network}} may cause {{ic|mpd}} to break.<br />
* Edit this array whenever new system services are installed, if starting them automatically during boot is desired.<br />
{{Tip|A list of available services (and their running status) can be found using this command: {{ic|rc.d list}}.}}<br />
<br />
=== Configure the network ===<br />
You need to configure the network again, but this time for your newly installed environment. The procedure and prerequisites are very similar to the one described [[#Setup_network_in_the_live_installation_environment|above]], except we are going to make it persistent and automatically run at boot.<br />
{{Note|For more in-depth information on network configration, visit [[configuring network]] and [[Wireless_Setup|Wireless setup]].}}<br />
<br />
====Wired Network====<br />
If you only use a single wired network connection, you can use the '''network''' daemon, a simple solution for both dynamic and static IP addressing. First, insure that the daemon is listed in the '''DAEMONS''' array:<br />
<br />
{{hc|/etc/rc.conf|<nowiki><br />
DAEMONS=(... network ...)<br />
</nowiki>}}<br />
<br />
Then configure the '''NETWORKING''' section of {{ic|/etc/rc.conf}} as follows, depending on your IP addressing type.<br />
<br />
===== Dynamic IP (DHCP) =====<br />
Assuming the network interface to activate at start is eth0, use this configuration:<br />
<br />
interface=eth0<br />
address=<br />
netmask=<br />
gateway=<br />
<br />
Your DNS server addresses will be automatically filled in by the dhcpcd daemon.<br />
<br />
===== Static IP =====<br />
If you need to use a static IP address, use this configuration:<br />
<br />
interface=eth0<br />
address=192.168.0.2<br />
netmask=255.255.255.0<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1<br />
<br />
You will also need to add your name servers' (DNS) IP addresses and your local domain name to your {{ic|/etc/resolv.conf}} like this:<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com<br />
<br />
{{Tip|The '''network''' daemon is suitable for systems connecting wired to a single network. For multiple network configurations (e.g. using a laptop), it is recommended to use a network manager program, such as [[netcfg]], which has been designed to manage both wired and wireless connections.}}<br />
<br />
==== Wireless network ====<br />
The '''network''' daemon is not sufficient to handle [[Wireless_Setup|Wireless]] networking, which requires additional configuration. You will need to install other programs to configure and manage wireless network profiles, such as [[netcfg]]. [[NetworkManager]] and [[Wicd]] are popular alternatives.<br />
<br />
* Exit the chroot environment:<br />
# exit<br />
<br />
* Install the required packages:<br />
# pacstrap /mnt wireless_tools netcfg<br />
<br />
* If you use WPA/WPA2 wireless encryption, install:<br />
# pacstrap /mnt wpa_supplicant wpa_actiond<br />
<br />
* If your wireless adapter requires a firmware (as described in [[#Setup_wireless_network]] and [[Wireless_Setup#Drivers_and_firmware]]), install the package containg your firmware, ''e.g.'':<br />
# pacstrap /mnt zd1211-firmware<br />
<br />
* Chroot back:<br />
# arch-chroot /mnt<br />
<br />
* Create a network profile for your wireless connection in the {{ic|/etc/network.d}} directory:<br />
** Copy and rename a configuration template from {{ic|/etc/network.d/examples/}} to {{ic|/etc/network.d/mynetwork}} (''mynetwork'' being an example; the name is not a network setting and does not need to match the wireless network name (SSID)). These templates are adapted to the type of your wireless connection, such as {{ic|wireless-wep}} or {{ic|wireless-wpa}}. See [[Netcfg#Configuration]] for a list of available templates and their usage.<br />
** Set {{ic|INTERFACE}} to the correct wireless interface. This can be checked with {{ic|iwconfig}}.<br />
** Ensure the {{ic|ESSID}} and {{ic|KEY}} (passkey) are set correctly for wireless connections. Typos in these fields are common errors.<br />
*** Note that WEP ''string'' keys (not ''hex'' keys) must be specified with a leading {{ic|s:}} (e.g. {{ic|<nowiki>KEY="s:somepasskey"</nowiki>}}).<br />
*** For WPA-Personal, it is possible to specify the passkey in plain text or as an encoded hex.<br />
<br />
* Add {{ic|net-auto-wireless}} to the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}:<br />
{{hc|/etc/rc.conf|<nowiki><br />
DAEMONS=(... net-auto-wireless ...)<br />
</nowiki>}}<br />
<br />
And specify the desired wireless interface with the {{ic|WIRELESS_INTERFACE}} variable in {{ic|/etc/conf.d/netcfg}}:<br />
<br />
{{hc|/etc/conf.d/netcfg|<nowiki><br />
WIRELESS_INTERFACE="wlan0"<br />
</nowiki>}}<br />
<br />
It is also possible to define a list of network profiles that should be automatically connected with the {{ic|AUTO_PROFILES}} variable in {{ic|/etc/conf.d/netcfg}}. If {{ic|AUTO_PROFILES}} is not set, all wireless networks will be tried.<br />
<br />
{{Note|[[netcfg|Netcfg]] also provides other daemons to connect automatically, including both wireless and wired networking. Refer to the [[netcfg]] article for more information.}}<br />
<br />
==== Direct Modem Connection ====<br />
For xDSL, analog modem (dial-up) and ISDN, see [[Direct Modem Connection]] for detailed instructions.<br />
<br />
=== Create an initial ramdisk environment ===<br />
Configure {{ic|/etc/mkinitcpio.conf}} as needed (see [[mkinitcpio]]) and create an initial ramdisk with<br />
<br />
# mkinitcpio -p linux<br />
<br />
{{Tip|Most users can simply accept the defaults provided in the {{ic|/etc/mkinitcpio.conf}} file.}}<br />
<br />
=== Install and configure a bootloader ===<br />
<br />
Install either Syslinux or GRUB. There is no need to install both. Most Archers prefer Syslinux, because of its simplicity and easy to understand configuration file, as opposed to GRUB's ''many'' configuration files and its silly requirement to run a command that re-generates the {{ic|grub.cfg}} file each time you change something ''(well, not so much a requirement but a recommended method)''. Syslinux is much easier in this regard. However, using GRUB for a while could make it more comfortable for someone to transition to BURG in the future, a much more [http://code.google.com/p/burg/wiki/Screenshots customizable] GRUB fork. Of course, Syslinux can also be customized. [https://bbs.archlinux.org/viewtopic.php?pid=1109328#p1109328 (*)]<br />
<br />
{{Note|If you have a separate boot partition, first check with {{ic|lsblk}} that you didn't forget to mount it. If you don't see a {{ic|/boot}} mountpoint for your designated boot partition, then you should reboot the computer and from the Arch LiveCD: mount the ''root'' partition to {{ic|/mnt}}, mount the ''boot'' partition to {{ic|/mnt/boot}}, run {{ic|arch-chroot /mnt}} and then proceed with the instructions bellow.}}<br />
<br />
==== Syslinux ====<br />
<br />
{{Note|Syslinux does not yet support [[UEFI]]. For UEFI motherboards you should go with GRUB (see bellow).}}<br />
<br />
Install the {{Pkg|syslinux}} package and edit {{ic|syslinux.cfg}} to point to the right root partition. This step is vital. If it points to the wrong partition, Arch Linux will not boot.<br />
<br />
{{hc|# pacman -S syslinux<br />
# nano /boot/syslinux/syslinux.cfg|<nowiki><br />
...<br />
LABEL arch<br />
...<br />
APPEND root=/dev/sda3 ro<br />
...</nowiki>}}<br />
<br />
Change {{ic|/dev/sda3}} to reflect your root partition (if you partitioned your disk as we did in the example, your root partition is sda1). Do the same for {{ic|LABEL archfallback}}.<br />
<br />
Then type the following command to ''install'' the files ({{ic|-i}}), mark the partition ''active'' with the ''boot'' flag ({{ic|-a}}), and install the ''MBR'' boot code ({{ic|-m}}):<br />
<br />
# syslinux-install_update -iam<br />
<br />
For more information on configuring and using Syslinux, see [[Syslinux]].<br />
<br />
==== GRUB ====<br />
<br />
For BIOS motherboards:<br />
<br />
# pacman -S grub-bios<br />
# grub-install --target=i386-pc --recheck /dev/sda<br />
<br />
For UEFI motherboards:<br />
<br />
# pacman -S grub-efi-x86_64<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck<br />
<br />
{{Note|In rare cases you may need to use {{ic|grub-efi-i386}} instead; on older macs for instance, where the bootloader only supports loading 32 bit modules, even though the CPU is 64 bit. This is because Apple hardware uses some kind of mixture between UEFI v1.x and v2.x.}}<br />
<br />
To prevent a (harmless) error message at boot time:<br />
<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Create the {{ic|grub.cfg}} file:<br />
<br />
{{Tip|To automatically search for other operating systems on your computer, before running the next command you should install {{Pkg|os-prober}}: {{ic|pacman -S os-prober}}.}}<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
For more information on configuring and using GRUB, see [[GRUB]].<br />
<br />
=== Root password ===<br />
Set the root password with:<br />
# passwd<br />
<br />
=== Unmount the partitions and reboot ===<br />
Exit from the chroot environment:<br />
# exit<br />
Since the partitions are mounted under {{ic|/mnt}}, we use the following command to unmount them. <br />
# umount /mnt/{boot,home,}<br />
<br />
Exit the install, and reboot:<br />
{{bc|# reboot}}<br />
{{Tip|Be sure to remove the installation media and change the boot preference in your BIOS (if you changed it to install); otherwise you may boot back into the installation media!}}<br />
<noinclude>{{Beginners' Guide navigation}}</noinclude></div>Cinellihttps://wiki.archlinux.org/index.php?title=User_talk:Cinelli&diff=218043User talk:Cinelli2012-08-15T20:45:57Z<p>Cinelli: /* Df */</p>
<hr />
<div>Hi Cinelli, please address the concerns I had regarding the reason for my edit. You have specifically deleted the section that warns users to a decision that must be made early on (during partitioning) to ensure compatibility of GRUB(2). Am I overlooking the warning directed at users who follow the tutorial and intend on using GRUB(2)?<br />
Please advise or I plan on rolling back your edit in the absence of a reason.<br />
<br />
Best,<br />
DF<br />
<br />
== Df ==<br />
<br />
Df, the reason for my removal of the note was because there is no need for the 2mb partition or partition gab that was stated to be required when using an MBR partition tables. I have never had to setup the "needed" partition gap with this type of table and other Archlinux community helpers within the #archlinux @ freenode.net community seemed to agree with that. Only when using GPT tables is there specific instructions needed. With MBR you could setup the entire system on one large partition if desired. With that being said, there was no need for the note. It seemed to just confuse people and increase inquiries in #archlinux <br />
<br />
-F. Cinelli</div>Cinellihttps://wiki.archlinux.org/index.php?title=User_talk:Cinelli&diff=218042User talk:Cinelli2012-08-15T20:45:28Z<p>Cinelli: </p>
<hr />
<div>Hi Cinelli, please address the concerns I had regarding the reason for my edit. You have specifically deleted the section that warns users to a decision that must be made early on (during partitioning) to ensure compatibility of GRUB(2). Am I overlooking the warning directed at users who follow the tutorial and intend on using GRUB(2)?<br />
Please advise or I plan on rolling back your edit in the absence of a reason.<br />
<br />
Best,<br />
DF<br />
<br />
== Df ==<br />
<br />
Df, the reason for my removal of the note was because there is no need for the 2mb partition or partition gab that was stated to be required when using an MBR partition tables. I have never had to setup the "needed" partition gap with this type of table and other Archlinux community helpers within the #archlinux @ freenode.net community seemed to agree with that. Only when using GPT tables is there specific instructions needed. With MBR you could setup the entire system on one large partition if desired. With that being said, there was no need for the note. It seemed to just confuse people and increase inquiries in #archlinux <br />
Regards<br />
<br />
Regards,<br />
F Cinelli</div>Cinellihttps://wiki.archlinux.org/index.php?title=User_talk:Cinelli&diff=218041User talk:Cinelli2012-08-15T20:44:23Z<p>Cinelli: /* In reply to Df */ new section</p>
<hr />
<div>Hi Cinelli, please address the concerns I had regarding the reason for my edit. You have specifically deleted the section that warns users to a decision that must be made early on (during partitioning) to ensure compatibility of GRUB(2). Am I overlooking the warning directed at users who follow the tutorial and intend on using GRUB(2)?<br />
Please advise or I plan on rolling back your edit in the absence of a reason.<br />
<br />
Best,<br />
DF<br />
<br />
== In reply to Df ==<br />
<br />
Df, the reason for my removal of the note was because there is no need for the 2mb partition or partition gab that was stated to be required when using an MBR partition tables. I have never had to setup the "needed" partition gap with this type of table and other Archlinux community helpers within the #archlinux @ freenode.net community seemed to agree with that. Only when using GPT tables is there specific instructions needed. With MBR you could setup the entire system on one large partition if desired. With that being said, there was no need for the note. It seemed to just confuse people and increase inquiries in #archlinux <br />
Regards<br />
<br />
Thank you<br />
F. Cinelli</div>Cinellihttps://wiki.archlinux.org/index.php?title=User_talk:Cinelli&diff=218040User talk:Cinelli2012-08-15T20:42:21Z<p>Cinelli: </p>
<hr />
<div>Hi Cinelli, please address the concerns I had regarding the reason for my edit. You have specifically deleted the section that warns users to a decision that must be made early on (during partitioning) to ensure compatibility of GRUB(2). Am I overlooking the warning directed at users who follow the tutorial and intend on using GRUB(2)?<br />
Please advise or I plan on rolling back your edit in the absence of a reason.<br />
<br />
Best,<br />
DF</div>Cinellihttps://wiki.archlinux.org/index.php?title=User_talk:Cinelli&diff=218039User talk:Cinelli2012-08-15T20:41:06Z<p>Cinelli: </p>
<hr />
<div>Hi Cinelli, please address the concerns I had regarding the reason for my edit. You have specifically deleted the section that warns users to a decision that must be made early on (during partitioning) to ensure compatibility of GRUB(2). Am I overlooking the warning directed at users who follow the tutorial and intend on using GRUB(2)?<br />
Please advise or I plan on rolling back your edit in the absence of a reason.<br />
<br />
Best,<br />
DF<br />
<br />
Df, the reason for my removal of the note was because there is no need for the 2mb that was stated to be needed when using MBR formatted partition tables. I have never had to setup the "needed" partition gap and other Archlinux community helpers within the #archlinux @ freenode.net community seemed to agree that it isn't needed. Only when using GPT tables is there specific instructions needed. With MBR you could setup the entire system on one large partition if desired. With that being said, there was no need for the note. It seemed to just confuse people and increase inquiries in #archlinux <br />
<br />
Regards,<br />
F. Cinelli</div>Cinellihttps://wiki.archlinux.org/index.php?title=Beginners%27_guide&diff=217896Beginners' guide2012-08-15T01:56:02Z<p>Cinelli: /* Manually partition hard drives */</p>
<hr />
<div><noinclude><br />
[[Category:Getting and installing Arch]]<br />
[[Category:About Arch]]<br />
[[da:Beginners' Guide/Installation]]<br />
[[es:Beginners' Guide/Installation]]<br />
[[hr:Beginners' Guide/Installation]]<br />
[[hu:Beginners' Guide/Installation]]<br />
[[it:Beginners' Guide/Installation]]<br />
[[ko:Beginners' Guide/Installation]]<br />
[[nl:Beginners' Guide/Installatie]]<br />
[[pt:Beginners' Guide/Installation]]<br />
[[ru:Beginners' Guide/Installation]]<br />
[[sr:Beginners' Guide/Installation]]<br />
[[zh-CN:Beginners' Guide/Installation]]<br />
{{Tip|This is part of a multi-page article for The Beginners' Guide. '''[[Beginners' Guide|Click here]]''' if you would rather read the guide in its entirety.}}<br />
</noinclude><br />
==Installation==<br />
After booting, the installation media automatically logs in as '''root''' and uses a US keyboard layout.<br />
<br />
===Changing the keymap===<br />
<br />
If you have a non-US keyboard layout you can interactively choose your keymap/console font with the command:<br />
{{bc|# loadkeys ''layout''}}<br />
where ''layout'' is your keyboard layout such as {{ic|fr}}, {{ic|uk}} or {{ic|be-latin1}}<br />
<br />
Keymaps are available for many countries and keyboard types. The keymap files can be found in {{ic|/usr/share/kbd/keymaps/}} (you can omit the keymap path and file extension when using {{ic|loadkeys}}).<br />
<br />
===Setup network in the live installation environment===<br />
The installer need network connection to download and install packages. So network have to be setup first. <br />
<br />
==== Automatic setup ====<br />
The installer will try to automatically configure a wired connection if available. You may check this was successful by using {{ic|/bin/ping}}:<br />
# ping -c 3 www.google.com<br />
<br />
If you get an answer that looks like this:<br />
PING www.l.google.com (74.125.132.105) 56(84) bytes of data.<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=1 ttl=50 time=17.0 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=2 ttl=50 time=18.2 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=3 ttl=50 time=16.6 ms<br />
<br />
--- www.l.google.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2003ms<br />
rtt min/avg/max/mdev = 16.660/17.320/18.254/0.678 ms<br />
<br />
then the network and Internet access have been properly configured. You may continue to [[#Prepare_hard_drive]]. Otherwise, if you get:<br />
ping: unknown host www.google.com<br />
you will need to set up the network manually, as explained below.<br />
<br />
====Set up a wired connection====<br />
Follow this procedure if your computer is connected to an Ethernet network. In most cases, you will have one interface, called {{ic|eth0}}. If you have additional ethernet interfaces (which may be additional cards or integrated to the motherboard), their name will follow the sequence {{ic|eth1}}, {{ic|eth''X''}},...<br />
<br />
=====Dynamic IP (DHCP)=====<br />
Assuming a wired Ethernet connection and access to a DHCP server (e.g. using a router), run:<br />
# dhcpcd<br />
to get a lease.<br />
If you have several interfaces (such as several Ethernet cards), you may specify the interface with {{ic|dhcpcd <interface>}}, e.g:<br />
# dhcpcd eth0<br />
Verify your connection as explained [[#Automatic_setup|above]] and if successful jump to [[#Prepare_hard_drive]].<br />
<br />
=====Static IP=====<br />
If you do not have access or are not using DHCP, you need to assign a static IP address.<br />
You need to know these settings:<br />
* Static IP address,<br />
* Subnet mask,<br />
* Gateway's IP address,<br />
* Name servers' (DNS) IP addresses,<br />
* Domain name (unless a local LAN, in which case you can make it up).<br />
<br />
Activate the connected ethernet interface, e.g. for {{ic|eth0}}:<br />
# ip link set eth0 up<br />
Add the address:<br />
# ip addr add <ip address>/<subnetmask> dev <interface><br />
For example:<br />
# ip addr add 192.168.1.2/24 dev eth0<br />
<br />
For more options, see: {{ic|man ip}}<br />
<br />
Add your gateway like so:<br />
# ip route add default via <ip address><br />
(Substitute your own gateway's IP address)<br />
<br />
For example:<br />
# ip route add default via 192.168.1.1<br />
<br />
Edit your {{ic|/etc/resolv.conf}} like this, substituting your name servers' IP addresses and your local domain name:<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com<br />
<br />
{{Note|Currently, you may include a maximum of 3 {{ic|nameserver}} lines.}}<br />
{{Note|For more in-depth information on network configration, visit [[configuring network]].}}<br />
<br />
{{Tip|If you do not need to configure ADSL or wireless, you may proceed to [[#Prepare_hard_drive|Prepare hard drive]].}}<br />
<br />
====Setup wireless network====<br />
Follow this procedure if you need wireless connectivity (WiFi) during the installation process.<br />
<br />
The wireless drivers and utilities are now available to you in the live environment of the installation media. A good knowledge of your wireless hardware will be of key importance to successful configuration. Note that the following quick-start procedure ''executed at this point in the installation'' will initialize your wireless hardware for use ''in the live environment of the installation media''. These steps (or some other form of wireless management) '''must be repeated from the actual installed system after booting into it'''.<br />
<br />
Also note that these steps are optional if wireless connectivity is unnecessary at this point in the installation; wireless functionality may always be established later.<br />
<br />
{{Note|The following examples use {{ic|wlan0}} for the interface and {{ic|linksys}} for the ESSID. Remember to change these values according to your setup.}}<br />
<br />
The basic procedure will be:<br />
* (optional) Identify the wireless interface:<br />
{{bc|<nowiki># lspci | grep -i net</nowiki>}}<br />
or, if using a USB adapter:<br />
{{bc|<nowiki># lsusb </nowiki>}}<br />
* Ensure udev has loaded the driver, and that the driver has created a usable wireless kernel interface with {{ic|/usr/sbin/iwconfig}}:<br />
<br />
{{hc|# iwconfig|<nowiki> lo no wireless extensions.<br />
eth0 no wireless extensions.<br />
wlan0 unassociated ESSID:""<br />
Mode:Managed Channel=0 Access Point: Not-Associated<br />
Bit Rate:0 kb/s Tx-Power=20 dBm Sensitivity=8/0<br />
Retry limit:7 RTS thr:off Fragment thr:off<br />
Power Management:off<br />
Link Quality:0 Signal level:0 Noise level:0<br />
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0<br />
Tx excessive retries:0 Invalid misc:0 Missed beacon:0<br />
</nowiki>}}<br />
{{ic|wlan0}} is the available wireless interface in this example. <br />
<br />
{{Note|If you do not see output similar to this, then your wireless driver has not been loaded. If this is the case, you must load the driver yourself. Please see [[Wireless Setup]] for more detailed information.}}<br />
<br />
* Bring the interface up with:<br />
{{bc|# ip link set wlan0 up}}<br />
<br />
A small percentage of wireless chipsets also require firmware, in addition to a corresponding driver. If the wireless chipset requires firmware, you are likely to receive this error when bringing the interface up:<br />
<br />
{{hc|# ip link set wlan0 up|SIOCSIFFLAGS: No such file or directory}}<br />
<br />
If unsure, invoke {{ic|/usr/bin/dmesg}} to query the kernel log for a firmware request from the wireless chipset. <br />
<br />
Example output from an Intel chipset which requires and has requested firmware from the kernel at boot:<br />
<br />
{{hc|<nowiki>$ dmesg | grep firmware</nowiki>|firmware: requesting iwlwifi-5000-1.ucode}}<br />
<br />
If there is no output, it may be concluded that the system's wireless chipset does not require firmware.<br />
<br />
{{Warning|Wireless chipset firmware packages (for cards which require them) are pre-installed under {{ic|/usr/lib/firmware}} in the live environment (on CD/USB stick) '''but must be explicitly installed to your actual system to provide wireless functionality after you reboot into it!''' Package installation is covered later in this guide. Ensure installation of both your wireless module and firmware before rebooting! See [[Wireless Setup]] if you are unsure about the requirement of corresponding firmware installation for your particular chipset. This is a very common error.}}<br />
<br />
* If the ESSID has been forgotten or is unknown, use {{ic|iwlist <interface> scan}} to scan for nearby networks:<br />
{{hc|# iwlist wlan0 scan|<nowiki><br />
Cell 01 - Address: 04:25:10:6B:7F:9D<br />
Channel:2<br />
Frequency:2.417 GHz (Channel 2)<br />
Quality=31/70 Signal level=-79 dBm <br />
Encryption key:off<br />
ESSID:"dlink"<br />
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s<br />
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s<br />
36 Mb/s; 48 Mb/s; 54 Mb/s<br />
</nowiki>}}<br />
<br />
* If using WPA encryption:<br />
<br />
Using WPA encryption requires that the key be encrypted and stored in a file, along with the ESSID, to be used later for connection via {{ic|wpa_supplicant}}. Thus, a few extra steps are required:<br />
<br />
For the purpose of simplifying and backup, rename the default {{ic|wpa_supplicant.conf}} file:<br />
{{bc|# mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf.original}}<br />
<br />
Using {{ic|wpa_passphrase}}, provide your wireless network name and WPA key to be encrypted and written to {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}.<br />
<br />
The following example encrypts the key "my_secret_passkey" of the "linksys" wireless network, generates a new configuration file ({{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}), and subsequently redirects the encrypted key, writing it to the file:<br />
{{bc|# wpa_passphrase linksys "my_secret_passkey" > /etc/wpa_supplicant/wpa_supplicant.conf}}<br />
{{Note|If the above fails with a {{ic|bash: event not found}} error, it may be due to special characters (e.g. {{ic|!}}) used in your wireless network name. In that case try the following:<br />
{{bc|# tee /etc/wpa_supplicant/wpa_supplicant.conf < <(wpa_passphrase linksys "passphrase")}}<br />
And if you are still having problems because of special characters in your network name or passphrase, you may try the following, where ({{ic|~/mykey}}) is a temporary text file containing only your passphrase:<br />
{{bc|# cat ~/mykey <nowiki>|</nowiki> wpa_passphrase linksys > /etc/wpa_supplicant/wpa_supplicant.conf}}<br />
Also, for security reasons, you may want to remove this file ({{ic|~/mykey}}) after you setup your ({{ic|/etc/wpa_supplicant.conf}}) file.}}<br />
<br />
Check [[WPA Supplicant]] for more information and troubleshooting.<br />
<br />
{{Note|{{ic|/etc/wpa_supplicant/wpa_supplicant.conf}} is stored in plain text format. This is not risky in the installation environment, but when you reboot into your new system and reconfigure WPA, remember to change the permissions on {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}} (e.g. {{ic|chmod 0600 /etc/wpa_supplicant/wpa_supplicant.conf}} to make it readable by root only).}}<br />
<br />
* Associate your wireless device with the access point you want to use. Depending on the encryption (none, WEP, or WPA), the procedure may differ. You need to know the name of the chosen wireless network (ESSID).<br />
<br />
{| border="1"<br />
! Encryption || Command<br />
|-<br />
| No Encryption || {{ic|iwconfig wlan0 essid "linksys"}}<br />
|-<br />
| WEP w/ Hex Key || {{ic|iwconfig wlan0 essid "linksys" key "0241baf34c"}}<br />
|-<br />
| WEP w/ ASCII passphrase || {{ic|iwconfig wlan0 essid "linksys" key "s:pass1"}}<br />
|-<br />
| WPA || {{ic|wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf}}<br />
|}<br />
<br />
{{Note|The network connection process may be automated later by using the default Arch network daemon, [[netcfg]], [[wicd]], or another network manager of your choice.}}<br />
{{Note|If connection to a wireless network is required, remember to select and install the {{Pkg|wireless_tools}} package. Some wireless interfaces also need [[Wireless Setup#ndiswrapper|'''ndiswrapper''']] and/or a specific [[Wireless Setup#Drivers and firmware|'''firmware''']]. If you plan to use WPA encryption, you will need [[WPA Supplicant|'''wpa_supplicant''']]. The [[Wireless Setup]] page will help you choose the correct packages for your wireless device. Also strongly consider installing '''[[netcfg]]''', which will help you set up your network connection and profiles after you reboot into your new system.}}<br />
{{Note|If you are booting from a live environment and have chrooted into your regular installation, you can start networkmanager from the commandline with {{ic|/etc/rc.d/dbus start}} and {{ic|/etc/rc.d/networkmanager start}}, list available connections with {{ic|nmcli con list}} and use a connection with {{ic|nmcli con up id NAME}} where NAME is the name of the connection.}}<br />
<br />
* After utilizing the appropriate association method outlined above, wait a few moments and confirm you have successfully associated to the access point before continuing, e.g.:<br />
{{bc|# iwconfig wlan0}}<br />
Output should indicate the wireless network is associated with the interface.<br />
* Request an IP address with {{ic|/sbin/dhcpcd <interface>}}, e.g.:<br />
{{bc|# dhcpcd wlan0}}<br />
<br />
You should now have a working network connection. If you do not, check the detailed [[Wireless Setup]] page.<br />
<br />
====Set up Direct Modem Connection====<br />
=====xDSL (PPPoE)=====<br />
Follow this procedure if you have a modem or router in bridge mode to connect to your ISP.<br />
<br />
Invoke:<br />
{{bc|# pppoe-setup}}<br />
<br />
If everything is well configured in the end, you can connect to your ISP with:<br />
{{bc|# pppoe-start}}<br />
<br />
=====Analog Modem, ISDN=====<br />
See [[Direct Modem Connection]] for detailed instructions.<br />
<br />
====Proxy Server====<br />
If you are behind a proxy server, you will need to export the {{Ic|http_proxy}} and {{Ic|ftp_proxy}} environment variables. '''[[Proxy|Click here]]''' for more information.<br />
<br />
==== Test network connection ====<br />
Lastly, ensure you can route using {{ic|/bin/ping}}:<br />
{{hc|# ping -c 3 www.google.com|<nowiki><br />
PING www.l.google.com (74.125.132.105) 56(84) bytes of data.<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=1 ttl=50 time=17.0 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=2 ttl=50 time=18.2 ms<br />
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=3 ttl=50 time=16.6 ms<br />
<br />
--- www.l.google.com ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2003ms<br />
rtt min/avg/max/mdev = 16.660/17.320/18.254/0.678 ms<br />
</nowiki>}}<br />
<br />
===Prepare hard drive===<br />
<br />
{{Warning|Partitioning hard drives can destroy data. You are '''strongly''' cautioned and advised to backup any critical data before proceeding.}}<br />
<br />
{{Note|Use any partitioning tool you prefer, such as [http://gparted.sourceforge.net/download.php GParted] or other available tools. The current install media includes the disk partitioning tools '''fdisk''', '''gdisk''', and '''parted'''.}}<br />
<br />
<br />
If you have already partitioned your hard disk, verify current disk identities and layout by invoking {{ic|/sbin/fdisk}} with the {{ic|-l}} (lower-case L) switch.<br />
<br />
At the root prompt enter:<br />
{{bc|# fdisk -l}}<br />
Take note of the disk(s) and/or partition(s) to utilize for the Arch installation. Each partition is identified with a number suffix. Example: {{ic|sda1}} specifies the first partition of a drive while {{ic|sda}} designates the entire drive. You may now proceed to [[#Configure_block_devices.2C_filesystems.2C_and_mountpoints|Configure block devices, filesystems, and mountpoints]].<br />
<br />
{{Note|If you are installing to a USB flash key, see [[Installing Arch Linux on a USB key]].}}<br />
<br />
{{Note|If you are not dual booting with windows then it is advisable to use [[GPT]] instead of [[MBR]]. GPT partitioning can only be done with '''gdisk''' or '''parted'''. Read [[GPT]] for list of advantages.}}<br />
<br />
The remainder of this section shows an example configuration for a beginner's Arch installation and uses the '''fdisk''' partitioning tool. You are not required to use this configuration or this tool; it is presented here only as an example.<br />
<br />
For more information on partitioning your hard disk, see [[Partitioning]].<br />
<br />
For more information on possible file system types, see [[File Systems]].<br />
<br />
====Manually partition hard drives====<br />
<br />
{{Note| The current install media includes the disk partitioning tools [[Wikipedia:fdisk|fdisk]], [[Wikipedia:gdisk|gdisk]], and [[Wikipedia:parted|parted]]. {{ic|gdisk}} supports only [[GPT]] partition tables, {{ic|fdisk}} supports only [[Master_Boot_Record|MBR]] partition tables and {{ic|parted}} supports both. This example uses '''fdisk''', but can also easily be followed substituting in '''gdisk''' for fdisk allowing use of the newer [[GPT]] partitioning.}}<br />
<br />
Use '''fdisk''' to open the selected target disk for manual partitioning (if you have an [[SSD]] drive other choices like [[GUID_Partition_Table|gdisk]] or [http://www.gnu.org/software/parted/manual/html_mono/parted.html GNU Parted] may be preferable). This example uses the first hard disk, designated '''sda''':<br />
<br />
# fdisk /dev/sda<br />
<br />
The example system will contain a 15GB root ({{ic|/}}) partition, a 1GB {{ic|swap}} partition, and a {{ic|/home}} partition for the remaining disk space. It is emphasized again that partitioning is a personal choice and this example is only for illustration.<br />
<br />
Choose '''N'''ew -> 'Primary' and enter the desired size (15.44 GB in this example) for the '''root''' ({{ic|/}}) filesystem. The partition will be put at the beginning of the disk. Select the '''T'''ype and designate it as {{ic|83 Linux}}. The created {{ic|/}} partition will appear as {{ic|sda1}}. Thereafter select "Bootable" to flag root as bootable. <br />
<br />
Next, create a second partition for ''swap''. Select an appropriate size (~1 GB here) and specify the '''T'''ype as {{ic|82 (Linux swap / Solaris)}}. The created swap partition will appear as {{ic|sda2}}.<br />
<br />
The remaining space is used to create a third partition for the {{ic|/home}} directory. Identify it as a primary partition and set the size. Select the '''T'''ype as {{ic|83 Linux}}. The created {{ic|/home}} partition will appear as {{ic|sda3}}.<br />
<br />
This is how the example will look:<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Boot Primary Linux 15440 #root<br />
sda2 Primary Linux swap / Solaris 1024 #swap<br />
sda3 Primary Linux 133000 #/home<br />
<br />
Be aware that this operation will destroy data on your disk so double check all of your work and make sure you are happy with the partition sizes as well as the partition table layout before continuing. If you would like to start over, you can simply select '''Q'''uit to quit without saving changes and then restart fdisk.<br />
<br />
Once satisfied choose '''W'''rite to finalize and write the partition table to the disk. After the partition table is written it will automatically exit fdisk.<br />
<br />
For more information on partitioning your hard disk, see [[Partitioning]]. <br />
<br />
{{Note|Since the latest developments of the Linux kernel which include the libata and PATA modules, all IDE, SATA and SCSI drives have adopted the sd''x'' naming scheme. This is perfectly normal and should not be a concern.}}<br />
{{Note|If you are using (U)EFI you will most probably need another partition to host the UEFI System partition. Read [[Unified_Extensible_Firmware_Interface#Create_an_UEFI_System_Partition_in_Linux|this article]].}}<br />
<br />
=== Configure block devices, filesystems, and mountpoints ===<br />
Use the {{ic|mkfs}} utility to format the partitions into filesystems. In this example configuration, we are using the ext4 filesystem for both root and home partitions.<br />
<br />
# mkfs.ext4 /dev/sda1<br />
# mkfs.ext4 /dev/sda3<br />
<br />
Format and activate the swap partition:<br />
<br />
# mkswap /dev/sda2 && swapon /dev/sda2<br />
<br />
For more information on possible file system types, see [[File Systems]].<br />
<br />
=== Mount the partitions ===<br />
Mount the root partition on {{ic|/mnt}}.<br />
# mount /dev/sda1 /mnt<br />
<br />
Create a directory for the /home partition and mount it: <br />
<br />
# mkdir /mnt/home && mount /dev/sda3 /mnt/home<br />
<br />
===Select installation mirror===<br />
Before installing, you may want to edit {{ic|/etc/pacman.d/mirrorlist}} such that your preferred mirror is first. This copy of the mirrorlist will be installed on your new system by {{ic|pacstrap}} as well, so it's worth getting it right.<br />
{{Note|ftp.archlinux.org is throttled to 50KB/s.}}<br />
<br />
=== Install the base system ===<br />
The base system is installed using the [https://github.com/falconindy/arch-install-scripts/blob/master/pacstrap.in pacstrap] script. A minimal system requires the '''base''' package group; also installing the '''base-devel''' package group at this time is highly recommended. If you require other packages at this time, simply add them to the pacstrap command.<br />
<br />
# pacstrap /mnt base base-devel<br />
<br />
* {{Grp|base}}: Software packages from the [core] repo to provide the minimal base environment.<br />
* {{Grp|base-devel}}: Extra tools from [core] such as {{ic|make}}, and {{ic|automake}}. Most beginners should choose to install it, as it will likely be needed to expand your new system. The ''base-devel'' group will be required to install software from the [[Arch User Repository]].<br />
<br />
This will give you a basic Arch system. Other packages can be installed later using [[pacman]].<br />
<br />
{{Note|If pacman fails to verify your packages, check your system time. If the system date is invalid (e.g. it shows year 2010), signing keys will be considered expired (or invalid), signature checks on packages will fail and installation will be interrupted. Make sure to correct the system time, either by doing so manually, or with ntp client, and retry running the pacstrap command. Refer to [[Time|Time]] page for more information on correcting system time. }}<br />
<br />
=== Generate fstab ===<br />
Generate an [[fstab]] file with the following command. (If you prefer to use UUIDs or labels, add the {{ic|-U}} or {{ic|-L}} option, respectively.)<br />
# genfstab -p /mnt >> /mnt/etc/fstab<br />
<br />
{{Note|It is a good idea to check the auto-generated fstab file ({{ic|/mnt/etc/fstab}}) before continuing. If you encounter errors running genfstab or later in the install process, do '''not''' run genfstab again; just edit the fstab file. Also, only the "/" partition needs "1" for the last field. Everything else should have "2" or "0" (see [https://wiki.archlinux.org/index.php/Fstab#Field_definitions #Field definitions]).}}<br />
<br />
=== Chroot into system ===<br />
Next we [[chroot]] into our newly installed system.<br />
# arch-chroot /mnt<br />
<br />
{{Tip|If you forgot to install packages with the pacstrap script, you may install them after the chroot with '''pacman -S <package>'''}}<br />
<br />
===Configure the system===<br />
<br />
{{Tip|Closely following and understanding these steps is of key importance to ensure a properly configured system.}}<br />
<br />
At this stage of the installation, you will configure the primary configuration files of your Arch Linux base system.<br />
<br />
====Configuration files====<br />
<br />
{{ic|/etc/rc.conf}} is the configuration file for Arch's initscripts, and in the past used to also contain configurations for other parts of the system. Unless you are using an alternate init system like [[systemd]], {{ic|/etc/rc.conf}} configures which daemons to start during boot-up and some networking and storage information.<br />
<br />
{{Note|Using the legacy configuration options in {{ic|/etc/rc.conf}} for system configuring still works (for now) with the default init system, but the new configuration files take precedence and using them is recommended. The new files will also work for configuring [[systemd]].}}<br />
<br />
{| class="wikitable"<br />
|-<br />
! scope="col"| Configuration<br />
! scope="col"| Configuration file(s)<br />
! scope="col"| Legacy {{ic|/etc/rc.conf}} section<br />
|-<br />
| align="center"|Hostname<br />
| align="left"|{{ic|/etc/hostname}}<br />
{{ic|/etc/hosts}}<br />
| align="center"|{{ic|NETWORKING}}<br />
|-<br />
| align="center"|Console fonts and Keymap<br />
| align="left"|{{ic|/etc/vconsole.conf}}<br />
| align="center"|{{ic|LOCALIZATION}}<br />
|-<br />
| align="center"|Locale<br />
| align="left"|{{ic|/etc/locale.conf}}<br />
{{ic|/etc/locale.gen}}<br />
| align="center"|{{ic|LOCALIZATION}}<br />
|-<br />
| align="center"|Timezone<br />
| align="left"|{{ic|/etc/timezone}}<br />
{{ic|/etc/localtime}}<br />
| align="center"|{{ic|LOCALIZATION}}<br />
|-<br />
| align="center"|Hardware clock<br />
| align="left"|{{ic|/etc/adjtime}}<br />
| align="center"|{{ic|LOCALIZATION}}<br />
|-<br />
| align="center"|Kernel modules<br />
| align="left"|{{ic|/etc/modules-load.d/}}<br />
| align="center"|{{ic|HARDWARE}}<br />
|-<br />
| align="center"|Daemons<br />
| align="left"|{{ic|/etc/rc.conf}}<br />
| align="center"|{{ic|DAEMONS}}<br />
|-<br />
| align="center"|Wired Network<br />
| align="left"|{{ic|/etc/rc.conf}}<br />
| align="center"|{{ic|NETWORKING}}<br />
|}<br />
<br />
Configuration files can simply be created if they do not exist already and you wish to change the defaults. During this procedure you use the editor [[nano]]. For example to edit your hostname file in {{ic|/etc/hostname}} you'll type:<br />
<br />
# nano /etc/hostname<br />
<br />
you press {{keypress|F2}} to either save changes or close the file. When prompted to save changes, press {{keypress|y}} or {{keypress|n}}, and {{keypress|enter}} to write the file<br />
<br />
==== Hostname ====<br />
<br />
Add your ''hostname'' in {{ic|/etc/hostname}}. '''Example:'''<br />
<br />
myhostname<br />
<br />
Set it to your liking. This is the name of your computer.<br />
<br />
Add also your ''hostname'' in {{ic|/etc/hosts}}, coinciding with the one specified in {{ic|/etc/hostname}} as an alias, so that it looks like this:<br />
<br />
127.0.0.1 localhost.localdomain localhost '''myhostname'''<br />
::1 localhost.localdomain localhost '''myhostname'''<br />
<br />
{{Note|::1 is the IPv6 equivalent of 127.0.0.1}}<br />
<br />
{{Warning |This format, '''including the "localhost" and your actual host name''', is required for program compatibility. Errors in this entry may cause poor network performance and/or certain programs to open very slowly, or not work at all.}}<br />
<br />
If you use a static IP, add another line using the syntax: <static-IP> <hostname.domainname.org> <hostname> e.g.:<br />
<br />
192.168.1.100 '''myhostname'''.domain.org '''myhostname'''<br />
<br />
{{Tip|For convenience, you may also use {{ic|/etc/hosts}} aliases for hosts on your network, and/or on the Web, e.g.:<br />
<br />
192.168.1.90 media<br />
192.168.1.88 data<br />
<br />
The above example would allow you access a media and data server on your network by name and without the need for typing out their respective IP addresses.}}<br />
<br />
==== Console fonts and keymap ====<br />
Edit {{ic|/etc/vconsole.conf}}.<br />
:; KEYMAP: The available keymaps are in {{ic|/usr/share/kbd/keymaps}}. Please note that this setting is only valid for your TTYs, not any graphical window managers or '''X'''.<br />
:; FONT : Available alternate console fonts reside in {{ic|/usr/share/kbd/consolefonts/}}. The default (blank) is safe.<br />
:; FONT_MAP : Defines the console map to load with the setfont program at boot. Possible maps are found in {{ic|/usr/share/kbd/consoletrans}}, if needed. The default (blank) is safe.<br />
<br />
'''Example:'''<br />
KEYMAP=us<br />
FONT=<br />
FONT_MAP=<br />
<br />
{{Note|For more information see: [[Fonts#Console_fonts|Console fonts]] and {{ic|man vconsole.conf}}.}}<br />
<br />
==== Timezone ====<br />
Available time zones and subzones can be found in the {{ic|/usr/share/zoneinfo/<Zone>/<SubZone>}} directories. <br />
<br />
To view the available <Zone>, check the directory {{ic|/usr/share/zoneinfo/}}:<br />
<br />
# ls /usr/share/zoneinfo/<br />
<br />
Similarly, you can check the contents of directories belonging to a <SubZone>:<br />
<br />
# ls /usr/share/zoneinfo/Europe<br />
<br />
Create a symbolic link {{ic|/etc/localtime}} to your zone file {{ic|/usr/share/zoneinfo/<Zone>/<SubZone>}} using this command:<br />
<br />
# ln -s {{ic|/usr/share/zoneinfo/<Zone>/<SubZone>}} /etc/localtime<br />
<br />
'''Example:'''<br />
<br />
# ln -s /usr/share/zoneinfo/Europe/Minsk /etc/localtime<br />
<br />
If you are using systemd's timedated, you might wish to also edit the file {{ic|/etc/timezone}} and write your {{ic|Zone}}/{{ic|Subzone}}.<br />
<br />
'''Example:'''<br />
Europe/Minsk<br />
Read {{ic|man 5 timezone}} for more options.<br />
<br />
The need for {{ic|/etc/timezone}} might go away in the future [http://cgit.freedesktop.org/systemd/systemd/commit/?id=9cb48731b29f508178731b45b0643c816800c05e].<br />
<br />
==== Locale ====<br />
=====Enable locales===== <br />
The {{ic|/usr/sbin/locale-gen}} command reads from {{ic|/etc/locale.gen}} to generate specific locales. They can then be used by '''glibc''' and any other locale-aware program or library for rendering text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards:<br />
<br />
# nano /etc/locale.gen<br />
<br />
By default {{ic|/etc/locale.gen}} is an empty file with commented documentation. Once edited, the file remains untouched. {{ic|locale-gen}} runs on every '''glibc''' upgrade, generating all the locales specified in {{ic|/etc/locale.gen}}.<br />
<br />
Choose the locale(s) you need by removing the # in front of the lines you want, e.g.:<br />
<br />
en_US.UTF-8 UTF-8<br />
<br />
{{Note|1=see the list of the locales and what they stand for here [http://www.greendesktiny.com/support/knowledgebase_detail.php?ref=EUH-483].}}<br />
<br />
Then run:<br />
<br />
# locale-gen<br />
<br />
=====Setting up system-wide locale=====<br />
<br />
Set [[Locale#Setting_system-wide_locale | locale]] preferences in {{ic|/etc/locale.conf}}.<br />
<br />
'''Example:'''<br />
<br />
{{hc|/etc/locale.conf|2=<br />
LANG=en_US.UTF-8<br />
LC_TIME=en_GB.UTF-8<br />
}}<br />
<br />
Setting only {{ic|LANG}} should be enough. It acts as the default value for all other locale settings.<br />
<br />
You can override parts of a locale using {{ic|LC_*}} variables – for example, setting {{ic|LC_COLLATE&#61;C}} disables locale-aware sorting, but keeps all other features. You can see all {{ic|LC_*}} variables by running {{ic|locale}}.<br />
<br />
{{ic|LC_ALL}} overrides ''all'' other settings. Because of that, you cannot set it from {{ic|locale.conf}}. It is recommended that you use {{ic|LC_ALL}} only when needed – do not put it in your default environment.<br />
<br />
For the ramdisk creation that will follow later, you should now set the {{ic|LANG}} variable. '''Example:'''<br />
# export LANG=en_US.UTF-8<br />
<br />
==== Hardware clock time ====<br />
This is set in {{ic|/etc/adjtime}}. Set the hardware clock mode uniformly between your operating systems on the same machine. Otherwise, they will overwrite the time and cause clock shifts (which can cause time drift correction to be miscalibrated).<br />
<br />
You can generate {{ic|/etc/adjtime}} automatically by using one of the following commands.<br />
<br />
{{Note|Make sure HARDWARECLOCK in {{ic|/etc/rc.conf}} is not set when using this method.}}<br />
<br />
* [[Wikipedia:Coordinated Universal Time|UTC]] (recommended)<br />
<br />
# hwclock --systohc --utc<br />
<br />
{{Note|Using UTC for the hardware clock does not mean time will be displayed in UTC in software.}}<br />
<br />
* '''localtime''' (discouraged) - Used by default in Windows<br />
<br />
# hwclock --systohc --localtime<br />
<br />
{{Warning|Using ''localtime'' may lead to several known and unfixable bugs. However, there are no plans to drop support for ''localtime''.}}<br />
<br />
=====Setting time in a Windows dual boot setup=====<br />
<br />
If you are setting up a dual-boot with Windows on your system, you have two options:<br />
<br />
* Recommended: Set both Arch Linux and Windows to use UTC (a quick registry fix is needed, see [https://help.ubuntu.com/community/UbuntuTime#Make_Windows_use_UTC this page] for instructions). Also, be sure to prevent Windows from synchronizing the time with the Internet, as it will make the hardware clock use ''localtime'' again. If you want such functionality (NTP sync), you should use [[ntpd]] on your Arch Linux installation instead.<br />
<br />
* Not recommended: Set Arch Linux to ''localtime'' and later (in [[#Configure the system|Configure the system]]) remove {{ic|hwclock}} from the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}} (Windows will take care of hardware clock corrections).<br />
<br />
==== Kernel modules ====<br />
{{Tip|Normally all needed modules are automatically loaded by udev, so you will rarely need to add something here. Only add modules that you know are missing.}}<br />
Edit {{ic|/etc/modules-load.d/}} to configure kernel modules to load during boot in a static list. Each configuration file is named in the style of {{ic|/etc/modules-load.d/<program>.conf}}. The configuration files should simply contain a list of kernel module names to load, separated by newlines. Empty lines and lines whose first non-whitespace character is {{ic|#}} or {{ic|;}} are ignored. Example:<br />
{{hc|/etc/modules-load.d/virtio-net.conf|<nowiki><br />
# Load virtio-net.ko at boot<br />
virtio-net</nowiki>}}<br />
<br />
====Daemons====<br />
{{Tip| The daemons line need not be changed at this time, but it is useful to explain what daemons are, as they will be addressed later in this guide. }}<br />
<br />
[[Wikipedia:Daemon (computing)|Daemons]] are programs that run in the background, waiting for events to occur and offering services. A good example is a web server that waits for a request to deliver a page (e.g.: {{ic|httpd}}) or an SSH server waiting for a user login (e.g.: {{ic|sshd}}). While these are full-featured applications, there are also daemons whose work is not that visible. Examples are a daemon which writes messages into a log file (e.g. {{ic|syslog}}, {{ic|metalog}}), and a daemon which provides a graphical login (e.g.: {{ic|gdm}}, {{ic|kdm}}).<br />
<br />
These programs can be added to the DAEMONS line in {{ic|/etc/rc.conf}} and will be started when the system boots. The DAEMONS array simply list the names of those scripts contained in {{ic|/etc/rc.d/}} which are to be started during the boot process, and the order in which they start. <br />
<br />
DAEMONS=(network @syslog-ng netfs @crond)<br />
<br />
* If a script name is prefixed with a bang ({{ic|!}}), it is not run.<br />
* If a script is prefixed with an &quot;at&quot; symbol ({{ic|@}}), it is run in the background; the startup sequence will not wait for successful completion of this daemon before continuing to the next (this may shorten system boot time). Do not background daemons that are needed by other daemons. For example {{ic|mpd}} depends on {{ic|network}}, so backgrounding {{ic|network}} may cause {{ic|mpd}} to break.<br />
* Edit this array whenever new system services are installed, if starting them automatically during boot is desired.<br />
{{Tip|A list of available services (and their running status) can be found using this command: {{ic|rc.d list}}.}}<br />
<br />
=== Configure the network ===<br />
You need to configure the network again, but this time for your newly installed environment. The procedure and prerequisites are very similar to the one described [[#Setup_network_in_the_live_installation_environment|above]], except we are going to make it persistent and automatically run at boot.<br />
{{Note|For more in-depth information on network configration, visit [[configuring network]] and [[Wireless_Setup|Wireless setup]].}}<br />
<br />
====Wired Network====<br />
If you only use a single wired network connection, you can use the '''network''' daemon, a simple solution for both dynamic and static IP addressing. First, insure that the daemon is listed in the '''DAEMONS''' array:<br />
<br />
{{hc|/etc/rc.conf|<nowiki><br />
DAEMONS=(... network ...)<br />
</nowiki>}}<br />
<br />
Then configure the '''NETWORKING''' section of {{ic|/etc/rc.conf}} as follows, depending on your IP addressing type.<br />
<br />
===== Dynamic IP (DHCP) =====<br />
Assuming the network interface to activate at start is eth0, use this configuration:<br />
<br />
interface=eth0<br />
address=<br />
netmask=<br />
gateway=<br />
<br />
Your DNS server addresses will be automatically filled in by the dhcpcd daemon.<br />
<br />
===== Static IP =====<br />
If you need to use a static IP address, use this configuration:<br />
<br />
interface=eth0<br />
address=192.168.0.2<br />
netmask=255.255.255.0<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1<br />
<br />
You will also need to add your name servers' (DNS) IP addresses and your local domain name to your {{ic|/etc/resolv.conf}} like this:<br />
nameserver 61.23.173.5<br />
nameserver 61.95.849.8<br />
search example.com<br />
<br />
{{Tip|The '''network''' daemon is suitable for systems connecting wired to a single network. For multiple network configurations (e.g. using a laptop), it is recommended to use a network manager program, such as [[netcfg]], which has been designed to manage both wired and wireless connections.}}<br />
<br />
==== Wireless network ====<br />
The '''network''' daemon is not sufficient to handle [[Wireless_Setup|Wireless]] networking, which requires additional configuration. You will need to install other programs to configure and manage wireless network profiles, such as [[netcfg]]. [[NetworkManager]] and [[Wicd]] are popular alternatives.<br />
<br />
* Exit the chroot environment:<br />
# exit<br />
<br />
* Install the required packages:<br />
# pacstrap /mnt wireless_tools netcfg<br />
<br />
* If you use WPA/WPA2 wireless encryption, install:<br />
# pacstrap /mnt wpa_supplicant wpa_actiond<br />
<br />
* If your wireless adapter requires a firmware (as described in [[#Setup_wireless_network]] and [[Wireless_Setup#Drivers_and_firmware]]), install the package containg your firmware, ''e.g.'':<br />
# pacstrap /mnt zd1211-firmware<br />
<br />
* Chroot back:<br />
# arch-chroot /mnt<br />
<br />
* Create a network profile for your wireless connection in the {{ic|/etc/network.d}} directory:<br />
** Copy and rename a configuration template from {{ic|/etc/network.d/examples/}} to {{ic|/etc/network.d/mynetwork}} (''mynetwork'' being an example; the name is not a network setting and does not need to match the wireless network name (SSID)). These templates are adapted to the type of your wireless connection, such as {{ic|wireless-wep}} or {{ic|wireless-wpa}}. See [[Netcfg#Configuration]] for a list of available templates and their usage.<br />
** Set {{ic|INTERFACE}} to the correct wireless interface. This can be checked with {{ic|iwconfig}}.<br />
** Ensure the {{ic|ESSID}} and {{ic|KEY}} (passkey) are set correctly for wireless connections. Typos in these fields are common errors.<br />
*** Note that WEP ''string'' keys (not ''hex'' keys) must be specified with a leading {{ic|s:}} (e.g. {{ic|<nowiki>KEY="s:somepasskey"</nowiki>}}).<br />
*** For WPA-Personal, it is possible to specify the passkey in plain text or as an encoded hex.<br />
<br />
* Add {{ic|net-auto-wireless}} to the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}:<br />
{{hc|/etc/rc.conf|<nowiki><br />
DAEMONS=(... net-auto-wireless ...)<br />
</nowiki>}}<br />
<br />
And specify the desired wireless interface with the {{ic|WIRELESS_INTERFACE}} variable in {{ic|/etc/conf.d/netcfg}}:<br />
<br />
{{hc|/etc/conf.d/netcfg|<nowiki><br />
WIRELESS_INTERFACE="wlan0"<br />
</nowiki>}}<br />
<br />
It is also possible to define a list of network profiles that should be automatically connected with the {{ic|AUTO_PROFILES}} variable in {{ic|/etc/conf.d/netcfg}}. If {{ic|AUTO_PROFILES}} is not set, all wireless networks will be tried.<br />
<br />
{{Note|[[netcfg|Netcfg]] also provides other daemons to connect automatically, including both wireless and wired networking. Refer to the [[netcfg]] article for more information.}}<br />
<br />
==== Direct Modem Connection ====<br />
For xDSL, analog modem (dial-up) and ISDN, see [[Direct Modem Connection]] for detailed instructions.<br />
<br />
=== Create an initial ramdisk environment ===<br />
Configure {{ic|/etc/mkinitcpio.conf}} as needed (see [[mkinitcpio]]) and create an initial ramdisk with<br />
<br />
# mkinitcpio -p linux<br />
<br />
{{Tip|Most users can simply accept the defaults provided in the {{ic|/etc/mkinitcpio.conf}} file.}}<br />
<br />
=== Install and configure the bootloader ===<br />
<br />
Install either Syslinux or Grub (you do not need to install both).<br />
{{Note| If you have a separate /boot partition, make sure it is mounted before generating the bootloader's configuration file.}}<br />
<br />
==== Syslinux ====<br />
Use pacman to install syslinux:<br />
<br />
# pacman -S syslinux<br />
<br />
Edit {{ic|/boot/syslinux/syslinux.cfg}} to point to the right {{ic|/ }} (root) partition. This step is vital. If it points to the wrong partition arch linux will not boot. Open {{ic|syslinux.cfg}} and under {{ic|LABEL arch}} find this line:<br />
<br />
APPEND root=/dev/sda2 ro<br />
<br />
change "sda2" to the designator for your root partition (if you partitioned your disk as we did in the example, your root partition is sda1). Do the same for {{ic|LABEL archfallback}}.<br />
<br />
Then type the following command to install ({{ic|-i}}), set the boot flag ({{ic|-a}}) and install the Master Boot Record (MBR) ({{ic|-m}}).<br />
<br />
# /usr/sbin/syslinux-install_update -iam<br />
<br />
For more information on configuring and using syslinux, see [[Syslinux]].<br />
<br />
==== Grub ====<br />
<br />
Install Grub for BIOS:<br />
<br />
# pacman -S grub-bios<br />
# grub-install --target=i386-pc --recheck /dev/sda<br />
<br />
Or Grub for UEFI:<br />
<br />
# pacman -S grub-efi-x86_64<br />
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck<br />
<br />
(in rare cases you may need grub-efi-i386 instead)<br />
<br />
To prevent a (harmless) error message at boot time:<br />
<br />
# mkdir -p /boot/grub/locale<br />
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo<br />
<br />
Create the grub.cfg file:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
{{Tip|If you want this command to automatically search for other systems in your computer, you may wish to install {{Pkg|os-prober}} first.}}<br />
<br />
# pacman -S os-prober<br />
<br />
For more information on configuring and using GRUB2, see [[GRUB2]].<br />
<br />
=== Root password ===<br />
Set the root password with:<br />
# passwd<br />
<br />
=== Unmount the partitions and reboot ===<br />
Exit from the chroot environment:<br />
# exit<br />
Since the partitions are mounted under {{ic|/mnt}}, we use the following command to unmount them. <br />
# umount /mnt/{boot,home,}<br />
<br />
Exit the install, and reboot:<br />
{{bc|# reboot}}<br />
{{Tip|Be sure to remove the installation media and change the boot preference in your BIOS (if you changed it to install); otherwise you may boot back into the installation media!}}<br />
<noinclude>{{Beginners' Guide navigation}}</noinclude></div>Cinelli