ETHW

(Next Steps)
(Partitioning Recommendations)
 
(117 intermediate revisions by 15 users not shown)
Line 1: Line 1:
== Introduction ==
+
== Introduction ==  
  
 
This document was written to help you install Funtoo Linux as concisely as possible, with a minimum number of distracting options regarding system configuration.  
 
This document was written to help you install Funtoo Linux as concisely as possible, with a minimum number of distracting options regarding system configuration.  
  
These docs assume you have a "PC compatible" computer system with a standard PC BIOS. Many new computers support UEFI for booting, which is a new firmware interface that replaces the old-fashioned MBR-based BIOS. If you have a system with UEFI, you will want to use this documentation along with the [[UEFI Install Guide]], which will augment these instructions and explain how to get your system to boot. You may need to change your PC BIOS settings to enable or disable UEFI booting. The [[UEFI Install Guide]] has more information on this, and steps on how to determine if your system supports UEFI.
+
These docs assume you have a "PC compatible" computer system with a standard PC BIOS. Many new computers support UEFI for booting, which is a new firmware interface that frequently replaces the older MBR-based BIOS. If you have a system with UEFI, you will want to use this documentation along with the [[UEFI Install Guide]], which will augment these instructions and explain how to get your system to boot. You may need to change your PC BIOS settings to enable or disable UEFI booting. The [[UEFI Install Guide]] has more information on this, and steps on how to determine if your system supports UEFI.
  
 
We also offer a [[ZFS Install Guide]], which augment the instructions on this page for those who want to install Funtoo Linux on ZFS.  If you are installing Funtoo Linux on [[Funtoo Linux Installation on ARM|ARM]] architecture, please see [[Funtoo Linux Installation on ARM]] for notable differences regarding ARM support. An experimental Funtoo Linux build also exists for [[Funtoo Linux Installation on SPARC|SPARC]] platforms. See [[Funtoo Linux Installation on SPARC]].
 
We also offer a [[ZFS Install Guide]], which augment the instructions on this page for those who want to install Funtoo Linux on ZFS.  If you are installing Funtoo Linux on [[Funtoo Linux Installation on ARM|ARM]] architecture, please see [[Funtoo Linux Installation on ARM]] for notable differences regarding ARM support. An experimental Funtoo Linux build also exists for [[Funtoo Linux Installation on SPARC|SPARC]] platforms. See [[Funtoo Linux Installation on SPARC]].
Line 27: Line 27:
 
=== Live CD ===
 
=== Live CD ===
  
Funtoo doesn't provide an "official" Funtoo Live CD, but there are plenty of good ones out there to choose from. A great choice is the Gentoo-based [http://www.sysresccd.org/ SystemRescueCd] as it contains lots of tools and utilities and supports both 32-bit and 64-bit systems.
+
Funtoo doesn't provide an "official" Funtoo Live CD, but there are plenty of good ones out there to choose from. A great choice is the Gentoo-based [http://www.sysresccd.org/ System Rescue CD] as it contains lots of tools and utilities and supports both 32-bit and 64-bit systems.
  
 
It is also possible to install Funtoo Linux using many other Linux-based live CDs. Generally, any modern bootable Linux live CD or live USB media will work. See [[Requirements|requirements]] for an overview of what the Live Media must provide to allow a problem-free install of Funtoo Linux.
 
It is also possible to install Funtoo Linux using many other Linux-based live CDs. Generally, any modern bootable Linux live CD or live USB media will work. See [[Requirements|requirements]] for an overview of what the Live Media must provide to allow a problem-free install of Funtoo Linux.
  
To begin a Funtoo Linux installation, download SystemRescueCD from:
+
To begin a Funtoo Linux installation, download System Rescue CD from:
  
