The translation is temporarily closed for contributions due to maintenance, please come back later.
Context English Portuguese (Brazil)
_ translator-credits Edson Brandi, ebrandi@FreeBSD.org, 2018
Lucas Andrade, slucasandrade@protonmail.ch, 2018
Danilo G. Baio, dbaio@FreeBSD.org, 2018
<personname> <firstname>Daniel</firstname> <surname>Gerzo</surname> </personname> <affiliation> <_:address-1/> </affiliation> <personname> <firstname>Daniel</firstname> <surname>Gerzo</surname> </personname> <affiliation> <_:address-1/> </affiliation>
FreeBSD is a registered trademark of the FreeBSD Foundation. FreeBSD is a registered trademark of the FreeBSD Foundation.
$FreeBSD: head/en_US.ISO8859-1/articles/remote-install/article.xml 51348 2017-12-30 22:56:56Z eadler $ $FreeBSD: head/en_US.ISO8859-1/articles/remote-install/article.xml 51348 2017-12-30 22:56:56Z eadler $
Background Background
As we have mentioned in the <link linkend="background">Background</link> section, many of the reputable server hosting companies provide some kind of rescue system, which is booted from their <acronym>LAN</acronym> and accessible over <application>SSH</application>. They usually provide this support in order to help their customers fix broken operating systems. As this article will explain, it is possible to install FreeBSD with the help of these rescue systems. Como mencionamos na seção <link linkend="background">​​Background</link>, muitas das empresas de hospedagem de servidores renomadas fornecem algum tipo de sistema de recuperação, que é inicializado a partir de sua <acronym>LAN</acronym> e acessível por <application>SSH</application>. Eles normalmente fornecem esse suporte para ajudar seus clientes a consertar sistemas operacionais quebrados. Como este artigo explicará, é possível instalar o FreeBSD com a ajuda destes sistemas de recuperação.
<prompt>#</prompt> <userinput>fetch http://mfsbsd.vx.sk/release/mfsbsd-<replaceable>2.1</replaceable>.tar.gz</userinput>
<prompt>#</prompt> <userinput>tar xvzf mfsbsd-<replaceable>2.1</replaceable>.tar.gz</userinput>
<prompt>#</prompt> <userinput>cd mfsbsd-<replaceable>2.1</replaceable>/</userinput>
<prompt>#</prompt> <userinput>fetch http://mfsbsd.vx.sk/release/mfsbsd-<replaceable>2.1</replaceable>.tar.gz</userinput>
<prompt>#</prompt> <userinput>tar xvzf mfsbsd-<replaceable>2.1</replaceable>.tar.gz</userinput>
<prompt>#</prompt> <userinput>cd mfsbsd-<replaceable>2.1</replaceable>/</userinput>
When the installed network interface card is unknown, it is possible to use the auto-detection features of <application>mfsBSD</application>. The startup scripts of <application>mfsBSD</application> can detect the correct driver to use, based on the MAC address of the interface, if we set the following options in <filename>conf/interfaces.conf</filename>: Quando a placa de rede instalada é desconhecida, é possível usar os recursos de detecção automática do <application>mfsBSD</application>. Os scripts de inicialização do <application>mfsBSD</application> podem detectar o driver correto a ser usado, com base no endereço MAC da interface, se configurarmos as seguintes opções em <filename>conf/interfaces.conf</filename>:
mac_interfaces="ext1"
ifconfig_ext1_mac="00:00:00:00:00:00"
ifconfig_ext1="inet 192.168.0.2/24"
mac_interfaces="ext1"
ifconfig_ext1_mac="00:00:00:00:00:00"
ifconfig_ext1="inet 192.168.0.2/24"
defaultrouter="192.168.0.1" defaultrouter="192.168.0.1"
defaultrouter="192.168.0.1"
ifconfig_re0="inet 192.168.0.2/24"
defaultrouter="192.168.0.1"
ifconfig_re0="inet 192.168.0.2/24"
<prompt>#</prompt> <userinput>mdconfig -a -t vnode -u 10 -f <replaceable>FreeBSD-10.1-RELEASE-amd64-disc1.iso</replaceable></userinput>
<prompt>#</prompt> <userinput>mount_cd9660 /dev/md10 /cdrom</userinput>
<prompt>#</prompt> <userinput>mdconfig -a -t vnode -u 10 -f <replaceable>FreeBSD-10.1-RELEASE-amd64-disc1.iso</replaceable></userinput>
<prompt>#</prompt> <userinput>mount_cd9660 /dev/md10 /cdrom</userinput>
<prompt>#</prompt> <userinput>mkdir <replaceable>DIST</replaceable></userinput>
<prompt>#</prompt> <userinput>tar -xvf /cdrom/usr/freebsd-dist/base.txz -C <replaceable>DIST</replaceable></userinput>
<prompt>#</prompt> <userinput>tar -xvf /cdrom/usr/freebsd-dist/kernel.txz -C <replaceable>DIST</replaceable></userinput>
<prompt>#</prompt> <userinput>mkdir <replaceable>DIST</replaceable></userinput>
<prompt>#</prompt> <userinput>tar -xvf /cdrom/usr/freebsd-dist/base.txz -C <replaceable>DIST</replaceable></userinput>
<prompt>#</prompt> <userinput>tar -xvf /cdrom/usr/freebsd-dist/kernel.txz -C <replaceable>DIST</replaceable></userinput>
<prompt>#</prompt> <userinput>make BASE=<replaceable>DIST</replaceable></userinput> <prompt>#</prompt> <userinput>make BASE=<replaceable>DIST</replaceable></userinput>
<prompt>#</prompt> <userinput>scp disk.img root@192.168.0.2:.</userinput> <prompt>#</prompt> <userinput>scp disk.img root@192.168.0.2:.</userinput>
<prompt>#</prompt> <userinput>dd if=/root/disk.img of=/dev/sda bs=1m</userinput> <prompt>#</prompt> <userinput>dd if=/root/disk.img of=/dev/sda bs=1m</userinput>
<prompt>#</prompt> <userinput>dd if=/dev/zero of=/dev/<replaceable>ad0</replaceable> count=2</userinput> <prompt>#</prompt> <userinput>dd if=/dev/zero of=/dev/<replaceable>ad0</replaceable> count=2</userinput>
Next, create slices and label them with your preferred tool. While it is considered easier to use <application>sysinstall</application>, a powerful and also probably less buggy method will be to use standard text-based <trademark class="registered">UNIX</trademark> tools, such as <citerefentry><refentrytitle>fdisk</refentrytitle><manvolnum>8</manvolnum></citerefentry> and <citerefentry><refentrytitle>bsdlabel</refentrytitle><manvolnum>8</manvolnum></citerefentry>, which will also be covered in this section. The former option is well documented in the <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/install-steps.html">Installing FreeBSD</link> chapter of the FreeBSD Handbook. As it was mentioned in the introduction, this article will present how to set up a system with RAID-1 and <application>ZFS</application> capabilities. Our set up will consist of a small <citerefentry><refentrytitle>gmirror</refentrytitle><manvolnum>8</manvolnum></citerefentry> mirrored <filename>/</filename> (root), <filename>/usr</filename> and <filename>/var</filename> dataset, and the rest of the disk space will be allocated for a <citerefentry><refentrytitle>zpool</refentrytitle><manvolnum>8</manvolnum></citerefentry> mirrored <application>ZFS</application> file system. Please note, that the <application>ZFS</application> file system will be configured after the FreeBSD operating system is successfully installed and booted. Em seguida, crie as slices e atribua um label usando sua ferramenta preferida. Embora seja considerado mais fácil usar o <application>sysinstall</application>, um método poderoso e provavelmente com menos bugs será usar as ferramentas padrões de console <trademark class="registered">UNIX</trademark>, como o <citerefentry><refentrytitle>fdisk</refentrytitle><manvolnum>8</manvolnum></citerefentry> e o <citerefentry><refentrytitle>bsdlabel</refentrytitle><manvolnum>8</manvolnum></citerefentry>, o qual também será abordado nesta seção. A primeira opção está bem documentada no capítulo <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/install-steps.html">Instalando o FreeBSD</link> do Handbook do FreeBSD. Como foi mencionado na introdução, este artigo apresentará como configurar um sistema com recursos RAID-1 e <application>ZFS</application>. Nossa configuração consistirá de uma pequena partição <filename>/</filename> (root) , de um dataset composto por um <filename>/usr</filename> e um <filename>/var</filename> , todos espelhados com o <citerefentry><refentrytitle>gmirror</refentrytitle><manvolnum>8</manvolnum></citerefentry>, e o restante do espaço em disco alocado para um sistema de arquivos <citerefentry><refentrytitle>zpool</refentrytitle><manvolnum>8</manvolnum></citerefentry> espelhado do <application>ZFS</application>. Por favor, observe que o sistema de arquivos<application>ZFS</application> será configurado depois que o sistema operacional FreeBSD for instalado e inicializado com sucesso.
The following example will describe how to create slices and labels, initialize <citerefentry><refentrytitle>gmirror</refentrytitle><manvolnum>8</manvolnum></citerefentry> on each partition and how to create a <application>UFS2</application> file system in each mirrored partition: O exemplo a seguir descreverá como criar slices e labels, inicializar o <citerefentry><refentrytitle>gmirror</refentrytitle><manvolnum>8</manvolnum></citerefentry> em cada partição e como criar um sistema de arquivos <application>UFS2</application> em cada partição espelhada:
<prompt>#</prompt> <userinput>fdisk -BI /dev/ad0</userinput> <co xml:id="fdisk"/>
<prompt>#</prompt> <userinput>fdisk -BI /dev/ad1</userinput>
<prompt>#</prompt> <userinput>bsdlabel -wB /dev/ad0s1</userinput> <co xml:id="bsdlabel-writing"/>
<prompt>#</prompt> <userinput>bsdlabel -wB /dev/ad1s1</userinput>
<prompt>#</prompt> <userinput>bsdlabel -e /dev/ad0s1</userinput> <co xml:id="bsdlabel-editing"/>
<prompt>#</prompt> <userinput>bsdlabel /dev/ad0s1 &gt; /tmp/bsdlabel.txt &amp;&amp; bsdlabel -R /dev/ad1s1 /tmp/bsdlabel.txt</userinput> <co xml:id="bsdlabel-restore"/>
<prompt>#</prompt> <userinput>gmirror label root /dev/ad[01]s1a</userinput> <co xml:id="gmirror1"/>
<prompt>#</prompt> <userinput>gmirror label var /dev/ad[01]s1d</userinput>
<prompt>#</prompt> <userinput>gmirror label usr /dev/ad[01]s1e</userinput>
<prompt>#</prompt> <userinput>gmirror label -F swap /dev/ad[01]s1b</userinput> <co xml:id="gmirror2"/>
<prompt>#</prompt> <userinput>newfs /dev/mirror/root</userinput> <co xml:id="newfs"/>
<prompt>#</prompt> <userinput>newfs /dev/mirror/var</userinput>
<prompt>#</prompt> <userinput>newfs /dev/mirror/usr</userinput>
<prompt>#</prompt> <userinput>fdisk -BI /dev/ad0</userinput> <co xml:id="fdisk"/>
<prompt>#</prompt> <userinput>fdisk -BI /dev/ad1</userinput>
<prompt>#</prompt> <userinput>bsdlabel -wB /dev/ad0s1</userinput> <co xml:id="bsdlabel-writing"/>
<prompt>#</prompt> <userinput>bsdlabel -wB /dev/ad1s1</userinput>
<prompt>#</prompt> <userinput>bsdlabel -e /dev/ad0s1</userinput> <co xml:id="bsdlabel-editing"/>
<prompt>#</prompt> <userinput>bsdlabel /dev/ad0s1 &gt; /tmp/bsdlabel.txt &amp;&amp; bsdlabel -R /dev/ad1s1 /tmp/bsdlabel.txt</userinput> <co xml:id="bsdlabel-restore"/>
<prompt>#</prompt> <userinput>gmirror label root /dev/ad[01]s1a</userinput> <co xml:id="gmirror1"/>
<prompt>#</prompt> <userinput>gmirror label var /dev/ad[01]s1d</userinput>
<prompt>#</prompt> <userinput>gmirror label usr /dev/ad[01]s1e</userinput>
<prompt>#</prompt> <userinput>gmirror label -F swap /dev/ad[01]s1b</userinput> <co xml:id="gmirror2"/>
<prompt>#</prompt> <userinput>newfs /dev/mirror/root</userinput> <co xml:id="newfs"/>
<prompt>#</prompt> <userinput>newfs /dev/mirror/var</userinput>
<prompt>#</prompt> <userinput>newfs /dev/mirror/usr</userinput>