Difference between pages "Subarches" and "Install/Partitioning"

(Difference between pages)
(Funtoo Linux Sub-Architectures: removed gcc man page text)
 
(Prepare Hard Disk)
 
Line 1: Line 1:
{{:Install/Header}}
+
<noinclude>
= Funtoo Linux Sub-Architectures =
+
{{InstallPart|the process of partitioning and filesystem creation}}
__NOTITLE__
+
</noinclude>
This page provides an overview of Funtoo Linux sub-architectures (also called ''subarches'',) designed for quick and easy reference. While this information is available in other places, such as Wikipedia, it often takes some time to study and cross-reference the various articles to get a good understanding of each type of sub-architecture, and this information generally isn't all collected neatly in one place. That is the purpose of this page. When possible, links to more detailed Wikipedia pages are provided. You are encouraged to help maintain this page as well as the Wikipedia articles referenced here.
+
=== Prepare Hard Disk ===
  
== 64-bit Suport (Generic) ==
+
==== Introduction ====
  
=== generic_64 ===
+
In earlier times, there was only one way to boot a PC-compatible computer. All of our desktops and servers had a standard BIOS, all our hard drives used Master Boot Records, and were partitioned using the MBR partition scheme. And we liked it that way!
<console>
+
CFLAGS: -mtune=generic -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2
+
</console>
+
  
The '''generic_64''' subarch is designed to support 64-bit PC-compatible CPUs, such as the [[Wikipedia:AMD_K8|AMD K8-series processors]], which were introduced in late 2003. They were notable as the first processors that supported the [[Wikipedia:X86-64|AMD64 (also called X86-64) 64-bit instruction set]] for PC-compatible systems, which was introduced as a backwards-compatible 64-bit alternative to Intel's IA-64 architecture. Intel followed suit and also began supporting this 64-bit instruction set, which they called "[[Wikipedia:X86-64#Intel_64|Intel 64]]", by releasing X86-64 64-bit compatible CPUs from mid-2004 onwards (See [[Wikipedia:X86-64#Intel_64_implementations|Intel 64 implementations]].)
+
Then, along came EFI and UEFI, which are new-style firmware designed to boot systems, along with GPT partition tables to support disks larger than 2.2TB. All of the sudden, we had a variety of options to boot Linux systems, turning what once was a one-method-fits-all approach into something a lot more complex.
  
AMD desktop 64-bit CPUs include the Athlon 64, Athlon 64 FX, Athlon 64 X2, Athlon X2, Turion 64, Turion 64 X2 and Sempron series processors. AMD server processors were released under the Opteron brand and have codenames SledgeHammer, Venus, Troy, Athens, Denmark, Italy, Egypt, Santa Ana and Santa Rosa. All Opterons released through late 2006 were based on the K8 microarchitecture with original X86-64 instructions.
+
Let's take a moment to review the boot options available to you. This Install Guide uses, and recommends, the old-school method of BIOS booting and using an MBR. It works. There's nothing wrong with it. If your system disk is 2TB or smaller in size, it won't prevent you from using all of your disk's capacity, either.
  
== 64-bit AMD Processors ==
+
But, there are some situations where the old-school method isn't optimal. If you have a system disk >2TB in size, then MBR partitions won't allow you to access all your storage. So that's one reason. Another reason is that there are some so-called "PC" systems out there that don't support BIOS booting anymore, and force you to use UEFI to boot.
  
=== amd64-k10 ===
+
Our recommendation is still to go old-school unless you have reason not to. We call this method the '''BIOS + GRUB (MBR)''' method. It's the traditional method of setting up a PC-compatible system to boot Linux.
<console>
+
CFLAGS: -march=amdfam10 -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 3dnow 3dnowext
+
</console>
+
  
The '''amd64-k10''' subarch provides support for the [[Wikipedia:AMD_10h|AMD Family 10h processors]], which were released in late 2007 as a successor to the AMD K8 series processors.
+
If you need to use UEFI to boot, we are supporting two options. One still uses the BIOS to boot, but with GPT partition tables to support system disks >2.2TB in size. We refer to this method as the '''BIOS + GRUB (GPT)''' method.
  