* Main US mirror: [http://ftp.osuosl.org/pub/funtoo/distfiles/sysresccd/sysresccd-3.7.1_zfs_0.6.2.iso The Oregon State University Open Source Lab]
+
{{MirrorList}}
* Main EU mirror: [http://ftp.heanet.ie/mirrors/funtoo/distfiles/sysresccd/sysresccd-3.7.1_zfs_0.6.2.iso HEAnet] or use your preferred live media. Insert it into your disc drive, and boot from it. If using an older version of SystemRescueCD, '''be sure to select the <tt>rescue64</tt> kernel at the boot menu if you are installing a 64-bit system'''. By default, SystemRescueCD used to boot in 32-bit mode though the latest version attempts to automatically detect 64-bit processors.
+
 
 +
Or, use your preferred live media. Insert it into your disc drive, and boot from it. If using an older version of System Rescue CD, '''be sure to select the <code>rescue64</code> kernel at the boot menu if you are installing a 64-bit system'''. By default, System Rescue CD used to boot in 32-bit mode though the latest version attempts to automatically detect 64-bit processors.
  
 
=== Prepare Hard Disk ===
 
=== Prepare Hard Disk ===
 
==== Partitions ====
 
==== Partitions ====
  
Funtoo Linux fully supports traditional MBR partitions, as well as newer GPT/GUID partition formats. Funtoo Linux recommends the use of the GPT partitioning scheme, since it is newer and more flexible. Here are the various trade-offs between each partitioning scheme:
+
Funtoo Linux fully supports traditional MBR partitions, as well as newer GPT/GUID partition formats. See below to determine which partitioning scheme to use:
 
+
===== GPT Partitions =====
+
 
+
* Newer, preferred format for Linux systems
+
* Supports 2 TB+ hard drives for booting
+
* Supports hundreds of partitions per disk of any size
+
* Requires legacy BIOS boot partition (~32 MB) to be created if system does not use EFI
+
* Requires bootloader with support for GPT such as GRUB 2, EXTLINUX, or a patched version of GRUB Legacy
+
  
 
===== MBR Partitions =====
 
===== MBR Partitions =====
  
 +
* '''Recommended if your system disk is <=2TB in size'''
 
* Legacy, DOS partitioning scheme
 
* Legacy, DOS partitioning scheme
 
* Only 4 primary partitions per disk; after that, you must use "logical" partitions
 
* Only 4 primary partitions per disk; after that, you must use "logical" partitions
Line 58: Line 52:
 
* Multiple boot loader options, e.g. GRUB 2, GRUB Legacy, lilo
 
* Multiple boot loader options, e.g. GRUB 2, GRUB Legacy, lilo
  
{{fancyimportant|If you plan to use partitions of 2 TB or greater, you ''must'' partition using the GPT/GUID format. Also note that there are small percentage of PCs that will not boot properly with GPT. For these systems, using MBR partitions or a primary drive with an MBR partition may be required in order to boot.}}
+
{{fancynote|Due to the fact that it is more widely supported on PC hardware, it is best to use MBR partitions if possible.}}
  
==== Partitioning Using gdisk ====
+
===== GPT Partitions =====
  
===== Notes Before We Begin =====
+
* '''Recommended if your disk is >2TB in size'''
 +
* Newer format for Linux systems
 +
* Supports 2 TB+ hard drives for booting
 +
* Supports hundreds of partitions per disk of any size
 +
* Requires legacy BIOS boot partition (~32 MB) to be created if system does not use EFI
 +
* Requires bootloader with support for GPT such as GRUB 2, EXTLINUX, or a patched version of GRUB Legacy
  
These install instructions assume you are installing Funtoo Linux to an empty hard disk using GUID partition tables (GPT). If you are installing Funtoo Linux on a machine where another OS is installed, or there is an existing Linux distribution on your system that you want to keep, then you will need to adapt these instructions to suit your needs.
+
{{fancyimportant|If you have a system disk that is 2TB or greater and want to use the space beyond 2TB, you ''must'' partition using the GPT/GUID format. Otherwise, MBR is recommended as the most reliable boot method.}}
  
If you are going to create a legacy MBR partition table instead of GUID/GPT, you will use the <tt>fdisk</tt> command instead of <tt>gdisk</tt>, and you will not need to create the GRUB boot loader partition. See the table under [[#Partitioning Recommendations|Partitioning Recommendations]], in particular the
+
===== Filesystem Resources =====
'''MBR Block Device (<tt>fdisk</tt>)''' and '''MBR Code''' columns. <tt>fdisk</tt> works just like <tt>gdisk</tt>, but creates legacy MBR partition tables instead of the newer GPT/GUID partition tables.
+
  
 
Advanced users may be interested in the following topics:
 
Advanced users may be interested in the following topics:
  
 
* [[GUID Booting Guide]]
 
* [[GUID Booting Guide]]
 +
* [[LVM Install Guide]]
 
* [[Rootfs over encrypted lvm]]
 
* [[Rootfs over encrypted lvm]]
 
* [[Rootfs over encrypted lvm over raid-1 on GPT]]
 
* [[Rootfs over encrypted lvm over raid-1 on GPT]]
 
* '''NEW!''' '''[[ZFS Install Guide]] (Also contains instructions for Rootfs over Encrypted ZFS!)'''
 
* '''NEW!''' '''[[ZFS Install Guide]] (Also contains instructions for Rootfs over Encrypted ZFS!)'''
  
===== Using gdisk =====
+
===== Partitioning Recommendations =====
  
The first step after booting SystemRescueCd is to use <tt>gdisk</tt> to create GPT (also known as GUID) partitions, specifying the disk you want to use, which is typically <tt>/dev/sda</tt>, the first disk in the system:
+
Below are our partitioning recommendations in table form. For MBR-based partitions, use the MBR Block Device and MBR code columns with <code>fdisk</code>. For GPT-based partitions, use the GPT Block Device and GPT Code columns with <code>gdisk</code>:
  
<console># ##i##gdisk /dev/sda</console>
+
{{TableStart}}
You should find <tt>gdisk</tt> very similar to <tt>fdisk</tt>. Here is the partition table we want to end up with:
+
<tr class="active"><th>Partition</th>
 +
<th>Size</th>
 +
<th>MBR Block Device (<code>fdisk</code>)</th>
 +
<th>GPT Block Device (<code>gdisk</code>)</th>
 +
<th>Filesystem</th>
 +
<th>MBR Code</th>
 +
<th>GPT Code</th>
 +
</tr><tr>
 +
<td><code>/boot</code></td>
 +
<td>512 MB</td>
 +
<td><code>/dev/sda1</code></td>
 +
<td><code>/dev/sda1</code></td>
 +
<td>ext2</td>
 +
<td>83</td>
 +
<td>8300</td>
 +
</tr><tr>
 +
<td>GRUB boot loader partition</td>
 +
<td>1 MB</td>
 +
<td>''not required for MBR''</td>
 +
<td><code>/dev/sda2</code></td>
 +
<td>For GPT/GUID only, skip for MBR - no filesystem.</td>
 +
<td>''N/A''</td>
 +
<td>EF02</td>
 +
</tr><tr>
 +
<td>swap</td>
 +
<td>2x RAM for low-memory systems and production servers; otherwise 2GB.</td>
 +
<td><code>/dev/sda2</code></td>
 +
<td><code>/dev/sda3</code></td>
 +
<td>swap (default)</td>
 +
<td>82</td>
 +
<td>8200</td>
 +
</tr><tr>
 +
<td><code>/</code> (root)</td>
 +
<td>Rest of the disk, minimum of 10GB.  Note: to compile the <code>debian-sources</code> kernel, as described later on this page, requires a minimum of 14GB free space in <code>/tmp</code>; consider a minimum of 20GB in this case.</td>
 +
<td><code>/dev/sda3</code></td>
 +
<td><code>/dev/sda4</code></td>
 +
<td>XFS recommended, alternatively ext4</td>
 +
<td>83</td>
 +
<td>8300</td>
 +
</tr><tr>
 +
<td><code>/home</code> (optional) </td>
 +
<td>User storage and media. Typically most of the disk.</td>
 +
<td><code>/dev/sda4</code> (if created)</td>
 +
<td><code>/dev/sda5</code> (if created)</td>
 +
<td>XFS recommended, alternatively ext4</td>
 +
<td>83</td>
 +
<td>8300</td>
 +
</tr><tr>
 +
<td>LVM (optional)</td>
 +
<td>If you want to create an LVM volume.</td>
 +
<td><code>/dev/sda4</code> (PV, if created)</td>
 +
<td><code>/dev/sda5</code> (PV, if created)</td>
 +
<td>LVM PV</td>
 +
<td>8E</td>
 +
<td>8E00</td>
 +
</tr>{{TableEnd}}
  
<console>Command (? for help): ##i##p
+
===== Partitioning Using fdisk (MBR) =====
Disk /dev/sda: 234441648 sectors, 111.8 GiB
+
Logical sector size: 512 bytes
+
Disk identifier (GUID): A4E5208A-CED3-4263-BB25-7147DC426931
+
Partition table holds up to 128 entries
+
First usable sector is 34, last usable sector is 234441614
+
Partitions will be aligned on 2048-sector boundaries
+
Total free space is 2014 sectors (1007.0 KiB)
+
  
Number  Start (sector)    End (sector)  Size      Code  Name
+
{{fancyimportant|If you need to create a GPT partition table, see [[Partitioning using gdisk]].}}
  1            2048          206847  500.0 MiB  8300  Linux filesystem
+
  2          206848          272383  32.0 MiB    EF02  BIOS boot partition
+
  3          272384        8660991  4.0 GiB    8200  Linux swap
+
  4        8660992      234441614  107.7 GiB  8300  Linux filesystem
+
  
Command (? for help): </console>
+
{{fancynote|These install instructions assume you are installing Funtoo Linux to an hard disk using Master Boot Record partition tables (MBR). If you are installing Funtoo Linux on a machine where another OS is installed, there is an existing Linux distribution on your system that you want to keep or any other scenario (such as differing swap size requirements), then you will need to adapt these instructions to suit your needs.}}
  
Above, you'll see that we have a 500 MiB boot partition, a 32 MiB "BIOS boot partition" (also known as the GRUB boot loader partition), 4 GiB of swap, and the remaining disk used by a 107.7 GiB root partition.
+
<code>fdisk</code> is the tool used to create an MBR partition table. MBR is well-supported on PCs and is recommended if your system disk is 2TB or smaller.
  
===== For new <tt>gdisk</tt> users =====
+
====== Preparation ======
  
These partitions were created using the "<tt>n</tt>" command from within <tt>gdisk</tt>. The <tt>gdisk</tt> commands to create the partition table above are as follows. Adapt sizes as necessary, although these defaults will work for most users. The partition codes entered below can be found in the [[#Partitioning Recommendations|Partitioning Recommendations]] table below, in the GPT Code column.
+
First, it's a good idea to make sure that you've found the correct hard disk to partition. Try this command and verify that <code>/dev/sda</code> is the disk that you want to partition:
  
Within <tt>gdisk</tt>, follow these steps:
+
<console>
 +
# ##i##fdisk -l /dev/sda
  
'''Create Partition 1''' (boot):
+
Disk /dev/sda: 640.1 GB, 640135028736 bytes, 1250263728 sectors
 +
Units = sectors of 1 * 512 = 512 bytes
 +
Sector size (logical/physical): 512 bytes / 512 bytes
 +
I/O size (minimum/optimal): 512 bytes / 512 bytes
 +
Disk label type: gpt
 +
 
 +
 
 +
#        Start          End    Size  Type            Name
 +
1        2048  1250263694  596.2G  Linux filesyste Linux filesystem
 +
</console>
 +
 
 +
Now, it's recommended that you erase any existing MBR or GPT partition tables on the disk, which could confuse the system's BIOS at boot time. We do this using <code>sgdisk</code>:
 +
{{fancywarning|This will make any existing partitions inaccessible! You are '''strongly''' cautioned and advised to backup any critical data before proceeding.}}
  
 
<console>
 
<console>
Command: ##i##n ↵
+
# ##i##sgdisk --zap-all /dev/sda
Partition Number: ##i##1 ↵
+
 
First sector: ##i##↵
+
Creating new GPT entries.
Last sector: ##i##+500M ↵
+
GPT data structures destroyed! You may now partition the disk using fdisk or
Hex Code: ##i##↵
+
other utilities.
 
</console>
 
</console>
  
'''Create Partition 2''' (GRUB):
+
This output is also nothing to worry about, as the command still succeded:
  
 
<console>
 
<console>
Command: ##i##n ↵
+
***************************************************************
Partition Number: ##i##2 ↵
+
Found invalid GPT and valid MBR; converting MBR to GPT format
First sector: ##i##↵
+
in memory.
Last sector: ##i##+32M ↵
+
***************************************************************
Hex Code: ##i##EF02 ↵
+
 
</console>
 
</console>
  
'''Create Partition 3''' (swap):
+
====== Partitioning ======
 +
 
 +
Now we will use <code>fdisk</code> to create the MBR partition table and partitions:
  
 
<console>
 
<console>
Command: ##i##n ↵
+
# ##i##fdisk /dev/sda
Partition Number: ##i##3 ↵
+
First sector: ##i##↵
+
Last sector: ##i##+4G ↵
+
Hex Code: ##i##8200 ↵
+
 
</console>
 
</console>
  
'''Create Partition 4''' (root):
+
Within <code>fdisk</code>, follow these steps:
 +
 
 +
'''Empty the partition table''':
  
 
<console>
 
<console>
Command: ##i##n ↵
+
Command (m for help): ##i##o
Partition Number: ##i##4 ↵
+
First sector: ##i##↵
+
Last sector: ##i##↵##!i## (for rest of disk)
+
Hex Code: ##i##↵
+
 
</console>
 
</console>
  
Along the way, you can type "<tt>p</tt>" and hit Enter to view your current partition table. If you make a mistake, you can type "<tt>d</tt>" to delete an existing partition that you created. When you are satisfied with your partition setup, type "<tt>w</tt>" to write your configuration to disk:
+
'''Create Partition 1''' (boot):
  
'''Write Partition Table To Disk''':
+
<console>
 +
Command (m for help): ##i##n ↵
 +
Partition type (default p): ##i##↵
 +
Partition number (1-4, default 1): ##i##↵
 +
First sector: ##i##↵
 +
Last sector: ##i##+128M ↵
 +
</console>
 +
 
 +
'''Create Partition 2''' (swap):
  
 
<console>
 
<console>
Command: ##i##w
+
Command (m for help): ##i##n
Do you want to proceed? (Y/N): ##i##Y
+
Partition type (default p): ##i##↵
 +
Partition number (2-4, default 2): ##i##↵
 +
First sector: ##i##↵
 +
Last sector: ##i##+2G ↵
 +
Command (m for help): ##i##t ↵
 +
Partition number (1,2, default 2): ##i## ↵
 +
Hex code (type L to list all codes): ##i##82
 
</console>
 
</console>
  
The partition table will now be written to disk and <tt>gdisk</tt> will close.
+
'''Create the root partition:'''
  
Now, your GPT/GUID partitions have been created, and will show up as the following ''block devices'' under Linux:
+
<console>
 +
Command (m for help): ##i##n ↵
 +
Partition type (default p): ##i##↵
 +
Partition number (3,4, default 3): ##i##↵
 +
First sector: ##i##↵
 +
Last sector: ##i##↵
 +
</console>
  
* <tt>/dev/sda1</tt>, which will be used to hold the <tt>/boot</tt> filesystem,
+
'''Verify the partition table:'''
* <tt>/dev/sda2</tt>, which will be used directly by the new GRUB,
+
* <tt>/dev/sda3</tt>, which will be used for swap space, and
+
* <tt>/dev/sda4</tt>, which will hold your root filesystem.
+
  
===== For Previous fdisk users =====
+
<console>
 +
Command (m for help): ##i##p
  
If you have installed Gentoo Linux before, the one thing that is likely new to you here is the GRUB boot loader partition, which is listed as "BIOS boot partition" within <tt>gdisk</tt>. This partition is required for GRUB 2 to boot GPT/GUID boot disks. What is it? In GRUB-speak, this partition is essentially the location of the meat of GRUB's boot loading code. If you've used GRUB Legacy in the past, this partition is where the new GRUB stores the equivalent of the <tt>stage1_5</tt> and <tt>stage2</tt> files in legacy GRUB. Since GPT-based partition tables have less dead space at the beginning of the disk than their MBR equivalents, an explicitly defined partition of code <tt>EF02</tt> is required to hold the guts of the boot loader.
+
Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 sectors
 +
Units: sectors of 1 * 512 = 512 bytes
 +
Sector size (logical/physical): 512 bytes / 512 bytes
 +
I/O size (minimum/optimal): 512 bytes / 512 bytes
 +
Disklabel type: dos
 +
Disk identifier: 0x82abc9a6
  
In all other respects, the partition table is similar to that which you might create for an MBR-based disk during a Gentoo Linux installation. We have a boot and a root partition with code <tt>0700</tt>, and a Linux swap partition with code <tt>8200</tt>.
+
Device    Boot    Start      End    Blocks  Id System
 +
/dev/sda1          2048    264191    131072  83 Linux
 +
/dev/sda2        264192  4458495  2097152  82 Linux swap / Solaris
 +
/dev/sda3        4458496 625142447 310341976  83 Linux
 +
</console>
  
===== Partitioning Recommendations =====
+
'''Write the parition table to disk:'''
  
Below are our partitioning recommendations in table form. For GPT-based partitions, use the GPT Block Device and GPT Code columns with <tt>gdisk</tt>. For legacy MBR-based partitions, use the MBR Block Device and MBR code columns with <tt>fdisk</tt>:
+
<console>
 +
Command (m for help): ##i##w
 +
</console>
  
{| {{table}}
+
Your new MBR partition table will now be written to your system disk.
!Partition
+
!Size
+
!MBR Block Device (<tt>fdisk</tt>)
+
!GPT Block Device (<tt>gdisk</tt>)
+
!Filesystem
+
!MBR Code
+
!GPT Code
+
|-
+
|<tt>/boot</tt>
+
|500 MB
+
|<tt>/dev/sda1</tt>
+
|<tt>/dev/sda1</tt>
+
|ext2
+
|83
+
|8300
+
|-
+
|GRUB boot loader partition
+
|32 MB
+
| ''not required for MBR''
+
|<tt>/dev/sda2</tt>
+
|For GPT/GUID only, skip for MBR - no filesystem.
+
|''N/A''
+
|EF02
+
|-
+
|swap
+
|2x RAM for low-memory systems and production servers; otherwise 2GB.
+
|<tt>/dev/sda2</tt>
+
|<tt>/dev/sda3</tt>
+
|swap (default)
+
|82
+
|8200
+
|-
+
|<tt>/</tt> (root)
+
|Rest of the disk, minimum of 10GB.
+
|<tt>/dev/sda3</tt>
+
|<tt>/dev/sda4</tt>
+
|ext4 recommended, alternatively XFS
+
|83
+
|8300
+
|-
+
|<tt>/home</tt> (optional)
+
|User storage and media. Typically most of the disk.
+
|<tt>/dev/sda4</tt> (if created)
+
|<tt>/dev/sda5</tt> (if created)
+
|ext4 recommended, alternatively XFS
+
|83
+
|8300
+
|-
+
| LVM (optional)
+
| If you want to create an LVM volume.
+
| <tt>/dev/sda4</tt> (PV, if created)
+
| <tt>/dev/sda5</tt> (PV, if created)
+
| LVM PV
+
| 8E
+
| 8E00
+
|}
+
  
 
==== Creating filesystems ====
 
==== Creating filesystems ====
Line 238: Line 262:
 
Before your newly-created partitions can be used, the block devices need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.
 
Before your newly-created partitions can be used, the block devices need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.
  
You will not create a filesystem on your swap partition, but will initialize it using the <tt>mkswap</tt> command so that it can be used as disk-based virtual memory. Then we'll run the <tt>swapon</tt> command to make your newly-initialized swap space active within the live CD environment, in case it is needed during the rest of the install process.
+
You will not create a filesystem on your swap partition, but will initialize it using the <code>mkswap</code> command so that it can be used as disk-based virtual memory. Then we'll run the <code>swapon</code> command to make your newly-initialized swap space active within the live CD environment, in case it is needed during the rest of the install process.
  
 
Note that we will not create a filesystem on the GRUB boot loader partition, as GRUB writes binary data directly to that partition when the boot loader is installed, which we'll do later.
 
Note that we will not create a filesystem on the GRUB boot loader partition, as GRUB writes binary data directly to that partition when the boot loader is installed, which we'll do later.
  
You can see the commands you will need to type below. Like the rest of this document, it assumes that you are using a GPT partitioning scheme. If you are using MBR, your root filesystem will likely be created on <tt>/dev/sda3</tt> instead and you will need to adjust the target block devices. If you are following our recommendations, then simply do this:
+
You can see the commands you will need to type below. Like the rest of this document, it assumes that you are using a GPT partitioning scheme. If you are using MBR, your root filesystem will likely be created on <code>/dev/sda3</code> instead and you will need to adjust the target block devices. If you are following our recommendations, then simply do this:
 +
 
 +
'''We generally recommend XFS for root filesystems, although ext4 is also a good choice.''' This tutorial assumes the use of XFS. If you want to use ext4, then be sure that your <code>/etc/fstab</code> file reflects this.
 +
 
 +
{{fancywarning|1=
 +
When deploying an OpenVZ host, please use ext4 exclusively. The Parallels development team tests extensively with ext4, and modern versions of <code>openvz-rhel6-stable</code> are '''not''' compatible with XFS, and you may experience kernel bugs.
 +
}}
 +
 
 +
'''To use ext4 as your root filesystem:'''
  
 
<console>
 
<console>
 
# ##i##mke2fs -t ext2 /dev/sda1  
 
# ##i##mke2fs -t ext2 /dev/sda1  
# ##i##mkfs.ext4 /dev/sda4
+
# ##i##mkfs.ext4 /dev/sda3
# ##i##mkswap /dev/sda3
+
# ##i##mkswap /dev/sda2
# ##i##swapon /dev/sda3
+
# ##i##swapon /dev/sda2
 
</console>
 
</console>
  
 +
'''To use XFS as your root filesystem:'''
  
XFS filesystem is incompatible with CONFIG_USER_NS config option in kernel (required for LXC)
 
for XFS filesystem:
 
 
<console>
 
<console>
 
# ##i##mke2fs -t ext2 /dev/sda1  
 
# ##i##mke2fs -t ext2 /dev/sda1  
# ##i##mkfs.xfs /dev/sda4
+
# ##i##mkfs.xfs /dev/sda3
# ##i##mkswap /dev/sda3
+
# ##i##mkswap /dev/sda2
# ##i##swapon /dev/sda3
+
# ##i##swapon /dev/sda2
 
</console>
 
</console>
 
  
 
==== Mounting filesystems ====
 
==== Mounting filesystems ====
  
Mount the newly-created filesystems as follows, creating <tt>/mnt/funtoo</tt> as the installation mount point:
+
Mount the newly-created filesystems as follows, creating <code>/mnt/funtoo</code> as the installation mount point:
  
 
<console>
 
<console>
 
# ##i##mkdir /mnt/funtoo
 
# ##i##mkdir /mnt/funtoo
# ##i##mount /dev/sda4 /mnt/funtoo
+
# ##i##mount /dev/sda3 /mnt/funtoo
 
# ##i##mkdir /mnt/funtoo/boot
 
# ##i##mkdir /mnt/funtoo/boot
 
# ##i##mount /dev/sda1 /mnt/funtoo/boot
 
# ##i##mount /dev/sda1 /mnt/funtoo/boot
 
</console>
 
</console>
  
Optionally, if you have a separate filesystem for <tt>/home</tt> or anything else:
+
Optionally, if you have a separate filesystem for <code>/home</code> or anything else:
  
 
<console>
 
<console>
 
# ##i##mkdir /mnt/funtoo/home
 
# ##i##mkdir /mnt/funtoo/home
# ##i##mount /dev/sda5 /mnt/funtoo/home
+
# ##i##mount /dev/sda4 /mnt/funtoo/home
 
</console>
 
</console>
  
If you have <tt>/tmp</tt> or <tt>/var/tmp</tt> on a separate filesystem, be sure to change the permissions of the mount point to be globally-writeable after mounting, as follows:
+
If you have <code>/tmp</code> or <code>/var/tmp</code> on a separate filesystem, be sure to change the permissions of the mount point to be globally-writeable after mounting, as follows:
  
 
<console>
 
<console>
Line 287: Line 317:
  
 
=== Installing the Stage 3 tarball ===
 
=== Installing the Stage 3 tarball ===
==== Stage 3 tarball ====
+
After creating filesystems, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux. Load one of the following URLs in another browser window:
  
After creating filesystems, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux. Visit the [[Download]] page and copy the URL to the Stage 3 tarball you want to use. We will download it soon.
+
{{MirrorList}}
 +
 
 +
Now, let's navigate the directories on the mirrors to find the appropriate build of Funtoo Linux for you.
 +
 
 +
==== Stable or Current? ====
 +
Funtoo Linux has a "stable" build and a "current" build. Most people use the "current" build of Funtoo Linux, and it's generally recommended that you do too. You will find "current' builds in the main <code>/funtoo-current</code> directory on our mirrors, and "stable" builds in <code>/funtoo-stable</code>.
 +
<br />If you want to read more about this, have a look at [[Funtoo_Linux#What_are_the_differences_between_.27stable.27.2C_.27current.27_and_.27experimental.27_.3F|Differences between stable, current and experimental]].
 +
 
 +
==== 32 or 64-bit? ====
 +
There are three different types of Funtoo Linux that you can install. If you are installing on an older 32-bit system (if you don't know, then you probably are not) then you want to grab a stage3 tarball from the <code>x86-32bit</code> sub-directory. Most likely, you'll want to grab a 64-bit build from the <code>x86-64bit</code> sub-directory.
 +
 
 +
==== Your SubArch ====
 +
Inside <code>/funtoo-current/x86-64bit/</code> on one of our mirrors, you'll see a bunch of directories for various ''subarches'' of Funtoo Linux.
 +
 
 +
Subarches are builds of Funtoo Linux that are designed to run on a particular type of CPU, to offer the best possible performance. They take advantage of the instruction sets available for each CPU.
 +
 
 +
For example, the <code>corei7</code> and <code>corei7-pure64</code> sub-arches require an Intel Core i7 processor to run (this includes Xeon x3400+ series, or other Nehalem-based CPUs such as Xeon x5500/x5600 series.)
 +
 
 +
If you are using an AMD-based CPU, download a stage3 from <code>generic_64</code>, <code>amd64-k8</code> or <code>amd64-k10</code>.
 +
 
 +
If you are using an Intel-based CPU, download a stage3 from <code>generic_64</code>, <code>atom_64</code>, <code>core2_64</code> or <code>corei7</code>.
 +
 
 +
===== Pure64 Builds =====
 +
Inside <code>x86-64bit</code>, you may notice a sub-directory named <code>pure64</code>. These builds are recommended for server systems, and they do not offer any 32-bit compatibility, which is generally not needed on server systems. If you are setting up a desktop or workstation system, it's recommended that you avoid these builds as you will need 32-bit compatibility to run several binary desktop-oriented applications such as Skype. But for servers, pure64 is recommended.
 +
 
 +
==== Setting the Date ====
  
 
{{fancyimportant|If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date.}}
 
{{fancyimportant|If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date.}}
  
Now is a good time to verify the date and time are correctly set to UTC. Use the <tt>date</tt> command to verify the date and time:
+
Now is a good time to verify the date and time are correctly set to UTC. Use the <code>date</code> command to verify the date and time:
  
 
<console>
 
<console>
Line 300: Line 355:
 
</console>
 
</console>
  
If the date and/or time need to be corrected, do so using <tt>date MMDDhhmmYYYY</tt>, keeping in mind <tt>hhmm</tt> are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:
+
If the date and/or time need to be corrected, do so using <code>date MMDDhhmmYYYY</code>, keeping in mind <code>hhmm</code> are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:
  
 
<console>
 
<console>
Line 307: Line 362:
 
</console>
 
</console>
  
Once you are in your Funtoo Linux root filesystem, use <tt>wget</tt> to download the Stage 3 tarball you have chosen from the [[Download]] page to use as the basis for your new Funtoo Linux system. It should be saved to the <tt>/mnt/funtoo</tt> directory as follows:
+
==== Download the Stage3 ====
 +
Once you are in your Funtoo Linux root filesystem, use <code>wget</code> to download the Stage 3 tarball you have chosen to use as the basis for your new Funtoo Linux system. It should be saved to the <code>/mnt/funtoo</code> directory as follows:
  
 
<console># ##i##cd /mnt/funtoo
 
<console># ##i##cd /mnt/funtoo
Line 314: Line 370:
  
  
Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the <tt>generic_64</tt> or <tt>generic_32</tt> stage. Consult the [[Download]] page for more information.
+
Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the <code>generic_64</code> or <code>generic_32</code> stage. Consult the [[Download]] page for more information.
  
 
Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:
 
Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:
 
<console>
 
<console>
# ##i##tar xJpf stage3-latest.tar.xz
+
# ##i##tar xpf stage3-latest.tar.xz
 
</console>
 
</console>
  
{{fancyimportant|It is very important to use <tt>tar</tt>'s "<tt>p</tt>" option when extracting the Stage 3 tarball - it tells <tt>tar</tt> to ''preserve'' any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.}}
+
{{fancyimportant|It is very important to use <code>tar's</code> "<code>'''p'''</code>" option when extracting the Stage 3 tarball - it tells <code>tar</code> to ''preserve'' any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.}}
  
 
=== Chroot into Funtoo ===
 
=== Chroot into Funtoo ===
Line 332: Line 388:
 
</console>
 
</console>
  
You'll also want to copy over <tt>resolv.conf</tt> in order to have proper DNS name resolution from inside the chroot:
+
You'll also want to copy over <code>resolv.conf</code> in order to have proper DNS name resolution from inside the chroot:
 
<console>
 
<console>
 
# ##i##cp /etc/resolv.conf etc
 
# ##i##cp /etc/resolv.conf etc
 
</console>
 
</console>
  
Now you can chroot into your new system. Use <tt>env</tt> before <tt>chroot</tt> to ensure that no environment variables from the installation media are used by your new system:
+
Now you can chroot into your new system. Use <code>env</code> before <code>chroot</code> to ensure that no environment variables from the installation media are used by your new system:
  
 
<console>
 
<console>
Line 343: Line 399:
 
</console>
 
</console>
  
{{fancynote|Users of live CDs with 64-bit kernels: Some software may use <tt>uname -r</tt> to check whether the system is 32 or 64-bit. You may want append linux32 to the chroot command as a workaround, but it's generally not needed.}}
+
{{fancynote|Users of live CDs with 64-bit kernels: Some software may use <code>uname -r</code> to check whether the system is 32 or 64-bit. You may want append linux32 to the chroot command as a workaround, but it's generally not needed.}}
{{fancyimportant|If you receive the error "<tt>chroot: failed to run command `/bin/bash': Exec format error</tt>", it is probably because you are running a 32-bit kernel and trying to execute 64-bit code. SystemRescueCd boots with a 32-bit kernel by default.}}
+
{{fancyimportant|If you receive the error "<code>chroot: failed to run command `/bin/bash': Exec format error</code>", it is probably because you are running a 32-bit kernel and trying to execute 64-bit code. SystemRescueCd boots with a 32-bit kernel by default.}}
  
 
It's also a good idea to change the default command prompt while inside the chroot. This will avoid confusion if you have to change terminals. Use this command:
 
It's also a good idea to change the default command prompt while inside the chroot. This will avoid confusion if you have to change terminals. Use this command:
Line 356: Line 412:
  
 
{{fancynote|For an alternative way to do this, see [[Installing Portage From Snapshot]].}}
 
{{fancynote|For an alternative way to do this, see [[Installing Portage From Snapshot]].}}
Now it's time to install a copy of the Portage repository, which contains package scripts (ebuilds) that tell portage how to build and install thousands of different software packages. To create the Portage repository, simply run <tt>emerge --sync</tt> from within the chroot. This will automatically clone the portage tree from [http://github.com/ GitHub]:
+
Now it's time to install a copy of the Portage repository, which contains package scripts (ebuilds) that tell portage how to build and install thousands of different software packages. To create the Portage repository, simply run <code>emerge --sync</code> from within the chroot. This will automatically clone the portage tree from [https://github.com/funtoo/ports-2012 GitHub]:
  
 
<console>
 
<console>
Line 362: Line 418:
 
</console>
 
</console>
  
{{fancyimportant|If you receive the error with initial <tt>emerge --sync</tt> due to git protocol restrictions, change <tt>SYNC</tt> variable in <tt>/etc/portage/make.conf</tt>}}
+
{{fancyimportant|1=
 +
If you receive the error with initial <code>emerge --sync</code> due to git protocol restrictions, change <code>SYNC</code> variable in <code>/etc/make.conf</code>:
 
<pre>
 
<pre>
 
SYNC="https://github.com/funtoo/ports-2012.git"
 
SYNC="https://github.com/funtoo/ports-2012.git"
 
</pre>
 
</pre>
 
+
}}
  
 
=== Configuring your system ===
 
=== Configuring your system ===
As is expected from a Linux distribution, Funtoo Linux has its share of configuration files. The one file you are absolutely required to edit in order to ensure that Funtoo Linux boots successfully is <tt>/etc/fstab</tt>. The others are optional. Here are a list of files that you should consider editing:
+
As is expected from a Linux distribution, Funtoo Linux has its share of configuration files. The one file you are absolutely required to edit in order to ensure that Funtoo Linux boots successfully is <code>/etc/fstab</code>. The others are optional. Here are a list of files that you should consider editing:
 
+
{{TableStart}}
{| {{table}}
+
<tr class="active"><th>File</th>
!File
+
<th>Do I need to change it?</th>
!Do I need to change it?
+
<th>Description</th>
!Description
+
</tr><tr  class="danger">
|-
+
<td><code>/etc/fstab</code></td>
|<tt>/etc/fstab</tt>
+
<td>'''YES - required'''</td>
|'''YES - required'''
+
<td>Mount points for all filesystems to be used at boot time. This file must reflect your disk partition setup. We'll guide you through modifying this file below.</td>
|Mount points for all filesystems to be used at boot time. This file must reflect your disk partition setup. We'll guide you through modifying this file below.
+
</tr><tr>
|-
+
<td><code>/etc/localtime</code></td>
|<tt>/etc/localtime</tt>
+
<td>''Maybe - recommended''</td>
|''Maybe - recommended''
+
<td>Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal) </td>
|Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal)  
+
</tr><tr>
|-
+
<td><code>/etc/make.conf</code> (symlink) - also known as:<br/><code>/etc/portage/make.conf</code></td>
|<tt>/etc/make.conf<br/>/etc/portage/make.conf&nbsp;(new&nbsp;location)</tt>
+
<td>''Maybe - recommended''</td>
|''Maybe - recommended''
+
<td>Parameters used by gcc (compiler), portage, and make. It's a good idea to set MAKEOPTS. This is covered later in this document.</td>
|Parameters used by gcc (compiler), portage, and make. It's a good idea to set MAKEOPTS. This is covered later in this document.
+
</tr><tr>
|-
+
<td><code>/etc/conf.d/hostname</code></td>
|<tt>/etc/conf.d/hostname</tt>
+
<td>''Maybe - recommended''</td>
|''Maybe - recommended''
+
<td>Used to set system hostname. Set the <code>hostname</code> variable to the fully-qualified (with dots, ie. <code>foo.funtoo.org</code>) name if you have one. Otherwise, set to the local system hostname (without dots, ie. <code>foo</code>). Defaults to <code>localhost</code> if not set.</td>
|Used to set system hostname. Set to the fully-qualified (with dots) name. Defaults to <tt>localhost</tt> if not set.
+
</tr><tr>
|-
+
<td><code>/etc/hosts</code></td>
|<tt>/etc/hosts</tt>
+
<td>''No''</td>
|''No''
+
<td> You no longer need to manually set the hostname in this file. This file is automatically generated by <code>/etc/init.d/hostname</code>.</td>
| You no longer need to manually set the hostname in this file. This file is automatically generated by <tt>/etc/init.d/hostname</tt>.
+
</tr><tr>
|-
+
<td><code>/etc/conf.d/keymaps</code></td>
|<tt>/etc/conf.d/keymaps</tt>
+
<td>Optional</td>
|Optional
+
<td>Keyboard mapping configuration file (for console pseudo-terminals). Set if you have a non-US keyboard. See [[Funtoo Linux Localization]].</td>
|Keyboard mapping configuration file (for console pseudo-terminals). Set if you have a non-US keyboard. See [[Funtoo Linux Localization]].
+
</tr><tr>
|-
+
<td><code>/etc/conf.d/hwclock</code></td>
|<tt>/etc/conf.d/hwclock</tt>
+
<td>Optional</td>
|Optional
+
<td>How the time of the battery-backed hardware clock of the system is interpreted (UTC or local time). Linux uses the battery-backed hardware clock to initialize the system clock when the system is booted.</td>
|How the time of the battery-backed hardware clock of the system is interpreted (UTC or local time). Linux uses the battery-backed hardware clock to initialize the system clock when the system is booted.
+
</tr><tr>
|-
+
<td><code>/etc/conf.d/modules</code></td>
|<tt>/etc/conf.d/modules</tt>
+
<td>Optional</td>
|Optional
+
<td>Kernel modules to load automatically at system startup. Typically not required. See [[Additional Kernel Resources]] for more info.</td>
|Kernel modules to load automatically at system startup. Typically not required. See [[Additional Kernel Resources]] for more info.
+
</tr><tr>
|-
+
<td><code>/etc/conf.d/consolefont</code></td>
|<tt>profiles</tt>
+
<td>Optional</td>
|Optional
+
<td>Allows you to specify the default console font. To apply this font, enable the consolefont service by running rc-update add consolefont.</td>
|Some useful portage settings that may help speed up intial configuration.
+
</tr><tr>
|}
+
<td><code>profiles</code></td>
 +
<td>Optional</td>
 +
<td>Some useful portage settings that may help speed up intial configuration.</td>
 +
</tr>
 +
{{TableEnd}}
  
 
If you're installing an English version of Funtoo Linux, you're in luck as most of the configuration files can be used as-is. If you're installing for another locale, don't worry. We will walk you through the necessary configuration steps on the [[Funtoo Linux Localization]] page, and if needed, there's always plenty of friendly, helpful support. (See [[#Community portal|Community]])
 
If you're installing an English version of Funtoo Linux, you're in luck as most of the configuration files can be used as-is. If you're installing for another locale, don't worry. We will walk you through the necessary configuration steps on the [[Funtoo Linux Localization]] page, and if needed, there's always plenty of friendly, helpful support. (See [[#Community portal|Community]])
  
Let's go ahead and see what we have to do. Use <tt>nano -w <name_of_file></tt> to edit files -- the "<tt>-w</tt>" disables word-wrapping, which is handy when editing configuration files. You can copy and paste from the examples.
+
Let's go ahead and see what we have to do. Use <code>nano -w <name_of_file></code> to edit files -- the "<code>-w</code>" disables word-wrapping, which is handy when editing configuration files. You can copy and paste from the examples.
  
{{fancywarning|It's important to edit your <tt>/etc/fstab</tt> file before you reboot! You will need to modify both the "fs" and "type" columns to match the settings for your partitions and filesystems that you created with <tt>gdisk</tt> or <tt>fdisk</tt>. Skipping this step may prevent Funtoo Linux from booting successfully.}}
+
{{fancywarning|It's important to edit your <code>/etc/fstab</code> file before you reboot! You will need to modify both the "fs" and "type" columns to match the settings for your partitions and filesystems that you created with <code>gdisk</code> or <code>fdisk</code>. Skipping this step may prevent Funtoo Linux from booting successfully.}}
  
 
==== /etc/fstab ====
 
==== /etc/fstab ====
  
<tt>/etc/fstab</tt> is used by the <tt>mount</tt> command which is ran when your system boots. Statements of this file inform <tt>mount</tt> about partitions to be mounted and how they are mounted. In order for the system to boot properly, you must edit <tt>/etc/fstab</tt> and ensure that it reflects the partition configuration you used earlier:
+
<code>/etc/fstab</code> is used by the <code>mount</code> command which is ran when your system boots. Statements of this file inform <code>mount</code> about partitions to be mounted and how they are mounted. In order for the system to boot properly, you must edit <code>/etc/fstab</code> and ensure that it reflects the partition configuration you used earlier:
  
 
<console>
 
<console>
Line 427: Line 488:
 
</console>
 
</console>
  
You can use arrow keys to move around and hit Control-X to exit. If you want to save your changes, type "<tt>Y</tt>" when asked if you want to save the modified buffer, or hit Control-O before closing <tt>nano</tt>. Otherwise your changes will be discarded.
+
You can use arrow keys to move around and hit Control-X to exit. If you want to save your changes, type "<code>Y</code>" when asked if you want to save the modified buffer, or hit Control-O before closing <code>nano</code>. Otherwise your changes will be discarded.
  
 
<pre>
 
<pre>
Line 439: Line 500:
 
# <fs>     <mountpoint>  <type>  <opts>        <dump/pass>
 
# <fs>     <mountpoint>  <type>  <opts>        <dump/pass>
  
/dev/sda1    /boot        ext2    noatime       1 2
+
/dev/sda1    /boot        ext2    noauto,noatime 1 2
/dev/sda3   none          swap    sw            0 0
+
/dev/sda2   none          swap    sw            0 0
/dev/sda4   /            ext4    noatime        0 1
+
/dev/sda3   /            ext4    noatime        0 1
 
#/dev/cdrom  /mnt/cdrom    auto    noauto,ro      0 0
 
#/dev/cdrom  /mnt/cdrom    auto    noauto,ro      0 0
 
</pre>
 
</pre>
Line 447: Line 508:
 
==== /etc/localtime ====
 
==== /etc/localtime ====
  
<tt>/etc/localtime</tt> is used to specify the timezone that your machine is in, and defaults to UTC. If you would like your Funtoo Linux system to use local time, you should replace <tt>/etc/localtime</tt> with a symbolic link to the timezone that you wish to use.  
+
<code>/etc/localtime</code> is used to specify the timezone that your machine is in, and defaults to UTC. If you would like your Funtoo Linux system to use local time, you should replace <code>/etc/localtime</code> with a symbolic link to the timezone that you wish to use.  
  
 
<console>
 
<console>
(chroot) # ##i##ln -sf /usr/share/zoneinfo/America/Montreal /etc/localtime
+
(chroot) # ##i##ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime
 
</console>
 
</console>
  
The above sets the timezone to Eastern Time Canada. Go to <tt>/usr/share/zoneinfo</tt> to see which values to use.
+
The above sets the timezone to Mountain Standard Time (with daylight savings). Type <code>ls /usr/share/zoneinfo</code> to see what timezones are available. There are also sub-directories containing timezones described by location.
  
 
==== /etc/make.conf ====
 
==== /etc/make.conf ====
 
{{fancynote|This file is the symlink to /etc/portage/make.conf, new default location, edit /etc/portage/make.conf.}}
 
  
 
MAKEOPTS can be used to define how many parallel compilations should occur when you compile a package, which can speed up compilation significantly. A rule of thumb is the number of CPUs (or CPU threads) in your system plus one. If for example you have a dual core processor without [[wikipedia:Hyper-threading|hyper-threading]], then you would set MAKEOPTS to 3:
 
MAKEOPTS can be used to define how many parallel compilations should occur when you compile a package, which can speed up compilation significantly. A rule of thumb is the number of CPUs (or CPU threads) in your system plus one. If for example you have a dual core processor without [[wikipedia:Hyper-threading|hyper-threading]], then you would set MAKEOPTS to 3:
Line 477: Line 536:
 
</pre>
 
</pre>
  
USE flags define what functionality is enabled when packages are built. It is not recommended to add a lot of them during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("<tt>-</tt>") sign tells Portage not to use the flag when compiling.  A Funtoo guide to USE flags will be available in the future. For now, you can find out more information about USE flags in the [http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=2&chap=2 Gentoo Handbook].
+
USE flags define what functionality is enabled when packages are built. It is not recommended to add a lot of them during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("<code>-</code>") sign tells Portage not to use the flag when compiling.  A Funtoo guide to USE flags will be available in the future. For now, you can find out more information about USE flags in the [http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=2&chap=2 Gentoo Handbook].
  
 
LINGUAS tells Portage which local language to compile the system and applications in (those who use LINGUAS variable like OpenOffice). It is not usually necessary to set this if you use English. If you want another language such as French (fr) or German (de), set LINGUAS appropriately:
 
LINGUAS tells Portage which local language to compile the system and applications in (those who use LINGUAS variable like OpenOffice). It is not usually necessary to set this if you use English. If you want another language such as French (fr) or German (de), set LINGUAS appropriately:
Line 486: Line 545:
  
 
==== /etc/conf.d/hwclock ====
 
==== /etc/conf.d/hwclock ====
If you dual-boot with Windows, you'll need to edit this file and change '''clock''' to '''local''', because Windows will set your hardware clock to local time every time you boot Windows. Otherwise you normally wouldn't need to edit this file.
+
If you dual-boot with Windows, you'll need to edit this file and change the value of '''clock''' from '''UTC''' to '''local''', because Windows will set your hardware clock to local time every time you boot Windows. Otherwise you normally wouldn't need to edit this file.
 
<console>
 
<console>
 
(chroot) # ##i##nano -w /etc/conf.d/hwclock
 
(chroot) # ##i##nano -w /etc/conf.d/hwclock
Line 495: Line 554:
 
By default, Funtoo Linux is configured with Unicode (UTF-8) enabled, and for the US English locale and keyboard. If you would like to configure your system to use a non-English locale or keyboard, see [[Funtoo Linux Localization]].
 
By default, Funtoo Linux is configured with Unicode (UTF-8) enabled, and for the US English locale and keyboard. If you would like to configure your system to use a non-English locale or keyboard, see [[Funtoo Linux Localization]].
  
==== Profiles ====
+
=== Introducing Portage ===
  
[[Funtoo 1.0 Profile|Funtoo profiles]] are used to define defaults for Portage specific to your needs. There are 4 basic profile types: arch, build, [[Flavors and Mix-ins|flavor, and mix-ins]]:
+
Portage, the Funtoo Linux package manager has a command called <code>emerge</code> which is used to build and install packages from source. It also takes care of installing all of the package's dependencies. You call emerge like this:
  
;arch: typically <tt>x86-32bit</tt> or <tt>x86-64bit</tt>, this defines the processor type and support of your system. This is defined when your stage was built and should not be changed.
+
<console>
;build: defines whether your system is a <tt>current</tt>, <tt>stable</tt> or <tt>experimental</tt> build. <tt>current</tt> systems will have newer packages unmasked than <tt>stable</tt> systems.
+
(chroot) # ##i##emerge packagename
;flavor: defines the general type of system, such as <tt>server</tt> or <tt>desktop</tt>, and will set default USE flags appropriate for your needs.
+
</console>
;mix-ins: define various optional settings that you may be interested in enabling.
+
 
+
One arch, build and flavor must be set for each Funtoo Linux system, while mix-ins are optional and you can enable more than one if desired.
+
  
Remember that profiles can often be inherited. For example, the <tt>desktop</tt> flavor inherits the <tt>workstation</tt> flavor settings, which in turn inherits the <tt>X</tt> and <tt>audio</tt> mix-ins. You can view this by using eselect:
+
When you install a package by specifying its name in the command-line, Portage records its name in the <code>/var/lib/portage/world</code> file. It does so because it assumes that, since you have installed it by name, you want to consider it part of your system and want to keep the package updated in the future. This is a handy feature, since when packages are being added to the <code>world</code> set, we can update our entire system by typing:
  
 
<console>
 
<console>
(chroot) # ##i##eselect profile show
+
(chroot) # ##i##emerge --sync
Currently set profiles:
+
(chroot) # ##i##emerge -auDN @world
    arch: gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit
+
</console>
  build: gentoo:funtoo/1.0/linux-gnu/build/current
+
  flavor: gentoo:funtoo/1.0/linux-gnu/flavor/desktop
+
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/kde
+
  
Automatically enabled profiles:
+
This is the "official" way to update your Funtoo Linux system. Above, we first update our Portage tree using git to grab the latest ebuilds (scripts), and then run an emerge command to update the <code>world</code> set of packages. The options specified tell <code>emerge</code> to:
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/print
+
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/X
+
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/audio
+
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/dvd
+
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/media
+
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/console-extras
+
  
 +
* '''<code>a</code>''' - show us what will be emerged, and '''ask''' us if we want to proceed
 +
* '''<code>u</code>''' - ''update'' the packages we specify -- don't emerge them again if they are already emerged.
 +
* '''<code>D</code>''' - Consider the entire dependency tree of packages when looking for updates. In other words, do a '''deep''' update.
 +
* '''<code>N</code>''' - Update any packages that have changed ('''new''') USE settings.
  
 +
You should also consider passing <code>--with-bdeps=y</code> when emerging @world, at least once in a while. This will update build dependencies as well.
 +
 +
Of course, sometimes we want to install a package but not add it to the <code>world</code> file. This is often done because you only want the package installed temproarily or because you know the package in question is a dependnecy of another package. If this behavior is desired, you call emerge like this:
 +
 +
<console>
 +
(chroot) # ##i##emerge -1 packagename
 
</console>
 
</console>
  
To view installed profiles:
+
Advanced users may be interested in the [[Emerge]] wiki page.
 +
 
 +
==== Updating World ====
 +
 
 +
Now is actually a very good time to update the entire system and it can be a good idea to do so prior to first boot.
 +
 
 
<console>
 
<console>
(chroot) # ##i##eselect profile list
+
(chroot) # ##i##emerge --sync
 +
(chroot) # ##i##emerge -auDN @world
 
</console>
 
</console>
  
To change the profile flavor:
+
{{fancyimportant|1=
 +
Make sure you read any post emerge messages and follow their instructions. This is especially true if you have upgraded perl or python.}}
 +
 
 +
=== Configuring and installing the Linux kernel ===
 +
 
 +
Now it's time to build and install a Linux kernel, which is the heart of any Funtoo Linux system. The kernel is loaded by the boot loader, and interfaces directly with your system's hardware, and allows regular (userspace) programs to run.
 +
 
 +
A kernel must be configured properly for your system's hardware, so that it supports your hard drives, file systems, network cards, and so on. More experienced Linux users can choose to install kernel sources and configure and install their own kernel. If you don't know how to do this, we provide ebuilds that will automatically build a "univeral" kernel, modules and initramfs for booting your system that supports all hardware. This is an extremely simple way of building a kernel that will get your system booted.
 +
 
 +
What is our goal? To build a kernel that will recognize all the hardware in your system necessary for booting, so that you will be greeted by a friendly login prompt after installation is complete. These instructions will guide you through the process of installing a kernel the "easy" way -- without requiring user configuration, by using a "universal" kernel.
 +
 
 +
==== Package Sets ====
 +
 
 +
Before we install a kernel, we're going to cover a feature of Portage called package sets. Portage, the package manager/ports system for Funtoo Linux, will keep track of system packages as well as packages you have installed by calling <code>emerge</code> directly. These packages that are part of the base system are considered part of the "system" package set, while packages that you have installed by typing them on the command line (such as "gnome" in <code>emerge gnome</code>) will be added to the "world" package set. This provides an easy way to update your entire system.
 +
 
 +
However, sometimes it's nice to be able to update the kernel all by itself, or leave a kernel update out of your regular whole system update. To do this, we will create a new package set called "kernel".
 +
 
 +
==== Kernel Package Set ====
 +
 
 +
To create the kernel package set, perform the following steps:
 +
 
 
<console>
 
<console>
(chroot) # ##i##eselect profile set-flavor 7
+
(chroot) # ##i##mkdir /etc/portage/sets
 +
(chroot) # ##i##echo sys-kernel/debian-sources > /etc/portage/sets/kernel
 
</console>
 
</console>
  
To add a mix-in:
+
Now, we'll want to set a USE variable to tell <code>debian-sources</code> to build a "universal" kernel and initramfs for us, to take the guess-work out of getting Funtoo Linux booted. To do this, we're going to set the <code>binary</code> USE variable for <code>debian-sources</code>, as follows:
  
 
<console>
 
<console>
(chroot) # ##i##eselect profile add 10
+
(chroot) # ##i##echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use
 
</console>
 
</console>
  
=== Configuring and installing the Linux kernel ===
+
If USE variables are new to you, you'll be getting a lot more familiar with them as you use Funtoo Linux. At their essence, they are "switches" that you can set to configure options that can be built in to various packages. They're used to customize your Funtoo Linux system to meet your exact needs. We added support for a <code>binary</code> USE flag to the <code>debian-sources</code> ebuilds, as well as a few other of our kernel ebuilds, to make it easier for new users to get Funtoo Linux up and running.
  
Now it's time to build and install a Linux kernel, which is the heart of any Funtoo Linux system. In the past, the process of creating a kernel that actually booted your system could be time-consuming and require a great deal of trial and error. Fortunately, Funtoo Linux offers an option to automatically build a kernel for you that will boot nearly all systems.
+
Now, when we just want to update our system's packages, we'll type <code>emerge -auDN @world</code>, and it will update our world set, leaving out the kernel. Likewise, when we just want to update our kernel, we'll type <code>emerge -au @kernel</code>, and it will update our kernel, leaving out the world set.
  
If you are unfamiliar with how to manually configure your own kernel, or you simply want to get your system up and running quickly, you can emerge <tt>debian-sources</tt> with the <tt>binary</tt> USE flag set, which will automatically build the kernel and an initrd that will boot nearly all Funtoo Linux systems. This kernel is based on a linux-3.2 LTS official debian kernel package and is an easy way to get your system up and running relatively quickly.
+
==== Building the Kernel ====
  
Click [http://wiki.debian.org/DebianKernel here] for a list of all architectures the Debian kernel supports.  
+
{{Fancynote|1=
 +
See [[Funtoo Linux Kernels]] for a full list of kernels supported in Funtoo Linux. We recommend <code>debian-sources</code> for new users.}}
  
{{fancyimportant|<tt>debian-sources</tt> with <tt>binary</tt> USE flag requires at least 12GB in /var/tmp}}
+
{{fancyimportant|1=
 +
<code>debian-sources</code> with <code>binary</code> USE flag requires at least 14GB free in <code>/var/tmp</code> and takes around 1 hour to build on a Intel Core i7 Processor.}}
 +
 
 +
Let's emerge our kernel:
  
 
<console>
 
<console>
(chroot) # ##i##cat /proc/mounts > /etc/mtab
+
(chroot) # ##i##emerge @kernel
(chroot) # ##i##echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use
+
</console>
(chroot) # ##i##emerge debian-sources</console>
+
  
All done!
+
Note that while use of the <code>binary</code> USE flag makes installing a working kernel extremely simple, it is one part of Funtoo Linux that takes a ''very'' long time to build from source, because it is building a kernel that supports ''all'' hardware that Linux supports! So, get the build started, and then let your machine compile. Slower machines can take up to several hours to build the kernel, and you'll want to make sure that you've set <code>MAKEOPTS</code> in <code>/etc/make.conf</code> to the number of processing cores/threads (plus one) in your system before starting to build it as quickly as possible -- see the [[#/etc/make.conf|/etc/make.conf section]] if you forgot to do this.
  
{{fancynote|NVIDIA card users: the <tt>binary</tt> USE flag installs the Nouveau drivers which cannot be loaded at the same time as the proprietary drivers, and cannot be unloaded at runtime because of KMS. You need to blacklist it under <tt>/etc/modprobe.d/</tt>.}}
+
{{fancynote|NVIDIA card users: the <code>binary</code> USE flag installs the Nouveau drivers which cannot be loaded at the same time as the proprietary drivers, and cannot be unloaded at runtime because of KMS. You need to blacklist it under <code>/etc/modprobe.d/</code>.}}
{{fancynote|For an overview of other kernel options for Funtoo Linux, see [[Funtoo Linux Kernels]]. There maybe modules that the Debian kernel doesn't include, a situation where [http://www.funtoo.org/wiki/Funtoo_Linux_Kernels#Using_Debian-Sources_with_Genkernel genkernel] would be useful. Also be sure to see [[:Category:Hardware Compatibility|hardware compatibility]] information. We have compiled a very good reference for [[Dell PowerEdge 11G Servers]] that includes kernel compatibility information as well..}}
+
  
 +
{{fancynote|For an overview of other kernel options for Funtoo Linux, see [[Funtoo Linux Kernels]]. There may be modules that the Debian kernel doesn't include, a situation where [http://www.funtoo.org/wiki/Funtoo_Linux_Kernels#Using_Debian-Sources_with_Genkernel genkernel] would be useful. Also be sure to see [[:Category:Hardware Compatibility|hardware compatibility]] information.}}
  
The next step is to configure your boot loader so that your new kernel loads when the system boots.
+
Once <code>emerge</code> completes, you'll have a brand new kernel and initramfs installed to <code>/boot</code>, plus kernel headers installed in <code>/usr/src/linux</code>, and you'll be ready to configure the boot loader to load these to boot your Funtoo Linux system.
  
 
=== Installing a Bootloader ===
 
=== Installing a Bootloader ===
 +
 +
{{fancynote|An alternate boot loader called extlinux can be used instead of GRUB if you desire. See the [[Extlinux|extlinux Guide]] for information on how to do this.}}
  
 
==== Installing Grub ====
 
==== Installing Grub ====
Line 572: Line 661:
 
The boot loader is responsible for loading the kernel from disk when your computer boots. For new installations, GRUB 2 and Funtoo's boot-update tool should be used as a boot loader. GRUB supports both GPT/GUID and legacy MBR partitioning schemes.
 
The boot loader is responsible for loading the kernel from disk when your computer boots. For new installations, GRUB 2 and Funtoo's boot-update tool should be used as a boot loader. GRUB supports both GPT/GUID and legacy MBR partitioning schemes.
  
To use this recommended boot method, first emerge <tt>boot-update</tt>. This will also cause <tt>grub-2</tt> to be merged, since it is a dependency of <tt>boot-update</tt>.
+
To use this recommended boot method, first emerge <code>boot-update</code>. This will also cause <code>grub-2</code> to be merged, since it is a dependency of <code>boot-update</code>. (You may need to adjust <code>GRUB_PLATFORMS</code> if you are on a UEFI system. See [[UEFI Install Guide]]).
  
 
<console>
 
<console>
Line 578: Line 667:
 
</console>
 
</console>
  
Then, edit <tt>/etc/boot.conf</tt> and specify "<tt>Funtoo Linux genkernel</tt>" as the <tt>default</tt> setting at the top of the file, replacing <tt>"Funtoo Linux"</tt>.  
+
Then, edit <code>/etc/boot.conf</code> and specify "<code>Funtoo Linux genkernel</code>" as the <code>default</code> setting at the top of the file, replacing <code>"Funtoo Linux"</code>.  
  
<tt>/etc/boot.conf</tt> should now look like this:
+
<code>/etc/boot.conf</code> should now look like this:
  
 
<pre>
 
<pre>
Line 595: Line 684:
  
 
"Funtoo Linux genkernel" {
 
"Funtoo Linux genkernel" {
 +
# if you use bliss-kernel package
 +
# you should change string
 +
# kernel kernel[-v]
 +
# to
 +
# kernel kernel/[-v]/kernel[-v]
 
         kernel kernel[-v]
 
         kernel kernel[-v]
 
         initrd initramfs[-v]
 
         initrd initramfs[-v]
Line 601: Line 695:
 
}  
 
}  
 
</pre>
 
</pre>
+
 
Please read <tt>man boot.conf</tt> for further details.
+
If you use bliss-kernel, your <code>/etc/boot.conf</code> should look like:
 +
 
 +
<pre>
 +
boot {
 +
        generate grub
 +
        default "Funtoo Linux genkernel"
 +
        timeout 3
 +
}
 +
 
 +
"Funtoo Linux" {
 +
        kernel bzImage[-v]
 +
        # params += nomodeset
 +
}
 +
 
 +
"Funtoo Linux genkernel" {
 +
        kernel kernels/[-v]/kernel[-v]
 +
        initrd initramfs[-v]
 +
        params += real_root=auto
 +
        # params += nomodeset
 +
}
 +
</pre>
 +
 
 +
Please read <code>man boot.conf</code> for further details.
  
 
===== Running grub-install and boot-update =====
 
===== Running grub-install and boot-update =====
  
Finally, we will need to actually install the GRUB boot loader to your disk, and also run <tt>boot-update</tt> which will generate your boot loader configuration file:
+
Finally, we will need to actually install the GRUB boot loader to your disk, and also run <code>boot-update</code> which will generate your boot loader configuration file:
  
 
<console>
 
<console>
Line 613: Line 729:
 
</console>
 
</console>
  
You only need to run <tt>grub-install</tt> when you first install Funtoo Linux, but you need to re-run <tt>boot-update</tt> every time you modify your <tt>/etc/boot.conf</tt> file, so your changes are applied on next boot.
+
Now you need to update your boot loader configuration file:
 
+
<console>
OK - your system should be ready to boot! Well, there are a few more loose ends...
+
(chroot) # ##i##boot-update
 
+
</console>
==== Installing Syslinux/Extlinux ====
+
You only need to run <code>grub-install</code> when you first install Funtoo Linux, but you need to re-run <code>boot-update</code> every time you modify your <code>/etc/boot.conf</code> file, so your changes are applied on next boot.
 
+
An alternate Bootloader is Extlinux, for installing it see the [[Extlinux|extlinux Guide]].
+
  
 
=== Configuring your network ===
 
=== Configuring your network ===
Line 626: Line 740:
  
 
==== Wi-Fi ====
 
==== Wi-Fi ====
 
+
===== Using NetworkManager =====
 
For laptop/mobile systems where you will be using Wi-Fi and connecting to various networks, NetworkManager is strongly recommended. The Funtoo version of NetworkManager is fully functional even from the command-line, so you can use it even without X or without the Network Manager applet. Here are the steps involved in setting up NetworkManager:
 
For laptop/mobile systems where you will be using Wi-Fi and connecting to various networks, NetworkManager is strongly recommended. The Funtoo version of NetworkManager is fully functional even from the command-line, so you can use it even without X or without the Network Manager applet. Here are the steps involved in setting up NetworkManager:
  
 
<console>
 
<console>
# ##i##emerge linux-firmware
+
(chroot) # ##i##emerge linux-firmware
# ##i##emerge networkmanager
+
(chroot) # ##i##emerge networkmanager
# ##i##rc-update add NetworkManager default
+
(chroot) # ##i##rc-update add NetworkManager default
 
</console>
 
</console>
  
Above, we installed linux-firmware which contains a complete collection of available firmware for many hardware devices including Wi-Fi adapters, plus NetworkManager to manage our network connection. Then we added NetworkManager to the <tt>default</tt> runlevel so it will start when Funtoo Linux boots.
+
Above, we installed linux-firmware which contains a complete collection of available firmware for many hardware devices including Wi-Fi adapters, plus NetworkManager to manage our network connection. Then we added NetworkManager to the <code>default</code> runlevel so it will start when Funtoo Linux boots.
  
 
After you reboot into Funtoo Linux, you will be able to add a Wi-Fi connection this way:
 
After you reboot into Funtoo Linux, you will be able to add a Wi-Fi connection this way:
Line 643: Line 757:
 
</console>
 
</console>
  
The <tt>addwifi</tt> command is used to configure and connect to a WPA/WPA2 Wi-Fi network named <tt>mywifinetwork</tt> with the password <tt>wifipassword</tt>. This network configuration entry is stored in <tt>/etc/NetworkManager/system-connections</tt> so that it will be remembered in the future. You should only need to enter this command once for each Wi-Fi network you connect to.
+
The <code>addwifi</code> command is used to configure and connect to a WPA/WPA2 Wi-Fi network named <code>mywifinetwork</code> with the password <code>wifipassword</code>. This network configuration entry is stored in <code>/etc/NetworkManager/system-connections</code> so that it will be remembered in the future. You should only need to enter this command once for each Wi-Fi network you connect to.
 +
 
 +
===== Using wpa_supplicant =====
 +
If for some reason you don't want to use a tool such as NetworkManager or <code>wicd</code>, you can use wpa_supplicant for wireless network connections.
 +
 
 +
First, emerge wpa_supplicant:
 +
 
 +
<console>
 +
(chroot) ###i## emerge -a wpa_supplicant
 +
</console>
 +
 
 +
Now, edit the wpa_supplicant configuration file, located at /etc/wpa_supplicant.conf.
 +
The syntax is very easy:
 +
<pre>
 +
network={
 +
ssid="MyWifiName"
 +
psk="lol42-wifi"
 +
}
 +
 
 +
network={
 +
ssid="Other Network"
 +
psk="6d96270004515a0486bb7f76196a72b40c55a47f"
 +
}
 +
</pre>
 +
 
 +
You will need to add both <code>wpa_supplicant</code> and <code>dhcpcd</code> to the default runlevel. <code>wpa_supplicant</code> will connect to your access point, and <code>dhcpcd</code> will acquire an IP address via DHCP:
 +
 
 +
<console>
 +
(chroot) # ##i##rc-update add dhcpcd default
 +
(chroot) # ##i##rc-update add wpa_supplicant default
 +
</console>
  
 
==== Desktop (Wired Ethernet) ====
 
==== Desktop (Wired Ethernet) ====
  
For a home desktop or workstation with wired Ethernet that will use DHCP, the simplest and most effective option to enable network connectivity is to simply add <tt>dhcpcd</tt> to the default runlevel:
+
For a home desktop or workstation with wired Ethernet that will use DHCP, the simplest and most effective option to enable network connectivity is to simply add <code>dhcpcd</code> to the default runlevel:
  
 
<console>
 
<console>
# ##i##rc-update add dhcpcd default
+
(chroot) # ##i##rc-update add dhcpcd default
 
</console>
 
</console>
  
When you reboot, <tt>dhcpcd</tt> will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.
+
When you reboot, <code>dhcpcd</code> will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.
  
 
==== Server (Static IP) ====
 
==== Server (Static IP) ====
Line 671: Line 815:
 
Now is the time to leave chroot, to unmount Funtoo Linux partitions and files and to restart your computer. When you restart, the GRUB boot loader will start, load the Linux kernel and initramfs, and your system will begin booting.
 
Now is the time to leave chroot, to unmount Funtoo Linux partitions and files and to restart your computer. When you restart, the GRUB boot loader will start, load the Linux kernel and initramfs, and your system will begin booting.
  
Leave the chroot, change directory to /, unmount your Funtoo partitions, and reboot.
+
Leave the chroot, change directory to /mnt, unmount your Funtoo partitions, and reboot.
 
<console>
 
<console>
 
(chroot) # ##i##exit
 
(chroot) # ##i##exit
# ##i##cd /
+
# ##i##cd /mnt
# ##i##umount -l /mnt/funtoo/boot /mnt/funtoo/dev /mnt/funtoo/proc /mnt/funtoo
+
# ##i##umount -l funtoo
 
# ##i##reboot
 
# ##i##reboot
 
</console>
 
</console>
  
You should now see your system reboot, the GRUB boot loader appear for a few seconds, and then see the Linux kernel and initramfs loading. After this, you should see Funtoo Linux itself start to boot, and you should be greeted with a <tt>login:</tt> prompt. Funtoo Linux has been successfully installed!
+
{{fancynote|System Rescue CD will gracefully unmount your new Funtoo filesystems as part of its normal shutdown sequence.}}
 +
 
 +
You should now see your system reboot, the GRUB boot loader appear for a few seconds, and then see the Linux kernel and initramfs loading. After this, you should see Funtoo Linux itself start to boot, and you should be greeted with a <code>login:</code> prompt. Funtoo Linux has been successfully installed!
 +
=== Profiles ===
 +
 
 +
Once you have rebooted into Funtoo Linux, you can further customize your system to your needs by using Funtoo Profiles.
 +
 
 +
[[Funtoo 1.0 Profile|Funtoo profiles]] are used to define defaults for Portage specific to your needs. There are 4 basic profile types: arch, build, [[Flavors and Mix-ins|flavor, and mix-ins]]:
 +
 
 +
;arch: typically <code>x86-32bit</code> or <code>x86-64bit</code>, this defines the processor type and support of your system. This is defined when your stage was built and should not be changed.
 +
;build: defines whether your system is a <code>current</code>, <code>stable</code> or <code>experimental</code> build. <code>current</code> systems will have newer packages unmasked than <code>stable</code> systems.
 +
;flavor: defines the general type of system, such as <code>server</code> or <code>desktop</code>, and will set default USE flags appropriate for your needs.
 +
;mix-ins: define various optional settings that you may be interested in enabling.
 +
 
 +
One arch, build and flavor must be set for each Funtoo Linux system, while mix-ins are optional and you can enable more than one if desired.
 +
 
 +
Remember that profiles can often be inherited. For example, the <code>desktop</code> flavor inherits the <code>workstation</code> flavor settings, which in turn inherits the <code>X</code> and <code>audio</code> mix-ins. You can view this by using eselect:
 +
 
 +
<console>
 +
(chroot) # ##i##eselect profile show
 +
Currently set profiles:
 +
    arch: gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit
 +
  build: gentoo:funtoo/1.0/linux-gnu/build/current
 +
  flavor: gentoo:funtoo/1.0/linux-gnu/flavor/desktop
 +
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/kde
 +
 
 +
Automatically enabled profiles:
 +
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/print
 +
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/X
 +
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/audio
 +
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/dvd
 +
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/media
 +
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/console-extras
 +
</console>
 +
 
 +
To view installed profiles:
 +
<console>
 +
(chroot) # ##i##eselect profile list
 +
</console>
 +
 
 +
To change the profile flavor:
 +
<console>
 +
(chroot) # ##i##eselect profile set-flavor 7
 +
</console>
 +
 
 +
To add a mix-in:
 +
 
 +
<console>
 +
(chroot) # ##i##eselect profile add 10
 +
</console>
  
 
===Next Steps===
 
===Next Steps===
  
If you are brand new to Funtoo Linux and Gentoo Linux, please check out [[Funtoo Linux First Steps]], which will help get you acquainted with your new system.
+
If you are brand new to Funtoo Linux and Gentoo Linux, please check out [[Funtoo Linux First Steps]], which will help get you acquainted with your new system. We also have a category for our [[:Category:Official Documentation|official documentation]], which includes all docs that we officially maintain for installation and operation of Funtoo Linux.
  
 
We also have a number of pages dedicated to setting up your system, which you can find below. If you are interested in adding a page to this list, add it to the "First Steps" MediaWiki category.
 
We also have a number of pages dedicated to setting up your system, which you can find below. If you are interested in adding a page to this list, add it to the "First Steps" MediaWiki category.
Line 693: Line 886:
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]
 
[[Category:Install]]
 
[[Category:Install]]
 +
[[Category:Official Documentation]]

Latest revision as of 08:09, October 21, 2014

Introduction

This document was written to help you install Funtoo Linux as concisely as possible, with a minimum number of distracting options regarding system configuration.

These docs assume you have a "PC compatible" computer system with a standard PC BIOS. Many new computers support UEFI for booting, which is a new firmware interface that frequently replaces the older MBR-based BIOS. If you have a system with UEFI, you will want to use this documentation along with the UEFI Install Guide, which will augment these instructions and explain how to get your system to boot. You may need to change your PC BIOS settings to enable or disable UEFI booting. The UEFI Install Guide has more information on this, and steps on how to determine if your system supports UEFI.

We also offer a ZFS Install Guide, which augment the instructions on this page for those who want to install Funtoo Linux on ZFS. If you are installing Funtoo Linux on ARM architecture, please see Funtoo Linux Installation on ARM for notable differences regarding ARM support. An experimental Funtoo Linux build also exists for SPARC platforms. See Funtoo Linux Installation on SPARC.

If you've had previous experience installing Gentoo Linux then a lot of steps will be familiar, but you should still read through as there are a few differences.

Installation Overview

This is a basic overview of the Funtoo installation process:

  1. Download and boot the live CD of your choice.
  2. Prepare your disk.
  3. Create and mount filesystems.
  4. Install the Funtoo stage tarball of your choice.
  5. Chroot into your new system.
  6. Download the Portage tree.
  7. Configure your system and network.
  8. Install a kernel.
  9. Install a bootloader.
  10. Complete final steps.
  11. Reboot and enjoy.

Live CD

Funtoo doesn't provide an "official" Funtoo Live CD, but there are plenty of good ones out there to choose from. A great choice is the Gentoo-based System Rescue CD as it contains lots of tools and utilities and supports both 32-bit and 64-bit systems.

It is also possible to install Funtoo Linux using many other Linux-based live CDs. Generally, any modern bootable Linux live CD or live USB media will work. See requirements for an overview of what the Live Media must provide to allow a problem-free install of Funtoo Linux.

To begin a Funtoo Linux installation, download System Rescue CD from:

Or, use your preferred live media. Insert it into your disc drive, and boot from it. If using an older version of System Rescue CD, be sure to select the rescue64 kernel at the boot menu if you are installing a 64-bit system. By default, System Rescue CD used to boot in 32-bit mode though the latest version attempts to automatically detect 64-bit processors.

Prepare Hard Disk

Partitions

Funtoo Linux fully supports traditional MBR partitions, as well as newer GPT/GUID partition formats. See below to determine which partitioning scheme to use:

MBR Partitions
  • Recommended if your system disk is <=2TB in size
  • Legacy, DOS partitioning scheme
  • Only 4 primary partitions per disk; after that, you must use "logical" partitions
  • Does not support 2 TB+ disks for booting
  • Compatible with certain problematic systems (such as the HP ProBook 4520)
  • Dual-boot with Windows for BIOS systems (Windows handle GPT only on true EFI systems, whatever version it is)
  • Multiple boot loader options, e.g. GRUB 2, GRUB Legacy, lilo

Note

Due to the fact that it is more widely supported on PC hardware, it is best to use MBR partitions if possible.

GPT Partitions
  • Recommended if your disk is >2TB in size
  • Newer format for Linux systems
  • Supports 2 TB+ hard drives for booting
  • Supports hundreds of partitions per disk of any size
  • Requires legacy BIOS boot partition (~32 MB) to be created if system does not use EFI
  • Requires bootloader with support for GPT such as GRUB 2, EXTLINUX, or a patched version of GRUB Legacy

Important

If you have a system disk that is 2TB or greater and want to use the space beyond 2TB, you must partition using the GPT/GUID format. Otherwise, MBR is recommended as the most reliable boot method.

Filesystem Resources

Advanced users may be interested in the following topics:

Partitioning Recommendations

Below are our partitioning recommendations in table form. For MBR-based partitions, use the MBR Block Device and MBR code columns with fdisk. For GPT-based partitions, use the GPT Block Device and GPT Code columns with gdisk:

Partition Size MBR Block Device (fdisk) GPT Block Device (gdisk) Filesystem MBR Code GPT Code
/boot 512 MB /dev/sda1 /dev/sda1 ext2 83 8300
GRUB boot loader partition 1 MB not required for MBR /dev/sda2 For GPT/GUID only, skip for MBR - no filesystem. N/A EF02
swap 2x RAM for low-memory systems and production servers; otherwise 2GB. /dev/sda2 /dev/sda3 swap (default) 82 8200
/ (root) Rest of the disk, minimum of 10GB. Note: to compile the debian-sources kernel, as described later on this page, requires a minimum of 14GB free space in /tmp; consider a minimum of 20GB in this case. /dev/sda3 /dev/sda4 XFS recommended, alternatively ext4 83 8300
/home (optional) User storage and media. Typically most of the disk. /dev/sda4 (if created) /dev/sda5 (if created) XFS recommended, alternatively ext4 83 8300
LVM (optional) If you want to create an LVM volume. /dev/sda4 (PV, if created) /dev/sda5 (PV, if created) LVM PV 8E 8E00
Partitioning Using fdisk (MBR)

Important

If you need to create a GPT partition table, see Partitioning using gdisk.

Note

These install instructions assume you are installing Funtoo Linux to an hard disk using Master Boot Record partition tables (MBR). If you are installing Funtoo Linux on a machine where another OS is installed, there is an existing Linux distribution on your system that you want to keep or any other scenario (such as differing swap size requirements), then you will need to adapt these instructions to suit your needs.

fdisk is the tool used to create an MBR partition table. MBR is well-supported on PCs and is recommended if your system disk is 2TB or smaller.

Preparation

First, it's a good idea to make sure that you've found the correct hard disk to partition. Try this command and verify that /dev/sda is the disk that you want to partition:

# fdisk -l /dev/sda

Disk /dev/sda: 640.1 GB, 640135028736 bytes, 1250263728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt


#         Start          End    Size  Type            Name
 1         2048   1250263694  596.2G  Linux filesyste Linux filesystem

Now, it's recommended that you erase any existing MBR or GPT partition tables on the disk, which could confuse the system's BIOS at boot time. We do this using sgdisk:

Warning

This will make any existing partitions inaccessible! You are strongly cautioned and advised to backup any critical data before proceeding.

# sgdisk --zap-all /dev/sda

Creating new GPT entries.
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.

This output is also nothing to worry about, as the command still succeded:

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. 
***************************************************************
Partitioning

Now we will use fdisk to create the MBR partition table and partitions:

# fdisk /dev/sda

Within fdisk, follow these steps:

Empty the partition table:

Command (m for help): o ↵

Create Partition 1 (boot):

Command (m for help): n ↵
Partition type (default p): 
Partition number (1-4, default 1): 
First sector: 
Last sector: +128M ↵

Create Partition 2 (swap):

Command (m for help): n ↵
Partition type (default p): 
Partition number (2-4, default 2): 
First sector: 
Last sector: +2G ↵
Command (m for help): t ↵ 
Partition number (1,2, default 2): 
Hex code (type L to list all codes): 82 ↵

Create the root partition:

Command (m for help): n ↵
Partition type (default p): 
Partition number (3,4, default 3): 
First sector: 
Last sector: 

Verify the partition table:

Command (m for help): p

Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x82abc9a6

Device    Boot     Start       End    Blocks  Id System
/dev/sda1           2048    264191    131072  83 Linux
/dev/sda2         264192   4458495   2097152  82 Linux swap / Solaris
/dev/sda3        4458496 625142447 310341976  83 Linux

Write the parition table to disk:

Command (m for help): w

Your new MBR partition table will now be written to your system disk.

Creating filesystems

Before your newly-created partitions can be used, the block devices need to be initialized with filesystem metadata. This process is known as creating a filesystem on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.

You will not create a filesystem on your swap partition, but will initialize it using the mkswap command so that it can be used as disk-based virtual memory. Then we'll run the swapon command to make your newly-initialized swap space active within the live CD environment, in case it is needed during the rest of the install process.

Note that we will not create a filesystem on the GRUB boot loader partition, as GRUB writes binary data directly to that partition when the boot loader is installed, which we'll do later.

You can see the commands you will need to type below. Like the rest of this document, it assumes that you are using a GPT partitioning scheme. If you are using MBR, your root filesystem will likely be created on /dev/sda3 instead and you will need to adjust the target block devices. If you are following our recommendations, then simply do this:

We generally recommend XFS for root filesystems, although ext4 is also a good choice. This tutorial assumes the use of XFS. If you want to use ext4, then be sure that your /etc/fstab file reflects this.

Warning

When deploying an OpenVZ host, please use ext4 exclusively. The Parallels development team tests extensively with ext4, and modern versions of openvz-rhel6-stable are not compatible with XFS, and you may experience kernel bugs.

To use ext4 as your root filesystem:

# mke2fs -t ext2 /dev/sda1 
# mkfs.ext4 /dev/sda3
# mkswap /dev/sda2
# swapon /dev/sda2

To use XFS as your root filesystem:

# mke2fs -t ext2 /dev/sda1 
# mkfs.xfs /dev/sda3
# mkswap /dev/sda2
# swapon /dev/sda2

Mounting filesystems

Mount the newly-created filesystems as follows, creating /mnt/funtoo as the installation mount point:

# mkdir /mnt/funtoo
# mount /dev/sda3 /mnt/funtoo
# mkdir /mnt/funtoo/boot
# mount /dev/sda1 /mnt/funtoo/boot

Optionally, if you have a separate filesystem for /home or anything else:

# mkdir /mnt/funtoo/home
# mount /dev/sda4 /mnt/funtoo/home

If you have /tmp or /var/tmp on a separate filesystem, be sure to change the permissions of the mount point to be globally-writeable after mounting, as follows:

# chmod 1777 /mnt/funtoo/tmp

Installing the Stage 3 tarball

After creating filesystems, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux. Load one of the following URLs in another browser window:

Now, let's navigate the directories on the mirrors to find the appropriate build of Funtoo Linux for you.

Stable or Current?

Funtoo Linux has a "stable" build and a "current" build. Most people use the "current" build of Funtoo Linux, and it's generally recommended that you do too. You will find "current' builds in the main /funtoo-current directory on our mirrors, and "stable" builds in /funtoo-stable.
If you want to read more about this, have a look at Differences between stable, current and experimental.

32 or 64-bit?

There are three different types of Funtoo Linux that you can install. If you are installing on an older 32-bit system (if you don't know, then you probably are not) then you want to grab a stage3 tarball from the x86-32bit sub-directory. Most likely, you'll want to grab a 64-bit build from the x86-64bit sub-directory.

Your SubArch

Inside /funtoo-current/x86-64bit/ on one of our mirrors, you'll see a bunch of directories for various subarches of Funtoo Linux.

Subarches are builds of Funtoo Linux that are designed to run on a particular type of CPU, to offer the best possible performance. They take advantage of the instruction sets available for each CPU.

For example, the corei7 and corei7-pure64 sub-arches require an Intel Core i7 processor to run (this includes Xeon x3400+ series, or other Nehalem-based CPUs such as Xeon x5500/x5600 series.)

If you are using an AMD-based CPU, download a stage3 from generic_64, amd64-k8 or amd64-k10.

If you are using an Intel-based CPU, download a stage3 from generic_64, atom_64, core2_64 or corei7.

Pure64 Builds

Inside x86-64bit, you may notice a sub-directory named pure64. These builds are recommended for server systems, and they do not offer any 32-bit compatibility, which is generally not needed on server systems. If you are setting up a desktop or workstation system, it's recommended that you avoid these builds as you will need 32-bit compatibility to run several binary desktop-oriented applications such as Skype. But for servers, pure64 is recommended.

Setting the Date

Important

If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date.

Now is a good time to verify the date and time are correctly set to UTC. Use the date command to verify the date and time:

# date
Fri Jul 15 19:47:18 UTC 2011

If the date and/or time need to be corrected, do so using date MMDDhhmmYYYY, keeping in mind hhmm are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:

# date 071620002011
Fri Jul 16 20:00:00 UTC 2011

Download the Stage3

Once you are in your Funtoo Linux root filesystem, use wget to download the Stage 3 tarball you have chosen to use as the basis for your new Funtoo Linux system. It should be saved to the /mnt/funtoo directory as follows:

# cd /mnt/funtoo
# wget http://ftp.osuosl.org/pub/funtoo/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz


Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the generic_64 or generic_32 stage. Consult the Download page for more information.

Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:

# tar xpf stage3-latest.tar.xz

Important

It is very important to use tar's "p" option when extracting the Stage 3 tarball - it tells tar to preserve any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.

Chroot into Funtoo

Before chrooting into your new system, there's a few things that need to be done first. You will need to mount /proc and /dev inside your new system. Use the following commands:

# cd /mnt/funtoo
# mount -t proc none proc
# mount --rbind /sys sys
# mount --rbind /dev dev

You'll also want to copy over resolv.conf in order to have proper DNS name resolution from inside the chroot:

# cp /etc/resolv.conf etc

Now you can chroot into your new system. Use env before chroot to ensure that no environment variables from the installation media are used by your new system:

# env -i HOME=/root TERM=$TERM chroot . bash -l

Note

Users of live CDs with 64-bit kernels: Some software may use uname -r to check whether the system is 32 or 64-bit. You may want append linux32 to the chroot command as a workaround, but it's generally not needed.

Important

If you receive the error "chroot: failed to run command `/bin/bash': Exec format error", it is probably because you are running a 32-bit kernel and trying to execute 64-bit code. SystemRescueCd boots with a 32-bit kernel by default.

It's also a good idea to change the default command prompt while inside the chroot. This will avoid confusion if you have to change terminals. Use this command:

# export PS1="(chroot) $PS1"

Congratulations! You are now chrooted inside a Funtoo Linux system. Now it's time to get Funtoo Linux properly configured so that Funtoo Linux will boot successfully when your system is restarted.

Downloading the Portage tree

Note

For an alternative way to do this, see Installing Portage From Snapshot.

Now it's time to install a copy of the Portage repository, which contains package scripts (ebuilds) that tell portage how to build and install thousands of different software packages. To create the Portage repository, simply run emerge --sync from within the chroot. This will automatically clone the portage tree from GitHub:

(chroot) # emerge --sync

Important

If you receive the error with initial emerge --sync due to git protocol restrictions, change SYNC variable in /etc/make.conf:

SYNC="https://github.com/funtoo/ports-2012.git"

Configuring your system

As is expected from a Linux distribution, Funtoo Linux has its share of configuration files. The one file you are absolutely required to edit in order to ensure that Funtoo Linux boots successfully is /etc/fstab. The others are optional. Here are a list of files that you should consider editing:

File Do I need to change it? Description
/etc/fstab YES - required Mount points for all filesystems to be used at boot time. This file must reflect your disk partition setup. We'll guide you through modifying this file below.
/etc/localtime Maybe - recommended Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal)
/etc/make.conf (symlink) - also known as:
/etc/portage/make.conf
Maybe - recommended Parameters used by gcc (compiler), portage, and make. It's a good idea to set MAKEOPTS. This is covered later in this document.
/etc/conf.d/hostname Maybe - recommended Used to set system hostname. Set the hostname variable to the fully-qualified (with dots, ie. foo.funtoo.org) name if you have one. Otherwise, set to the local system hostname (without dots, ie. foo). Defaults to localhost if not set.
/etc/hosts No You no longer need to manually set the hostname in this file. This file is automatically generated by /etc/init.d/hostname.
/etc/conf.d/keymaps Optional Keyboard mapping configuration file (for console pseudo-terminals). Set if you have a non-US keyboard. See Funtoo Linux Localization.
/etc/conf.d/hwclock Optional How the time of the battery-backed hardware clock of the system is interpreted (UTC or local time). Linux uses the battery-backed hardware clock to initialize the system clock when the system is booted.
/etc/conf.d/modules Optional Kernel modules to load automatically at system startup. Typically not required. See Additional Kernel Resources for more info.
/etc/conf.d/consolefont Optional Allows you to specify the default console font. To apply this font, enable the consolefont service by running rc-update add consolefont.
profiles Optional Some useful portage settings that may help speed up intial configuration.

If you're installing an English version of Funtoo Linux, you're in luck as most of the configuration files can be used as-is. If you're installing for another locale, don't worry. We will walk you through the necessary configuration steps on the Funtoo Linux Localization page, and if needed, there's always plenty of friendly, helpful support. (See Community)

Let's go ahead and see what we have to do. Use nano -w <name_of_file> to edit files -- the "-w" disables word-wrapping, which is handy when editing configuration files. You can copy and paste from the examples.

Warning

It's important to edit your /etc/fstab file before you reboot! You will need to modify both the "fs" and "type" columns to match the settings for your partitions and filesystems that you created with gdisk or fdisk. Skipping this step may prevent Funtoo Linux from booting successfully.

/etc/fstab

/etc/fstab is used by the mount command which is ran when your system boots. Statements of this file inform mount about partitions to be mounted and how they are mounted. In order for the system to boot properly, you must edit /etc/fstab and ensure that it reflects the partition configuration you used earlier:

(chroot) # nano -w /etc/fstab

You can use arrow keys to move around and hit Control-X to exit. If you want to save your changes, type "Y" when asked if you want to save the modified buffer, or hit Control-O before closing nano. Otherwise your changes will be discarded.

# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
#
# See the manpage fstab(5) for more information.
#
# <fs>	     <mountpoint>  <type>  <opts>         <dump/pass>

/dev/sda1    /boot         ext2    noauto,noatime 1 2
/dev/sda2    none          swap    sw             0 0
/dev/sda3    /             ext4    noatime        0 1
#/dev/cdrom  /mnt/cdrom    auto    noauto,ro      0 0

/etc/localtime

/etc/localtime is used to specify the timezone that your machine is in, and defaults to UTC. If you would like your Funtoo Linux system to use local time, you should replace /etc/localtime with a symbolic link to the timezone that you wish to use.

(chroot) # ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime

The above sets the timezone to Mountain Standard Time (with daylight savings). Type ls /usr/share/zoneinfo to see what timezones are available. There are also sub-directories containing timezones described by location.

/etc/make.conf

MAKEOPTS can be used to define how many parallel compilations should occur when you compile a package, which can speed up compilation significantly. A rule of thumb is the number of CPUs (or CPU threads) in your system plus one. If for example you have a dual core processor without hyper-threading, then you would set MAKEOPTS to 3:

MAKEOPTS="-j3" 

If you are unsure about how many processors/threads you have then use /proc/cpuinfo to help you.

(chroot) # grep "processor" /proc/cpuinfo | wc -l
16

Set MAKEOPTS to this number plus one:

MAKEOPTS="-j17"

USE flags define what functionality is enabled when packages are built. It is not recommended to add a lot of them during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("-") sign tells Portage not to use the flag when compiling. A Funtoo guide to USE flags will be available in the future. For now, you can find out more information about USE flags in the Gentoo Handbook.

LINGUAS tells Portage which local language to compile the system and applications in (those who use LINGUAS variable like OpenOffice). It is not usually necessary to set this if you use English. If you want another language such as French (fr) or German (de), set LINGUAS appropriately:

LINGUAS="fr"

/etc/conf.d/hwclock

If you dual-boot with Windows, you'll need to edit this file and change the value of clock from UTC to local, because Windows will set your hardware clock to local time every time you boot Windows. Otherwise you normally wouldn't need to edit this file.

(chroot) # nano -w /etc/conf.d/hwclock

Localization

By default, Funtoo Linux is configured with Unicode (UTF-8) enabled, and for the US English locale and keyboard. If you would like to configure your system to use a non-English locale or keyboard, see Funtoo Linux Localization.

Introducing Portage

Portage, the Funtoo Linux package manager has a command called emerge which is used to build and install packages from source. It also takes care of installing all of the package's dependencies. You call emerge like this:

(chroot) # emerge packagename

When you install a package by specifying its name in the command-line, Portage records its name in the /var/lib/portage/world file. It does so because it assumes that, since you have installed it by name, you want to consider it part of your system and want to keep the package updated in the future. This is a handy feature, since when packages are being added to the world set, we can update our entire system by typing:

(chroot) # emerge --sync
(chroot) # emerge -auDN @world

This is the "official" way to update your Funtoo Linux system. Above, we first update our Portage tree using git to grab the latest ebuilds (scripts), and then run an emerge command to update the world set of packages. The options specified tell emerge to:

  • a - show us what will be emerged, and ask us if we want to proceed
  • u - update the packages we specify -- don't emerge them again if they are already emerged.
  • D - Consider the entire dependency tree of packages when looking for updates. In other words, do a deep update.
  • N - Update any packages that have changed (new) USE settings.

You should also consider passing --with-bdeps=y when emerging @world, at least once in a while. This will update build dependencies as well.

Of course, sometimes we want to install a package but not add it to the world file. This is often done because you only want the package installed temproarily or because you know the package in question is a dependnecy of another package. If this behavior is desired, you call emerge like this:

(chroot) # emerge -1 packagename

Advanced users may be interested in the Emerge wiki page.

Updating World

Now is actually a very good time to update the entire system and it can be a good idea to do so prior to first boot.

(chroot) # emerge --sync
(chroot) # emerge -auDN @world

Important

Make sure you read any post emerge messages and follow their instructions. This is especially true if you have upgraded perl or python.

Configuring and installing the Linux kernel

Now it's time to build and install a Linux kernel, which is the heart of any Funtoo Linux system. The kernel is loaded by the boot loader, and interfaces directly with your system's hardware, and allows regular (userspace) programs to run.

A kernel must be configured properly for your system's hardware, so that it supports your hard drives, file systems, network cards, and so on. More experienced Linux users can choose to install kernel sources and configure and install their own kernel. If you don't know how to do this, we provide ebuilds that will automatically build a "univeral" kernel, modules and initramfs for booting your system that supports all hardware. This is an extremely simple way of building a kernel that will get your system booted.

What is our goal? To build a kernel that will recognize all the hardware in your system necessary for booting, so that you will be greeted by a friendly login prompt after installation is complete. These instructions will guide you through the process of installing a kernel the "easy" way -- without requiring user configuration, by using a "universal" kernel.

Package Sets

Before we install a kernel, we're going to cover a feature of Portage called package sets. Portage, the package manager/ports system for Funtoo Linux, will keep track of system packages as well as packages you have installed by calling emerge directly. These packages that are part of the base system are considered part of the "system" package set, while packages that you have installed by typing them on the command line (such as "gnome" in emerge gnome) will be added to the "world" package set. This provides an easy way to update your entire system.

However, sometimes it's nice to be able to update the kernel all by itself, or leave a kernel update out of your regular whole system update. To do this, we will create a new package set called "kernel".

Kernel Package Set

To create the kernel package set, perform the following steps:

(chroot) # mkdir /etc/portage/sets
(chroot) # echo sys-kernel/debian-sources > /etc/portage/sets/kernel

Now, we'll want to set a USE variable to tell debian-sources to build a "universal" kernel and initramfs for us, to take the guess-work out of getting Funtoo Linux booted. To do this, we're going to set the binary USE variable for debian-sources, as follows:

(chroot) # echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use

If USE variables are new to you, you'll be getting a lot more familiar with them as you use Funtoo Linux. At their essence, they are "switches" that you can set to configure options that can be built in to various packages. They're used to customize your Funtoo Linux system to meet your exact needs. We added support for a binary USE flag to the debian-sources ebuilds, as well as a few other of our kernel ebuilds, to make it easier for new users to get Funtoo Linux up and running.

Now, when we just want to update our system's packages, we'll type emerge -auDN @world, and it will update our world set, leaving out the kernel. Likewise, when we just want to update our kernel, we'll type emerge -au @kernel, and it will update our kernel, leaving out the world set.

Building the Kernel

Note

See Funtoo Linux Kernels for a full list of kernels supported in Funtoo Linux. We recommend debian-sources for new users.

Important

debian-sources with binary USE flag requires at least 14GB free in /var/tmp and takes around 1 hour to build on a Intel Core i7 Processor.

Let's emerge our kernel:

(chroot) # emerge @kernel

Note that while use of the binary USE flag makes installing a working kernel extremely simple, it is one part of Funtoo Linux that takes a very long time to build from source, because it is building a kernel that supports all hardware that Linux supports! So, get the build started, and then let your machine compile. Slower machines can take up to several hours to build the kernel, and you'll want to make sure that you've set MAKEOPTS in /etc/make.conf to the number of processing cores/threads (plus one) in your system before starting to build it as quickly as possible -- see the /etc/make.conf section if you forgot to do this.

Note

NVIDIA card users: the binary USE flag installs the Nouveau drivers which cannot be loaded at the same time as the proprietary drivers, and cannot be unloaded at runtime because of KMS. You need to blacklist it under /etc/modprobe.d/.

Note

For an overview of other kernel options for Funtoo Linux, see Funtoo Linux Kernels. There may be modules that the Debian kernel doesn't include, a situation where genkernel would be useful. Also be sure to see hardware compatibility information.

Once emerge completes, you'll have a brand new kernel and initramfs installed to /boot, plus kernel headers installed in /usr/src/linux, and you'll be ready to configure the boot loader to load these to boot your Funtoo Linux system.

Installing a Bootloader

Note

An alternate boot loader called extlinux can be used instead of GRUB if you desire. See the extlinux Guide for information on how to do this.

Installing Grub

The boot loader is responsible for loading the kernel from disk when your computer boots. For new installations, GRUB 2 and Funtoo's boot-update tool should be used as a boot loader. GRUB supports both GPT/GUID and legacy MBR partitioning schemes.

To use this recommended boot method, first emerge boot-update. This will also cause grub-2 to be merged, since it is a dependency of boot-update. (You may need to adjust GRUB_PLATFORMS if you are on a UEFI system. See UEFI Install Guide).

(chroot) # emerge boot-update

Then, edit /etc/boot.conf and specify "Funtoo Linux genkernel" as the default setting at the top of the file, replacing "Funtoo Linux".

/etc/boot.conf should now look like this:

boot {
        generate grub
        default "Funtoo Linux genkernel"
        timeout 3 
}

"Funtoo Linux" {
        kernel bzImage[-v]
        # params += nomodeset
}

"Funtoo Linux genkernel" {
# if you use bliss-kernel package
# you should change string
# kernel kernel[-v]
# to
# kernel kernel/[-v]/kernel[-v]
        kernel kernel[-v]
        initrd initramfs[-v]
        params += real_root=auto 
        # params += nomodeset
} 

If you use bliss-kernel, your /etc/boot.conf should look like:

boot {
        generate grub
        default "Funtoo Linux genkernel"
        timeout 3 
}

"Funtoo Linux" {
        kernel bzImage[-v]
        # params += nomodeset
}

"Funtoo Linux genkernel" {
        kernel kernels/[-v]/kernel[-v]
        initrd initramfs[-v]
        params += real_root=auto 
        # params += nomodeset
} 

Please read man boot.conf for further details.

Running grub-install and boot-update

Finally, we will need to actually install the GRUB boot loader to your disk, and also run boot-update which will generate your boot loader configuration file:

(chroot) # grub-install --no-floppy /dev/sda
(chroot) # boot-update

Now you need to update your boot loader configuration file:

(chroot) # boot-update

You only need to run grub-install when you first install Funtoo Linux, but you need to re-run boot-update every time you modify your /etc/boot.conf file, so your changes are applied on next boot.

Configuring your network

It's important to ensure that you will be able to connect to your local-area network after you reboot into Funtoo Linux. There are three approaches you can use for configuring your network: NetworkManager, dhcpcd, and the Funtoo Linux Networking scripts. Here's how to choose which one to use based on the type of network you want to set up.

Wi-Fi

Using NetworkManager

For laptop/mobile systems where you will be using Wi-Fi and connecting to various networks, NetworkManager is strongly recommended. The Funtoo version of NetworkManager is fully functional even from the command-line, so you can use it even without X or without the Network Manager applet. Here are the steps involved in setting up NetworkManager:

(chroot) # emerge linux-firmware
(chroot) # emerge networkmanager
(chroot) # rc-update add NetworkManager default

Above, we installed linux-firmware which contains a complete collection of available firmware for many hardware devices including Wi-Fi adapters, plus NetworkManager to manage our network connection. Then we added NetworkManager to the default runlevel so it will start when Funtoo Linux boots.

After you reboot into Funtoo Linux, you will be able to add a Wi-Fi connection this way:

# addwifi -S wpa -K 'wifipassword' mywifinetwork

The addwifi command is used to configure and connect to a WPA/WPA2 Wi-Fi network named mywifinetwork with the password wifipassword. This network configuration entry is stored in /etc/NetworkManager/system-connections so that it will be remembered in the future. You should only need to enter this command once for each Wi-Fi network you connect to.

Using wpa_supplicant

If for some reason you don't want to use a tool such as NetworkManager or wicd, you can use wpa_supplicant for wireless network connections.

First, emerge wpa_supplicant:

(chroot) # emerge -a wpa_supplicant

Now, edit the wpa_supplicant configuration file, located at /etc/wpa_supplicant.conf. The syntax is very easy:

network={
ssid="MyWifiName"
psk="lol42-wifi"
}

network={
ssid="Other Network"
psk="6d96270004515a0486bb7f76196a72b40c55a47f"
}

You will need to add both wpa_supplicant and dhcpcd to the default runlevel. wpa_supplicant will connect to your access point, and dhcpcd will acquire an IP address via DHCP:

(chroot) # rc-update add dhcpcd default
(chroot) # rc-update add wpa_supplicant default

Desktop (Wired Ethernet)

For a home desktop or workstation with wired Ethernet that will use DHCP, the simplest and most effective option to enable network connectivity is to simply add dhcpcd to the default runlevel:

(chroot) # rc-update add dhcpcd default

When you reboot, dhcpcd will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.

Server (Static IP)

For servers, the Funtoo Linux Networking scripts are recommended. They are optimized for static configurations and things like virtual ethernet bridging for virtualization setups. See Funtoo Linux Networking for information on how to use Funtoo Linux's template-based network configuration system.

Finishing Steps

Set your root password

It's imperative that you set your root password before rebooting so that you can log in.

(chroot) # passwd

Restart your system

Now is the time to leave chroot, to unmount Funtoo Linux partitions and files and to restart your computer. When you restart, the GRUB boot loader will start, load the Linux kernel and initramfs, and your system will begin booting.

Leave the chroot, change directory to /mnt, unmount your Funtoo partitions, and reboot.

(chroot) # exit
# cd /mnt
# umount -l funtoo
# reboot

Note

System Rescue CD will gracefully unmount your new Funtoo filesystems as part of its normal shutdown sequence.

You should now see your system reboot, the GRUB boot loader appear for a few seconds, and then see the Linux kernel and initramfs loading. After this, you should see Funtoo Linux itself start to boot, and you should be greeted with a login: prompt. Funtoo Linux has been successfully installed!

Profiles

Once you have rebooted into Funtoo Linux, you can further customize your system to your needs by using Funtoo Profiles.

Funtoo profiles are used to define defaults for Portage specific to your needs. There are 4 basic profile types: arch, build, flavor, and mix-ins:

arch
typically x86-32bit or x86-64bit, this defines the processor type and support of your system. This is defined when your stage was built and should not be changed.
build
defines whether your system is a current, stable or experimental build. current systems will have newer packages unmasked than stable systems.
flavor
defines the general type of system, such as server or desktop, and will set default USE flags appropriate for your needs.
mix-ins
define various optional settings that you may be interested in enabling.

One arch, build and flavor must be set for each Funtoo Linux system, while mix-ins are optional and you can enable more than one if desired.

Remember that profiles can often be inherited. For example, the desktop flavor inherits the workstation flavor settings, which in turn inherits the X and audio mix-ins. You can view this by using eselect:

(chroot) # eselect profile show
Currently set profiles:
    arch: gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit
   build: gentoo:funtoo/1.0/linux-gnu/build/current
  flavor: gentoo:funtoo/1.0/linux-gnu/flavor/desktop
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/kde

Automatically enabled profiles:
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/print
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/X
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/audio
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/dvd
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/media
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/console-extras

To view installed profiles:

(chroot) # eselect profile list

To change the profile flavor:

(chroot) # eselect profile set-flavor 7

To add a mix-in:

(chroot) # eselect profile add 10

Next Steps

If you are brand new to Funtoo Linux and Gentoo Linux, please check out Funtoo Linux First Steps, which will help get you acquainted with your new system. We also have a category for our official documentation, which includes all docs that we officially maintain for installation and operation of Funtoo Linux.

We also have a number of pages dedicated to setting up your system, which you can find below. If you are interested in adding a page to this list, add it to the "First Steps" MediaWiki category.



If your system did not boot correctly, see Installation Troubleshooting for steps you can take to resolve the problem.