Difference between pages "Funtoo Linux Installation" and "Install/Partitioning"

(Difference between pages)
(Configuring your network)
 
(Created page with "<noinclude> {{Note|This is a template that is used as part of the Installation instructions, to describe the process of partitioning and filesystem creation. Templates are bei...")
 
Line 1: Line 1:
<div class="container"><div class="row"><div class="col-sm-12 col-md-9">
+
<noinclude>
== Introduction ==
+
{{Note|This is a template that is used as part of the Installation instructions, to describe the process of partitioning and filesystem creation. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.}}
 
+
</noinclude>
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 [[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]].
+
 
+
New  [[F2FS Install Guide]] is in progress  which will augment the instructions on this page for those who want to install Funtoo Linux on F2FS.
+
 
+
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:
+
 
+
# [[#Live CD|Download and boot the live CD of your choice]].
+
# [[#Prepare Hard Disk|Prepare your disk]].
+
# [[#Creating filesystems|Create]] and [[#Mounting filesystems|mount]] filesystems.
+
# [[#Installing the Stage 3 tarball|Install the Funtoo stage tarball]] of your choice.
+
# [[#Chroot into Funtoo|Chroot into your new system]].
+
# [[#Downloading the Portage tree|Download the Portage tree]].
+
# [[#Configuring your system|Configure your system]] and [[#Configuring your network|network]].
+
# [[#Configuring and installing the Linux kernel|Install a kernel]].
+
# [[#Installing a Bootloader|Install a bootloader]].
+
# [[#Finishing Steps|Complete final steps]].
+
# [[#Restart your system|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 [http://www.sysresccd.org/ System Rescue CD] as it contains lots of tools and utilities and supports both 32-bit and 64-bit systems. For a generation 2 Hyper-V system, the [http://www.ubuntu.com/ Ubuntu] desktop install DVD as of version 14.04.1 works well enough. Gentoo CDs don't support EFI boot, and the System Rescue CD lacks appropriate graphics support for Hyper-V as of version 4.4.0.
+
 
+
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 System Rescue CD from:
+
 
+
{{MirrorList}}
+
 
+
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 ====
Line 322: Line 284:
  
 
{{:Install/Chroot}}
 
{{:Install/Chroot}}
 
=== Downloading the Portage tree ===
 
 
{{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 <code>emerge --sync</code> from within the chroot. This will automatically clone the portage tree from [https://github.com/funtoo/ports-2012 GitHub]:
 
 
<console>
 
(chroot) # ##i##emerge --sync
 
</console>
 
 
{{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>
 
SYNC="https://github.com/funtoo/ports-2012.git"
 
</pre>
 
}}
 
 
{{:Install/Configuring}}
 
 
=== Introducing Portage ===
 
 
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:
 
 
<console>
 
(chroot) # ##i##emerge packagename
 
</console>
 
 
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>
 
(chroot) # ##i##emerge --sync
 
(chroot) # ##i##emerge -auDN @world
 
</console>
 
 
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:
 
 
* '''<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>
 
 
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>
 
(chroot) # ##i##emerge --sync
 
(chroot) # ##i##emerge -auDN @world
 
</console>
 
 
{{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>
 
(chroot) # ##i##mkdir /etc/portage/sets
 
(chroot) # ##i##echo sys-kernel/debian-sources > /etc/portage/sets/kernel
 
</console>
 
 
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>
 
(chroot) # ##i##echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use
 
</console>
 
 
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, 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.
 
 
==== Building the Kernel ====
 
 
{{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|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>
 
(chroot) # ##i##emerge @kernel
 
</console>
 
 
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 <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 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.}}
 
 
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 ===
 
 
{{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 ====
 
 
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 <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>
 
(chroot) # ##i##emerge boot-update
 
</console>
 
 
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>.
 
 
<code>/etc/boot.conf</code> should now look like this:
 
 
<pre>
 
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
 
}
 
</pre>
 
 
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 =====
 
 
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>
 
(chroot) # ##i##grub-install --no-floppy /dev/sda
 
(chroot) # ##i##boot-update
 
</console>
 
 
Now you need to update your boot loader configuration file:
 
<console>
 
(chroot) # ##i##boot-update
 
</console>
 
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.
 
 
{{:Install/Network}}
 
 
=== Finishing Steps ===
 
 
==== Set your root password ====
 
It's imperative that you set your root password before rebooting so that you can log in.
 
<console>
 
(chroot) # ##i##passwd
 
</console>
 
 
===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.
 
<console>
 
(chroot) # ##i##exit
 
# ##i##cd /mnt
 
# ##i##umount -l funtoo
 
# ##i##reboot
 
</console>
 
 
{{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===
 
 
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.
 
 
{{#ask: [[Category:First Steps]] | format=ul }}
 
 
If your system did not boot correctly, see [[Installation Troubleshooting]] for steps you can take to resolve the problem.
 
 
[[Category:HOWTO]]
 
[[Category:Install]]
 
[[Category:Official Documentation]]
 
</div><div class="col-md-3 col-hidden-sm col-hidden-xs"><div id="tocwrap" >
 
__TOC__
 
</div></div></div>
 

Revision as of 05:27, November 12, 2014

Note

This is a template that is used as part of the Installation instructions, to describe the process of partitioning and filesystem creation. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.

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 or Partitioning using parted.

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.

Which Build?

If you're not sure, pick funtoo-current.

Funtoo Linux has various different 'builds', or variants. Here is a list of the various builds that are available, and what their distinctive features are:

BuildDescription
funtoo-currentThe most commonly-selected build of Funtoo Linux. Receives rapid updates and preferred by desktop users.
funtoo-current-hardenedSame package set as funtoo-current, but with a hardened, exploit-resistant toolchain.
funtoo-stableEmphasizes less-frequent package updates and trusted, reliable versions of packages over the latest versions.

If you want to read more about this, have a look at Differences between stable, current and experimental.

What Architecture?

If you're not sure, pick x86-64bit, or possibly pure64 for server systems.

For PC-compatible systems, the following choices are available:

ArchitectureDescription
x86-64bitFor modern 64-bit processors. Uses new 64-bit instructions and address space. Maintains 32-bit compatibility with multilib.
pure64For modern 64-bit processors but with no support for 32-bit compatibility.
x86-32bitFor older 32-bit systems such as Athlon XP, Pentium 4, or earlier Atom.

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 also take advantage of the instruction sets available for each CPU.

If you are using an AMD-based CPU, download a stage3 from generic_64, amd64-k8, amd64-k10, amd64-bulldozer, amd64-piledriver, amd64-steamroller or amd64-jaguar. See Subarches for help figuring out what AMD subarch is best for you.

If you are using an Intel-based CPU, download a stage3 from generic_64, atom_64, core2_64 or corei7. Note that corei7 is ideal for any modern Intel processor, including Core i3 and Core i5, and many Xeons.

If you are using a 32-bit CPU, download a stage3 from generic_32, i686, core2_32, atom_32 or athlon-xp.

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. However, if you system time is relatively close to correct, you can probably skip this step for now.

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

Once you have set the system clock, it's a very good idea to copy the time to the hardware clock, so it persists across reboots:

# hwclock --systohc

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 installing 32-bit systems: 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.