Desktop amd64-k10 CPUs include [[Wikipedia:AMD Phenom|AMD Phenom]], [[Wikipedia:AMD_10h#Phenom_II_Models|AMD Phenom II]] and [[Wikipedia:AMD_10h#Athlon_II_Models|AMD Athlon II]]. Server CPUs include Opterons with codenames Budapest, Barcelona, Suzuka, Shanghai, Istanbul, Lisbon, and Magny-Cours. A full listing of amd64-k10 Opteron models [[Wikipedia:List_of_AMD_Opteron_microprocessors#K10_based_Opterons|can be found here]].
+
There is also another method, which avoids using the BIOS for booting at all. Instead, it uses UEFI, with GPT. We call this the '''UEFI + GRUB (GPT)''' method.
  
=== amd64-bulldozer ===
+
==== Partitions ====
<console>
+
CFLAGS: -march=bdver1 -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
</console>
+
  
The '''amd64-bulldozer''' subarch supports the [[Wikipedia:Bulldozer (microarchitecture)|AMD bulldozer microarchitecture]] CPUs, which were released from late 2011 through the first quarter of 2012 as a replacement for the [[Wikipedia:AMD_10h|K10 microarchitecture]] CPUs.
+
Funtoo Linux fully supports traditional MBR partitions, as well as newer GPT/GUID partition formats. See below to determine which partitioning scheme to use:
Bulldozer desktop CPUs use the [[Wikipedia:Socket_AM3+|AM3+ socket]] and server CPUs use the  [[Wikipedia:Socket_G34|G34 socket]].
+
  
Desktop bulldozer CPUs include the [[Wikipedia:List_of_AMD_FX_microprocessors#.22Zambezi.22_.2832_nm_SOI.29|Zambezi FX-series CPUs]]. Server bulldozer CPUs include Opterons with codenames Zurich (Opteron 3200-series), Valencia (Opteron 4200-series) and Interlagos (Opteron 6200 series). A complete list of Opteron models [[Wikipedia:http://en.wikipedia.org/wiki/Opteron#Opteron_.2832_nm_SOI.29-_First_Generation_Bulldozer_Microarchitecture|can be found here.]].
+
===== MBR Partitions =====
  
=== amd64-piledriver ===
+
* '''Recommended if your system disk is <=2TB in size'''
<console>
+
* Legacy, DOS partitioning scheme
CFLAGS: -march=bdver2 -O2 -pipe
+
* Only 4 primary partitions per disk; after that, you must use "logical" partitions
CHOST: x86_64-pc-linux-gnu
+
* Does not support 2 TB+ disks for booting
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
* Compatible with certain problematic systems (such as the HP ProBook 4520)
</console>
+
* 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
  
The '''amd64-piledriver''' subarch supports the [[Wikipedia:Piledriver (microarchitecture)|AMD Piledriver microarchitecture]] produced by AMD from mid-2012 through 2015, which is the successor to the [[Wikipedia:Bulldozer (microarchitecture)|AMD bulldozer microarchitecture]].
+
{{fancynote|Due to the fact that it is more widely supported on PC hardware, it is best to use MBR partitions if possible.}}
Piledriver CPUs and APUs are available that use the [[Wikipedia:FM2 Socket|FM2 socket]]. Desktop Piledriver CPUs use the [[Wikipedia:Socket_AM3+|AM3+ socket]]. Server Piledriver CPUs use a variety of sockets, including [[Wikipedia:Socket_AM3+|AM3+]], [[Wikipedia:Socket_C32|C32]] and [[Wikipedia:Socket_G34|G34]].
+
  
Desktop piledriver CPU and APUs include FX-series with codename Vishera (FX-8350, FX-8370),  [[Wikipedia:List_of_AMD_accelerated_processing_unit_microprocessors#Virgo:_.22Trinity.22_.282012.2C_32_nm.29|A-series with codename Trinity]] (A6-5400K, A10-5800K) and [[Wikipedia:http://en.wikipedia.org/wiki/List_of_AMD_accelerated_processing_unit_microprocessors#.22Richland.22_.282013.2C_32_nm.29_2|A-series with codename Richland]].
+
===== GPT Partitions =====
  
Server piledriver CPUs include Opterons with codenames Delhi (Opteron 3300-series, [[Wikipedia:Socket_AM3+|AM3+]]), Seoul (Opteron 4300-series, [[Wikipedia:Socket_C32|C32]])  and Abu Dhabi (Opteron 6300-series, [[Wikipedia:Socket_G34|G34]]). A full listing of Opteron models [[Wikipedia:Opteron#Opteron_.2832_nm_SOI.29_-_Piledriver_Microarchitecture|is available here]].
+
* '''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
  
Piledriver adds several new instructions over bulldozer, so AMD bulldozer systems cannot run amd64-piledriver-optimized stages. However, this subarch is instruction-compatible with its successor, the, so amd64-piledriver stages can run on amd64-steamroller systems, and vice versa.
+
{{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.}}
  
=== amd64-steamroller ===
+
===== Filesystem Resources =====
<console>
+
CFLAGS: -march=bdver3 -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
</console>
+
  
The '''amd64-steamroller''' subarch supports the [[Wikipedia:Steamroller (microarchitecture)|AMD steamroller microarchitecture]], produced from early 2014. It is the successor to the [[Wikipedia:Piledriver (microarchitecture)|AMD Piledriver microarchitecture]].
+
Advanced users may be interested in the following topics:
Steamroller APUs are available that use the [[Wikipedia:FM2+ Socket|FM2+ socket]] and  [[Wikipedia:Socket_FP3|FP3 socket]] (mobile.)
+
  
Desktop steamroller APUs include the [[Wikipedia:AMD_Accelerated_Processing_Unit#Steamroller_architecture_.282014.29:_Kaveri|A-Series with codename Kaveri]], such as the quad-core AMD A10-7850K APU. Steamroller APUs are also available in mobile versions. Server steamroller APUs will include the Berlin APUs, which are expected to be released some time in 2015.
+
* [[GUID Booting Guide]]
 +
* [[LVM Install Guide]]
 +
* [[Rootfs over encrypted lvm]]
 +
* [[Rootfs over encrypted lvm over raid-1 on GPT]]
 +
* '''NEW!''' '''[[ZFS Install Guide]] (Also contains instructions for Rootfs over Encrypted ZFS!)'''
  
Amd64-steamroller subarches are instruction-compatible with amd64-piledriver, but add new instructions over amd64-bulldozer.
+
===== Partitioning Recommendations =====
  
=== amd64-jaguar ===
+
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>
+
CFLAGS: -march=btver2 -O2 -pipe
+
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3 sse4 3dnow 3dnowext
+
</console>
+
  
The '''amd64-jaguar''' (also called AMD Family 16h) subarch supports the  [[Wikipedia:Jaguar (microarchitecture)|AMD jaguar microarchitecture]], which is targeted at low-power devices, including notebooks, tablets and small form-factor desktops and servers. It is perhaps most well-known for being the microarchitecture used for the [[Wikipedia:Playstation 4|Playstation 4]] and [[Wikipedia:Xbox One|Xbox One]], which each use custom 8-core Jaguar APUs.
+
{{TableStart}}
Socketed Jaguar APUs use the [[Wikipedia:AM1 Socket|AM1 socket]], and  [[Wikipedia:Socket_FT3|FT3 socket]] for mobile devices. G-series [[Wikipedia:System_on_a_chip|"system on a chip" (SoC)]] APUs are available for non-socketed devices such as tablets and embedded system boards.
+
<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}}
  
Desktop Jaguar APUs include the [[Wikipedia:List_of_AMD_accelerated_processing_unit_microprocessors#.22Kabini.22.2C_.22Temash.22_.282013.2C_28_nm.29|Kabini A-series APUs and Temash E-series APUs]], such as the Athlon 5150 and 5350 APUs, and Sempron 2650 and 3850.
+
===== Partitioning Using fdisk (MBR) =====
  
Amd64-jaguar subarches use the MOVBE instruction which is not available on amd64-bulldozer, amd64-piledriver or amd64-steamroller. They are thus not instruction-compatible with any of these subarches.
+
{{fancyimportant|If you need to create a GPT partition table, see [[Partitioning using gdisk]] or [[Partitioning using parted]].}}
  
== 64-bit Intel Processors ==
+
{{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.}}
 +
 
 +
<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.
 +
 
 +
====== 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 <code>/dev/sda</code> is the disk that you want to partition:
  
=== corei7 ===
 
 
<console>
 
<console>
CFLAGS: -march=corei7 -O2 -pipe
+
# ##i##fdisk -l /dev/sda
CHOST: x86_64-pc-linux-gnu
+
 
USE: mmx sse sse2 sse3 ssse3 sse4
+
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>
 
</console>
  
Introduced November of 2008, the '''corei7''' subarch supports the [[Wikipedia:Nehalem_(microarchitecture)|Nehalem]], [[Wikipedia:Sandy_Bridge_(microarchitecture)|Sandy Bridge]], [[Wikipedia:Ivy_Bridge_(microarchitecture)|Ivy Bridge]], and [[Wikipedia:Haswell_(microarchitecture)|Haswell]] microarchitectures.
+
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.}}
  
=== core2_64 ===
 
 
<console>
 
<console>
CFLAGS: -march=core2 -O2 -pipe
+
# ##i##sgdisk --zap-all /dev/sda
CHOST: x86_64-pc-linux-gnu
+
 
USE: mmx sse sse2 sse3 ssse3
+
Creating new GPT entries.
 +
GPT data structures destroyed! You may now partition the disk using fdisk or
 +
other utilities.
 
</console>
 
</console>
  
The '''core2_64''' subarch supports 64-bit-capable [[Wikipedia:Intel_Core_2|Intel Core 2 Processors]], which includes ''some'' processors of the [[Wikipedia:Intel Core (microarchitecture)|Core]] and all processors of the [[Wikipedia:Penryn_(microarchitecture)|Penryn]] microarchitecture. All "Core 2" branded processors are 64-bit-capable. These processors were introduced in July of 2006 and were phased out in July of 2011, in favor of  [[Wikipedia:Nehalem_(microarchitecture)|Nehalem-based]] processors.
+
This output is also nothing to worry about, as the command still succeded:
  
For a full list of 64-bit capable Core 2 processors, [http://ark.intel.com/search/advanced?s=t&FamilyText=Legacy%20Intel%C2%AE%20Core%E2%84%A22%20Processor&InstructionSet=64-bit see this link].
+
<console>
 +
***************************************************************
 +
Found invalid GPT and valid MBR; converting MBR to GPT format
 +
in memory.  
 +
***************************************************************
 +
</console>
  
The 64-bit capable ''Core 2''-branded CPUs include: "Conroe"/"Allendale" (dual-core for desktops), "Merom" (dual-core for laptops), "Merom-L" (single-core for laptops), "Kentsfield" (quad-core for desktops), and the updated variants named "Wolfdale" (dual-core for desktops), "Penryn" (dual-core for laptops),  and "Yorkfield" (quad-core for desktops). (Note: ''For the server and workstation "Woodcrest", "Tigerton", "Harpertown" and "Dunnington" CPUs see the [[Wikipedia:Xeon|Xeon]] brand''.)
+
====== Partitioning ======
 +
 
 +
Now we will use <code>fdisk</code> to create the MBR partition table and partitions:
  
=== atom_64 ===
 
 
<console>
 
<console>
CFLAGS: -O2 -fomit-frame-pointer -march=atom -pipe -mno-movbe
+
# ##i##fdisk /dev/sda
CHOST: x86_64-pc-linux-gnu
+
USE: mmx sse sse2 sse3
+
 
</console>
 
</console>
  
The Intel Atom Processor is the common name for Intel's  [[Wikipedia:Bonnell_(microarchitecture)|Bonnell microarchitecture]], which represents a partial revival of the principles used in earlier Intel designs such as P5 and the i486, with the sole purpose of enhancing the performance per watt ratio.  Successor to the [[Wikipedia:Stealey_(microprocessor)|Intel A100 series (Stealey)]], which was derived from the [[Wikipedia:Pentium_M|Pentium M]], the Intel Atom has been produced since 2008. Targeted at low-power devices, Atom processors can be found in a wide range of notebooks, tablets and small form-factor desktops and servers.
+
Within <code>fdisk</code>, follow these steps:
 
+
The '''atom_64''' sub-architecture supports 64-bit capable Intel Atom CPUs.  The first 64-bit capable Intel Atom CPUs were the Intel Atom 230 and 330, released in late 2008. However, Intel also continued to produce new 32-bit Atom Processors after this date. For example, the Atom N2xx series Atom Diamondville models cannot support 64-bit operation, while the 2xx and 3xx Diamondville, Pineview, Cedarview and Centerton can. A full list of 64-bit capable Intel Atom Processors [http://ark.intel.com/search/advanced?s=t&FamilyText=Intel%C2%AE%20Atom%E2%84%A2%20Processor&InstructionSet=64-bit can be seen here.]
+
  
{{Important|For 64-bit support to be functional, a 64-bit capable Atom Processor must be paired ''with a processor, chipset, and BIOS'' that all support [[Wikipedia:X86-64#Intel_64|Intel 64]]. If not all hardware supports 64-bit, then you must use the [[subarches#atom_32|atom_32]] subarch instead.}}
+
'''Empty the partition table''':
  
== 32-bit Suport (Generic) ==
 
=== generic_32 ===
 
 
<console>
 
<console>
CFLAGS: -mtune=generic -O2 -pipe
+
Command (m for help): ##i##o ↵
CHOST: i686-pc-linux-gnu
+
USE:
+
 
</console>
 
</console>
  
== 32-bit AMD Processors ==
+
'''Create Partition 1''' (boot):
=== amd64-k8_32 ===
+
 
 
<console>
 
<console>
CFLAGS: -O2 -fomit-frame-pointer -march=k8 -pipe
+
Command (m for help): ##i##n ↵
CHOST: i686-pc-linux-gnu
+
Partition type (default p): ##i##↵
USE: mmx sse sse2 3dnow 3dnowext
+
Partition number (1-4, default 1): ##i##↵
 +
First sector: ##i##↵
 +
Last sector: ##i##+128M ↵
 
</console>
 
</console>
  
=== athlon-xp ===
+
'''Create Partition 2''' (swap):
 +
 
 
<console>
 
<console>
CFLAGS: -O2 -fomit-frame-pointer -march=athlon-xp -pipe
+
Command (m for help): ##i##n ↵
CHOST: i686-pc-linux-gnu
+
Partition type (default p): ##i##↵
USE: mmx sse 3dnow
+
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>
  
== 32-bit Intel Processors ==
+
'''Create the root partition:'''
=== atom_32 ===
+
 
 
<console>
 
<console>
CFLAGS: -O2 -fomit-frame-pointer -march=atom -pipe -mno-movbe
+
Command (m for help): ##i##n ↵
CHOST: i686-pc-linux-gnu
+
Partition type (default p): ##i##↵
USE: mmx sse sse2 sse3
+
Partition number (3,4, default 3): ##i##↵
 +
First sector: ##i##↵
 +
Last sector: ##i##↵
 
</console>
 
</console>
  
=== core2_32 ===
+
'''Verify the partition table:'''
 +
 
 
<console>
 
<console>
CFLAGS: -march=core2 -O2 -fomit-frame-pointer -pipe
+
Command (m for help): ##i##p
CHOST: i686-pc-linux-gnu
+
 
USE: mmx sse sse2 sse3 ssse3
+
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
 
</console>
 
</console>
  
=== i686 ===
+
'''Write the parition table to disk:'''
 +
 
 
<console>
 
<console>
CHOST: i686-pc-linux-gnu
+
Command (m for help): ##i##w
CFLAGS: -O2 -march=i686 -mtune=generic -pipe
+
USE:
+
 
</console>
 
</console>
  
=== pentium4 ===
+
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 <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.
 +
 
 +
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>
CFLAGS: -O2 -fomit-frame-pointer -march=pentium4 -pipe
+
# ##i##mke2fs -t ext2 /dev/sda1
CHOST: i686-pc-linux-gnu
+
# ##i##mkfs.ext4 /dev/sda3
USE: mmx sse sse2
+
# ##i##mkswap /dev/sda2
 +
# ##i##swapon /dev/sda2
 
</console>
 
</console>
  
== 32-bit ARM (Advanced RISC Machines) Processors ==
+
'''To use XFS as your root filesystem:'''
=== armv5te ===
+
 
 
<console>
 
<console>
CFLAGS: -O2 -pipe -march=armv5te
+
# ##i##mke2fs -t ext2 /dev/sda1
CHOST: armv5tel-softfloat-linux-gnueabi
+
# ##i##mkfs.xfs /dev/sda3
USE:
+
# ##i##mkswap /dev/sda2
 +
# ##i##swapon /dev/sda2
 
</console>
 
</console>
  
=== armv6j_hardfp ===
+
==== Mounting filesystems ====
 +
 
 +
Mount the newly-created filesystems as follows, creating <code>/mnt/funtoo</code> as the installation mount point:
 +
 
 
<console>
 
<console>
CFLAGS: -O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard
+
# ##i##mkdir /mnt/funtoo
CHOST: armv6j-hardfloat-linux-gnueabi
+
# ##i##mount /dev/sda3 /mnt/funtoo
USE:
+
# ##i##mkdir /mnt/funtoo/boot
 +
# ##i##mount /dev/sda1 /mnt/funtoo/boot
 
</console>
 
</console>
  
=== armv7a_hardfp ===
+
Optionally, if you have a separate filesystem for <code>/home</code> or anything else:
 +
 
 
<console>
 
<console>
CFLAGS: -O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard
+
# ##i##mkdir /mnt/funtoo/home
CHOST: armv7a-hardfloat-linux-gnueabi
+
# ##i##mount /dev/sda4 /mnt/funtoo/home
USE:
+
 
</console>
 
</console>
  
{{:Install/Footer}}
+
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>
 +
# ##i##chmod 1777 /mnt/funtoo/tmp
 +
</console>

Revision as of 22:26, November 18, 2014


Note

This is a template that is used as part of the Installation instructions which covers: 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

Introduction

In earlier times, there was only one way to boot a PC-compatible computer. All of our desktops and servers had a standard BIOS, all our hard drives used Master Boot Records, and were partitioned using the MBR partition scheme. And we liked it that way!

Then, along came EFI and UEFI, which are new-style firmware designed to boot systems, along with GPT partition tables to support disks larger than 2.2TB. All of the sudden, we had a variety of options to boot Linux systems, turning what once was a one-method-fits-all approach into something a lot more complex.

Let's take a moment to review the boot options available to you. This Install Guide uses, and recommends, the old-school method of BIOS booting and using an MBR. It works. There's nothing wrong with it. If your system disk is 2TB or smaller in size, it won't prevent you from using all of your disk's capacity, either.

But, there are some situations where the old-school method isn't optimal. If you have a system disk >2TB in size, then MBR partitions won't allow you to access all your storage. So that's one reason. Another reason is that there are some so-called "PC" systems out there that don't support BIOS booting anymore, and force you to use UEFI to boot.

Our recommendation is still to go old-school unless you have reason not to. We call this method the BIOS + GRUB (MBR) method. It's the traditional method of setting up a PC-compatible system to boot Linux.

If you need to use UEFI to boot, we are supporting two options. One still uses the BIOS to boot, but with GPT partition tables to support system disks >2.2TB in size. We refer to this method as the BIOS + GRUB (GPT) method.

There is also another method, which avoids using the BIOS for booting at all. Instead, it uses UEFI, with GPT. We call this the UEFI + GRUB (GPT) method.

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