Difference between pages "IPv4 calculations" and "Install/Partitioning/pt-br"

(Difference between pages)
(The Internet layer)
 
(Preparaçaõ)
 
Line 1: Line 1:
WARNING: Work in progress. Do not edit this article unless you are the original author.
 
  
 +
===Particionamento===
  
= Refresh on TCP/IP model =  
+
=== Prepare o Disco Rígido ===
  
When the ARPANet (a packet oriented network) was born in those good old seventies, engineers had to solve the problem of making computers being able to exchange packets of information over the network and they invented in 1974 something you are now using to view this page: TCP/IP! TCP/IP is a collection of various network protocols, being organized as a stack. Just like your boss does not do everything in the company and delegates at lower levels which in turn delegates at an even more lower level, no protocol in the TCP/IP suite takes all responsibilities, they are working together in a hierarchical and cooperative manner.  A level of the TCP/IP stack knows what its immediate lower subordinate can do for it and whatever it will do will be done the right way and will not worry about the manner the job will be done.  Also the only problem for a given level of the stack is to fulfill its own duties and deliver the service requested  by the upper layer, it does not have to worry about the ultimate goal of what upper levels do.
+
==== Introdução ====
 
+
<illustration goes here TCP/IP model>
+
  
The above illustration sounds horribly familiar : yes, it is sounds like this good old OSI model. Indeed it is a tailored view of the original OSI model and it works the exact same way: so the data sent by an application A1 (residing on computer C1) to another application A2 (residing on computer C2) goes through C1's TCP/IP stack (from top to bottom), reach the C1's lower layers that will take the responsibility to move the bits from C1 to C2 over a physical link (electrical or lights pulses, radio waves...sorry no quantum mechanism yet) . C2's lower layers will receive the bits sent by C1 and pass  what has been received to the C2's TCP/IP  stack (bottom to top) which will pass the data to A2. If C1 and C2 are not on the same network the process is a bit more complex because it involves relays (routers) but the global idea remains the same. Also there is no shortcuts in the process : both TCP/IP stacks are crossed in their whole, either from top to bottom for the sender or  bottom to top for the receiver. The transportation process in itself is also absolutely transparent from an application's point of view:  A1 knows it can rely on the TCP/IP stack to transmits some data to A2, ''how'' the data is transmitted is not its problem, A1 just assumes the data can be transmitted by some means. The TCP/IP stack is also loosely coupled to a particular network technology because its frontier is precisely the physical transportation of bits over a medium and so the physical network's technology,  just the same way A1 does not care about how the TCP/IP stack will move the data from one computer to another. The TCP/IP stack itself does not care about the details about how the bits are physically moved and thus it can work with any network technology no matter the technology is Ethernet, Token Ring or FDDI for example.  
+
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!
  
= The Internet layer =
+
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.
  
