Difference between pages "Install/pt-br/Partitioning" and "Install/ru/Partitioning"

From Funtoo
< Install(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
<noinclude>
{{InstallPart|процесс разбиения диска и создания файловых систем}}
</noinclude>
=== Подготовка жесткого диска ===


===Particionamento===
В этой части  мы научимся различным способам установки Funtoo Linux -- и загрузки с -- жесткий диск.


=== Prepare o Disco Rígido ===
==== Введение ====


==== Introdução ====
В прежние времена существовал лишь один способ загрузить PC-совместимый компьютер. Все наши дектопы и сервера имели стандартный PC BIOS, все наши харды использовали MBR и были разбиты используя схему разбивки MBR.  Вот как это все было и нам это нравилось!


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!
Затем появились EFI и UEFI, встроенные программы нового образца наряду со схемой разбивки GPT, поддерживающая диски размером более 2.2TБ. Неожиданно, нам стали доступны различные способы установки и загрузки Линукс систем . То, что было единым методом, стало чем-то более сложным.


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.
Let's take a moment to review the options available to you for configuring a hard drive to boot Funtoo Linux. This Install Guide uses, and recommends, the old-school method of BIOS booting and using an MBR. It works and (except for rare cases) is universally supported. 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.


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.
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. So, out of compassion for people who fall into this predicament, this Install Guide documents UEFI booting too.


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.
Our recommendation is still to go old-school unless you have reason not to. The boot loader we will be using to load the Linux kernel in this guide is called GRUB, so we call this method the '''BIOS + GRUB (MBR)''' method. It's the traditional method of setting up a PC-compatible system to boot Linux.


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.
If you need to use UEFI to boot, we recommend not using the MBR at all for booting, as some systems support this, but others don't. Instead, we recommend using UEFI to boot GRUB, which in turn will load Linux. We refer to this method as the '''UEFI + GRUB (GPT)''' method.


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)'''.
And yes, there are even more methods, some of which are documented on the [[Boot Methods]] page. We used to recommend a '''BIOS + GRUB (GPT)''' method but it is not consistently supported across a wide variety of hardware.


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.
'''The big question is -- which boot method should you use?''' Here's how to tell.


'''A grande pergunta é -- que método de boot eu devo usar?''' Aqui está como responder.
;Principle 1 - Old School: If you can reliably boot System Rescue CD and it shows you an initial light blue menu, you are booting the CD using the BIOS, and it's likely that you can thus boot Funtoo Linux using the BIOS. So, go old-school and use BIOS booting, ''unless'' you have some reason to use UEFI, such as having a >2.2TB system disk. In that case, see Principle 2, as your system may also support UEFI booting.


;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.
;Principle 2 - New School: If you can reliably boot System Rescue CD and it shows you an initial black and white menu -- congratulations, your system is configured to support UEFI booting. This means that you are ready to install Funtoo Linux to boot via UEFI. Your system may still support BIOS booting, but just be trying UEFI first. You can poke around in your BIOS boot configuration and play with this.


;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.
;What's the Big Difference between Old School and New School?: Here's the deal. If you go with old-school MBR partitions, your <code>/boot</code> partition will be an ext2 filesystem, and you'll use <code>fdisk</code> to create your MBR partitions. If you go with new-school GPT partitions and UEFI booting, your <code>/boot</code> partition will be a vfat filesystem, because this is what UEFI is able to read, and you will use <code>gdisk</code> to create your GPT partitions. And you'll install GRUB a bit differently. That's about all it comes down to, in case you were curious.


;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.
;Also Note: To install Funtoo Linux to boot via the New School UEFI method, you must boot System Rescue CD using UEFI -- and see an initial black and white screen. Otherwise, UEFI will not be active and you will not be able to set it up!


{{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.}}
{{Note|'''Some motherboards may appear to support UEFI, but don't.''' Do your research. For example, the Award BIOS in my Gigabyte GA-990FXA-UD7 rev 1.1 has an option to enable UEFI boot for CD/DVD. '''This is not sufficient for enabling UEFI boot for hard drives and installing Funtoo Linux.''' UEFI must be supported for both removable media (so you can boot System Rescue CD using UEFI) as well as fixed media (so you can boot your new Funtoo Linux installation.) It turns out that later revisions of this board (rev 3.0) have a new BIOS that fully supports UEFI boot.  This may point to a third principle -- know thy hardware.}}


==== O método a moda antiga (BIOS/MBR) ====
==== Old-School (BIOS/MBR) Method ====


{{Note|Use esse método se você estiver inicializando sua BIOS, e se o o menu boot inicial do seu System Rescue CD initial estiver em azul claro. Se você for utilizar o método moderno, [[#New-School (UEFI/GPT) Method|click aqui para saltar para o UEFI/GPT.]]}}
{{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.]]}}


===== Preparo =====
===== Preparation =====


Primeiro, é uma boa idea certificar-se de que encontrou o hard disk correto para particioná-lo. Tente esse comando e verifique que  <code>/dev/sda</code> é o disco que você quer particionar:
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:


<console>
<console>
Line 52: Line 56:
</console>
</console>


Agora, é recomendado que você apague quaisquer tabelas de partição MBR ou GPT existente no disco, que poderiam confundir o BIOS do sistema no momento da inicialização. Fazemos isso utilizando <code>sgdisk</code>:
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|Isso tornará quaisquer partições existentes inacessiveis! You are '''strongly''' cautioned and advised to backup any critical data before proceeding.}}
{{fancywarning|This will make any existing partitions inaccessible! You are '''strongly''' cautioned and advised to backup any critical data before proceeding.}}


<console>
<console>
Line 261: Line 265:
}}
}}


