Beruflich Dokumente
Kultur Dokumente
Almacenamiento
La seccin Almacenamiento de la interfaz grfica permite configurar estas opciones:
8.1. Volmenes
La seccin Volmenes de la interfaz grfica de FreeNAS se puede utilizar para formatear grupos de ZFS,
importar un disco para copiar sus datos en un grupo existente o importar un grupo de ZFS existente. Tambin
se puede utilizar para crear conjuntos de datos ZFS y zvols y para administrar sus permisos.
Nota
El diseo de almacenamiento adecuado es importante para cualquier NAS. Lea todo este captulo antes de
configurar los discos de almacenamiento. Todas las caractersticas se describen para ayudar a aclarar cul
ser el mayor beneficio para sus usos y advertencias o restricciones o restricciones de hardware que
podran limitar su uso.
Administrador de volmenes se utiliza para agregar discos a un grupo de ZFS. Los datos antiguos de
los discos aadidos se sobrescriben, as que gurdelos en otro lugar antes de reutilizar un disco. Consulte
el ZFS Primer para obtener informacin sobre la redundancia ZFS con varios discos antes de utilizar Volume
Manager .
Seleccionando Storage Volumes Volume Manager abre una pantalla como el ejemplo que se
muestra en la Figura 8.1.1 .
Arrastre el control deslizante para seleccionar el nmero de discos deseado. Volume Manager mostrar la
capacidad de almacenamiento resultante, teniendo en cuenta el espacio de intercambio. Para cambiar el
diseo o el nmero de discos, utilice el ratn para arrastrar el control deslizante al diseo de volumen
deseado. Tambin se puede hacer clic en el men desplegable Volumen de diseo si se requiere un nivel
diferente de redundancia.
Nota
Por razones de rendimiento y capacidad, esta pantalla no permite crear un volumen a partir de discos de
diferentes tamaos. Aunque no es recomendable, es posible crear un volumen en esta situacin utilizando el
botn Configuracin manual y siguiendo las instrucciones de Configuracin manual .
Volume Manager slo permite elegir una configuracin si se han seleccionado suficientes discos para crear
esa configuracin. Estos diseos son compatibles:
Stripe: requiere al menos un disco
Espejo: requiere al menos dos discos
RAIDZ1: requiere al menos tres discos
RAIDZ2: requiere al menos cuatro discos
RAIDZ3: requiere al menos cinco discos
dispositivo de registro: requiere al menos un dispositivo dedicado, SSD se recomienda
dispositivo de cach: requiere al menos un dispositivo dedicado, se recomienda SSD
Cuando se utilizan ms de cinco discos, se debe considerar la disposicin ptima para obtener el mejor
rendimiento y escalabilidad. Se puede encontrar una vista general de los tamaos de grupo de discos
recomendados, as como ms informacin acerca de los dispositivos de registro y cach en el ZFS Primer .
El botn Aadir volumen advierte que los datos existentes se borrarn . En otras palabras, la creacin de
un nuevo volumen reformatea los discos seleccionados. Si desea conservar los datos existentes, haga clic en el
botn Cancelar y consulte Importar disco e importar volumen para ver si el formato existente es
compatible. En ese caso, realice la accin soportada en su lugar. Si el formato de almacenamiento actual no es
compatible, es necesario hacer una copia de seguridad de los datos en un soporte externo, formatear los
discos y restaurar los datos al nuevo volumen.
Dependiendo del tamao y el nmero de discos, del tipo de controlador y de si se ha seleccionado el cifrado,
la creacin del volumen puede tardar algn tiempo. Despus de crear el volumen, la pantalla se actualizar y
el nuevo volumen aparecer en el rbol en Storage Volumes . Haga clic en el signo + junto al nombre
del volumen para acceder a las opciones Sustituir permisos , Crear conjunto de datosy Crear zvol .
8.1.1.1. Cifrado
A partir de 8.3.1, FreeNAS soporta el cifrado de disco completo GELI al crear volmenes ZFS. Es importante
entender lo siguiente cuando se considera si el cifrado es correcto para su sistema FreeNAS :
Este no es el mtodo de cifrado utilizado por la versin de Oracle de ZFS, ya que la versin no es de cdigo
abierto y es propiedad de Oracle.
Se trata de cifrado de disco completo y no de cifrado por sistema de archivos. Las unidades subyacentes se
cifran primero y, a continuacin, se crea el grupo en la parte superior de los dispositivos cifrados.
Este tipo de cifrado est dirigido principalmente a usuarios que almacenan datos confidenciales y quieren
conservar la capacidad de eliminar discos del grupo sin tener que limpiar primero el contenido del disco.
Este diseo slo es adecuado para la eliminacin segura de discos independientes de la clave de
cifrado. Mientras la clave y los discos estn intactos, el sistema es vulnerable a ser descifrado. La clave
debe estar protegida por una frase de contrasea fuerte y cualquier copia de seguridad de la clave debe
almacenarse de forma segura.
Por otro lado, si se pierde la clave, los datos de los discos son inaccesibles. Siempre respalde la llave!
La clave de cifrado es por volumen ZFS (grupo). Si crea varias agrupaciones, cada grupo tiene su propia
clave de cifrado.
Si el sistema tiene muchos discos, habr un impacto en el rendimiento si la CPU no soporta AES-NI o si no
hay hardware de cifrado instalado. Sin aceleracin de hardware, habr un impacto de rendimiento del
20% para un solo disco. La degradacin del rendimiento continuar aumentando con ms discos. A medida
que se escriben los datos, se cifran automticamente y, a medida que se leen los datos, se descifran al
vuelo. Si el procesador es compatible con el conjunto de instrucciones AES-NI, debe haber muy poca o
ninguna degradacin en el rendimiento al utilizar el cifrado. Este post de foro compara el rendimiento de
varias CPUs.
Los datos en el cach de ARC y el contenido de RAM no estn cifrados.
El intercambio siempre se cifra, incluso en volmenes no cifrados.
No hay manera de convertir un volumen existente, sin cifrar. En su lugar, se debe realizar una copia de
seguridad de los datos, se debe destruir el conjunto existente, crear un nuevo volumen cifrado y restaurar
la copia de seguridad en el nuevo volumen.
Las agrupaciones hbridas no son compatibles. En otras palabras, los vdevs recin creados deben coincidir
con el esquema de cifrado existente. Al extender un volumen, Volume Manager cifrar automticamente
el nuevo vdev que se agrega al grupo cifrado existente.
Nota
La instalacin de cifrado utilizada por FreeNAS est diseada para proteger contra el robo fsico de los
discos. No est diseado para proteger contra el acceso de software no autorizado. Asegrese de que slo los
usuarios autorizados tengan acceso a la GUI administrativa y que los permisos adecuados se establezcan en
los recursos compartidos si se almacenan datos confidenciales en el sistema.
Para crear un volumen cifrado, marque el cuadro Cifrado que se muestra en la Figura 8.1.1 . Un mensaje
emergente le recuerda que es extremadamente importante hacer una copia de seguridad de la clave , ya
que sin ella los datos de los discos son inaccesibles. Consulte Gestin de volmenes cifrados para obtener
instrucciones.
Nota
Cuando se utilizan discos de diferentes tamaos, el volumen est limitado por el tamao del disco ms
pequeo. Por este motivo, se recomienda utilizar Volume Manager con discos del mismo tamao.
La figura 8.1.2 muestra la pantalla de configuracin manual y la tabla 8.1.2 resume las opciones
disponibles.
Discos
lista resalte el nmero deseado de discos de la lista de discos disponibles
miembros
Nota
Si el volumen existente est cifrado, un mensaje de advertencia le recordar que la operacin de extender un
volumen restablecer la contrasea y la clave de recuperacin. Despus de ampliar el volumen, debe volver a
crearlo de inmediato utilizando las instrucciones de Gestin de volmenes cifrados .
Despus de seleccionar un volumen existente en el men desplegable, arrastre y suelte los discos deseados y
seleccione el diseo de volumen deseado. Por ejemplo, se pueden agregar discos para aumentar la capacidad
del grupo ZFS.
Al agregar discos para aumentar la capacidad de un volumen, ZFS admite la adicin de dispositivos virtuales,
conocidos como vdevs, a un grupo de ZFS existente. Un vdev puede ser un solo disco, una franja, un espejo,
un RAIDZ1, RAIDZ2 o un RAIDZ3. Despus de crear un vdev, no se pueden agregar ms unidades a ese
vdev ; sin embargo, puede rayar un nuevo vdev (y sus discos) con otro del mismo tipo de vdev existente para
aumentar el tamao total de ZFS del grupo. En otras palabras, cuando se extiende un volumen de ZFS,
realmente est rayando vdevs similares. Aqu hay unos ejemplos:
para extender una franja ZFS, agregue uno o ms discos. Dado que no hay redundancia, no es necesario
agregar la misma cantidad de discos que la existente.
para extender un espejo ZFS, agregue el mismo nmero de unidades. Por ejemplo, si tiene 10 unidades,
puede comenzar creando un espejo de dos unidades, ampliando este espejo creando otro espejo de dos
unidades y repitiendo tres veces ms hasta que las 10 unidades tengan se ha aadido.
para ampliar un RAIDZ1 de tres unidades, agregue tres unidades adicionales. El resultado es un RAIDZ + 0,
similar a RAID 50 en un controlador de hardware.
para ampliar un RAIDZ2 se requiere un mnimo de cuatro unidades adicionales. El resultado es un RAIDZ2
+ 0, similar a RAID 60 en un controlador de hardware.
Si intenta agregar un nmero incorrecto de discos al vdev existente, aparecer un mensaje de error que
indicar el nmero de discos que se necesitan. Deber seleccionar el nmero correcto de discos para
continuar.
Storage Volumes Volume Manager (vase la Figura 8.1.1 ) tambin se utiliza para agregar SSD
L2ARC o ZIL para mejorar tipos especficos de rendimiento de volumen. Esto se describe con ms detalle en
el ZFS Primer .
Despus de que los SSD se hayan instalado fsicamente, haga clic en el botn Volume Manager y elija el
volumen en el men desplegable Volumen para extender . Haga clic en el + al lado del SSD en la
lista Discos disponibles . En el men desplegable Volumen , seleccione Cach (L2ARC) para agregar
un dispositivo de cach, o Registro (ZIL) para agregar un dispositivo de registro. Por ltimo, haga clic
en Extender volumen para agregar el SSD.
El captulo sobre comparticin contiene ejemplos de configuracin para varios tipos de escenarios de
permisos. Esta seccin proporciona una descripcin general de la pantalla que se utiliza para establecer
permisos.
Nota
Para que los usuarios y grupos estn disponibles, deben crearse primero mediante las instrucciones
de Account o importarse desde un servicio de directorio utilizando las instrucciones de Directory Services . Si
hay ms de 50 usuarios o grupos disponibles, los mens desplegables descritos en esta seccin
automticamente truncarn su pantalla a 50 por razones de rendimiento. En este caso, comience a escribir el
nombre de usuario o grupo deseado para que la pantalla reduzca su bsqueda a resultados coincidentes.
Despus de crear un volumen o conjunto de datos, se muestra por su nombre de punto de montaje
en Storage Volumes ViewVolumes . Al hacer clic en el icono Cambiar permisos para un
volumen / conjunto de datos especfico, se muestra la pantalla que se muestra en la Figura 8.1.3 . En la tabla
8.1.3 se resumen las opciones de esta pantalla.
Fig. 8.1.3 Cambio de permisos en un volumen o conjunto de datos
Tabla 8.1.3 Opciones al cambiar permisos
Aplicar
desactive para evitar que se aplique el cambio de permiso nuevo
propietario caja
a Propietario (usuario) , vea Nota abajo
(usuario)
Aplicar
desactive para evitar que se aplique el cambio de permiso nuevo
propietario caja
a Propietario (grupo) , vea Nota abajo
(grupo)
Tabla 8.1.3 Opciones al cambiar permisos
casillas de slo se aplica a Unix o Mac "Tipo de permiso" por lo que ser en
Modo
verificacin gris si Windows est seleccionado
Si una mezcla de sistemas operativos o clientes accede al volumen / conjunto de datos utilizando un recurso
no SMB, seleccione el tipo de permiso Unix , ya que todos los clientes los entienden.
El tipo de permiso de Windows aumenta los permisos Unix tradicionales con ACL. Utilice el Tipo de
permiso de Windows para los recursos compartidos de SMB o cuando el sistema FreeNAS sea miembro
de un dominio de Active Directory.
Si cambia de opinin sobre el tipo de permiso , no es necesario volver a crear el volumen / conjunto de
datos, ya que los datos existentes no se pierden. Sin embargo, al cambiar de Windows a Unix o Mac se
eliminarn los permisos extendidos proporcionados por las ACL de los archivos existentes.
Cuando se establece el tipo de permiso de Windows , las ACL se establecen en lo que Windows
establece en nuevos archivos y directorios de forma predeterminada. El cliente de Windows debe utilizarse
para ajustar los permisos segn sea necesario.
Un volumen ZFS existente se puede dividir en conjuntos de datos. Los permisos, la compresin, la
deduplicacin y las cuotas pueden establecerse en base a un conjunto de datos, lo que permite un mayor
control granular sobre el acceso a los datos de almacenamiento.Un conjunto de datos es similar a una carpeta
en la que puede establecer permisos; tambin es similar a un sistema de archivos en el que puede establecer
propiedades como cuotas y compresin, as como crear instantneas.
Nota
La seleccin de un volumen ZFS existente en el rbol y el clic en Crear conjunto de datos muestra la
pantalla de la Figura 8.1.4 .
Fig. 8.1.4 Creacin de un conjunto de datos ZFS
La Tabla 8.1.4 resume las opciones disponibles al crear un conjunto de datos de ZFS. Algunos ajustes slo
estn disponibles en Modo avanzado . Para ver estos ajustes, haga clic en el botn Modo avanzado o
configure el sistema para que muestre siempre esta configuracin marcando la casilla Mostrar campos
avanzados de forma predeterminada en System Advanced . La mayora de los atributos,
excepto el nombre del conjunto de datos , la sensibilidad de maysculas y el tamao
de registro , se pueden cambiar despus de la creacin del conjunto de datos resaltando el nombre del
conjunto de datos y haciendo clic en el botn Editar
opciones en Storage Volumes View Volumes .
Tabla 8.1.4 Opciones del conjunto de datos de ZFS
Espacio reservado
slo disponible en modo avanzado ; un valor especificado
para este conjunto de
entero se aplica tanto a este conjunto de datos como a cualquier
datos y todos los
conjunto de datos secundario
nios
Despus de crear un conjunto de datos, puede hacer clic en ese conjunto de datos y seleccionar Crear
conjunto de datos , creando as un conjunto de datos anidado o un conjunto de datos dentro de un
conjunto de datos. Tambin se puede crear un zvol en un dataset.Al crear conjuntos de datos, compruebe que
est utilizando la opcin Crear conjunto de datos para el volumen o conjunto de datos deseado. Si
se confunde al crear un conjunto de datos en un volumen, haga clic en todos los conjuntos de datos existentes
para cerrarlos: el conjunto de datos de creacin restante corresponder al volumen.
8.1.3.1. Deduplicacin
Deduplicacin es el proceso de ZFS reutilizando de forma transparente una sola copia de datos duplicados
para ahorrar espacio.Dependiendo de la cantidad de datos duplicados, la deduplicacin puede mejorar la
capacidad de almacenamiento, ya que se escriben y almacenan menos datos. Sin embargo, la deduplicacin
es RAM intensiva. Una regla general es 5 GB de RAM por terabyte de almacenamiento deduplicado. En la
mayora de los casos, la compresin proporciona ganancias de almacenamiento comparables a la
deduplicacin con menos impacto en el rendimiento.
En FreeNAS , la deduplicacin se puede habilitar durante la creacin del conjunto de datos. Tenga presente
que no hay manera de descomprimir los datos dentro de un conjunto de datos una vez que la deduplicacin
est habilitada , ya que la deshabilitacin de la deduplicacin NO tiene EFECTO en los datos
existentes. Cuantos ms datos se escriban en un dataset deduplicado, ms RAM necesita.Cuando el sistema
comienza a almacenar los DDTs (tablas dedup) en el disco porque ya no caben en RAM, los crteres de
rendimiento.Adems, importar un pool impuro puede requerir entre 3-5 GB de RAM por terabyte de datos
deduplicados, y si el sistema no tiene la RAM necesaria, entrar en pnico. La nica solucin es agregar ms
RAM o recrear la agrupacin. Piense cuidadosamente antes de habilitar dedup! Este artculo proporciona una
buena descripcin de las consideraciones de valor versus costo para deduplicacin.
A menos que haya una gran cantidad de RAM y una gran cantidad de datos duplicados, no cambie la
configuracin de deduplicacin predeterminada de "Desactivado". Por razones de rendimiento, considere
utilizar la compresin en lugar de activar esta opcin.
Nota
La deduplicacin se considera a menudo cuando se utiliza un grupo de imgenes de mquinas virtuales muy
similares. Sin embargo, otras caractersticas de ZFS pueden proporcionar funcionalidad dedup-like de manera
ms eficiente. Por ejemplo, cree un conjunto de datos para una VM estndar, luego clone ese conjunto de
datos para otras VM. Slo se guarda la diferencia entre cada VM creada y el conjunto de datos principal,
dando el efecto de la deduplicacin sin la sobrecarga.
8.1.3.2. Compresin
Al seleccionar un tipo de compresin, debe equilibrar el rendimiento con la cantidad de espacio en disco
guardado por compresin. La compresin es transparente para el cliente y las aplicaciones, ya que ZFS
comprime automticamente los datos cuando se escriben en un dataset comprimido o zvol y descomprime
automticamente esos datos a medida que se leen. Estos algoritmos de compresin son compatibles:
lz4: mtodo de compresin recomendado, ya que permite que los conjuntos de datos comprimidos
funcionen a una velocidad casi en tiempo real. Este algoritmo slo comprime los archivos que se
beneficiarn de la compresin. De forma predeterminada, las agrupaciones de ZFS realizadas con
FreeNAS 9.2.1 o superior usan este mtodo de compresin, lo que significa que este algoritmo se utiliza
si el nivel de compresin se deja en Inherit al crear un conjunto de datos o zvol.
gzip: vara de los niveles 1 a 9 donde gzip ms rpido (nivel 1) da la menor compresin y mximo
gzip (nivel 9) proporciona la mejor compresin, pero se desaconseja debido a su impacto en el
rendimiento.
zle: algoritmo rpido pero simple para eliminar las ejecuciones de ceros.
lzjb: proporciona compresin de datos decente, pero se considera obsoleto como lz4 proporciona un
rendimiento mucho mejor.
Un zvol es una caracterstica de ZFS que crea un dispositivo de bloque sin procesar a travs de ZFS. Esto le
permite usar un zvol como una extensin de dispositivo iSCSI .
Para crear un archivo zvol, seleccione un volumen o conjunto de datos ZFS existente en el rbol y, a
continuacin, haga clic en Crear zvol para abrir la pantalla que se muestra en la Figura 8.1.5 .
Fig. 8.1.5 Creacin de un zvol
Las opciones de configuracin se describen en la Tabla 8.1.5 . Algunos ajustes slo estn disponibles en Modo
avanzado . Para ver estos ajustes, haga clic en el botn Modo avanzado o configure el sistema para que
siempre muestre estos valores marcando Mostrar campos avanzados de forma
predeterminada en System Advanced .
Nivel de Men consulte la seccin sobre Compresin para obtener una descripcin
compresin desplegable de los algoritmos disponibles
La pantalla Volume Import Disk , que se muestra en la figura 8.1.6 , se utiliza para importar
un solo disco que ha sido formateado con el sistema de archivos UFS, NTFS, MSDOS o EXT2. La importacin
est destinada a ser una medida temporal para copiar los datos de un disco a un conjunto de datos ZFS
existente. Slo se puede importar un disco a la vez.
Nota
Las importaciones de sistemas de archivos EXT3 o EXT4 son posibles en algunos casos, aunque ninguno de
ellos es totalmente compatible. El registro en diario de EXT3 no es compatible, por lo que esos sistemas de
archivos deben tener una utilidad fsckexterna, como la proporcionada por las utilidades de E2fsprogs , que se
ejecutan en ellas antes de la importacin. Los sistemas de archivos EXT4 con atributos extendidos o inodos
mayores de 128 bytes no son compatibles. Los sistemas de archivos EXT4 con registro en EXT3 deben tener
un fsck ejecutado en ellos antes de la importacin, como se describe anteriormente.
Si hace clic en Storage Volumes Import Volume , puede configurar FreeNAS para utilizar un
grupo de ZFS existente . Esta accin se realiza tpicamente cuando se vuelve a instalar un sistema
FreeNAS existente. Dado que el sistema operativo est separado de los discos de almacenamiento, una
nueva instalacin no afecta a los datos de los discos. Sin embargo, el nuevo sistema operativo debe
configurarse para utilizar el volumen existente.
La Figura 8.1.7 muestra la ventana emergente inicial que aparece al importar un volumen.
Si un grupo ZFS existente no se muestra en el men desplegable, ejecute zpool import desde Shell para
importar el grupo.
Si planea instalar fsicamente discos con formato ZFS desde otro sistema, asegrese de exportar las unidades
en ese sistema para evitar un error "en uso por otra mquina" durante la importacin.
Si sospecha que su hardware no est siendo detectado, ejecute camcontrol devlist desde Shell . Si el
disco no aparece en la salida, compruebe si el controlador del controlador es compatible o si debe cargarse
utilizando Tunables .
Si est importando una agrupacin ZFS con cifrado GELI existente, debe descifrar los discos antes de importar
la agrupacin. En la Figura 8.1.7 , seleccione S: Descifrar discos para acceder a la pantalla mostrada
en la Figura 8.1.9 .
Nota
La clave de cifrado es necesaria para descifrar la agrupacin. Si no se puede descifrar el conjunto, no se puede
volver a importar despus de una actualizacin fallida o una configuracin perdida. Esto significa que es muy
importante guardar una copia de la clave y recordar la contrasea que se configur para la
clave. Consulte Gestin de volmenes cifrados para obtener instrucciones sobre cmo administrar las claves
para volmenes cifrados.
Una vez descifrada la agrupacin, aparecer en el men desplegable de la Figura 8.1.8 . Haga clic en el
botn Aceptar para finalizar la importacin de volumen.
Storage Volumes View Disks muestra todos los discos reconocidos por el sistema
FreeNAS . Un ejemplo se muestra en la Figura 8.1.10 .
De serie cuerda valor de slo lectura que muestra el nmero de serie del disco
Administracin
Men predeterminado es Desactivado , puede seleccionar un perfil de
avanzada de
desplegable administracin de energa en el men
energa
Opciones
adicionales de cuerda opciones adicionales smartctl (8)
SMART
Nota
Si el nmero de serie de un disco no se muestra en esta pantalla, utilice el comando smartctl de Shell . Por
ejemplo, para determinar el nmero de serie del disco ada0 , escriba smartctl -a / dev / ada0
| grep en serie .
Advertencia
Asegrese de que se ha realizado una copia de seguridad de todos los datos y de que el disco ya no est en
uso. Compruebe que el disco correcto est siendo seleccionado para ser borrado, ya que la recuperacin de
datos de un disco borrado es generalmente imposible. Si hay alguna duda, retire fsicamente el disco,
compruebe que todos los datos todava estn presentes en el sistema FreeNAS y limpie el disco en un equipo
separado.
Al hacer clic en Wipe se ofrecen varias opciones. Quick borra slo la informacin de particin en un disco, lo
que facilita su reutilizacin, pero sin borrar otros datos antiguos. For more security, Full with zeros overwrites
the entire disk with zeros, while Full with random dataoverwrites the entire disk with random binary data.
Quick wipes take only a few seconds. A Full with zeros wipe of a large disk can take several hours, and a Full
with random data takes longer. A progress bar is displayed during the wipe to track status.
Note that in this example, there are two datasets named volume1 . The first represents the ZFS pool and
its Used and Available entries reflect the total size of the pool, including disk parity. The second
represents the implicit or root dataset and its Used and Availableentries indicate the amount of disk
space available for storage.
Buttons are provided for quick access to Volume Manager , Import Disk , Import Volume ,
and View Disks . If the system has multipath-capable hardware, an extra button will be added, View
Multipaths . For each entry, the columns indicate the Name , how much disk space is Used , how much
disk space is Available , the type of Compression , the Compression Ratio , the Status ,
whether it is mounted as read-only, and any Comments entered for the volume.
Fig. 8.1.11 Viewing Volumes
Clicking the entry for a pool causes several buttons to appear at the bottom of the screen. The buttons
perform these actions:
Detach Volume: allows you to either export the pool or to delete the contents of the pool, depending upon
the choice you make in the screen shown in Figure 8.1.12 . The Detach Volume screen displays the current
used space and indicates if there are any shares, provides checkboxes to Mark the disks as new
(destroy data) and to Also delete the share's configuration , asks if you are sure that
you want to do this, and the browser will turn red to alert you that you are about to do something that will
make the data inaccessible. If you do not check the box to mark the disks as new, the volume will be
exported. This means that the data is not destroyed and the volume can be re-imported at a later time. If you
will be moving a ZFS pool from one system to another, perform this export action first as it flushes any
unwritten data to disk, writes data to the disk indicating that the export was done, and removes all knowledge
of the pool from the system. If you do check the box to mark the disks as new, the pool and all the data in its
datasets, zvols, and shares will be destroyed and the underlying disks will be returned to their raw state.
Fig. 8.1.12 Detach or Delete a Volume
Scrub Volume: scrubs and scheduling them are described in more detail in Scrubs . This button allows
manually initiating a scrub. Scrubs are I/O intensive and can negatively impact performance. Avoid initiating a
scrub when the system is busy.
A Cancel button is provided to cancel a scrub. When a scrub is cancelled, it is abandoned. The next scrub to
run starts from the beginning, not where the cancelled scrub left off.
The status of a running scrub or the statistics from the last completed scrub can be seen by clicking
the Volume Status button.
Volume Status: as shown in the example in Figure 8.1.13 , this screen shows the device name and status of
each disk in the ZFS pool as well as any read, write, or checksum errors. It also indicates the status of the
latest ZFS scrub. Clicking the entry for a device causes buttons to appear to edit the device's options (shown
in Figure 8.1.14 ), offline or online the device, or replace the device (as described in Replacing a Failed Drive ).
Upgrade: used to upgrade the pool to the latest ZFS features, as described in Upgrading a ZFS Pool . This
button does not appear if the pool is running the latest version of feature flags.
Versions of FreeNAS prior to 8.3.1 required a reboot to apply changes to the HDD Standby , Advanced
Power Management , and Acoustic Level settings. As of 8.3.1, changes to these settings are applied
immediately.
Clicking a dataset in Storage Volumes View Volumes causes buttons to appear at the bottom of
the screen, providing these options:
Create Snapshot: create a one-time snapshot. To schedule the regular creation of snapshots, instead
use Periodic Snapshot Tasks .
Destroy Dataset: clicking the Destroy Dataset button causes the browser window to turn red to indicate
that this is a destructive action. The Destroy Dataset screen forces you to check the box I'm aware
this will destroy all child datasets and snapshots within this
dataset before it will perform this action.
Edit Options: edit the volume's properties described in Table 8.1.4 . Note that it will not allow changing the
dataset's name.
Clicking a zvol in Storage Volumes View Volumes causes icons to appear at the bottom of the
screen: Create Snapshot , Edit zvol , and Destroy zvol . Similar to datasets, a zvol's name
cannot be changed, and destroying a zvol requires confirmation.
If the Encryption box is checked during the creation of a pool, additional buttons appear in the entry for
the pool in Storage Volumes View Volumes . An example is shown in Figure 8.1.15 .
Fig. 8.1.15 Encryption Icons Associated with an Encrypted Pool
These additional encryption buttons are used to:
Create/Change Passphrase: click this button to set and confirm the passphrase associated with the GELI
encryption key. You will be prompted to enter and repeat the desired passphrase and a red warning reminds
you to Remember to add a new recovery key as this action invalidates the
previous recovery key . Unlike a password, a passphrase can contain spaces and is typically a series of
words. A good passphrase is easy to remember (like the line to a song or piece of literature) but hard to guess
(people who know you should not be able to guess the passphrase). Remember this passphrase as you
cannot re-import an encrypted volume without it.In other words, if you forget the passphrase, the data on
the volume can become inaccessible if you need to re-import the pool. Protect this passphrase as anyone who
knows it could re-import your encrypted volume, thwarting the reason for encrypting the disks in the first
place.
Once the passphrase is set, the name of this button will change to Change Passphrase . After setting or
changing the passphrase, it is important to immediately create a new recovery key by clicking the Add
recovery key button. This way, if the passphrase is forgotten, the associated recovery key can be used
instead.
Download Key: click this icon to download a backup copy of the GELI encryption key. The encryption key is
saved to the client system, not on the FreeNAS system. You will be prompted to input the password used to
access the FreeNAS administrative GUI before the selecting the directory in which to store the key. Since the
GELI encryption key is separate from the FreeNAS configuration database, it is highly recommended to make
a backup of the key. If the key is every lost or destroyed and there is no backup key, the data on the disks is
inaccessible.
Encryption Re-key: generates a new GELI encryption key. Typically this is only performed when the
administrator suspects that the current key may be compromised. This action also removes the current
passphrase.
Add recovery key: generates a new recovery key. This screen prompts for entry of the password used to
access the FreeNAS administrative GUI and then to select the directory in which to save the key. Note that
the recovery key is saved to the client system, not on the FreeNAS system. This recovery key can be used if
the passphrase is forgotten. Always immediately add a recovery key whenever the passphrase is changed.
Remove recover key: Typically this is only performed when the administrator suspects that the current
recovery key may be compromised. Immediately create a new passphrase and recovery key.
Nota
The passphrase, recovery key, and encryption key must be protected. Do not reveal the passphrase to others.
On the system containing the downloaded keys, take care that the system and its backups are protected.
Anyone who has the keys has the ability to re-import the disks if they are discarded or stolen.
Advertencia
If a re-key fails on a multi-disk system, an alert is generated. Do not ignore this alert as doing so may result in
the loss of data.
Multipath hardware adds fault tolerance to a NAS as the data is still available even if one disk I/O path has a
failure.
FreeNAS automatically detects active/active and active/passive multipath-capable hardware. Any multipath-
capable devices that are detected will be placed in multipath units with the parent devices hidden. The
configuration will be displayed in Storage Volumes View Multipaths . Note that this option is
not be displayed in the Storage Volumes tree on systems that do not contain multipath-capable
hardware.
Nota
Striping (RAID0) does not provide redundancy. If a disk in a stripe fails, the volume will be destroyed and must
be recreated and the data restored from backup.
Nota
If your pool is encrypted with GELI, refer to Replacing an Encrypted Drive before proceeding.
Before physically removing the failed device, go to Storage Volumes View Volumes . Select the
volume's name. At the bottom of the interface are several icons, one of which is Volume Status . Click
the Volume Status icon and locate the failed disk. A continuacin, realice estos pasos:
1. If the disk is formatted with ZFS, click the disk's entry then its Offline button in order to change that
disk's status to OFFLINE. This step is needed to properly remove the device from the ZFS pool and to
prevent swap issues. If the hardware supports hot-pluggable disks, click the disk's Offline button, pull
the disk, then skip to step 3. If there is no Offline button but only a Replace button, the disk is
already offlined and you can safely skip this step.
Nota
If the process of changing the disk's status to OFFLINE fails with a disk offline failed - no valid replicas
message, the ZFS volume must be scrubbed first with the Scrub Volume button
in Storage Volumes View Volumes . After the scrub completes, try to Offline the disk
again before proceeding.
2. If the hardware is not AHCI capable, shut down the system to physically replace the disk. When finished,
return to the GUI and locate the OFFLINE disk.
3. After the disk has been replaced and is showing as OFFLINE, click the disk again and then click
its Replace button. Select the replacement disk from the drop-down menu and click the Replace
Disk button. After clicking the Replace Disk button, the ZFS pool starts to resilver and the status of
the resilver is displayed.
4. After the drive replacement process is complete, re-add the replaced disk in the SMART Tests screen.
In the example shown in Figure 8.1.16 , a failed disk is being replaced by disk ada5 in the volume
named volume1 .
Fig. 8.1.16 Replacing a Failed Disk
After the resilver is complete, Volume Status shows a Completed resilver status and indicates any
errors. Figure 8.1.17 indicates that the disk replacement was successful in this example.
Nota
A disk that is failing but has not completely failed can be replaced in place, without first removing it. Whether
this is a good idea depends on the overall condition of the failing disk. A disk with a few newly-bad blocks that
is otherwise functional can be left in place during the replacement to provide data redundancy. A drive that is
experiencing continuous errors can actually slow down the replacement. In extreme cases, a disk with serious
problems might spend so much time retrying failures that it could prevent the replacement resilvering from
completing before another drive fails.
Fig. 8.1.17 Disk Replacement is Complete
8.1.10.1. Replacing an Encrypted Drive
If the ZFS pool is encrypted, additional steps are needed when replacing a failed drive.
First, make sure that a passphrase has been set using the instructions in Encryption before attempting to
replace the failed drive. Then, follow the steps 1 and 2 as described above. During step 3, you will be
prompted to input and confirm the passphrase for the pool. Enter this information then click the Replace
Disk button. Wait until the resilvering is complete.
Next, restore the encryption keys to the pool. If the following additional steps are not performed before the
next reboot, access to the pool might be permanently lost.
1. Highlight the pool that contains the disk that was just replaced and click the Encryption Re-
key button in the GUI. Entry of the rootpassword will be required.
2. Highlight the pool that contains the disk you just replaced and click Create Passphrase and enter the
new passphrase. The old passphrase can be reused if desired.
3. Highlight the pool that contains the disk you just replaced and click the Download Key button to save
the new encryption key. Since the old key will no longer function, any old keys can be safely discarded.
4. Highlight the pool that contains the disk that was just replaced and click the Add Recovery
Key button to save the new recovery key. The old recovery key will no longer function, so it can be safely
discarded.
8.1.10.2. Removing a Log or Cache Device
Added log or cache devices appear in Storage Volumes View Volumes Volume Status .
Clicking the device enables its Replace and Remove buttons.
Log and cache devices can be safely removed or replaced with these buttons. Both types of devices improve
performance, and throughput can be impacted by their removal.
However, this is not an option if there are no open drive ports and a SAS/SATA HBA card cannot be added. In
this case, one disk at a time can be replaced with a larger disk, waiting for the resilvering process to
incorporate the new disk into the pool, then repeating with another disk until all of the original disks have
been replaced.
The safest way to perform this is to use a spare drive port or an eSATA port and a hard drive dock. The process
follows these steps:
If a spare drive port is not available, a drive can be replaced with a larger one using the instructions
in Replacing a Failed Drive . This process is slow and places the system in a degraded state. Since a failure at
this point could be disastrous, do not attempt this method unless the system has a reliable backup. Replace
one drive at a time and wait for the resilver process to complete on the replaced drive before replacing the
next drive. After all the drives are replaced and the final resilver completes, the added space will appear in the
pool.
Snapshots provide a clever way of keeping a history of files, providing a way to recover an older copy or even
a deleted file. For this reason, many administrators take snapshots often (perhaps every fifteen minutes),
store them for a period of time (possibly a month), and store them on another system (typically
using Replication Tasks ). Such a strategy allows the administrator to roll the system back to a specific point in
time. If there is a catastrophic loss, an off-site snapshot can be used to restore the system up to the time of
the last snapshot.
An existing ZFS volume is required before creating a snapshot. Creating a volume is described in Volume
Manager .
Para crear una tarea peridica instantnea, haga clic en el que se abre la pantalla mostrada en la figura
8.2.1 . Tabla 8.2.1 resume los campos de esta
pantalla.Storage Periodic Snapshot Tasks Add Periodic Snapshot
Nota
Si slo se necesita una instantnea de una sola vez, en lugar de utilizar y haga clic en la instantnea
Crear botn del volumen o conjunto de datos de instantnea.Storage Volumes View Volumes
Fig. 8.2.1 Creacin de una instantnea Peridica
Tabla 8.2.1 opciones al crear una instantnea peridica
Men
Empezar no crean instantneas antes de esta hora del da
desplegable
Men
Fin no crean las instantneas despus de esta hora del da
desplegable
Da casillas de
qu das de la semana para tomar instantneas
laborable verificacin
Si el recursiva casilla est marcada, los nios conjuntos de datos de este conjunto de datos se incluyen en
la instantnea y no hay necesidad de crear instantneas para cada conjunto de datos nio. La desventaja es
que no hay manera de excluir particular de los nios conjuntos de datos desde una instantnea recursiva.
When the OK button is clicked, a snapshot is taken and the task will be repeated according to your settings.
After creating a periodic snapshot task, an entry for the snapshot task will be added to View Periodic
Snapshot Tasks . Click an entry to access its Edit and Delete buttons.
The basic configuration requires a source system with the original data and a destination system where the
data will be replicated. The destination system is prepared to receive replicated data, a periodic snapshot of
the data on the source system is created, and then a replication task is created. As snapshots are
automatically created on the source computer, they are automatically replicated to the destination computer.
Nota
Replicated data is not visible on the receiving system until the replication task completes.
Alpha is the source computer with the data to be replicated. It is at IP address 10.0.0.102 .
A volume named alphavol has already been created, and a dataset named alphadata has been created on that
volume. This dataset contains the files which will be snapshotted and replicated onto Beta .
This new dataset has been created for this example, but a new dataset is not required. Most users will already
have datasets containing the data they wish to replicate.
Create a periodic snapshot of the source dataset by selecting Storage Volumes . Click
the alphavol/alphadata dataset to highlight it. Create a periodic snapshot of it by clicking Periodic
Snapshot Tasks , then Add Periodic Snapshot as shown in Figure 8.3.1 .
This example creates a snapshot of the alphavol/alphadata dataset every two hours from Monday through
Friday between the hours of 9:00 and 18:00 (6:00 PM). Snapshots are automatically deleted after their chosen
lifetime of two weeks expires.
Fig. 8.3.1 Create a Periodic Snapshot for Replication
8.3.1.2. Beta (Destination)
Beta is the destination computer where the replicated data will be copied. It is at IP address 10.0.0.118 .
A volume named betavol has already been created.
Snapshots are transferred with SSH . To allow incoming connections, this service is enabled on Beta . The
service is not required for outgoing connections, and so does not need to be enabled on Alpha .
Nota
If WebGUI HTTP > HTTPS Redirect has been enabled in System General on the destination
computer, Remote HTTP/HTTPS Port must be set to the HTTPS port (usually 443 ) and Remote
HTTPS must be enabled when creating the replication on the source computer.
Fig. 8.3.2 Add Replication Dialog, Semi-Automatic
The Remote Auth Token field expects a special token from the Beta computer. On Beta ,
choose Storage Replication Tasks , then click Temporary Auth Token . A dialog showing
the temporary authorization token is shown as in Figure 8.3.3 .
Highlight the temporary authorization token string with the mouse and copy it.
Nota
The temporary authorization token is only valid for a few minutes. If a Token is invalid message is shown, get a
new temporary authorization token from the destination system, clear the Remote Auth Token field, and
paste in the new one.
A public encryption key must be copied from Alpha to Beta to allow a secure connection without a password
prompt. On Alpha , select Storage Replication Tasks View Public Key , producing the
window shown in Figure 8.3.5 . Use the mouse to highlight the key data shown in the window, then copy it.
Click the SSH Key Scan button to retrieve the SSH host keys from Beta and fill the Remote
hostkey field. Finally, click OK to create the replication task. After each periodic snapshot is created, a
replication task will copy it to the destination system. See Limiting Replication Times for information about
restricting when replication is allowed to run.
Fig. 8.3.7 Add Replication Dialog
8.3.4. Replication Options
Table 8.3.1 describes the options in the replication task dialog.
Recursively replicate
when checked, also replicate snapshots of datasets that are
child dataset's checkbox
children of the main dataset
snapshots
drop-down
Setup mode Manual or Semi-automatic
menu
Dedicated User
checkbox allow a user account other than root to be used for replication
Enabled
drop-down
Encryption Cipher Standard or Fast
menu
use the SSH Key Scan button to retrieve the public host
Remote hostkey cuerda key of the remote or destination computer and populate this
field with that key
The replication task runs after a new periodic snapshot is created. The periodic snapshot and any new manual
snapshots of the same dataset are replicated onto the destination computer.
When multiple replications have been created, replication tasks run serially, one after another. Completion
time depends on the number and size of snapshots and the bandwidth available between the source and
destination computers.
The first time a replication runs, it must duplicate data structures from the source to the destination
computer. This can take much longer to complete than subsequent replications, which only send differences
in data.
Selecting Storage Replication Tasks displays Figure 8.3.8 , the list of replication tasks. The Last
snapshot sent to remote side column shows the name of the last snapshot that was successfully
replicated, and Status shows the current status of each replication task. The display is updated every five
seconds, always showing the latest status.
The encryption key that was copied from the source computer ( Alpha ) to the destination computer ( Beta ) is
an RSA public key located in the /data/ssh/replication.pub file on the source computer. The host
public key used to identify the destination computer ( Beta ) is from
the /etc/ssh/ssh_host_rsa_key.pub file on the destination computer.
8.3.7.1. SSH
SSH must be able to connect from the source system to the destination system with an encryption key. This
can be tested from Shell by making an SSH connection from the source system to the destination system.
From the previous example, this is a connection from Alphato Beta at 10.0.0.118 . Start the Shell on the
source machine ( Alpha ), then enter this command:
Verify that this is the correct destination computer from the preceeding information on the screen and
type yes . At this point, an SSHshell connection is open to the destination system, Beta .
If a password is requested, SSH authentication is not working. See Figure 8.3.5 above. This key value must be
present in the /root/.ssh/authorized_keys file on Beta , the destination computer.
The /var/log/auth.log file can show diagnostic errors for login problems on the destination computer
also.
8.3.7.2. Compression
Matching compression and decompression programs must be available on both the source and destination
computers. This is not a problem when both computers are running FreeNAS , but other operating systems
might not have lz4 , pigz , or plzip compression programs installed by default. An easy way to diagnose the
problem is to set Replication Stream Compression to Off . If the replication runs, select the
preferred compression method and check /var/log/debug.log on the FreeNAS system for errors.
On Alpha , the source computer, the /var/log/messages file can also show helpful messages to locate
the problem.
On the source computer, Alpha , open a Shell and manually send a single snapshot to the destination
computer, Beta . The snapshot used in this example is named auto-20161206.1110-2w . As before, it is
located in the alphavol/alphadata dataset. A @ symbol separates the name of the dataset from the name of
the snapshot in the command.
If a snapshot of that name already exists on the destination computer, the system will refuse to overwrite it
with the new snapshot. The existing snapshot on the destination computer can be deleted by opening
a Shell on Beta and running this command:
Then send the snapshot manually again. Snapshots on the destination system, Beta , can be listed from
the Shell with zfs list -tsnapshot or by going to Storage Snapshots .
8.4. Scrubs
A scrub is the process of ZFS scanning through the data on a volume. Scrubs help to identify data integrity
problems, detect silent data corruptions caused by transient hardware issues, and provide early alerts of
impending disk failures. FreeNAS makes it easy to schedule periodic automatic scrubs.
Each volume should be scrubbed at least once a month. Bit errors in critical data can be detected by ZFS, but
only when that data is read. Scheduled scrubs can find bit errors in rarely-read data. The amount of time
needed for a scrub is proportional to the quantity of data on the volume. Typical scrubs take several hours or
longer.
The scrub process is I/O intensive and can negatively impact performance. Schedule scrubs for evenings or
weekends to minimize impact to users. Make certain that scrubs and other disk-intensive activity like SMART
Tests are scheduled to run on different days to avoid disk contention and extreme performance impacts.
Scrubs only check used disk space. To check unused disk space, schedule SMART Tests of Type Long Self-
Test to run once or twice a month.
When a volume is created, a ZFS scrub is automatically scheduled. An entry with the same volume name is
added to Storage Scrubs. A summary of this entry can be viewed
with Storage Scrubs View Scrubs . Figure 8.4.1 displays the default settings for the volume
named volume1 . In this example, the entry has been highlighted and the Edit button clicked to display
the Edit screen. Table 8.4.1 summarizes the options in this screen.
Fig. 8.4.1 Viewing a Volume's Default Scrub Settings
Table 8.4.1 ZFS Scrub Options
drop-down
Volumen select ZFS volume to scrub
menu
number of days since the last scrub completed before the next scrub
Threshold can occur, regardless of the calendar schedule; the default is a
entero
days multiple of 7 which should ensure that the scrub always occurs on
the same day of the week
slider or
if use the slider, scrub occurs every N minutes; if use minute
Minuto minute
selections, scrub starts at the highlighted minutes
selections
slider or hour if use the slider, scrub occurs every N hours; if use hour selections,
Hora
selections scrub occurs at the highlighted hours
Day of slider or month if use the slider, scrub occurs every N days; if use month selections,
Month selections scrub occurs on the highlighted days of the selected months
Review the default selections and, if necessary, modify them to meet the needs of the environment.
Scrubs can be deleted with the Delete button, but deleting a scrub is not recommended as a scrub
provides an early indication of disk issues that could lead to a disk failure. If a scrub is too intensive for the
hardware, consider unchecking the Enabled button for the scrub as a temporary measure until the
hardware can be upgraded.
8.5. Snapshots
The Snapshots tab is used to review the listing of available snapshots. An example is shown in Figure 8.5.1 .
Nota
If snapshots do not appear, check that the current time configured in Periodic Snapshot Tasks does not
conflict with the Begin , End, and Interval settings. If the snapshot was attempted but failed, an entry is
added to /var/log/messages . This log file can be viewed in Shell .
Fig. 8.5.1 Viewing Available Snapshots
The listing includes the name of the volume or dataset, the name of each snapshot, and the amount of used
and referenced data.
Used is the amount of space consumed by this dataset and all of its descendants. This value is checked against
the dataset's quota and reservation. The space used does not include the dataset's reservation, but does take
into account the reservations of any descendent datasets. The amount of space that a dataset consumes from
its parent, as well as the amount of space that are freed if this dataset is recursively destroyed, is the greater
of its space used and its reservation. When a snapshot is created, the space is initially shared between the
snapshot and the filesystem, and possibly with previous snapshots. As the filesystem changes, space that was
previously shared becomes unique to the snapshot, and is counted in the snapshot's space used. Additionally,
deleting snapshots can increase the amount of space unique to (and used by) other snapshots. The amount of
space used, available, or referenced does not take into account pending changes. While pending changes are
generally accounted for within a few seconds, disk changes do not necessarily guarantee that the space usage
information is updated immediately.
Propina
Space used by individual snapshots can be seen by running zfs list -t snapshot from Shell .
Refer indicates the amount of data accessible by this dataset, which may or may not be shared with other
datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as
the file system or snapshot it was created from, since its contents are identical.
Replication shows whether the snapshot has been replicated to a remote system.
Clone Snapshot prompts for the name of the clone to create. A clone is a writable copy of the snapshot. Since
a clone is really a dataset which can be mounted, the clone appears in the Active Volumes tab, instead of
the Periodic Snapshots tab, and has the word clonein its name.
Destroy Snapshot a pop-up message asks for confirmation. Child clones must be destroyed before their
parent snapshot can be destroyed. While creating a snapshot is instantaneous, deleting a snapshot can be I/O
intensive and can take a long time, especially when deduplication is enabled. In order to delete a block in a
snapshot, ZFS has to walk all the allocated blocks to see if that block is used anywhere else; if it is not, it can
be freed.
The most recent snapshot also has a Rollback Snapshot icon. Clicking the icon asks for confirmation before
rolling back to this snapshot state. Confirming by clicking Yes causes any files that have changed since the
snapshot was taken to be reverted back to their state at the time of the snapshot.
Nota
Rollback is a potentially dangerous operation and causes any configured replication tasks to fail as the
replication system uses the existing snapshot when doing an incremental backup. To restore the data within a
snapshot, the recommended steps are:
1. Clone the desired snapshot.
2. Share the clone with the share type or service running on the FreeNAS system.
3. After users have recovered the needed data, destroy the clone in the Active Volumes tab.
This approach does not destroy any on-disk data and has no impact on replication.
A range of snapshots can be selected with the mouse. Click on the checkbox in the left column of the first
snapshot, then press and hold Shift and click on the checkbox for the end snapshot. This can be used to
select a range of obsolete snapshots to be deleted with the Destroy icon at the bottom. Be cautious and
careful when deleting ranges of snapshots.
Periodic snapshots can be configured to appear as shadow copies in newer versions of Windows Explorer, as
described in Configuring Shadow Copies . Users can access the files in the shadow copy using Explorer without
requiring any interaction with the FreeNAS graphical administrative interface.
The ZFS Snapshots screen allows the creation of filters to view snapshots by selected criteria. To create a
filter, click the Define filter icon (near the text No filter applied ). When creating a filter:
If you create multiple filters, select the filter to use before leaving the define filter screen. Once a filter is
selected, the No filter applied text changes to Clear filter . If you click Clear filter , a
pop-up message indicates that this removes the filter and all available snapshots are listed.
8.6. VMware-Snapshot
Storage VMware-Snapshotle permite coordinar instantneas de ZFS cuando se utiliza
FreeNAS como un almacn de datos de VMware. Una vez creado este tipo de instantnea, FreeNAS ser
instantnea automticamente cualquier mquinas virtuales de VMware se ejecutan antes de tomar una
instantnea ZFS programado o manual del conjunto de datos o zvol copias que VMware almacn de datos. Las
instantneas temporales de VMware se eliminan automticamente en el lado de VMware, pero todava
existen en la instantnea ZFS y se pueden utilizar como puntos de resurreccin estables en esa
instantnea. Estas instantneas coordinados sern enumerados en instantneas .
La Figura 8.6.1 muestra el men para aadir una instantnea VMware y Tabla 8.6.1 resume las opciones
disponibles.
Sistema de Men
el sistema de archivos de instantnea
archivos ZFS desplegable
10. Compartir
Las acciones se crean para que todo o parte de un volumen sea accesible a otros equipos de la red. El tipo de
recurso compartido que se crea depende de factores como los sistemas operativos que estn utilizando los
equipos de la red, los requisitos de seguridad y las expectativas de velocidades de transferencia de red.
FreeNAS proporciona un Asistente para crear acciones. El asistente crea automticamente el tipo correcto de
conjunto de datos y permisos para el tipo de recurso compartido, establece los permisos predeterminados
para el tipo de recurso compartido e inicia el servicio necesario para el recurso compartido. Se recomienda
utilizar el Asistente para crear recursos compartidos, ajustar las opciones de uso compartido utilizando las
instrucciones del resto de este captulo, si es necesario, ajustar los permisos predeterminados del sistema
operativo del cliente para cumplir con los requisitos de la red.
Nota
Las acciones se crean para proporcionar y controlar el acceso a un rea de almacenamiento. Antes de crear
acciones, se recomienda hacer una lista de los usuarios que necesitan acceso a los datos de almacenamiento,
qu sistemas operativos utilizan, si todos los usuarios deben tener los mismos permisos para los datos
almacenados y si estos usuarios deben autenticarse antes de acceder los datos. Esta informacin puede
ayudar a determinar qu tipo de acciones se necesitan, si se necesitan conjuntos de datos mltiples para
dividir el almacenamiento en reas con diferentes accesos y permisos y lo complejo que ser configurar estos
requisitos de permisos. Tenga en cuenta que las acciones se utilizan para proporcionar acceso a los
datos. Cuando se elimina un recurso, elimina el acceso a los datos pero no elimina los datos.
AFP : Las acciones de Apple File Protocol se utilizan a menudo cuando los equipos cliente ejecutan Mac OS
X. Apple ha cambiado lentamente a preferir SMB para redes modernas, aunque Time Machine todava
requiere AFP.
Unix (NFS) : las comparticiones de sistema de archivos de red son accesibles desde Mac OS X, Linux, BSD y
las versiones profesionales y empresariales (pero no las ediciones domsticas) de Windows. Esto puede
ser una buena opcin cuando los equipos cliente no todos ejecutan el mismo sistema operativo, pero el
software de cliente NFS est disponible para todos ellos.
WebDAV : Las acciones WebDAV son accesibles mediante un navegador web autenticado (solo de lectura)
o un cliente WebDAV que se ejecute en cualquier sistema operativo.
SMB : Los bloques de bloque de mensajes de servidor, tambin conocidos como compartimentos CIFS
(Common Internet File System), son accesibles por los ordenadores Windows, Mac OS X, Linux y BSD. El
acceso es ms lento que un recurso compartido NFS debido al diseo de un solo subproceso de
Samba. SMB proporciona ms opciones de configuracin que NFS y es una buena opcin en una red para
sistemas Windows. Sin embargo, es una mala eleccin si la CPU del sistema FreeNAS es limitada; si la CPU
se agota, actualice la CPU o considere otro tipo de recurso compartido.
Bloquear (iSCSI) : los bloques o los recursos compartidos iSCSI aparecen como un disco sin formato en los
clientes que ejecutan software iniciador iSCSI o en una solucin de virtualizacin como VMware. Estos se
usan generalmente como unidades virtuales.
Se puede obtener acceso rpido desde cualquier sistema operativo configurando el servicio FTP en lugar de
un recurso compartido y utilizando una aplicacin de gestor de archivos FTP multiplataforma como Filezilla . El
FTP seguro puede configurarse si los datos necesitan ser cifrados.
Cuando la seguridad de los datos es una preocupacin y los usuarios de la red estn familiarizados con las
utilidades de lnea de comandos de SSH o WinSCP , considere el uso del servicio SSH en lugar de un recurso
compartido. Es ms lento que el FTP sin cifrar debido a la sobrecarga del cifrado, pero los datos que pasan a
travs de la red estn encriptados.
Nota
Generalmente es un error compartir un volumen o conjunto de datos con ms de un tipo de recurso o mtodo
de acceso. Diferentes tipos de acciones y servicios utilizan diferentes mtodos de bloqueo de archivos. Por
ejemplo, si el mismo volumen est configurado para utilizar NFS y FTP, NFS bloquear un archivo para su
edicin por un usuario NFS, pero un usuario FTP puede editarlo o eliminarlo simultneamente. Esto produce
ediciones perdidas y usuarios confusos. Otro ejemplo: si un volumen est configurado para AFP y SMB, los
usuarios de Windows pueden confundirse con los nombres de archivo "extra" utilizados por los archivos Mac
y eliminarlos. Esto daa los archivos de la cuota de AFP. Elija el tipo de recurso compartido o servicio que
tenga ms sentido para los tipos de clientes que accedan a ese volumen y utilice ese nico tipo de recurso
compartido o servicio. Para admitir varios tipos de acciones, divida el volumen en conjuntos de datos y utilice
un conjunto de datos por accin.
Esta seccin muestra la configuracin y el ajuste fino de las acciones de AFP, NFS, SMB, WebDAV e iSCSI. Las
configuraciones FTP y SSH se describen en Servicios .
Para ver el recurso compartido AFP creado por el Asistente, haga clic en Sharing Apple (AFP) y
resalte el nombre del recurso compartido. Haga clic en su botn Editar para ver las opciones de configuracin
que se muestran en la Figura 10.1.1 . Los valores que se muestran para estas opciones variarn, dependiendo
de la informacin proporcionada al crear el recurso compartido.
En la Tabla 10.1.1 se resumen las opciones disponibles para afinar una accin AFP. Normalmente, estas
opciones deben dejarse en la configuracin predeterminada. Cambiarlos podra causar un comportamiento
inesperado. La mayora de los ajustes slo estn disponibles con el modo avanzado . No cambie una opcin
avanzada sin comprender completamente la funcin de esa opcin.Consulte Configuracin de Netatalk para
obtener una explicacin ms detallada de estas opciones.
Compartir
cuerda comentario opcional, slo disponible en modo avanzado
Comentario
Permiso de slo disponible en modo avanzado ; slo funciona con las ACL
casillas de
archivo de Unix; los nuevos archivos creados en el recurso compartido se
verificacin
predeterminado establecen con los permisos seleccionados
Permiso del slo disponible en modo avanzado ; slo funciona con las ACL
casillas de
directorio de Unix; los nuevos directorios creados en el recurso compartido
verificacin
predeterminado se establecen con los permisos seleccionados
Nota
Cuando se crea un recurso compartido de invitados junto con un recurso compartido que requiere
autenticacin, AFP slo asigna a los usuarios que acceden como invitados al recurso compartido de
invitados. Si un usuario inicia sesin en el recurso compartido que requiere autenticacin, los permisos en el
recurso compartido de invitado pueden impedir que el usuario escriba en el recurso compartido de
invitados. La nica forma de permitir que los usuarios invitados y autenticados escriban en una cuenta de
invitados es establecer los permisos en la parte de invitados en 777 o agregar los usuarios autenticados a un
grupo de invitados y establecer los permisos en 77x .
Antes de crear una accin de invitado, vaya a Services AFP y asegrese de que la casilla Acceso de
invitado est marcada.
Para crear la parte de invitado AFP, haga clic en Asistente y , a continuacin, haga clic dos veces en el
botn Siguiente para mostrar la pantalla que se muestra en la Figura 10.1.2 . Complete estos campos en esta
pantalla:
1. Nombre de recurso compartido: introduzca un nombre para el recurso que sea identificable pero que
tenga menos de 27 caracteres.Este nombre no puede contener un punto. En este ejemplo,
el recurso compartido se denomina afp_guest .
2. Haga clic en el botn para Mac OS X (AFP) .
3. Haga clic en el botn Propiedad . Haga clic en el men de usuario desplegable y seleccione nadie . Haga
clic en el botn Volverpara volver a la pantalla anterior.
4. Haga clic en el botn Agregar . El recurso compartido no se crea hasta que se hace clic en el botn . Al
hacer clic en el botn Agregar, se agrega una entrada al marco Nombre con el nombre que se escribi
en Nombre del recurso compartido .
Fig. 10.1.2 Creacin de un recurso compartido AFP invitado
Haga clic dos veces en el botn Siguiente y luego en el botn Confirmar para crear el recurso compartido. El
asistente crea automticamente un conjunto de datos para el recurso compartido que contiene los permisos
predeterminados correctos e inicia el servicio AFP para que el recurso est inmediatamente disponible. La
nueva accin tambin se agrega como una entrada a Sharing Apple (AFP) .
Los usuarios de Mac OS X pueden conectarse al recurso compartido AFP invitado haciendo clic
en Go Connect to Server . En el ejemplo mostrado en la figura 10.1.3 , el usuario ha ingresado afp:
// seguido de la direccin IP del sistema FreeNAS .
Haga clic en el botn Conectar . Una vez conectado, Finder se abre automticamente. El nombre de la accin
AFP se muestra en la seccin COMPARTIDA en el marco izquierdo y el contenido de los datos guardados en el
recurso compartido se muestra en el marco derecho.
Fig. 10.1.3 Conexin al dilogo de servidor
Para desconectarse del volumen, haga clic en el botn de expulsin de la barra lateral Compartida .
Mac OS X incluye la aplicacin Time Machine que se puede utilizar para programar copias de seguridad
automticas. En este ejemplo de configuracin, un usuario de Time Machine se configurar para realizar
copias de seguridad en un recurso AFP en un sistema FreeNAS .Se recomienda crear una cuenta separada de
Time Machine para cada usuario que utilice Time Machine para realizar una copia de seguridad de su sistema
Mac OS X en FreeNAS . El proceso para crear un recurso compartido autenticado para un usuario es el mismo
que crear un recurso de Time Machine para ese usuario.
Para usar el Asistente para crear un recurso compartido autenticado o Time Machine, ingrese la siguiente
informacin, como se muestra en el ejemplo de la Figura 10.1.4 .
1. Nombre de recurso compartido: introduzca un nombre para el recurso que sea identificable pero que
tenga menos de 27 caracteres.El nombre no puede contener un punto. En este ejemplo,
el recurso compartido se denomina backup_user1 .
2. Haga clic en el botn para Mac OS X (AFP) y marque la casilla de Time Machine . Si el usuario no va a
utilizar Time Machine, deje la casilla sin marcar.
3. Haga clic en el botn Propiedad . Si el usuario ya existe en el sistema FreeNAS , haga clic en el men
de usuario desplegable para seleccionar su cuenta de usuario. Si el usuario an no existe en el sistema
FreeNAS , escriba su nombre en el campo Usuario y active la casilla Crear usuario . Si el usuario
pertenece a un grupo que ya existe en el sistema FreeNAS , haga clic en el men desplegable Grupo para
seleccionar el nombre del grupo. Para crear un nuevo grupo para ser utilizado por los usuarios de Time
Machine, ingrese el nombre en el campo Grupo y active la casilla Crear grupo . De lo contrario,
introduzca el mismo nombre que el usuario. En el ejemplo mostrado en la Figura 10.1.5 , se crear un
nuevo usuario1 y un nuevo grupo tm_backups . Dado que se est creando un nuevo usuario, esta pantalla
solicita que se use la contrasea de usuario al acceder al recurso compartido. Tambin proporciona una
oportunidad para cambiar los permisos predeterminados en el recurso compartido. Cuando termine, haga
clic en Volver para volver a la pantalla mostrada en la Figura 10.1.4 .
4. Haga clic en el botn Agregar . Recuerde hacer esto o el recurso compartido no se crear . Al hacer clic
en el botn Agregar, se agrega una entrada al marco Nombre con el nombre que se escribi en Nombre
del recurso compartido .
Para configurar varios compartimentos autenticados o Time Machine, repita para cada usuario, dando a cada
usuario su propio nombre de Share y Ownership . Cuando haya terminado, haga clic dos veces en el
botn Siguiente y luego en el botn Confirmar para crear las acciones. El asistente crea automticamente un
conjunto de datos para cada recurso compartido con la propiedad correcta e inicia el servicio AFP para que los
recursos estn inmediatamente disponibles. Las nuevas acciones tambin se agregan
a Sharing Apple(AFP) .
Fig. 10.1.4 Creacin de un recurso de tiempo compartido
Fig. 10.1.5 Creacin de un usuario autenticado
En este punto, puede ser deseable configurar una cuota para cada recurso de Time Machine, para restringir
las copias de seguridad de utilizar todo el espacio disponible en el sistema FreeNAS . La primera vez que Time
Machine hace una copia de seguridad, crear una copia de seguridad completa despus de esperar dos
minutos. A continuacin, crear una copia de seguridad incremental de una hora para las prximas 24 horas y,
a continuacin, una copia de seguridad cada da, cada semana y cada mes. Dado que las copias de seguridad
ms antiguas se eliminan cuando un recurso de Time Machine se llena, asegrese de que el tamao de
cuota es suficiente para contener el nmero de copias de seguridad deseado. Tenga en cuenta que una
instalacin predeterminada de Mac OS X tiene un tamao de ~ 21 GB.
Para configurar una cuota, vaya a Storage Volumes y resalte la entrada para el recurso compartido. En
el ejemplo mostrado en la Figura 10.1.6 , el nombre de recurso de Time Machine es backup_user1 . Haga clic
en el botn Editar opciones para el recurso compartido y luego en Modo avanzado . Introduzca un valor en
el campo Cuota para este conjunto de datos y , a continuacin, haga clic en Editar conjunto de datos para
guardar el cambio. En este ejemplo, el recurso Time Machine est restringido a 200 GB.
Fig. 10.1.6 Establecimiento de una cuota
Nota
Una alternativa es crear una cuota global utilizando las instrucciones de Configurar Time Machine para varios
equipos con las cuotas de estilo de servidor de OSX .
Si Time Machine complet una verificacin de sus copias de seguridad. Para mejorar la fiabilidad, Time
Machine debe crear una nueva copia de seguridad para usted. se muestra, siga las instrucciones de esta
publicacin para evitar realizar otra copia de seguridad o perder copias de seguridad anteriores.
Nota
Por razones de rendimiento, se prefiere iSCSI a los compartimentos NFS cuando se instala FreeNAS en
ESXi. Al considerar la creacin de comparticiones NFS en ESXi, lea el anlisis de rendimiento en Running ZFS
sobre NFS como un almacn de VMware .
Para crear un recurso compartido NFS con el Asistente , haga clic dos veces en el botn Siguiente para
mostrar la pantalla que se muestra en la Figura 10.2.1 . Introduzca un nombre de recurso compartido . Los
espacios no estn permitidos en estos nombres. Haga clic en el botn Generic Unix (NFS) y , a continuacin,
haga clic en Agregar para que aparezca el nombre de recurso compartido en el marco Nombre . Cuando
haya terminado, haga clic dos veces en el botn Siguiente y luego en el botn Confirmar para crear el
recurso compartido. La creacin de un recurso compartido NFS con el asistente crea automticamente un
nuevo conjunto de datos para el recurso compartido, inicia los servicios necesarios para NFS y agrega una
entrada en Sharing Unix (NFS) Shares . Dependiendo de sus requerimientos, las direcciones IP
que estn permitidas para acceder al recurso compartido NFS pueden estar restringidas o los permisos
ajustados.
Fig. 10.2.1 Asistente para compartir NFS
Las acciones NFS se editan haciendo clic en Sharing Unix (NFS) , resaltando la entrada para
el Sharing Unix (NFS)compartido y haciendo clic en su botn Editar . En el ejemplo mostrado en
la Figura 10.2.2 , la pantalla de configuracin est abierta para el recurso compartido nfs_share1 .
Fig. 10.2.2 Configuracin de la cuenta NFS
La Tabla 10.2.1 resume las opciones de configuracin disponibles en esta pantalla. Algunos ajustes slo estn
disponibles haciendo clic en el botn Modo avanzado .
Modo
Ajuste Valor Descripcin
avanzado
Modo
Ajuste Valor Descripcin
avanzado
Grupo Men los permisos del grupo especificado son utilizados por
Mapall desplegable todos los clientes
Modo
Ajuste Valor Descripcin
avanzado
Al crear los recursos compartidos NFS, tenga en cuenta los siguientes puntos:
Para entender mejor estas restricciones, considere el siguiente escenario donde hay:
Debido a la restriccin # 3, se muestra un error al intentar crear un recurso compartido NFS como este:
Ese directorio tambin podra estar restringido a una de las redes creando dos acciones en su lugar:
Tenga en cuenta que esto requiere la creacin de dos acciones. No se puede hacer con una sola accin.
De forma predeterminada, las opciones de Mapall aparecen como N / A. Esto significa que cuando un usuario
se conecta al recurso compartido NFS, se conectan con los permisos asociados con su cuenta de usuario. Este
es un riesgo de seguridad si un usuario puede conectarse como root, ya que tendr acceso completo al
recurso compartido.
Con esta configuracin, no importa qu cuenta de usuario se conecta al recurso compartido NFS, ya que se
asignar a la cuenta de usuario nobody y slo tendr los permisos que se especificaron en el volumen /
conjunto de datos. Por ejemplo, incluso si el usuario rootpuede conectarse, no obtendr acceso root al
recurso compartido.
El recurso compartido NFS est montado en sistemas BSD o Linux que necesitan acceso con este comando
ejecutado como superusuario o con sudo :
Un montaje exitoso del recurso compartido vuelve al smbolo del sistema sin ningn mensaje de estado o de
error.
Nota
Si este comando falla en un sistema Linux, asegrese de que el paquete nfs-utils est instalado.
Esta configuracin permite a los usuarios del sistema cliente copiar archivos /mnt desde /mnt (el punto de
montaje). Todos los archivos son propiedad de nadie: nadie . Los cambios en los archivos o directorios
en /mnt se escriben en el conjunto de datos del sistema FreeNAS /mnt/volume1/nfs_share1 .
La configuracin no se puede cambiar en el recurso compartido NFS si est montado en cualquier equipo
cliente. El comando umount se utiliza para desmontar el recurso compartido en clientes BSD y
Linux. Ejectelo como superusuario o con sudo en cada equipo cliente:
umount / mnt
10.2.2.2. De Microsoft
La compatibilidad con el cliente NFS de Windows vara con versiones y versiones. Para obtener mejores
resultados, utilice las Acciones de Windows (SMB) .
Para montar el volumen NFS desde un cliente Mac OS X, haga clic en Go Connect to Server . En el
campo Direccin del servidor , escriba nfs: // seguido por la direccin IP del sistema FreeNAS y el nombre
del volumen / dataset que comparte NFS. El ejemplo mostrado en la figura 10.2.3 contina con nuestro
ejemplo de 192.168.2.2:/mnt/volume1/nfs_share1 .
Finder se abre automticamente despus de conectarse. La direccin IP del sistema FreeNAS se muestra en
la seccin COMPARTIDA en el marco izquierdo y el contenido del recurso compartido se muestra en el marco
derecho. En el ejemplo mostrado en la Figura 10.2.4 , /mnt/data tiene una carpeta
denominada images . El usuario ahora puede copiar archivos ay desde el recurso compartido.
Fig. 10.2.3 Montaje del recurso compartido NFS desde Mac OS X
Fig. 10.2.4 Visualizacin del recurso compartido NFS en el Finder
10.2.3. Solucin de problemas de NFS
Algunos clientes NFS no admiten el protocolo NLM (Network Lock Manager) utilizado por NFS. Este es el caso
si el cliente recibe un error que todo o parte del archivo se puede bloquear cuando se intenta una
transferencia de archivos. Para resolver este error, agregue la opcin -o nolock al ejecutar el
comando mount en el cliente para permitir el acceso de escritura al recurso compartido NFS.
Si se muestra un error de "tiempo de espera" cuando se intenta montar el recurso compartido desde un
sistema Linux, asegrese de que el servicio portmapper se est ejecutando en el cliente Linux. Si se est
ejecutando portmapper y se muestran los tiempos de espera, forzar el uso de TCP incluyendo -o tcp en el
comando mount .
Si se muestra un error "RPC: Programa no registrado", actualice a la versin ms reciente de FreeNAS y
reinicie el servicio NFS despus de la actualizacin para borrar el cach NFS.
Si los clientes ven errores de "DNS inverso", agregue la direccin IP de FreeNAS en el campo Base de datos
de nombres de hostde Network Global Configuration .
Si los clientes reciben errores de tiempo de espera al intentar montar el recurso compartido, agregue la
direccin IP y el nombre de host del cliente al campo Base de datos de nombre de
host en Network Global Configuration .
Algunas versiones anteriores de clientes NFS predeterminan a UDP en lugar de TCP y no negocian
automticamente para TCP. De forma predeterminada, FreeNAS utiliza TCP. Para admitir conexiones UDP,
vaya a Services NFS y marque la casilla Servir clientes UDP NFS .
Configurar los recursos compartidos de WebDAV es un proceso de dos pasos. Primero, cree las acciones de
WebDAV para especificar a qu datos se puede acceder. A continuacin, configure el servicio WebDAV
especificando el puerto, el tipo de autenticacin y la contrasea de autenticacin. Una vez completada la
configuracin, se puede acceder al recurso compartido mediante una URL en el formato:
dnde:
Advertencia
En este momento, slo se admite el usuario webdav . Por esta razn, es importante establecer una buena
contrasea para esta cuenta y dar slo la contrasea a los usuarios que deberan tener acceso al recurso
compartido de WebDAV.
Nombre de ruta de
cuerda ingrese un nombre para el recurso compartido
acceso compartido
botn de
Camino busque el volumen / conjunto de datos para compartir
exploracin
Despus de hacer clic en Aceptar , una ventana emergente pregunta acerca de cmo habilitar el servicio. Una
vez que se inicia el servicio, revise la configuracin en Services WebDAV ya que se utilizan para
determinar qu URL se utiliza para acceder al recurso compartido de WebDAV y si se requiere o no
autenticacin para acceder al recurso compartido. Estos ajustes se describen en WebDAV .
El protocolo SMB soporta muchos tipos diferentes de escenarios de configuracin, que van desde los muy
simples a los bastante complejos. La complejidad del escenario depende de los tipos y versiones de los
sistemas operativos cliente que se conectarn al recurso compartido, si la red tiene un servidor Windows y si
se est utilizando Active Directory. Dependiendo de los requisitos de autenticacin, puede ser necesario crear
o importar usuarios y grupos.
Samba admite la copia del lado del servidor de archivos en el mismo recurso compartido con clientes de
Windows 8 y superiores. Copiar entre dos partes diferentes no es del lado del servidor. Los clientes de
Windows 7 admiten copia de servidor con Robocopy .
Este captulo comienza resumiendo las opciones de configuracin disponibles. Demuestra algunos escenarios
de configuracin comunes, as como ofrece algunas sugerencias de solucin de problemas. Se recomienda
leer primero todo este captulo antes de crear cualquier recurso compartido de SMB para obtener una mejor
idea del escenario de configuracin que mejor se adapte a las necesidades de su red.
Propina
Consejos y trucos de SMB muestra sugerencias tiles para configurar y administrar redes SMB. Los permisos
de FreeNAS y Samba (CIFS) y los permisos de Samba avanzada (CIFS) en los videos de FreeNAS aclaran la
configuracin de permisos en los recursos compartidos de SMB.
Propina
Ejecute smbstatus desde el Shell para obtener una lista de conexiones y usuarios activos.
La Figura 10.4.1 muestra la pantalla de configuracin que aparece despus de hacer clic
en Sharing Windows (SMB Shares) AddWindows (SMB) Share .
botn de
Camino seleccione volumen / conjunto de datos / directorio para compartir
exploracin
Utilizar como marque esta casilla si el recurso compartido est destinado a tener
recurso caja directorios personales de usuario; slo una parte puede ser la
compartido parte hogares
Only Allow Guest slo disponible en modo avanzado ; requires Allow guest
caja
Access access to also be checked; forces guest access for all connections
Hostname lookups add some time to accessing the SMB share. If you only use IP addresses, uncheck
the Hostnames lookups box in Services SMB .
Be careful about unchecking the Browsable to Network Clients box. When this box is checked (the
default), other users will see the names of every share that exists using Windows Explorer, but they will
receive a permissions denied error message if they try to access someone else's share. If this box is
unchecked, even the owner of the share will not see it or be able to create a drive mapping for the share
in Windows Explorer. However, they can still access the share from the command line. Unchecking this
option provides limited security and is not a substitute for proper permissions and password control.
If some files on a shared volume should be hidden and inaccessible to users, put a veto files= line in
the Auxiliary Parameters field. The syntax for the veto files option and some examples can be found in
the smb.conf manual page .
To configure support for OS/2 clients, add this line to Auxiliary Parameters :
To configure lanman authentication for pre-NT authentication, add these lines instead:
Table 10.4.2 provides an overview of the available VFS modules. Be sure to research each
module before adding or deleting it from the Selected column of the VFS Objects field of the share. Some
modules need additional configuration after they are added. Refer to Stackable VFS modules and the vfs_*
man pages for more details.
Valor Descripcin
acl_tdb stores NTFS ACLs in a tdb file to enable full mapping of Windows ACLs
stores NTFS ACLs in Extended Attributes (EAs) to enable the full mapping of
acl_xattr
Windows ACLs
implements async I/O in Samba vfs using a pthread pool instead of the internal
aio_pthread
Posix AIO interface
Valor Descripcin
translates filenames to and from the CAP encoding format, commonly used in
gorra
Japanese language environments
catia creates filenames that use characters that are illegal in SMB filenames
tracks the amount of data written to a file and synchronizes it to disk when a
cometer
specified amount accumulates
allows server side rename operations even if source and target are on different
crossrename
physical devices
stores the default quotas that are reported to a windows client in the quota record
default_quota
of a user
distributed file system for providing an alternative name space, load balancing,
dfs_samba4
and automatic failover
dirsort sorts directory entries alphabetically before sending them to the client
extd_audit sends audit logs to both syslog and the Samba log files
record selected client operations to the system log; if selected, a warning will
full_audit indicate that Windows 10 clients may experience issues when transferring files
to the NAS system when this module is enabled
Valor Descripcin
preopen useful for video streaming applications that want to read one file per frame
readahead useful for Windows Vista clients reading data using Windows Explorer
marks a share as read-only for all clients connecting within the configured time
solo lectura
period
ensures that only files that have been scanned for viruses are visible and
scannedonly
accessible
smb_traffic_analyzer logs Samba read and write operations through a socket to a helper application
provides the ability for remote SMB clients to access shadow copies of FSRVP
snapper
snapshots using Windows Explorer
streams_xattr enables storing of NTFS alternate data streams in the file system
time_audit logs system calls that take longer than the number of defined milliseconds
Valor Descripcin
controls the writability of files and folders depending on their change time and
worm
an adjustable grace period
stores Extended Attributes (EAs) in a tdb file so they can be used on filesystems
xattr_tdb
which do not provide support for EAs
Nota
When using fruit , also add the streams_xattr and catia VFS objects and be sure to configure all SMB shares
this way. Reboot the Mac client after making this change.
These VFS objects do not appear in the drop-down menu as they are always enabled:
recycle: moves deleted files to the recycle directory instead of deleting them
shadow_copy2: a more recent implementation of shadow_copy with some additional features
zfs_space: correctly calculates ZFS space used by share, including any reservations or quotas
zfsacl: provide ACL extensions for proper integration with ZFS.
To configure an unauthenticated SMB share, click Wizard , then click the Next button twice to display the
screen shown in Figure 10.4.2. Complete the following fields in this screen:
1. Share name: enter a name for the share that is useful to you. In this example, the share is
named smb_insecure .
2. Click the button for Windows (SMB) and check the box for Allow Guest .
3. Click the Ownership button. Click the drop-down User menu and select nobody . Click the Return button
to return to the previous screen.
4. Click the Add button. If you forget to do this, the share will not be created . Clicking the Add button adds
an entry to the Name frame with the name that was entered in Share name .
Users can now access the share from any SMB client and will not be prompted for their username or
password. For example, to access the share from a Windows system, open Explorer and click on Network . For
this configuration example, a system named FREENASappears with a share named insecure_smb . The user
can copy data to and from the unauthenticated SMB share.
10.4.2. Configuring Authenticated Access Without a
Domain Controller
Most configuration scenarios require each user to have their own user account and to authenticate before
accessing the share. This allows the administrator to control access to data, provide appropriate permissions
to that data, and to determine who accesses and modifies stored data. A Windows domain controller is not
needed for authenticated SMB shares, which means that additional licensing costs are not required. However,
since there is no domain controller to provide authentication for the network, each user account needs to be
created on the FreeNAS system. This type of configuration scenario is often used in home and small
networks as it does not scale well if many users accounts are needed.
Before configuring this scenario, determine which users will need authenticated access. While not required
for the configuration, it eases troubleshooting if the username and password that will be created on the
FreeNAS system matches that information on the client system. Next, determine if each user should have
their own share to store their own data or if several users will be using the same share. The simpler
configuration is to make one share per user as it does not require the creation of groups, adding the correct
users to the groups, and ensuring that group permissions are set correctly.
To use the Wizard to create an authenticated SMB share, enter the following information, as shown in the
example in Figure 10.4.3 .
1. Share name: enter a name for the share that is useful to you. In this example, the share is
named smb_user1 .
2. Click the button for Windows (SMB) .
3. Click the Ownership button. To create the user account on the FreeNAS system, type their name into
the User field and check the Create User checkbox. The user's password is then entered and confirmed. If
the user will not be sharing this share with other users , type their name into the Group field and
click Create Group . If, however, the share will be used by several users , instead type in a group name
and check the Create Group box. In the example shown in Figure 10.4.4 , user1 has been used for both
the user and group name, meaning that this share will only be used by user1 . When finished,
click Return to return to the screen shown in Figure 10.4.3 .
4. Click the Add button. If you forget to do this, the share will not be created . Clicking the Add button adds
an entry to the Name frame with the name that was entered in Share name .
If you wish to configure multiple authenticated shares, repeat for each user, giving each user their own Share
name and Ownership . When finished, click Next twice, then Confirm to create the shares. The Wizard
automatically creates a dataset with the correct ownership for each share and starts the SMB service so the
shares are available immediately. The new shares are also added to Sharing Windows (SMB) .
To prevent Windows Explorer from hanging when accessing the share, map the share as a network drive. To
do this, right-click the share and select Map network drive... . Choose a drive letter from the drop-down
menu and click the Finish button.
Note that Windows systems cache a user's credentials. This can cause issues when testing or accessing
multiple authenticated shares as only one authentication is allowed at a time. If you are having problems
authenticating to a share and are sure that you are entering the correct username and password, type cmd in
the Search programs and files box and use the following command to see if you have already authenticated
to a share. In this example, the user has already authenticated to the smb_user1 share:
net use
New connections will be remembered.
There are open files and/or incomplete directory searches pending on the
connection
to \\FREENAS|smb_user1.
The next time a share is accessed with Explorer, you will be prompted to authenticate.
When you create a periodic snapshot task on a ZFS volume that is configured as a SMB share in FreeNAS , it is
automatically configured to support shadow copies.
Before using shadow copies with FreeNAS , be aware of the following caveats:
If the Windows system is not fully patched to the latest service pack, Shadow Copies may not work. If you
are unable to see any previous versions of files to restore, use Windows Update to make sure that the
system is fully up-to-date.
Shadow copy support only works for ZFS pools or datasets. This means that the SMB share must be
configured on a volume or dataset, not on a directory.
Datasets are filesystems and shadow copies cannot traverse filesystems. If you want to be able to see the
shadow copies in your child datasets, create separate shares for them.
Shadow copies will not work with a manual snapshot, you must create a periodic snapshot task for the
pool or dataset being shared by SMB or a recursive task for a parent dataset.
The periodic snapshot task should be created and at least one snapshot should exist before creating the
SMB share. If the SMB share was created first, restart the SMB service
in Services Control Services .
Appropriate permissions must be configured on the volume/dataset being shared by SMB.
Users cannot delete shadow copies on the Windows system due to the way Samba works. Instead, the
administrator can remove snapshots from the FreeNAS administrative GUI. The only way to disable
shadow copies completely is to remove the periodic snapshot task and delete all snapshots associated
with the SMB share.
To configure shadow copy support, use the instructions in Configuring Authenticated Access Without a
Domain Controller to create the desired number of shares. In this configuration example, a Windows 7
computer has two users: user1 and user2 . For this example, two authenticated shares are created so that
each user account has their own share. The first share is named user1 and the second share is
named user2 . Entonces:
1. Use Storage Periodic Snapshot Tasks Add Periodic Snapshot to create at least
one periodic snapshot task. You can either create a snapshot task for each user's dataset, in this example
the datasets /mnt/volume1/user1 and /mnt/volume1/user2, or you can create one periodic
snapshot task for the entire volume, in this case /mnt/volume1 . Before continuing to the next
step,confirm that at least one snapshot for each defined task is displayed in
the Storage Snapshots tab. When creating the schedule for the periodic snapshot tasks, keep in
mind how often your users need to access modified files and during which days and time of day they are
likely to make changes.
2. Go to Sharing Windows (SMB) Shares . Highlight a share and click Edit , then Advanced
Mode . Click the Periodic Snapshot Task drop-down menu and select the periodic snapshot task to use
for that share. Repeat for each share being configured as a shadow copy. For this example, the share
named /mnt/volume1/user1 is configured to use a periodic snapshot task that was configured to
take snapshots of the /mnt/volume1/user1 dataset and the share
named /mnt/volume1/user2 is configured to use a periodic snapshot task that was configured to
take snapshots of the /mnt/volume1/user2 dataset.
3. Verify that the SMB service is set to ON in Services Control Services .
Figure 10.4.5 provides an example of using shadow copies while logged in as user1 on the Windows system. In
this example, the user right-clicked modified file and selected Restore previous versions from the menu. This
particular file has three versions: the current version, plus two previous versions stored on the
FreeNAS system. The user can choose to open one of the previous versions, copy a previous version to the
current folder, or restore one of the previous versions, overwriting the existing file on the Windows system.
Fig. 10.4.5 Viewing Previous Versions within Explorer
Before configuring the iSCSI service, be familiar with this iSCSI terminology:
CHAP: an authentication method which uses a shared secret and three-way authentication to determine if a
system is authorized to access the storage device and to periodically confirm that the session has not been
hijacked by another system. In iSCSI, the initiator (client) performs the CHAP authentication.
Mutual CHAP: a superset of CHAP in that both ends of the communication authenticate to each other.
Initiator: a client which has authorized access to the storage data on the FreeNAS system. The client requires
initiator software to initiate the connection to the iSCSI share.
Target: a storage resource on the FreeNAS system. Every target has a unique name known as an iSCSI
Qualified Name (IQN).
Internet Storage Name Service (iSNS): protocol for the automated discovery of iSCSI devices on a TCP/IP
network.
Portal: indicates which IP addresses and ports to listen on for connection requests.
LUN: stands for Logical Unit Number and represents a logical SCSI device. An initiator negotiates with a target
to establish connectivity to a LUN; the result is an iSCSI connection that emulates a connection to a SCSI hard
disk. Initiators treat iSCSI LUNs the same way as they would a raw SCSI or IDE hard drive; rather than
mounting remote directories, initiators format and directly manage filesystems on iSCSI LUNs. When
configuring multiple iSCSI LUNs, create a new target for each LUN. Since iSCSI multiplexes a target with
multiple LUNs over the same TCP connection, you will experience contention from TCP if there is more than
one target per LUN.
In FreeNAS , iSCSI is built into the kernel. This version of iSCSI supports Microsoft Offloaded Data Transfer
(ODX) , meaning that file copies happen locally, rather than over the network. It also supports
the VAAI (vStorage APIs for Array Integration) primitives for efficient operation of storage tasks directly on the
NAS. To take advantage of the VAAI primitives, create a zvol using the instructions in Create zvol and use it to
create a device extent, as described in Extents .
To configure iSCSI:
Some built-in values affect iSNS usage. Fetching of allowed initiators from iSNS is not implemented, so target
ACLs must be configured manually. To make iSNS registration useful, iSCSI targets should have explicitly
configured port IP addresses. This avoids initiators attempting to discover unconfigured target portal
addresses like 0.0.0.0 .
The iSNS registration period is 900 seconds. Registered Network Entities not updated during this period are
unregistered. The timeout for iSNS requests is 5 seconds.
Fig. 10.5.1 iSCSI Target Global Configuration Variables
Table 10.5.1 Target Global Configuration Settings
see the Constructing iSCSI names using the iqn. format section
Base Name cuerda
of RFC 3721 if unfamiliar with this format
enter the percentage of free space that should remain in the pool; when
Pool Available
entero this percentage is reached, the system issues an alert, but only if zvols
Space Threshold
are used; see VAAI Threshold Warning
10.5.2. Portals
A portal specifies the IP address and port number to be used for iSCSI
connections. Sharing Block (iSCSI) Portals AddPortal brings up the screen shown
in Figure 10.5.2 .
Table 10.5.2 summarizes the settings that can be configured when adding a portal. If you need to assign
additional IP addresses to the portal, click the link Add extra Portal IP .
Discovery Men select a user created in Authorized Access if the Discovery Auth
Auth Group desplegable Method is set to CHAP or Mutual CHAP
Puerto entero TCP port used to access the iSCSI target; default is 3260
FreeNAS systems with multiple IP addresses or interfaces can use a portal to provide services on different
interfaces or subnets. This can be used to configure multi-path I/O (MPIO). MPIO is more efficient than a link
aggregation.
If the FreeNAS system has multiple configured interfaces, portals can also be used to provide network access
control. For example, consider a system with four interfaces configured with the following addresses:
192.168.1.1/24
192.168.2.1/24
192.168.3.1/24
192.168.4.1/24
You could create a portal containing the first two IP addresses (group ID 1) and a portal containing the
remaining two IP addresses (group ID 2). You could then create a target named A with a Portal Group ID of 1
and a second target named B with a Portal Group ID of 2. In this scenario, the iSCSI service would listen on all
four interfaces, but connections to target A would be limited to the first two networks and connections to
target B would be limited to the last two networks.
Another scenario would be to create a portal which includes every IP address except for the one used by a
management interface. This would prevent iSCSI connections to the management interface.
10.5.3. Initiators
The next step is to configure authorized initiators, or the systems which are allowed to connect to the iSCSI
targets on the FreeNAS system. To configure which systems can connect,
use Sharing Block (iSCSI) Initiators Add Initiator , shown in Figure 10.5.3 .
Initiators cuerda use ALL keyword or a list of initiator hostnames separated by spaces
Authorized use ALL keyword or a network address with CIDR mask such
cuerda
network as 192.168.2.0/24
Table 10.5.3 Initiator Configuration Settings
In the example shown in Figure 10.5.4 , two groups have been created. Group 1 allows connections from any
initiator on any network. Group 2 allows connections from any initiator on the 10.10.1.0/24 network. Click an
initiator's entry to display its Edit and Deletebuttons.
Nota
Attempting to delete an initiator causes a warning that indicates if any targets or target/extent mappings
depend upon the initiator. Confirming the delete causes these to be deleted as well.
Nota
This screen sets login authentication. This is different from discovery authentication which is set in Target
Global Configuration .
name of user account to create for CHAP authentication with the user on
Usuario cuerda the remote system; many initiators default to using the initiator name as
the user
only input when configuring mutual CHAP; in most cases it will need to
Peer User cuerda
be the same value as User
the mutual secret password which must be different than the Secret ;
Peer Secret cuerda
required if Peer User is set
Nota
As authorized accesses are added, they will be listed under View Authorized Accesses . In the example
shown in Figure 10.5.6 , three users ( test1 , test2 , and test3 ) and two groups ( 1 and 2 ) have been created,
with group 1 consisting of one CHAP user and group 2 consisting of one mutual CHAP user and one CHAP user.
Click an authorized access entry to display its Edit and Delete buttons.
Nota
An iSCSI target creates a block device that may be accessible to multiple initiators. A clustered filesystem is
required on the block device, such as VMFS used by VMware ESX/ESXi, in order for multiple initiators to
mount the block device read/write. If a traditional filesystem such as EXT, XFS, FAT, NTFS, UFS, or ZFS is placed
on the block device, care must be taken that only one initiator at a time has read/write access or the result
will be filesystem corruption. If multiple clients need access to the same data on a non-clustered filesystem,
use SMB or NFS instead of iSCSI, or create multiple iSCSI targets (one per client).
Men
Portal Group ID leave empty or select number of existing portal to use
desplegable
Men
Auth Method choices are None , Auto , CHAP , or Mutual CHAP
desplegable
10.5.6. Extents
In iSCSI, the target virtualizes something and presents it as a device to the iSCSI client. That something can be
a device extent or a file extent:
Device extent: virtualizes an unformatted physical disk, RAID controller, zvol, zvol snapshot, or an
existing HAST device .
Virtualizing a single disk is slow as there is no caching, but virtualizing a hardware RAID controller has higher
performance due to its cache. This type of virtualization does a pass-through to the disk or hardware RAID
controller. None of the benefits of ZFS are provided and performance is limited to the capabilities of the disk
or controller.
Virtualizing a zvol adds the benefits of ZFS, such as its read cache and write cache. Even if the client formats
the device extent with a different filesystem, as far as FreeNAS is concerned, the data benefits from ZFS
features such as block checksums and snapshots.
Al determinar si se debe utilizar un archivo o un dispositivo de medida, ser conscientes de que se requiere un
zvol para tomar ventaja de todas las primitivas VAAI y se recomienda cuando se utiliza el software de
virtualizacin como el iniciador iSCSI. El ATS, WRITE MISMO, XCOPY y STUN, primitivas estn soportados por
ambas extensiones de archivos y dispositivos. El UNmap primitiva es apoyado por zvols y SSD primas. Las
advertencias de umbral primitivas es totalmente compatible con zvols y en parte con el apoyo de las
extensiones de archivo.
Extensin del archivo: permite exportar una parte de un volumen de ZFS. La ventaja de una medida de
archivos es que se pueden crear varios exportaciones por volumen.
Advertencia
Por motivos de rendimiento y evitar la fragmentacin excesiva, se recomienda mantener el espacio usado de
la piscina por debajo del 50% cuando se utiliza iSCSI. Segn se requiera, se puede aumentar la capacidad de
una medida existente siguiendo las instrucciones de LUN en crecimiento .
Para aadir un punto, vaya a . En el ejemplo mostrado en la figura 10.5.8 , la extensin dispositivo est
utilizando la zvol que se cre anteriormente desde
el volumen.Sharing Block (iSCSI) Extents Add Extentexport/mnt/volume1
Tabla 10.5.6 resume los parmetros que se pueden configurar cuando se crea un punto. Tenga en cuenta
que la creacin de archivos medida fracasar si no anexar el nombre del archivo que se cre para el nombre
del volumen / conjunto de datos.
La Fig. 10.5.8 Adicin de un grado iSCSI
Table 10.5.6 Extent Configuration Settings
Men
Extent Type select from File or Device
desplegable
unique LUN ID; the default is generated from the system's MAC
De serie cuerda
address
Logical Block Men only override the default if the initiator requires a different block
Size desplegable size
Disable
if the initiator does not support physical block size values over 4K
Physical Block caja
(MS SQL), check this box
Size Reporting
Xen initiator
caja check this box when using Xen as the iSCSI initiator
compat mode
Solo lectura caja check this box to prevent the initiator from initializing this LUN
10.5.7. Target/Extents
The last step is associating an extent to a target
within Sharing Block (iSCSI) Associated Targets Add Target/Extent. This
screen is shown in Figure 10.5.9 . Use the drop-down menus to select the existing target and extent.
Click OK to add an entry for the LUN.
Fig. 10.5.9 Associating a Target With an Extent
Table 10.5.7 summarizes the settings that can be configured when associating targets and extents.
LUN ID Men desplegable select the value of the ID or type in the desired value
It is recommended to always associate extents to targets in a one-to-one manner, even though the GUI will
allow multiple extents to be associated with the same target.
Nota
Each LUN entry has Edit and Delete buttons for modifying the settings or deleting the LUN entirely. A
verification popup appears when the Delete button is clicked. If an initiator has an active connection to the
LUN, it is indicated in red text. It is recommended to clear initiator connections to a LUN before deleting it.
After iSCSI has been configured, remember to start it in Services Control Services . Click the
red OFF button next to iSCSI. After a second or so, it will change to a blue ON , indicating that the service has
started.
An iSCSI Initiator client is pre-installed with Windows 7. A detailed how-to for this client can be found here . A
client for Windows 2000, XP, and 2003 can be found here . This how-to shows how to create an iSCSI target
for a Windows 7 system.
Mac OS X does not include an initiator. globalSAN is a commercial, easy-to-use Mac initiator.
BSD systems provide command line initiators: iscontrol(8) comes with FreeBSD versions 9.x and
lower, iscsictl(8) comes with FreeBSD versions 10.0 and higher, iscsi-initiator(8) comes with NetBSD,
and iscsid(8) comes with OpenBSD.
Some Linux distros provide the command line utility iscsiadm from Open-iSCSI . Use a web search to see if
a package exists for your distribution should the command not exist on your Linux system.
If a LUN is added while iscsiadm is already connected, it will not see the new LUN until rescanned
with iscsiadm -m node -R . Alternately, use iscsiadm -m discovery -t st -p
portal_IP to find the new LUN and iscsiadm -m node -T LUN_Name -l to log into the LUN.
Instructions for connecting from a VMware ESXi Server can be found at How to configure FreeNAS 8 for iSCSI
and connect to ESX(i) . Note that the requirements for booting vSphere 4.x off iSCSI differ between ESX and
ESXi. ESX requires a hardware iSCSI adapter while ESXi requires specific iSCSI boot firmware support. The
magic is on the booting host side, meaning that there is no difference to the FreeNAS configuration. See
the iSCSI SAN Configuration Guide for details.
The VMware firewall only allows iSCSI connections on port 3260 by default. If a different port has been
selected, outgoing connections to that port must be manually added to the firewall before those connections
will work.
If the target can be seen but does not connect, check the Discovery Auth settings in Target Global
Configuration .
If the LUN is not discovered by ESXi, make sure that promiscuous mode is set to Accept in the vSwitch.
10.5.9. Growing LUNs
The method used to grow the size of an existing iSCSI LUN depends on whether the LUN is backed by a file
extent or a zvol. Both methods are described in this section.
Enlarging a LUN with one of the methods below gives it more unallocated space, but does not automatically
resize filesystems or other data on the LUN. This is the same as binary-copying a smaller disk onto a larger
one. More space is available on the new disk, but the partitions and filesystems on it must be expanded to use
this new space. Resizing virtual disk images is usually done from virtual machine management software.
Application software to resize filesystems is dependent on the type of filesystem and client, but is often run
from within the virtual machine. For instance, consider a Windows VM with the last partition on the disk
holding an NTFS filesystem. The LUN is expanded and the partition table edited to add the new space to the
last partition. The Windows disk manager must still be used to resize the NTFS filesystem on that last partition
to use the new space.
Hacer crecer un zvol basado LUN, ir a , resalte el zvol ser cultivadas, y haga clic en Editar zvol . En el ejemplo
mostrado en la Figura 10.5.10 , el tamao actual de la zvol llamado zvol1 es de 4
GB.Storage Volumes View Volumes
Fig. 10.5.10 Edicin de un zvol existente
Introduzca el nuevo tamao para el zvol en el tamao de campo y haga clic en Editar ZFS volumen . Este
men se cierra y el nuevo tamao para el zvol se muestra inmediatamente en la Usado columna de
la Volmenes Ver pantalla.
Nota
La interfaz grfica de usuario no permite la reduccin (reduccin) del tamao de la zvol, ya que al hacerlo
podra provocar la prdida de datos. Tambin no permite aumentar el tamao de la zvol pasado el 80% del
tamao del volumen.
Volver a y haga clic en el Editar botn de la extensin del archivo. Establecer el tamao a 0 ya que esto hace
que el destino iSCSI para utilizar el nuevo tamao del
archivo.Services iSCSI File Extents View File Extents