Source string Read only

(itstool) path: sect2/screen
154/1540
Context English State
Format the file systems on the new mirror, enabling soft-updates.
<prompt>#</prompt> <userinput>newfs -U /dev/mirror/gm0s1a</userinput>
<prompt>#</prompt> <userinput>newfs -U /dev/mirror/gm0s1d</userinput>
<prompt>#</prompt> <userinput>newfs -U /dev/mirror/gm0s1e</userinput>
<prompt>#</prompt> <userinput>newfs -U /dev/mirror/gm0s1f</userinput>
File systems from the original <filename>ada0</filename> disk can now be copied onto the mirror with <citerefentry><refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum></citerefentry> and <citerefentry><refentrytitle>restore</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
<prompt>#</prompt> <userinput>mount /dev/mirror/gm0s1a /mnt</userinput>
<prompt>#</prompt> <userinput>dump -C16 -b64 -0aL -f - / | (cd /mnt &amp;&amp; restore -rf -)</userinput>
<prompt>#</prompt> <userinput>mount /dev/mirror/gm0s1d /mnt/var</userinput>
<prompt>#</prompt> <userinput>mount /dev/mirror/gm0s1e /mnt/tmp</userinput>
<prompt>#</prompt> <userinput>mount /dev/mirror/gm0s1f /mnt/usr</userinput>
<prompt>#</prompt> <userinput>dump -C16 -b64 -0aL -f - /var | (cd /mnt/var &amp;&amp; restore -rf -)</userinput>
<prompt>#</prompt> <userinput>dump -C16 -b64 -0aL -f - /tmp | (cd /mnt/tmp &amp;&amp; restore -rf -)</userinput>
<prompt>#</prompt> <userinput>dump -C16 -b64 -0aL -f - /usr | (cd /mnt/usr &amp;&amp; restore -rf -)</userinput>
Edit <filename>/mnt/etc/fstab</filename> to point to the new mirror file systems:
# Device Mountpoint FStype Options Dump Pass#
/dev/mirror/gm0s1a / ufs rw 1 1
/dev/mirror/gm0s1b none swap sw 0 0
/dev/mirror/gm0s1d /var ufs rw 2 2
/dev/mirror/gm0s1e /tmp ufs rw 2 2
/dev/mirror/gm0s1f /usr ufs rw 2 2
If the <filename>geom_mirror.ko</filename> kernel module has not been built into the kernel, <filename>/mnt/boot/loader.conf</filename> is edited to load the module at boot:
geom_mirror_load="YES"
Reboot the system to test the new mirror and verify that all data has been copied. The <acronym>BIOS</acronym> will see the mirror as two individual drives rather than a mirror. Because the drives are identical, it does not matter which is selected to boot.
See <xref linkend="gmirror-troubleshooting"/> if there are problems booting. Powering down and disconnecting the original <filename>ada0</filename> disk will allow it to be kept as an offline backup.
In use, the mirror will behave just like the original single drive.
Creating a Mirror with an Existing Drive
In this example, FreeBSD has already been installed on a single disk, <filename>ada0</filename>. A new disk, <filename>ada1</filename>, has been connected to the system. A one-disk mirror will be created on the new disk, the existing system copied onto it, and then the old disk will be inserted into the mirror. This slightly complex procedure is required because <command>gmirror</command> needs to put a 512-byte block of metadata at the end of each disk, and the existing <filename>ada0</filename> has usually had all of its space already allocated.
Load the <filename>geom_mirror.ko</filename> kernel module:
Check the media size of the original disk with <command>diskinfo</command>:
<prompt>#</prompt> <userinput>diskinfo -v ada0 | head -n3</userinput>
/dev/ada0
512 # sectorsize
1000204821504 # mediasize in bytes (931G)
Create a mirror on the new disk. To make certain that the mirror capacity is not any larger than the original <filename>ada0</filename> drive, <citerefentry><refentrytitle>gnop</refentrytitle><manvolnum>8</manvolnum></citerefentry> is used to create a fake drive of the exact same size. This drive does not store any data, but is used only to limit the size of the mirror. When <citerefentry><refentrytitle>gmirror</refentrytitle><manvolnum>8</manvolnum></citerefentry> creates the mirror, it will restrict the capacity to the size of <filename>gzero.nop</filename>, even if the new <filename>ada1</filename> drive has more space. Note that the <replaceable>1000204821504</replaceable> in the second line is equal to <filename>ada0</filename>'s media size as shown by <command>diskinfo</command> above.
<prompt>#</prompt> <userinput>geom zero load</userinput>
<prompt>#</prompt> <userinput>gnop create -s 1000204821504 gzero</userinput>
<prompt>#</prompt> <userinput>gmirror label -v gm0 gzero.nop ada1</userinput>
<prompt>#</prompt> <userinput>gmirror forget gm0</userinput>
Since <filename>gzero.nop</filename> does not store any data, the mirror does not see it as connected. The mirror is told to <quote>forget</quote> unconnected components, removing references to <filename>gzero.nop</filename>. The result is a mirror device containing only a single disk, <filename>ada1</filename>.
After creating <filename>gm0</filename>, view the partition table on <filename>ada0</filename>. This output is from a 1 TB drive. If there is some unallocated space at the end of the drive, the contents may be copied directly from <filename>ada0</filename> to the new mirror.
However, if the output shows that all of the space on the disk is allocated, as in the following listing, there is no space available for the 512-byte mirror metadata at the end of the disk.
<prompt>#</prompt> <userinput>gpart show ada0</userinput>
=&gt; 63 1953525105 ada0 MBR (931G)
63 1953525105 1 freebsd [active] (931G)
In this case, the partition table must be edited to reduce the capacity by one sector on <filename>mirror/gm0</filename>. The procedure will be explained later.
In either case, partition tables on the primary disk should be first copied using <command>gpart backup</command> and <command>gpart restore</command>.
<prompt>#</prompt> <userinput>gpart backup ada0 &gt; table.ada0</userinput>
<prompt>#</prompt> <userinput>gpart backup ada0s1 &gt; table.ada0s1</userinput>
These commands create two files, <filename>table.ada0</filename> and <filename>table.ada0s1</filename>. This example is from a 1 TB drive:
<prompt>#</prompt> <userinput>cat table.ada0</userinput>
MBR 4
1 freebsd 63 1953525105 [active]
<prompt>#</prompt> <userinput>cat table.ada0s1</userinput>
BSD 8
1 freebsd-ufs 0 4194304
2 freebsd-swap 4194304 33554432
4 freebsd-ufs 37748736 50331648
5 freebsd-ufs 88080384 41943040
6 freebsd-ufs 130023424 838860800
7 freebsd-ufs 968884224 984640881
If no free space is shown at the end of the disk, the size of both the slice and the last partition must be reduced by one sector. Edit the two files, reducing the size of both the slice and last partition by one. These are the last numbers in each listing.
<prompt>#</prompt> <userinput>cat table.ada0</userinput>
MBR 4
1 freebsd 63 <emphasis>1953525104</emphasis> [active]
<prompt>#</prompt> <userinput>cat table.ada0s1</userinput>
BSD 8
1 freebsd-ufs 0 4194304
2 freebsd-swap 4194304 33554432
4 freebsd-ufs 37748736 50331648
5 freebsd-ufs 88080384 41943040
6 freebsd-ufs 130023424 838860800
7 freebsd-ufs 968884224 <emphasis>984640880</emphasis>

Loading…

No matching activity found.

Browse all component changes

Things to check

Multiple failing checks

The translations in several languages have failing checks

Reset

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect2/screen
Flags
no-wrap, read-only
Source string location
book.translate.xml:36294
String age
a year ago
Source string age
a year ago
Translation file
books/handbook.pot, string 6046