Difference between pages "Rootfs over encrypted lvm over raid-1 on GPT" and "Install/pt-br/Overview"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
(Added another necessary step to take if /boot resides on a raid)
 
 
Line 1: Line 1:
This howto describes how to setup LVM and rootfs with cryptoLUKS-encrypted raid-1 over drive with GPT
<noinclude>
= Rootfs over encrypted lvm over raid-1 on GPT =
{{InstallPart|uma visão geral inicial do processo de instalação, tão em quanto instruções de download do LiveCD e de boot}}
</noinclude>
== Visão geral da instalação ==


To start read [[Rootfs_over_encrypted_lvm|Rootfs over encrypted lvm]]
Essa é uma básica visão geral do processo de instalação do Funtoo:


How to prepare the hard disk for GPT read [[Funtoo_Linux_Installation#GPT_Partitions|Funtoo Linux Installation on GPT_Partitions]].
# [[#Live CD|Baixe e boot o live CD da sua escolha]].
For example, installing a new system on <code>/dev/sdb</code>
# [[#Prepare Hard Disk|Prepare seu disco]].
# [[#Creating filesystems|Crie]] e [[#Mounting filesystems|monte]] os filesystems.
# [[#Installing the Stage 3 tarball|Instale o tarball stage doFuntoo]] da sua escolha.
# [[#Chroot into Funtoo|Use o Chroot no seu novo sistema]].
# [[#Downloading the Portage tree|Baixe o Portage tree]].
# [[#Configuring your system|Configure seu sistema]] e sua [[#Configuring your network|rede]].
# [[#Configuring and installing the Linux kernel|Instale um kernel]].
# [[#Installing a Bootloader|Instale um bootloader]].
# [[#Finishing Steps|Complete os passos finais]].
# [[#Restart your system|Reboot e aproveite]].


<console>
=== Live CD ===
###i## gdisk -l /dev/sdb
 
GPT fdisk (gdisk) version 0.6.13
Funtoo não provê um  Live CD "official" do Funtoo. Recomendamos utilizar o Gentoo-based [http://www.sysresccd.org/ System Rescue CD] já que ele contem muitas ferramentas e utilizades e tem suporte a sistemas tanto à 32-bit quando 64-bit. Baixe-o aqui:
 
http://www.sysresccd.org/Download


Partition table scan:
{{Note|Se utilizar uma versão antiga do System Rescue CD, '''certifique-se de selecionar o kernel <code>rescue64</code> no menu de boot se estiver instalando um sistema 64-bit'''. Por padrão, o System Rescue CD costumava a bottar em em módo 32-bit, embora a ultima versão atenta para detectar automaticamente  os processadores 64-bit.}}
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present


Found valid GPT with protective MBR; using GPT.
==== Acesso a Rede ====
Disk /dev/sdb: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 67AC0F92-E033-4B53-B6C5-D99DD8F49D90
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 2048-sector boundaries
Total free space is 3038 sectors (1.5 MiB)


Number  Start (sector)    End (sector)  Size      Code  Name
Uma vez que você tenha inicializado o System Rescue CD, veja se você possui acesso a Internet. Acesso a internet é necessário para a instalação do Funtoo Linux:
  1            2048          206847  100.0 MiB  0700  Linux/Windows data
  2          206848          207871  512.0 KiB  EF02  BIOS boot partition
  3          208896      625142414  298.0 GiB  FD00  Linux RAID
</console>


If you plan to use a raid-1 for installing only one partition (/dev/sdb3 in example) and, if successful, later add more to the mirror, issue something like:
<console>
<console>
###i## mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sdb3
# ##i##ping www.google.com
PING www.google.com (216.58.217.36) 56(84) bytes of data.
64 bytes from den03s10-in-f4.1e100.net (216.58.217.36): icmp_seq=1 ttl=57 time=30.1 ms
</console>
</console>


If you prefer to add the two final destination devices to the array in the first place, issue something like:
Se o ping obtiver sucesso  (Você visualiza as mensagens <code>64 bytes</code> como acima,) então sua rede está ativa. Pressione Control-C para parar o ping.
<console>
###i## mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
</console>


If everything worked well, the arrays will start synchronising immediately. You can monitor this progress by looking at the contents of <code>/proc/mdstat</code>:
Sei você precisar configurar uma conexão  WiFi para acesso a Internet, então essa precisa ser feita utilizando o ambiente gráfico do System Rescue CD. Execute <code>startx</code> para inicializar a seção gráfica:


<console>
<console>
###i## cat /proc/mdstat
# ##i##startx
Personalities : [raid1] [raid0] [raid6] [raid5] [raid4]
</console>
md2 : active raid1 sdb5[1] sda5[0]
      581595328 blocks [2/2] [UU]
        resync=DELAYED


md1 : active raid1 sdb4[1] sda4[0]
Depois, utilize o NetworkManager applet (ícone no canto inferior direito) para conectar a uma rede WiFi de sua escolha. Depois, um terminal terminal dentro de seu ambiente gráfico, e você deve ser capaz de utilizar o terminal para completar o resto dos passos.
      41942976 blocks [2/2] [UU]
      [>....................]  resync =  1.6% (691456/41942976) finish=8.9min speed=76828K/sec


md0 : active raid1 sdb1[1] sda1[0]
==== Instalação Remota ====
      511936 blocks [2/2] [UU]


unused devices: <none>
Alternativamente, você pode logar no System Rescue CD pela rede via SSH para realizar a instalação a partir de outro computador, e isso pode ser mais o jeito conveniente para instalar o Funtoo Linux.
###i##
</console>


Now, that's awesome, isn't it? :)
Se você gostaria de completar a instalação remotamente, aqui está como fazer isso. Primeiro, você precisará se assegurar de que o System Rescue CD tem uma conexão de rede funcional. Depois, você precisara definir uma senha de root para o System Rescue CD:
Even more awesome is the fact that you can immediately start using your shiny new RAID. It will finish it's sync in the background while you do changes to its filesystem.
 
== Encrypting the raid-1 ==


<console>
<console>
###i## cryptsetup -c aes-xts-plain luksFormat /dev/md0
# ##i##passwd
###i## cryptsetup luksOpen /dev/md0 dmcrypt_root
New password: ##i##********
Retype new password: ##i##********
passwd: password updated successfully
#
</console>
</console>


== Initramfs setup and configuration ==
Uma vez que você tenha digitado uma senha, você precisará agora determinar o endereço IP do System Rescue CD, e então você pode utilizar <code>ssh</code> para conectar-se à rede. Para determinar o endereço IP atualmente sendo utilizado pelo System Rescue CD, digite <code>ifconfig</code>:
=== No initramfs ===
To activate the raid-1 during boot without an initramfs, perform:
<syntaxhighlight lang="bash">
echo "Activating RAID device."
if [ ! -e '/etc/mdadm.conf' ]
then
echo "DEVICE /dev/sda[0-9] /dev/sdb[0-9] /dev/md[0-9]" >> /etc/mdadm.conf
mdadm --examine --scan --config=/etc/mdadm.conf  >> /etc/mdadm.conf
mdadm --assemble --scan
fi
</syntaxhighlight>


=== Better-initramfs ===
Or use [https://bitbucket.org/piotrkarbowski/better-initramfs better-initramfs] with raid-1 mdadm support
<console>
<console>
###i## git clone git@bitbucket.org:piotrkarbowski/better-initramfs.git
# ##i##ifconfig
</console>
</console>
This script is well documented at it's GitHub overview site (which displays the documentation from README.rst).
== Grub2 configuration ==
Do not forget:
<pre>enc_root=/dev/md0</pre>


Also, in the [[Funtoo_Linux_Installation#Running_grub-install_and_boot-update|non-RAID Funtoo Linux Installation doc]], GRUB is only installed into the MBR of <tt>/dev/sda</tt>. When using RAID1 for <tt>/boot</tt>, you most probably want to be able to boot your system from the second device in this array, if the first one dies. To be able to do so, a bootloader must be present in the MBR of each array member disk.
One of the interfaces should have an IP address (listed as <code>inet addr:</code>) from your LAN. You can then connect remotely, from another system on your LAN, to System Rescue CD, and perform steps from the comfort of an existing OS. On your remote system, type the following, replacing <code>1.2.3.4</code> with the IP address of System Rescue CD. Connecting from an existing Linux or MacOS system would look something like this:
Because of this, apply the command shown in the main doc to install GRUB to the MBR for each of your array member disks, instead of only the first one.
If, for example, you are building a RAID from <tt>/dev/sda1</tt> and <tt>/dev/sdb1</tt> to contain <tt>/boot</tt>, you will have to issue the following:


<console>
<console>
(chroot) # ##i##grub-install --no-floppy /dev/sda
(remote system) $ ##i##ssh root@1.2.3.4
(chroot) # ##i##grub-install --no-floppy /dev/sdb
Password: ##i##**********
(chroot) # ##i##boot-update
</console>
</console>


= Additional links =
{{Note|If you'd like to connect remotely from an existing Microsoft Windows system, you'll need to download an SSH client for Windows, such as [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY].}}
* [http://en.gentoo-wiki.com/wiki/RAID/Software RAID/Software]
* [http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml Gentoo Linux x86 with Software Raid and LVM2 Quick Install Guide]


[[Category:HOWTO]]
After you've logged in via SSH, you're now connected remotely to System Rescue CD and can perform the installation steps.

Revision as of 13:54, January 20, 2015


   Note

This is a template that is used as part of the Installation instructions which covers: uma visão geral inicial do processo de instalação, tão em quanto instruções de download do LiveCD e de boot. Templates are being used to allow multiple variant install guides that use most of the same re-usable parts.


Visão geral da instalação

Essa é uma básica visão geral do processo de instalação do Funtoo:

  1. Baixe e boot o live CD da sua escolha.
  2. Prepare seu disco.
  3. Crie e monte os filesystems.
  4. Instale o tarball stage doFuntoo da sua escolha.
  5. Use o Chroot no seu novo sistema.
  6. Baixe o Portage tree.
  7. Configure seu sistema e sua rede.
  8. Instale um kernel.
  9. Instale um bootloader.
  10. Complete os passos finais.
  11. Reboot e aproveite.

Live CD

Funtoo não provê um Live CD "official" do Funtoo. Recomendamos utilizar o Gentoo-based System Rescue CD já que ele contem muitas ferramentas e utilizades e tem suporte a sistemas tanto à 32-bit quando 64-bit. Baixe-o aqui:

http://www.sysresccd.org/Download

   Note

Se utilizar uma versão antiga do System Rescue CD, certifique-se de selecionar o kernel rescue64 no menu de boot se estiver instalando um sistema 64-bit. Por padrão, o System Rescue CD costumava a bottar em em módo 32-bit, embora a ultima versão atenta para detectar automaticamente os processadores 64-bit.

Acesso a Rede

Uma vez que você tenha inicializado o System Rescue CD, veja se você possui acesso a Internet. Acesso a internet é necessário para a instalação do Funtoo Linux:

root # ping www.google.com
PING www.google.com (216.58.217.36) 56(84) bytes of data.
64 bytes from den03s10-in-f4.1e100.net (216.58.217.36): icmp_seq=1 ttl=57 time=30.1 ms

Se o ping obtiver sucesso (Você visualiza as mensagens 64 bytes como acima,) então sua rede está ativa. Pressione Control-C para parar o ping.

Sei você precisar configurar uma conexão WiFi para acesso a Internet, então essa precisa ser feita utilizando o ambiente gráfico do System Rescue CD. Execute startx para inicializar a seção gráfica:

root # startx

Depois, utilize o NetworkManager applet (ícone no canto inferior direito) para conectar a uma rede WiFi de sua escolha. Depois, um terminal terminal dentro de seu ambiente gráfico, e você deve ser capaz de utilizar o terminal para completar o resto dos passos.

Instalação Remota

Alternativamente, você pode logar no System Rescue CD pela rede via SSH para realizar a instalação a partir de outro computador, e isso pode ser mais o jeito conveniente para instalar o Funtoo Linux.

Se você gostaria de completar a instalação remotamente, aqui está como fazer isso. Primeiro, você precisará se assegurar de que o System Rescue CD tem uma conexão de rede funcional. Depois, você precisara definir uma senha de root para o System Rescue CD:

root # passwd
New password: ********
Retype new password: ********
passwd: password updated successfully
root #

Uma vez que você tenha digitado uma senha, você precisará agora determinar o endereço IP do System Rescue CD, e então você pode utilizar ssh para conectar-se à rede. Para determinar o endereço IP atualmente sendo utilizado pelo System Rescue CD, digite ifconfig:

root # ifconfig

One of the interfaces should have an IP address (listed as inet addr:) from your LAN. You can then connect remotely, from another system on your LAN, to System Rescue CD, and perform steps from the comfort of an existing OS. On your remote system, type the following, replacing 1.2.3.4 with the IP address of System Rescue CD. Connecting from an existing Linux or MacOS system would look something like this:

(remote system) $ ssh root@1.2.3.4
Password: **********
   Note

If you'd like to connect remotely from an existing Microsoft Windows system, you'll need to download an SSH client for Windows, such as PuTTY.

After you've logged in via SSH, you're now connected remotely to System Rescue CD and can perform the installation steps.