The goal of this article being more focused on calculation of addresses used at the ''Internet layer'' so  let's forget the gory details of the TCP/IP stack works (you can find an extremely detailed discussion in [[How the TCP/IP stack works]]...  to be written...). From here, we assume you have a good general understanding of its functionalities and how a network transmission works. As you know the ''Internet'' layer is responsible to handle logical addressing issues of a TCP segment (or UDP datagram) that has either to be transmitted over the network to a remote computer or that has been received from the network from a remote computer. That layer is governed by a set of strict set rules called the ''Internet Protocol'' or ''IP'' originally specified by [RFC 791] in september 1981. What is pretty amazing with IP is that, although its original RFC has been amended by several others since 1981, its specification remains absolutely valid! If have a look at [RFC 791] you won't see "obsoleted". Sure IPv4 reached its limits in this first half the XXIst century but will remains in the IT landscape for probably several years to not say decades (you know, the COBOL language....). To finish on historical details, you might find interesting know that TCP/IP was not the original protocol suite used on the ARAPANet, it superseded in 1983 another protocol suite the [http://en.wikipedia.org/wiki/Network_Control_Program Network Control Program] or NCP. NCP looks like, from our point of view, prehistoric however it is of big importance as it established a lot of concepts still in use today : protocol data units, splitting an address in various components, connection management and so on comes from NCP. Historical reward  for those who are still reading this long paragraph: first, even a user was addressable in NCP messages second even in 1970 the engineers were concerned by network congestions issues ([http://www.cs.utexas.edu/users/chris/think/ARPANET/Timeline this page]) :-)
+
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.
  
Enough of historical background, packet networks history is super interesting but would make this article would just too long. So let's go back to the Internet Protocol! In those good old seventies: the engineers who designed the Internet Protocol retained a 32 bits addressing scheme. Why 32 bits and not 64 or 128? In that decade, computers were rare with very limited resources and everyone found that using 32 bits to express the a computer's address on the network would be more than enough : 2^32 gives 4,294,967,296 or roughly 4.3 billions (even some briliant visionaries like  [http://en.wikipedia.org/wiki/J._C._R._Licklider J.C.Lickleider] would have never imagined the growth and popularity of computer networks at that time).
+
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.
  
= Classful and classless networks =
+
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.
  
Those addresses follows the thereafter logic:
+
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)'''.
  
{| class="wikitable"
+
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.
|-
+
| colspan="2" | '''32 bits (fixed length)'''
+
|-
+
| '''Network''' part (variable length of N bits ) || '''Host''' part (length : 32 - N bits)
+
|}
+
  
* The network address : this part is uniquely assigned amongst all of the organizations in the world (i.e. No one in the world can hold the same network part) 
+
'''A grande pergunta é -- que método de boot eu devo usar?''' Aqui está como responder.
* The host address :  unique within a given network part
+
  
So in theory we can have something like this (remember the network nature is not to be unique, it hs to be be a collection of networks :
+
;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.
  
* Network 1 Host 1
+
;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 <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.
  
Just like your birthday cake is divided in more or less smaller parts depending on how guests' appetite, the IPv4 address space has also been divided into more or less smaller parts just because organizations needs more or less computers on their networks. How to make this possible? Simply by dedicating a variable number of bits to the network part! Do you see the consequence? An IPv4 address being '''always''' 32 bits wide, the more bits you dedicate to the network part the lesser you have for the host part and vice-versa, this is a tradeoff, always. Basically, having more bits in :
+
{{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 UEFIIsso pode apontar para o terceiro princípio -- conheça teu hardware.}}
* the network part : means more networks possible at the cost of having less hosts per network  
+
* the host part : means less networks but more hosts per network
+
  
It might sounds a bit abstract but let's take an example : imagine we dedicate only 8 bits for the network part and the remaining 24 for the hosts part. What happens?  First if we only
+
==== 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, [[#New-School (UEFI/GPT) Method|click here to jump down to UEFI/GPT.]]}}
  
Is the network part assigned by each organization to itself? Of course not! Assignment are coordinated at the worldwide level by what we call Regional Internet Registries or RIRs which, in turn, can delegate assignments to third-parties located within their geographic jurisdiction. Those latter are called Local Internet Registries or LIRs (the system is detailed in RFC 7020). All of those RIRs are themselves put under the responsibility of now now well-known Internet Assigned Numbers Authority or [http://www.iana.org IANA]. As of 2014 five RIR exists :
+
===== Preparação =====
   
+
 
* ARIN (American Registry for Internet Numbers) : covers North America
+
Primeiro, é uma boa idea certificar-se de que encontrou o hard disk correto para particioná-lo. Try this command and verify that <code>/dev/sda</code> is the disk that you want to partition:
* LACNIC (Latin America and Caribbean Network Information Centre): covers South America and the Caribbean
+
 
* RIPE-NCC (Réseaux IP Européens / or RIPE Network Coordination Centre): covers Europe, Russia and middle east
+
<console>
* Afrinic (Africa Network Information Center) : covers the whole Africa
+
# ##i##fdisk -l /dev/sda
* APNIC (Asian and Pacific Network Information Centre) : covers oceania and far east.
+
 
 +
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>
 +
 
 +
Agora, é recomendado que você apague quaisquer tabelas de partição MBR ou GPT existente no disco, which could confuse the system's BIOS at boot time. We do this using <code>sgdisk</code>:
 +
{{fancywarning|This will make any existing partitions inaccessible! You are '''strongly''' cautioned and advised to backup any critical data before proceeding.}}
 +
 
 +
<console>
 +
# ##i##sgdisk --zap-all /dev/sda
 +
 
 +
Creating new GPT entries.
 +
GPT data structures destroyed! You may now partition the disk using fdisk or
 +
other utilities.
 +
</console>
 +
 
 +
This output is also nothing to worry about, as the command still succeded:
 +
 
 +
<console>
 +
***************************************************************
 +
Found invalid GPT and valid MBR; converting MBR to GPT format
 +
in memory.
 +
***************************************************************
 +
</console>
 +
 
 +
===== Partitioning =====
 +
 
 +
Now we will use <code>fdisk</code> to create the MBR partition table and partitions:
 +
 
 +
<console>
 +
# ##i##fdisk /dev/sda
 +
</console>
 +
 
 +
Within <code>fdisk</code>, follow these steps:
 +
 
 +
'''Empty the partition table''':
 +
 
 +
<console>
 +
Command (m for help): ##i##o ↵
 +
</console>
 +
 
 +
'''Create Partition 1''' (boot):
 +
 
 +
<console>
 +
Command (m for help): ##i##n ↵
 +
Partition type (default p): ##i##↵
 +
Partition number (1-4, default 1): ##i##↵
 +
First sector: ##i##↵
 +
Last sector: ##i##+128M ↵
 +
</console>
 +
 
 +
'''Create Partition 2''' (swap):
 +
 
 +
<console>
 +
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>
 +
 
 +
'''Create the root partition:'''
 +
 
 +
<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>
 +
 
 +
'''Verify the partition table:'''
 +
 
 +
<console>
 +
Command (m for help): ##i##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
 +
</console>
 +
 
 +
'''Write the parition table to disk:'''
 +
 
 +
<console>
 +
Command (m for help): ##i##w
 +
</console>
 +
 
 +
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|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 <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:55, December 9, 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.

Preparação

Primeiro, é uma boa idea certificar-se de que encontrou o hard disk correto para particioná-lo. 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

Agora, é recomendado que você apague quaisquer tabelas de partição MBR ou GPT existente no disco, 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.

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:

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

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

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

# mkswap /dev/sda2
# 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:

# mkfs.ext4 /dev/sda3

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

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

# 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