Difference between pages "Initialization Systems" and "Install/pt-br/Partitioning"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
Funtoo's portage contains ebuilds for the following initialization systems:


== In Portage ==
===Particionamento===
The following packages have ebuilds available in Portage.


==== OpenRC====
=== Prepare o Disco Rígido ===


(Uses <tt>sys-apps/sysvinit</tt>)
==== Introdução ====


{{Package|sys-apps/openrc}} is Funtoo's default and preferred init system. Funtoo OpenRC is an independently-maintained, forked version of the [[Wikipedia:OpenRC|OpenRC]] init scripts ([http://www.gentoo.org/proj/en/base/openrc/ now maintained by Gentoo]). Funtoo Linux-specific changes generally relate to [[Funtoo Linux Networking|Funtoo network configuration]].
Em tempos remotos, só havia um jeito de inicializar (boot)o computador compatível com a arquitetura PC. Todos os nossos desktops e servidores tinham uma BIOS padrão, todos os nossos hard drives utilizavam Master Boot Records, e eram particionados utilizando esquema de partição MBR. E nós gostávamos disso daquele jeito mesmo!


It supports named runlevels, custom runlevels, and [[Stacked_Runlevels|stacked runlevels]]. There is no process supervision. Dependencies and actions are determined in <tt>/etc/init.d/</tt> and <tt>/etc/config.d/</tt> by shell scripts and environment variables. There is optional parallel service startup.
Então, depois veio os EFI e UEFI, que são firmware em novo-estilo projetados para inicializar sistemas, junto as tabelas de partição GPT para suportar discos superiores à 2.2TB. Tudo repentino, nós tínhamos uma variedade de opções para inicializar os sistemas Linux, tornando o que uma vez era um método único de encaixe de tudo  (one-method-fits-all) aproximar-se á algo muito mais complexo.


See {{Package|sys-apps/openrc}} for more info.
Vamos parar por um momento para rever as opções de boot disponíveis para você. Esse pequeno Guia utiliza, e recomenda, o método da BIOS à moda antiga inicializando e usando um MBR. Funciona. Não há nada de errado com ele. Se seu disco é do tamanho de  2TB ou menor, ele não vai impedir que você use toda a capacidade do seu disco, também.


==== sysvinit ====
Mas, há alguns situações onde  o método da não é satisfatório. Se você obtiver um disco de tamando superior à 2TB, então partições MBR não o permitirão acessar todo o seu  armazenamento (storage). Então essa é uma rasão. Outra rasão é que há alguns então assim chamados  "PC" por aí afora que não suportam maias BIOS, e lhe força a utilizar o UEFI para inicializar. Então, sem compaixão pelas pessoas que se enquadram nessa situação, esse Guia de Instalação documenta boot pelo UEFI também.


{{Package|sys-apps/sysvinit}} is the main <tt>init</tt> process. In Funtoo it is used as PID 1, along with {{Package|sys-apps/openrc}}. It utilizes a runlevel system.  
Nossa recomandação ainda é ir pela moda antiga a não ser  que tenha resão para não. Chamamos esse método  de método '''BIOS + GRUB (MBR)'''. Esse é o método tradicional de configurar um PC para inicilizar o Linux.