==== Montando os filesystems ====
==== Mounting filesystems ====


Monte os recem-criados filesystems como a seguir, criando <code>/mnt/funtoo</code> como ponto de montagem da instalação:
Mount the newly-created filesystems as follows, creating <code>/mnt/funtoo</code> as the installation mount point:


<console>
<console>

Revision as of 13:31, January 5, 2015


   Note

This is a template that is used as part of the Installation instructions which covers: процесс разбиения диска и создания файловых систем. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.


Подготовка жесткого диска

В этой части мы научимся различным способам установки Funtoo Linux -- и загрузки с -- жесткий диск.

Введение

В прежние времена существовал лишь один способ загрузить PC-совместимый компьютер. Все наши дектопы и сервера имели стандартный PC BIOS, все наши харды использовали MBR и были разбиты используя схему разбивки MBR. Вот как это все было и нам это нравилось!

Затем появились EFI и UEFI, встроенные программы нового образца наряду со схемой разбивки GPT, поддерживающая диски размером более 2.2TБ. Неожиданно, нам стали доступны различные способы установки и загрузки Линукс систем . То, что было единым методом, стало чем-то более сложным.

Let's take a moment to review the options available to you for configuring a hard drive to boot Funtoo Linux. This Install Guide uses, and recommends, the old-school method of BIOS booting and using an MBR. It works and (except for rare cases) is universally supported. 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. So, out of compassion for people who fall into this predicament, this Install Guide documents UEFI booting too.

Our recommendation is still to go old-school unless you have reason not to. The boot loader we will be using to load the Linux kernel in this guide is called GRUB, so 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 recommend not using the MBR at all for booting, as some systems support this, but others don't. Instead, we recommend using UEFI to boot GRUB, which in turn will load Linux. We refer to this method as the UEFI + GRUB (GPT) method.

And yes, there are even more methods, some of which are documented on the Boot Methods page. We used to recommend a BIOS + GRUB (GPT) method but it is not consistently supported across a wide variety of hardware.

The big question is -- which boot method should you use? Here's how to tell.

Principle 1 - Old School
If you can reliably boot System Rescue CD and it shows you an initial light blue menu, you are booting the CD using the BIOS, and it's likely that you can thus boot Funtoo Linux using the BIOS. So, go old-school and use BIOS booting, unless you have some reason to use UEFI, such as having a >2.2TB system disk. In that case, see Principle 2, as your system may also support UEFI booting.
Principle 2 - New School
If you can reliably boot System Rescue CD and it shows you an initial black and white menu -- congratulations, your system is configured to support UEFI booting. This means that you are ready to install Funtoo Linux to boot via UEFI. Your system may still support BIOS booting, but just be trying UEFI first. You can poke around in your BIOS boot configuration and play with this.
What's the Big Difference between Old School and New School?
Here's the deal. If you go with old-school MBR partitions, your /boot partition will be an ext2 filesystem, and you'll use fdisk to create your MBR partitions. If you go with new-school GPT partitions and UEFI booting, your /boot partition will be a vfat filesystem, because this is what UEFI is able to read, and you will use gdisk to create your GPT partitions. And you'll install GRUB a bit differently. That's about all it comes down to, in case you were curious.
Also Note
To install Funtoo Linux to boot via the New School UEFI method, you must boot System Rescue CD using UEFI -- and see an initial black and white screen. Otherwise, UEFI will not be active and you will not be able to set it up!
   Note

Some motherboards may appear to support UEFI, but don't. Do your research. For example, the Award BIOS in my Gigabyte GA-990FXA-UD7 rev 1.1 has an option to enable UEFI boot for CD/DVD. This is not sufficient for enabling UEFI boot for hard drives and installing Funtoo Linux. UEFI must be supported for both removable media (so you can boot System Rescue CD using UEFI) as well as fixed media (so you can boot your new Funtoo Linux installation.) It turns out that later revisions of this board (rev 3.0) have a new BIOS that fully supports UEFI boot. This may point to a third principle -- know thy 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.

Mounting filesystems

Mount the newly-created filesystems as follows, creating /mnt/funtoo as the installation mount point:

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