The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
Difference between revisions of "F2FS Install Guide"
(Starting to format the mess I wrote) |
|||
(33 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{Important|Carlos, I recommend removing most of these old docs and just document the differences to the official install docs. --Daniel}} | |||
<div class="container"><div class="row"><div class="col-sm-12 col-md-9"> | <div class="container"><div class="row"><div class="col-sm-12 col-md-9"> | ||
== Introduction == | == Introduction == | ||
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. | 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. | ||
Installing on F2FS isn't terribly different from installing on XFS or EXT4 | Installing on F2FS isn't terribly different from installing on XFS or EXT4, but there are enough factors that warrant a guide of its own. | ||
=== 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 | 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 [https://www.system-rescue.org/ System Rescue] as it contains lots of tools and utilities and supports F2FS and BTRFS. | |||
To learn how to install SystemRescueCd on a USB-stick, [https://www.system-rescue.org/Installing-SystemRescue-on-a-USB-memory-stick/ click here]. | |||
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, boot your preferred live media & start a commandline session. | To begin a Funtoo Linux installation, boot your preferred live media & start a commandline session. | ||
===Starting an SSH session=== | |||
This is only required if you wish to perform the installation process on a remote computer, not at the console of the machine you're installing funtoo on: | |||
<console> | |||
systemctl stop iptables | |||
passwd | |||
ip a | |||
</console> | |||
SSH is a default daemon in SystemRescue, but if you don't want to make iptables rule, it's better to stop the service, asks for a root password, and it then displays the IP address. | |||
===Partitioning=== | |||
<console> | |||
cfdisk /dev/sda | |||
</console> | |||
Your partition layout should be similar to this: | |||
{{TableStart}} | |||
<tr class="active"><th>Partition</th> | |||
<th>Size</th> | |||
<th>MBR Block Device (<code>fdisk</code>)</th> | |||
<th>MBR Code</th> | |||
</tr><tr> | |||
<td><code>/boot</code></td> | |||
<td>512 MB</td> | |||
<td><code>/dev/sda1</code></td> | |||
<td>83</td> | |||
</tr><tr> | |||
<td>swap</td> | |||
<td>1.5 to 2x RAM for low-memory systems and production servers; otherwise 2GB.</td> | |||
<td><code>/dev/sda2</code></td> | |||
<td>82</td> | |||
</tr><tr> | |||
<td><code>/</code> (root)</td> | |||
<td>minimum of 10GB. Note: to compile the <code>debian-sources</code> kernel, 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>83</td> | |||
</tr> | |||
</tr>{{TableEnd}} | |||
For a step by step how to format the disk see: | |||
* Legacy (BIOS/MBR) Method: [[Install/MBR_Partitioning]] | |||
* UEFI/GPT Method: [[Install/GPT_Partitioning]] | |||
==Formatting== | |||
<console> | |||
mkfs.vfat -F 32 /dev/sda1 | |||
mkswap /dev/sda2 | |||
swapon /dev/sda2 | |||
mkfs.f2fs -l root -O extra_attr,inode_checksum,sb_checksum /dev/sda3 | |||
</console> | |||
===Mounting the new system=== | |||
<console> | |||
mkdir /mnt/funtoo | |||
mount -t f2fs /dev/sda3 /mnt/funtoo | |||
mkdir /mnt/funtoo/boot | |||
mount /dev/sda1 /mnt/funtoo/boot | |||
</console> | |||
===Downloading the system=== | |||
<console> | |||
cd /mnt/funtoo/ | |||
elinks build.funtoo.org | |||
</console> | |||
Navigate to your build, arch, and subarch and save stage3. | |||
==Installing stage3== | |||
<console> | |||
cd /mnt/funtoo | |||
tar --numeric-owner --xattrs --xattrs-include='*' -xpf stage3-latest.tar.xz | |||
rm -f stage3-latest.tar.xz | |||
</console> | |||
See more [[Install/Download_and_Extract_Stage3]] | |||
===chrooting into the new system=== | |||
<console> | |||
mount -t proc none /mnt/funtoo/proc | |||
mount --rbind /dev /mnt/funtoo/dev | |||
mount --rbind /sys /mnt/funtoo/sys | |||
env -i HOME=/root TERM=$TERM $(which chroot) /mnt/funtoo bash -l | |||
</console> | |||
=== Setting the root password === | |||
<console> | |||
(chroot) # ##i## passwd | |||
</console> | |||
=== Configuring DNS === | |||
<console> | |||
(chroot) # ##i## echo "nameserver 1.1.1.1" > /etc/resolv.conf | |||
</console> | |||
=== Downloading the Portage tree === | |||
<console> | |||
(chroot) # ##i## ego sync | |||
</console> | |||
See more [[Install/Download_Portage_Tree]] | |||
=== Configuring your system === | |||
For a better understanding of configuration files see [[Install/Configuration_Files]] | |||
==== /etc/fstab ==== | |||
<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> | |||
(chroot) # ##i## nano -w /etc/fstab | |||
</console> | |||
<pre> | |||
# <device> <dir> <type> <options> <dump> <fsck> | |||
/dev/sda1 /boot vfat defaults 0 2 | |||
/dev/sda2 none swap sw 0 0 | |||
/dev/sda3 / f2fs defaults,rw 0 0 | |||
#/dev/cdrom /mnt/cdrom auto noauto,ro 0 0 | |||
</pre> | |||
{{fancynote|1=When using f2fs as rootfs fsck fails on boot. Solutions are either disabling fsck in /etc/fstab (setting the last number to 0). See bug #671786. | |||
[https://bugs.gentoo.org/show_bug.cgi?id=671786].}} | |||
==== Setting the Date and localtime file ==== | |||
<console> | |||
(chroot) # ##i## # date --set=mm/dd/yy | |||
(chroot) # ##i## date --set=12/12/2021 | |||
(chroot) # ##i## # date --set=hh:mm:ss | |||
(chroot) # ##i## date -s 00:05:00 | |||
</console> | |||
<code>/etc/localtime</code> is used to specify the timezone that your machine is in, and defaults to UTC. | |||
<console> | |||
(chroot) # ##i## ln -sf /usr/share/zoneinfo/$(tzselect) /etc/localtime | |||
</console> | |||
See more [[Install/Setting_the_Date]] | |||
==== /etc/portage/make.conf ==== | |||
Setting: | |||
* MAKEOPTS="-j<nproc>/2" | |||
* EMERGE_DEFAULT_OPTS to have "--jobs <nproc> --load-average <nproc+1>" | |||
* LINGUAS and L10N variable, see [https://www.gentoo.org/support/news-items/2016-06-23-l10n-use_expand.html L10N USE_EXPAND variable replacing LINGUAS] | |||
<console> | |||
(chroot) # ##i## nproc | |||
4 | |||
</console> | |||
So your <code>make.conf</code> file will look like: | |||
<pre> | |||
cat > /etc/portage/make.conf <<'EOF' | |||
MAKEOPTS="-j2" | |||
EMERGE_DEFAULT_OPTS="--jobs 4 --load-average 5" | |||
LINGUAS="en en_US en_GB pt pt_BR" | |||
L10N="pt-BR en en-US" | |||
ACCEPT_LICENSE="*" | |||
EOF | |||
</pre> | |||
==== /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. | |||
<console> | |||
(chroot) # ##i## nano -w /etc/conf.d/hwclock | |||
</console> | |||
==== 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]]. | |||
=== Portage Sync === | |||
<console> | |||
(chroot) # ##i## ego sync | |||
(chroot) # ##i## emerge -auDN @world | |||
</console> | |||
Advanced users may be interested in the [[Emerge]] wiki page. | |||
=== 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. | |||
==== 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.}} | |||
<console> | |||
(chroot) # ##i## echo "sys-kernel/linux-firmware initramfs" >> /etc/portage/package.use | |||
(chroot) # ##i## emerge -av sys-kernel/debian-sources sys-kernel/genkernel sys-fs/f2fs-tools sys-kernel/linux-firmware | |||
(chroot) # ##i## emerge -av gentoolkit intel-microcode iucode_tool | |||
</console> | |||
Go to <code>/usr/src/linux</code> and let's use genkernel: | |||
<console> | |||
(chroot) # ##i## cd /usr/src/linux | |||
(chroot) # ##i## genkernel --menuconfig --no-clean --disklabel --fullname=$(uname -r) all | |||
</console> | |||
See more about genkernel at [https://wiki.gentoo.org/wiki/Genkernel Gentoo Genkernel] | |||
F2FS is not included by default; we must specify that we need it | |||
{{kernelop|title=foo,bar|desc= | |||
Filesystems-->Miscellaneous-->F2FS | |||
> File systems ────────────────────────────────────────────────────────────────────────────── | |||
<*> F2FS filesystem support │ │ | |||
│ │[*] F2FS Status Information │ │ | |||
│ │-*- F2FS extended attributes │ │ | |||
│ │[*] F2FS Access Control Lists │ │ | |||
│ │[*] F2FS Security Labels │ │ | |||
│ │[ ] F2FS consistency checking feature │ │ | |||
│ │[ ] F2FS fault injection facility │ │ | |||
│ │[*] F2FS compression feature │ │ | |||
│ │[*] LZO compression support │ │ | |||
│ │[*] LZO-RLE compression support │ │ | |||
│ │[*] LZ4 compression support │ │ | |||
│ │[*] LZ4HC compression support │ │ | |||
│ │[*] ZSTD compression support │ │ | |||
│ │[*] F2FS IO statistics information │ │ | |||
}} | |||
=== 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>sys-boot/grub</code>. This will also cause <code>grub-2</code> to be merged, since it is a dependency of <code>ego 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 -av sys-boot/grub | |||
(chroot) # ##i## nano -w /etc/boot.conf | |||
</console> | |||
Then, edit <code>/etc/boot.conf</code> should now look like this: | |||
<pre> | |||
boot { | |||
generate grub | |||
default "Funtoo Linux" | |||
timeout 3 | |||
} | |||
"Funtoo Linux" { | |||
kernel kernel[-v] | |||
initrd initramfs[-v] | |||
params += real_root=/dev/sda3 rootfstype=f2fs | |||
} | |||
"Funtoo Linux (nomodeset)" { | |||
kernel kernel[-v] | |||
initrd initramfs[-v] | |||
params += real_root=/dev/sda3 rootfstype=f2fs nomodeset | |||
} | |||
</pre> | |||
Please read <code>man boot.conf</code> for further details. | |||
===== Rootwait ===== | |||
If you are using a root partition on an <code>nvme</code> device, add the <code>rootwait</code> kernel parameter to force the kernel to wait for it to asynchronously initialize or the kernel will panic on some hardware. | |||
===== Running grub-install (UEFI) ===== | |||
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: | |||
For x86-64bit systems: | |||
<console> | |||
(chroot) # ##i## mount -o remount,rw /sys/firmware/efi/efivars | |||
(chroot) # ##i## grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda | |||
(chroot) # ##i## ego boot update | |||
</console> | |||
For x86-32bit systems: | |||
<console> | |||
(chroot) # ##i## mount -o remount,rw /sys/firmware/efi/efivars | |||
(chroot) # ##i## grub-install --target=i386-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda | |||
(chroot) # ##i## ego boot update | |||
</console> | |||
OK -- you are almost ready to boot! | |||
=== Troubleshooting === | |||
Sometimes problems can occur and the boot doesn't work. | |||
Start with your favorite liveCD. | |||
Let's go now chroot mount again. For this do: | |||
<console> | |||
mkdir /mnt/funtoo | |||
mount -t f2fs /dev/sda3 /mnt/funtoo | |||
mount /dev/sda1 /mnt/funtoo/boot | |||
mount /dev/sda4 /mnt/funtoo/home | |||
mount -t proc none /mnt/funtoo/proc | |||
mount --rbind /dev /mnt/funtoo/dev | |||
mount --rbind /sys /mnt/funtoo/sys | |||
env -i HOME=/root TERM=$TERM $(which chroot) /mnt/funtoo bash -l | |||
</console> | |||
If things get tough, get in touch with the Funtoo community. See [[Getting_Help]] | |||
=== 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. | |||
===== A simple entropy daemon ===== | |||
The haveged project is an attempt to provide an easy-to-use, unpredictable random number generator based upon an adaptation of the HAVEGE algorithm. See more at [http://www.issihosts.com/haveged/ Haveged official documentation]. | |||
<console> | |||
(chroot) # ##i## emerge -av sys-apps/haveged | |||
(chroot) # ##i## rc-update add haveged default | |||
</console> | |||
==== Network ==== | |||
===== 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: | |||
<console> | |||
(chroot) # ##i## emerge -av net-misc/networkmanager | |||
(chroot) # ##i## rc-update add NetworkManager default | |||
</console> | |||
==== 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 <code>dhcpcd</code> to the default runlevel: | |||
<console> | |||
(chroot) # ##i## emerge -av net-misc/dhcpcd | |||
(chroot) # ##i## rc-update add dhcpcd default | |||
</console> | |||
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) ==== | |||
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. | |||
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. | |||
==== Wi-Fi ==== | |||
After you reboot into Funtoo Linux, you will be able to add a Wi-Fi connection this way: | |||
{{console|body= | |||
# ##i## nmtui | |||
}} | |||
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> | <console> | ||
(chroot) # ##i## emerge -a wpa_supplicant | |||
</console> | </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> | <console> | ||
(chroot) # ##i## rc-update add wpa_supplicant default | |||
</console> | </console> | ||
=== | === Finishing Steps === | ||
==== Set your root password ==== | |||
It's imperative that you set your root password before rebooting so that you can log in. | |||
<console> | <console> | ||
passwd | |||
</console> | </console> | ||
===Next Steps=== | ===Next Steps=== | ||
Latest revision as of 16:14, December 20, 2021
Carlos, I recommend removing most of these old docs and just document the differences to the official install docs. --Daniel
Introduction
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.
Installing on F2FS isn't terribly different from installing on XFS or EXT4, but there are enough factors that warrant a guide of its own.
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 System Rescue as it contains lots of tools and utilities and supports F2FS and BTRFS.
To learn how to install SystemRescueCd on a USB-stick, click here.
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, boot your preferred live media & start a commandline session.
Starting an SSH session
This is only required if you wish to perform the installation process on a remote computer, not at the console of the machine you're installing funtoo on:
systemctl stop iptables passwd ip a
SSH is a default daemon in SystemRescue, but if you don't want to make iptables rule, it's better to stop the service, asks for a root password, and it then displays the IP address.
Partitioning
cfdisk /dev/sda
Your partition layout should be similar to this:
Partition | Size | MBR Block Device (fdisk ) |
MBR Code |
---|---|---|---|
/boot |
512 MB | /dev/sda1 |
83 |
swap | 1.5 to 2x RAM for low-memory systems and production servers; otherwise 2GB. | /dev/sda2 |
82 |
/ (root) |
minimum of 10GB. Note: to compile the debian-sources kernel, requires a minimum of 14GB free space in /tmp ; consider a minimum of 20GB in this case. |
/dev/sda3 |
83 |
For a step by step how to format the disk see:
- Legacy (BIOS/MBR) Method: Install/MBR_Partitioning
- UEFI/GPT Method: Install/GPT_Partitioning
Formatting
mkfs.vfat -F 32 /dev/sda1 mkswap /dev/sda2 swapon /dev/sda2 mkfs.f2fs -l root -O extra_attr,inode_checksum,sb_checksum /dev/sda3
Mounting the new system
mkdir /mnt/funtoo mount -t f2fs /dev/sda3 /mnt/funtoo mkdir /mnt/funtoo/boot mount /dev/sda1 /mnt/funtoo/boot
Downloading the system
cd /mnt/funtoo/ elinks build.funtoo.org
Navigate to your build, arch, and subarch and save stage3.
Installing stage3
cd /mnt/funtoo tar --numeric-owner --xattrs --xattrs-include='*' -xpf stage3-latest.tar.xz rm -f stage3-latest.tar.xz
See more Install/Download_and_Extract_Stage3
chrooting into the new system
mount -t proc none /mnt/funtoo/proc mount --rbind /dev /mnt/funtoo/dev mount --rbind /sys /mnt/funtoo/sys env -i HOME=/root TERM=$TERM $(which chroot) /mnt/funtoo bash -l
Setting the root password
(chroot) # passwd
Configuring DNS
(chroot) # echo "nameserver 1.1.1.1" > /etc/resolv.conf
Downloading the Portage tree
(chroot) # ego sync
See more Install/Download_Portage_Tree
Configuring your system
For a better understanding of configuration files see Install/Configuration_Files
/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
# <device> <dir> <type> <options> <dump> <fsck> /dev/sda1 /boot vfat defaults 0 2 /dev/sda2 none swap sw 0 0 /dev/sda3 / f2fs defaults,rw 0 0 #/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
When using f2fs as rootfs fsck fails on boot. Solutions are either disabling fsck in /etc/fstab (setting the last number to 0). See bug #671786. [1].
Setting the Date and localtime file
(chroot) # # date --set=mm/dd/yy (chroot) # date --set=12/12/2021 (chroot) # # date --set=hh:mm:ss (chroot) # date -s 00:05:00
/etc/localtime
is used to specify the timezone that your machine is in, and defaults to UTC.
(chroot) # ln -sf /usr/share/zoneinfo/$(tzselect) /etc/localtime
See more Install/Setting_the_Date
/etc/portage/make.conf
Setting:
- MAKEOPTS="-j<nproc>/2"
- EMERGE_DEFAULT_OPTS to have "--jobs <nproc> --load-average <nproc+1>"
- LINGUAS and L10N variable, see L10N USE_EXPAND variable replacing LINGUAS
(chroot) # nproc
4
So your make.conf
file will look like:
cat > /etc/portage/make.conf <<'EOF' MAKEOPTS="-j2" EMERGE_DEFAULT_OPTS="--jobs 4 --load-average 5" LINGUAS="en en_US en_GB pt pt_BR" L10N="pt-BR en en-US" ACCEPT_LICENSE="*" EOF
/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.
Portage Sync
(chroot) # ego sync (chroot) # emerge -auDN @world
Advanced users may be interested in the Emerge wiki page.
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.
Building the Kernel
See Funtoo Linux Kernels for a full list of kernels supported in Funtoo Linux. We recommend debian-sources
for new users.
(chroot) # echo "sys-kernel/linux-firmware initramfs" >> /etc/portage/package.use (chroot) # emerge -av sys-kernel/debian-sources sys-kernel/genkernel sys-fs/f2fs-tools sys-kernel/linux-firmware (chroot) # emerge -av gentoolkit intel-microcode iucode_tool
Go to /usr/src/linux
and let's use genkernel:
(chroot) # cd /usr/src/linux (chroot) # genkernel --menuconfig --no-clean --disklabel --fullname=$(uname -r) all
See more about genkernel at Gentoo Genkernel
F2FS is not included by default; we must specify that we need it
Under foo-->bar:
Filesystems-->Miscellaneous-->F2FS > File systems ────────────────────────────────────────────────────────────────────────────── <*> F2FS filesystem support │ │ │ │[*] F2FS Status Information │ │ │ │-*- F2FS extended attributes │ │ │ │[*] F2FS Access Control Lists │ │ │ │[*] F2FS Security Labels │ │ │ │[ ] F2FS consistency checking feature │ │ │ │[ ] F2FS fault injection facility │ │ │ │[*] F2FS compression feature │ │ │ │[*] LZO compression support │ │ │ │[*] LZO-RLE compression support │ │ │ │[*] LZ4 compression support │ │ │ │[*] LZ4HC compression support │ │ │ │[*] ZSTD compression support │ │ │ │[*] F2FS IO statistics information │ │
Installing a Bootloader
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 sys-boot/grub
. This will also cause grub-2
to be merged, since it is a dependency of ego boot update
. (You may need to adjust GRUB_PLATFORMS
if you are on a UEFI system. See UEFI Install Guide).
(chroot) # emerge -av sys-boot/grub (chroot) # nano -w /etc/boot.conf
Then, edit /etc/boot.conf
should now look like this:
boot { generate grub default "Funtoo Linux" timeout 3 } "Funtoo Linux" { kernel kernel[-v] initrd initramfs[-v] params += real_root=/dev/sda3 rootfstype=f2fs } "Funtoo Linux (nomodeset)" { kernel kernel[-v] initrd initramfs[-v] params += real_root=/dev/sda3 rootfstype=f2fs nomodeset }
Please read man boot.conf
for further details.
Rootwait
If you are using a root partition on an nvme
device, add the rootwait
kernel parameter to force the kernel to wait for it to asynchronously initialize or the kernel will panic on some hardware.
Running grub-install (UEFI)
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:
For x86-64bit systems:
(chroot) # mount -o remount,rw /sys/firmware/efi/efivars (chroot) # grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda (chroot) # ego boot update
For x86-32bit systems:
(chroot) # mount -o remount,rw /sys/firmware/efi/efivars (chroot) # grub-install --target=i386-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda (chroot) # ego boot update
OK -- you are almost ready to boot!
Troubleshooting
Sometimes problems can occur and the boot doesn't work.
Start with your favorite liveCD.
Let's go now chroot mount again. For this do:
mkdir /mnt/funtoo mount -t f2fs /dev/sda3 /mnt/funtoo mount /dev/sda1 /mnt/funtoo/boot mount /dev/sda4 /mnt/funtoo/home mount -t proc none /mnt/funtoo/proc mount --rbind /dev /mnt/funtoo/dev mount --rbind /sys /mnt/funtoo/sys env -i HOME=/root TERM=$TERM $(which chroot) /mnt/funtoo bash -l
If things get tough, get in touch with the Funtoo community. See Getting_Help
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.
A simple entropy daemon
The haveged project is an attempt to provide an easy-to-use, unpredictable random number generator based upon an adaptation of the HAVEGE algorithm. See more at Haveged official documentation.
(chroot) # emerge -av sys-apps/haveged (chroot) # rc-update add haveged default
Network
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 -av net-misc/networkmanager (chroot) # rc-update add NetworkManager 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) # emerge -av net-misc/dhcpcd (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.
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.
Wi-Fi
After you reboot into Funtoo Linux, you will be able to add a Wi-Fi connection this way:
root # nmtui
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 wpa_supplicant default
Finishing Steps
Set your root password
It's imperative that you set your root password before rebooting so that you can log in.
passwd
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.
{{#ask: | format=ul }}
If your system did not boot correctly, see Installation Troubleshooting for steps you can take to resolve the problem.