See the [[Wikipedia:Init#SysV-style|Wikipedia Page]] for more info.
Se você precisa usar UEFI para inicilizar, recomendamos não utillizar de maneira alguma o MBR para boot, já que alguns sistemas suportam as some UEFI, mas outros não. Ao inves disso, recomendamos utilizar o UEFI para inicializar o GRUB, que carregará o Linux. Referimos a esse método como o método '''UEFI + GRUB (GPT)'''.


==== s6 ====
E sim, há ainda mais, alguns aos quais estão documentados na página [[Boot Methods]]. Nós costumavamos recomendar um étodo '''BIOS + GRUB (GPT)''', mas esse não tem consistentemente suporte em uma variedade de hardware.


{{Package|sys-apps/s6}}. s6 is a small suite of programs for UNIX, designed to allow process supervision (a.k.a service supervision), in the line of daemontools and runit.  
'''A grande pergunta é -- que método de boot eu devo usar?''' Aqui está como responder.


See the [http://www.skarnet.org/software/s6/index.html| Project Home Page] for more info.
;Princípio nº 1 - Moda antiga (Old School): Se você pode inicializar com confiavelmente o System Rescue CD e ele exibe um menu inicial azul claro, você está inializando o CD usando a BIOS, e provavelmente você pode assim inicilizar o Funtoo Linux ussando a BIOS. Então, vá pela moda antiga e use a boot da BIO, ''a não ser que'' você tenha alguma resão para usar UEFI, tal qual ter um disco do tamando superior a 2.2TB. Nesse caso, veja o segundo Princípio nº 2, já que seu sistema pode ter suporte também à  boot UEFI.


==== runit ====
;Princípio nº 2 - Moderno (New School): Se você pode confiavelmente inicilizar o System Rescue CD e ele te exibe um menu inicial preto e branco -- parabens, seu sistema é configurado para suportar o boot via UEFI. Isso significa que você está pronto para instalar o install Funtoo Linux para inicializá-lo via UEFI. Seu sistema pode ainda ter suporte para inicilizar com a BIOS, mas  somente se for testado pela UEFI primeiro. Você pode dar uma bisbilhotada na sua configuração de boot pelo BIOS e brincar com isso.


{{Package|sys-process/runit}} is a cross-platform Unix init scheme with service supervision, a replacement for sysvinit, and other init schemes. It runs on GNU/Linux, *BSD, MacOSX, Solaris, and can easily be adapted to other Unix operating systems. It uses 3 runlevels.
;Qual pe a Grande Diferença entra a Moda Antiga e a Moderna?: Aqui está a coisa. Se você for com as as partições MBR a moda antiga, sua partição <code>/boot</code> será um sistema de arquivos ext2, e você utilizará <code>fdisk</code> para criar suas partições MBR. Se você com as partições GPT e boot via UEFI, sua partição <code>/boot</code> será um sistema de arquivos vfat, por que isso é o que o UEFI é capaz de ler, e você utilizará <code>gdisk</code> para criar suas partiçẽos GP. E você instalará o GRUB um pouco diferente. É a respeito disso que tudo vem abaixo, em caso você estivesse curioso/a.


See the [http://smarden.org/runit/| Project Home page] for more info.
{{Note|'''Algumas placas mãe pode aparentar suporte a UEFI, mas não suportam.''' Faça sua pesquisa. Por exemplo, O BIOS atribuído na minha Gigabyte GA-990FXA-UD7 rev 1.1 tem uma opção de abilitar o boot UEFI por CD/DVD. '''Isso não é o sufuciente para abilitar boot via UEFI pelo hard drives e instalar o Funtoo Linux.''' UEFI deve ter tanto para mídia removível (assim você pode inicializar o System Rescue CD utilizando o UEFI) quanto mídias fixas (assim você pode inicializar sua nova instalação do Funtoo Linux.) Revelá-se que revisões posteriores dessa placa (rev 3.0) tem um novo BIOS que suporta completamente o boot do UEFI. Isso pode apontar para o terceiro princípio -- conheça teu hardware.}}


==== systemd ====
==== Old-School (BIOS/MBR) Method ====


{{Package|sys-apps/systemd}} is a suite of system management daemons, libraries, and utilities designed for Linux and programmed exclusively for the Linux API. Systemd authors characterize the software suite as a "basic building block" for an operating system.
{{Note|Use this method if you are booting using your BIOS, and if your System Rescue CD initial boot menu was light blue. If you're going to use the new-school method, [[#New-School (UEFI/GPT) Method|click here to jump down to UEFI/GPT.]]}}


See the [http://freedesktop.org/wiki/Software/systemd/| Project Home Page] for more info.
===== Preparation =====


==== daemontools ====
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:


{{Package|sys-process/daemontools}} is a collection of tools for managing UNIX services.
<console>
# ##i##fdisk -l /dev/sda


<tt>supervise</tt> monitors a service. It starts the service and restarts the service if it dies. Setting up a new service is easy: all supervise needs is a directory with a run script that runs the service.
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


<tt>multilog</tt> saves error messages to one or more logs. It optionally timestamps each line and, for each log, includes or excludes lines matching specified patterns. It automatically rotates logs to limit the amount of disk space used. If the disk fills up, it pauses and tries again, without losing any data.


See the [http://cr.yp.to/daemontools.html| Project Home page] for more info.
#        Start          End    Size  Type            Name
1        2048  1250263694  596.2G  Linux filesyste Linux filesystem
</console>


==== daemontools-encore ====
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.}}


{{Package|sys-process/daemontools-encore}} is a collection of tools for managing UNIX services. It is derived from the public-domain release of daemontools by D. J. Bernstein.
<console>
# ##i##sgdisk --zap-all /dev/sda


daemontools-encore adds numerous enhancements above what daemontools could do while maintaining backwards compatibility with daemontools. See the [http://untroubled.org/daemontools-encore/CHANGES| CHANGES] file for more details on what features have been added.
Creating new GPT entries.
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
</console>


See the [http://untroubled.org/daemontools-encore/| Project Home page] for more info.
This output is also nothing to worry about, as the command still succeded:


== Not in Portage ==
<console>
The following systems do not have ebuilds in portage.
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.  
***************************************************************
</console>


==== [[Wikipedia:upstart|upstart]] ====
===== Partitioning =====


Upstart is an event-based replacement for the <code>/sbin/init</code> daemon which handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running.
Now we will use <code>fdisk</code> to create the MBR partition table and partitions:


It was originally developed for the Ubuntu distribution, but is intended to be suitable for deployment in all Linux distributions as a replacement for the venerable System-V init.
<console>
# ##i##fdisk /dev/sda
</console>


See the [[http://upstart.ubuntu.com/| Project Home Page]] for more info.
Within <code>fdisk</code>, follow these steps:


==== [http://universe2.us/epoch.html| epoch] ====
'''Empty the partition table''':


The Epoch Init System is a small but powerful init system for Linux 2.6+. It requires a libc, (not glibc specific), a Linux kernel of 2.6 or greater, a shell is recommended, and while it will function somewhat without it, /proc. It has very low memory usage, very small binary size, and is designed to be suitable for both full blown desktop and server systems as well as keeping minimalist and embedded distros heavily in mind. It is architecture and compiler independent, written in mostly ANSI C, and is designed with a philosophy in mind.
<console>
Command (m for help): ##i##o ↵
</console>


==== [[Wikipedia:launchd|launchd]] ====
'''Create Partition 1''' (boot):


<tt>launchd</tt> is unified, open-source service-management framework that starts, stops and manages daemons, applications, processes, and scripts in Apple OS X environments. Dave Zarzycki at Apple designed and wrote <tt>launchd</tt>; Apple introduced it with Mac OS X Tiger and licenses it under the Apache License.
<console>
Command (m for help): ##i##n ↵
Partition type (default p): ##i##↵
Partition number (1-4, default 1): ##i##↵
First sector: ##i##↵
Last sector: ##i##+128M ↵
</console>


The sources are available [https://opensource.apple.com/source/launchd/| here].
'''Create Partition 2''' (swap):
==== [http://troglobit.com/finit.html| finit] ====


Finit is a small SysV init replacement with process supervision similar to that of daemontools and runit. Its focus is on small and embedded GNU/Linux systems, although fully functional on standard server and desktop installations.
<console>
Command (m for help): ##i##n ↵
Partition type (default p): ##i##↵
Partition number (2-4, default 2): ##i##↵
First sector: ##i##↵
Last sector: ##i##+2G ↵
Command (m for help): ##i##t ↵
Partition number (1,2, default 2): ##i## ↵
Hex code (type L to list all codes): ##i##82 ↵
</console>


Finit is fast because it starts services in parallel, it then supervises and automatically restarts them if they fail. This can be extended upon with custom callbacks for all services, hooks into the boot process, or plugins to extend the functionality and adapt Finit to your needs.
'''Create the root partition:'''


==== [[Wikipedia:Service_Management_Facility|SMF]] ====
<console>
Command (m for help): ##i##n ↵
Partition type (default p): ##i##↵
Partition number (3,4, default 3): ##i##↵
First sector: ##i##↵
Last sector: ##i##↵
</console>


Service Management Facility (SMF) is a feature of the Solaris operating system that creates a supported, unified model for services and service management on each Solaris system and replaces init.d scripts. SMF treats Services as "first class objects". That is, they are more than just user-executed software to the OS. They can be defined to have special states that allow finer control and permit monitoring and probing for diagnosing software failures, rather than having the administrator or dedicated "restarter" modules kill and restart the service as before.
'''Verify the partition table:'''


==== [[Wikipedia:SystemStarter|SystemStarter]] ====
<console>
Command (m for help): ##i##p


SystemStarter is a system program in Mac OS X, started by Mac OS X's BSD-style init prior to Mac OS X v10.4 and by launchd in Mac OS X v10.4 and later releases, that starts system processes specified by a set of property lists. SystemStarter was originally written by Wilfredo Sanchez for Mac OS X. In Mac OS X v10.4, it was deprecated in favor of <tt>launchd</tt>, and kept in the system only to start system processes not yet converted to use <tt>launchd</tt>.
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


It's manpages are [https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/SystemStarter.8.html| here].
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>


== Other Packages of Interest ==
'''Write the parition table to disk:'''


==== monit ====
<console>
Command (m for help): ##i##w
</console>


{{Package|app-admin/monit}} is a small Open Source utility for managing and monitoring Unix systems. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.  
Your new MBR partition table will now be written to your system disk.


= References =
{{Note|You're done with partitioning! Now, jump over to [[#Creating filesystems|Creating filesystems]].}}


* [http://wiki.gentoo.org/wiki/Comparison_of_init_systems| Gentoo Comparison of Init Systems chart]
==== New-School (UEFI/GPT) Method ====
 
{{Note|Use this method if you are booting using UEFI, and if your System Rescue CD initial boot menu was black and white. If it was light blue, this method will not work.}}
 
The <tt>gdisk</tt> commands to create a GPT partition table are as follows. Adapt sizes as necessary, although these defaults will work for most users. Start <code>gdisk</code>:
 
<console>
# ##i##gdisk
</console>
 
Within <tt>gdisk</tt>, follow these steps:
 
'''Create a new empty partition table''' (This ''will'' erase all data on the disk when saved):
 
<console>
Command: ##i##o ↵
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): ##i##y ↵
</console>
 
'''Create Partition 1''' (boot):
 
<console>
Command: ##i##n ↵
Partition Number: ##i##1 ↵
First sector: ##i##↵
Last sector: ##i##+500M ↵
Hex Code: ##i##↵
</console>
 
'''Create Partition 2''' (swap):
 
<console>
Command: ##i##n ↵
Partition Number: ##i##2 ↵
First sector: ##i##↵
Last sector: ##i##+4G ↵
Hex Code: ##i##8200 ↵
</console>
 
'''Create Partition 3''' (root):
 
<console>
Command: ##i##n ↵
Partition Number: ##i##3 ↵
First sector: ##i##↵
Last sector: ##i##↵##!i## (for rest of disk)
Hex Code: ##i##↵
</console>
 
Along the way, you can type "<tt>p</tt>" and hit Enter to view your current partition table. If you make a mistake, you can type "<tt>d</tt>" to delete an existing partition that you created. When you are satisfied with your partition setup, type "<tt>w</tt>" to write your configuration to disk:
 
'''Write Partition Table To Disk''':
 
<console>
Command: ##i##w ↵
Do you want to proceed? (Y/N): ##i##Y ↵
</console>
 
The partition table will now be written to disk and <tt>gdisk</tt> will close.
 
Now, your GPT/GUID partitions have been created, and will show up as the following ''block devices'' under Linux:
 
* <tt>/dev/sda1</tt>, which will be used to hold the <tt>/boot</tt> filesystem,
* <tt>/dev/sda2</tt>, which will be used for swap space, and
* <tt>/dev/sda3</tt>, which will hold your root filesystem.
 
==== Creating filesystems ====
 
{{Note|This section covers both BIOS ''and'' UEFI installs. Don't skip it!}}
 
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.
 
Let's keep this simple. Are you using old-school MBR partitions? If so, let's create an ext2 filesystem on /dev/sda1:
 
<console>
# ##i##mkfs.ext2 /dev/sda1
</console>
 
If you're using new-school GPT partitions for UEFI, you'll want to create a vfat filesystem on /dev/sda1, because this is what UEFI is able to read:
 
<console>
# ##i##mkfs.vfat -F 32 /dev/sda1
</console>
 
Now, let's create a swap partition. This partition will be used as disk-based virtual memory for your Funtoo Linux system.
 
You will not create a filesystem on your swap partition, since it is not used to store files. But it is necessary to initialize it using the <code>mkswap</code> command. Then we'll run the <code>swapon</code> command to make your newly-initialized swap space immediately active within the live CD environment, in case it is needed during the rest of the install process:
 
<console>
# ##i##mkswap /dev/sda2
# ##i##swapon /dev/sda2
</console>
 
Now, we need to create a root filesystem. This is where Funtoo Linux will live. We generally recommend ext4 or XFS root filesystems. If you're not sure, choose ext4. Here's how to create a root ext4 filesystem:
 
<console>
# ##i##mkfs.ext4 /dev/sda3
</console>
 
...and here's how to create an XFS root filesystem, if you choose to use XFS:
 
<console>
# ##i##mkfs.xfs /dev/sda3
</console>
 
Your filesystems (and swap) have all now been initialized, so that that can be mounted (attached to your existing directory heirarchy) and used to store files. We are ready to begin installing Funtoo Linux on these brand-new filesystems.
 
{{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.
}}
 
==== Montando os filesystems ====
 
Monte os recem-criados filesystems como a seguir, criando <code>/mnt/funtoo</code> como ponto de montagem da instalação:
 
<console>
# ##i##mkdir /mnt/funtoo
# ##i##mount /dev/sda3 /mnt/funtoo
# ##i##mkdir /mnt/funtoo/boot
# ##i##mount /dev/sda1 /mnt/funtoo/boot
</console>
 
Optionally, if you have a separate filesystem for <code>/home</code> or anything else:
 
<console>
# ##i##mkdir /mnt/funtoo/home
# ##i##mount /dev/sda4 /mnt/funtoo/home
</console>
 
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 16:17, December 7, 2014

Particionamento

Prepare o Disco Rígido

Introdução

Em tempos remotos, só havia um jeito de inicializar (boot)o computador compatível com a arquitetura PC. Todos os nossos desktops e servidores tinham uma BIOS padrão, todos os nossos hard drives utilizavam Master Boot Records, e eram particionados utilizando esquema de partição MBR. E nós gostávamos disso daquele jeito mesmo!

Então, depois veio os EFI e UEFI, que são firmware em novo-estilo projetados para inicializar sistemas, junto as tabelas de partição GPT para suportar discos superiores à 2.2TB. Tudo repentino, nós tínhamos uma variedade de opções para inicializar os sistemas Linux, tornando o que uma vez era um método único de encaixe de tudo (one-method-fits-all) aproximar-se á algo muito mais complexo.

Vamos parar por um momento para rever as opções de boot disponíveis para você. Esse pequeno Guia utiliza, e recomenda, o método da BIOS à moda antiga inicializando e usando um MBR. Funciona. Não há nada de errado com ele. Se seu disco é do tamanho de 2TB ou menor, ele não vai impedir que você use toda a capacidade do seu disco, também.

Mas, há alguns situações onde o método da não é satisfatório. Se você obtiver um disco de tamando superior à 2TB, então partições MBR não o permitirão acessar todo o seu armazenamento (storage). Então essa é uma rasão. Outra rasão é que há alguns então assim chamados "PC" por aí afora que não suportam maias BIOS, e lhe força a utilizar o UEFI para inicializar. Então, sem compaixão pelas pessoas que se enquadram nessa situação, esse Guia de Instalação documenta boot pelo UEFI também.

Nossa recomandação ainda é ir pela moda antiga a não ser que tenha resão para não. Chamamos esse método de método BIOS + GRUB (MBR). Esse é o método tradicional de configurar um PC para inicilizar o Linux.

Se você precisa usar UEFI para inicilizar, recomendamos não utillizar de maneira alguma o MBR para boot, já que alguns sistemas suportam as some UEFI, mas outros não. Ao inves disso, recomendamos utilizar o UEFI para inicializar o GRUB, que carregará o Linux. Referimos a esse método como o método UEFI + GRUB (GPT).

E sim, há ainda mais, alguns aos quais estão documentados na página Boot Methods. Nós costumavamos recomendar um étodo BIOS + GRUB (GPT), mas esse não tem consistentemente suporte em uma variedade de hardware.

A grande pergunta é -- que método de boot eu devo usar? Aqui está como responder.

Princípio nº 1 - Moda antiga (Old School)
Se você pode inicializar com confiavelmente o System Rescue CD e ele exibe um menu inicial azul claro, você está inializando o CD usando a BIOS, e provavelmente você pode assim inicilizar o Funtoo Linux ussando a BIOS. Então, vá pela moda antiga e use a boot da BIO, a não ser que você tenha alguma resão para usar UEFI, tal qual ter um disco do tamando superior a 2.2TB. Nesse caso, veja o segundo Princípio nº 2, já que seu sistema pode ter suporte também à boot UEFI.
Princípio nº 2 - Moderno (New School)
Se você pode confiavelmente inicilizar o System Rescue CD e ele te exibe um menu inicial preto e branco -- parabens, seu sistema é configurado para suportar o boot via UEFI. Isso significa que você está pronto para instalar o install Funtoo Linux para inicializá-lo via UEFI. Seu sistema pode ainda ter suporte para inicilizar com a BIOS, mas somente se for testado pela UEFI primeiro. Você pode dar uma bisbilhotada na sua configuração de boot pelo BIOS e brincar com isso.
Qual pe a Grande Diferença entra a Moda Antiga e a Moderna?
Aqui está a coisa. Se você for com as as partições MBR a moda antiga, sua partição /boot será um sistema de arquivos ext2, e você utilizará fdisk para criar suas partições MBR. Se você com as partições GPT e boot via UEFI, sua partição /boot será um sistema de arquivos vfat, por que isso é o que o UEFI é capaz de ler, e você utilizará gdisk para criar suas partiçẽos GP. E você instalará o GRUB um pouco diferente. É a respeito disso que tudo vem abaixo, em caso você estivesse curioso/a.
   Note

Algumas placas mãe pode aparentar suporte a UEFI, mas não suportam. Faça sua pesquisa. Por exemplo, O BIOS atribuído na minha Gigabyte GA-990FXA-UD7 rev 1.1 tem uma opção de abilitar o boot UEFI por CD/DVD. Isso não é o sufuciente para abilitar boot via UEFI pelo hard drives e instalar o Funtoo Linux. UEFI deve ter tanto para mídia removível (assim você pode inicializar o System Rescue CD utilizando o UEFI) quanto mídias fixas (assim você pode inicializar sua nova instalação do Funtoo Linux.) Revelá-se que revisões posteriores dessa placa (rev 3.0) tem um novo BIOS que suporta completamente o boot do UEFI. Isso pode apontar para o terceiro princípio -- conheça teu hardware.

Old-School (BIOS/MBR) Method

   Note

Use this method if you are booting using your BIOS, and if your System Rescue CD initial boot menu was light blue. If you're going to use the new-school method, click here to jump down to UEFI/GPT.

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:

root # 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


root #         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.

root # 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:

root # 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.

   Note

You're done with partitioning! Now, jump over to Creating filesystems.

New-School (UEFI/GPT) Method

   Note

Use this method if you are booting using UEFI, and if your System Rescue CD initial boot menu was black and white. If it was light blue, this method will not work.

The gdisk commands to create a GPT partition table are as follows. Adapt sizes as necessary, although these defaults will work for most users. Start gdisk:

root # gdisk

Within gdisk, follow these steps:

Create a new empty partition table (This will erase all data on the disk when saved):

Command: o ↵
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y ↵

Create Partition 1 (boot):

Command: n ↵
Partition Number: 1 ↵
First sector: 
Last sector: +500M ↵
Hex Code: 

Create Partition 2 (swap):

Command: n ↵
Partition Number: 2 ↵
First sector: 
Last sector: +4G ↵
Hex Code: 8200 ↵

Create Partition 3 (root):

Command: n ↵
Partition Number: 3 ↵
First sector: 
Last sector:  (for rest of disk)
Hex Code: 

Along the way, you can type "p" and hit Enter to view your current partition table. If you make a mistake, you can type "d" to delete an existing partition that you created. When you are satisfied with your partition setup, type "w" to write your configuration to disk:

Write Partition Table To Disk:

Command: w ↵
Do you want to proceed? (Y/N): Y ↵

The partition table will now be written to disk and gdisk will close.

Now, your GPT/GUID partitions have been created, and will show up as the following block devices under Linux:

  • /dev/sda1, which will be used to hold the /boot filesystem,
  • /dev/sda2, which will be used for swap space, and
  • /dev/sda3, which will hold your root filesystem.

Creating filesystems

   Note

This section covers both BIOS and UEFI installs. Don't skip it!

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.

Let's keep this simple. Are you using old-school MBR partitions? If so, let's create an ext2 filesystem on /dev/sda1:

root # mkfs.ext2 /dev/sda1

If you're using new-school GPT partitions for UEFI, you'll want to create a vfat filesystem on /dev/sda1, because this is what UEFI is able to read:

root # mkfs.vfat -F 32 /dev/sda1

Now, let's create a swap partition. This partition will be used as disk-based virtual memory for your Funtoo Linux system.

You will not create a filesystem on your swap partition, since it is not used to store files. But it is necessary to initialize it using the mkswap command. Then we'll run the swapon command to make your newly-initialized swap space immediately active within the live CD environment, in case it is needed during the rest of the install process:

root # mkswap /dev/sda2
root # swapon /dev/sda2

Now, we need to create a root filesystem. This is where Funtoo Linux will live. We generally recommend ext4 or XFS root filesystems. If you're not sure, choose ext4. Here's how to create a root ext4 filesystem:

root # mkfs.ext4 /dev/sda3

...and here's how to create an XFS root filesystem, if you choose to use XFS:

root # mkfs.xfs /dev/sda3

Your filesystems (and swap) have all now been initialized, so that that can be mounted (attached to your existing directory heirarchy) and used to store files. We are ready to begin installing Funtoo Linux on these brand-new filesystems.

   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.

Montando os filesystems

Monte os recem-criados filesystems como a seguir, criando /mnt/funtoo como ponto de montagem da instalação:

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

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

root # mkdir /mnt/funtoo/home
root # 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:

root # chmod 1777 /mnt/funtoo/tmp