Sie sind auf Seite 1von 121

8.

Almacenamiento
La seccin Almacenamiento de la interfaz grfica permite configurar estas opciones:

Volumes crea y gestiona volmenes de almacenamiento.


Tareas peridicas de instantneas programa la creacin automtica de instantneas del sistema de
archivos.
Tareas de replicacin automatiza la replicacin de instantneas en un sistema remoto.
Scrubs programa scrubs como parte del mantenimiento del disco en curso.
Snapshots gestiona instantneas locales.
VMware-Snapshot coordina las instantneas de ZFS con un almacn de datos de VMware.

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

En la terminologa de ZFS, el almacenamiento administrado por ZFS se denomina agrupacin. La interfaz


grfica de FreeNAS utiliza el trmino volumen para referirse a un grupo ZFS.

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.

8.1.1. Administrador de volumen

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 .

Fig. 8.1.1 Creacin de una agrupacin ZFS mediante Volume Manager


La tabla 8.1.1 resume las opciones de configuracin de esta pantalla.

Tabla 8.1.1 Opciones al crear un volumen ZFS

Ajuste Valor Descripcin

Los volmenes de ZFS deben ajustarse a estos convenios de


Nombre del
cuerda nomenclatura ; se recomienda elegir un nombre que sobresalga en
volumen
los registros (por ejemplo, no data o freenas )
Tabla 8.1.1 Opciones al crear un volumen ZFS

Ajuste Valor Descripcin

utilizado para extender un grupo existente de


Volumen a Men
ZFS; consulte Extendiendo un volumen de ZFSpara obtener
ampliar desplegable
instrucciones

Cifrado caja lea la seccin Encryption antes de elegir utilizar el cifrado

muestra el nmero y el tamao de los discos disponibles; coloque


Discos el cursor sobre la pantalla para mostrar los nombres de
monitor
disponibles dispositivos disponibles; haga clic en el + para agregar todos los
discos a la piscina

haga clic y arrastre el icono para seleccionar el nmero deseado de


Distribucin del arrastrar y discos para un vdev; una vez que se selecciona al menos un disco,
volumen soltar los diseos admitidos por el nmero seleccionado de discos se
aadirn al men desplegable

Agregar se utiliza para configurar vdevs mltiples o para agregar


dispositivo botn dispositivos de registro o cach durante la creacin de la
adicional agrupacin

usado para hacer un pool no ptimo (no


Configuracin
botn recomendado); consulte Configuracin manual para obtener
manual
detalles

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.

8.1.1.2. Configuracin manual


El botn Manual Setup que se muestra en la Figura 8.1.1 se puede usar para crear un volumen ZFS no
ptimo. Si bien esto no serecomienda, puede, por ejemplo, utilizarse para crear un volumen que contenga
discos de diferentes tamaos.

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.

Fig. 8.1.2 Creacin de un volumen ZFS no ptimo


Tabla 8.1.2 Opciones de configuracin manual

Ajuste Valor Descripcin

Los volmenes de ZFS deben ajustarse a estos convenios de


Nombre del
cuerda nomenclatura ; se recomienda elegir un nombre que sobresalga en
volumen
los registros (por ejemplo, no data o freenas )

Cifrado caja lea la seccin Encryption antes de elegir utilizar el cifrado

Discos
lista resalte el nmero deseado de discos de la lista de discos disponibles
miembros

las opciones estn desactivadas , Verificar y Activar ; considere


Men
Deduplicacin cuidadosamente la seccin de Deduplicacin antes de cambiar este
desplegable
ajuste

se utiliza para especificar si el disco se utiliza para el


seleccin de
ZFS Extra almacenamiento ( Ninguno ), un dispositivo de registro, un
balas
dispositivo de cach o un dispositivo de reserva.
8.1.1.3. Ampliacin de un volumen ZFS

El men desplegable Volumen a extender en Storage Volumes Volume Manager , que se


muestra en la Figura 8.1.1 , se puede utilizar para agregar discos adicionales a un volumen ZFS existente. Este
men desplegable estar vaco si no existe ningn volumen de ZFS.

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.

8.1.1.3.1. Adicin de dispositivos L2ARC o ZIL

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.

8.1.2. Cambiar permisos

La configuracin de permisos es un aspecto importante de la configuracin de volmenes. La interfaz


administrativa grfica est destinada a establecer los permisos iniciales para un volumen o conjunto de datos
con el fin de que est disponible como un recurso compartido. Una vez que un recurso compartido est
disponible, el sistema operativo del cliente debe utilizarse para ajustar los permisos de los archivos y
directorios creados por el cliente.

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

Ajuste Valor Descripcin

Aplicar
desactive para evitar que se aplique el cambio de permiso nuevo
propietario caja
a Propietario (usuario) , vea Nota abajo
(usuario)

usuario para controlar el volumen / conjunto de datos; los


Propietario Men
usuarios creados manualmente o importados de un servicio de
(usuario) desplegable
directorio aparecern en el men desplegable

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

Ajuste Valor Descripcin

grupo para controlar el volumen / conjunto de datos; los grupos


Propietario Men
creados manualmente o importados de un servicio de directorio
(grupo) desplegable
aparecern en el men desplegable

desmarque para evitar que el cambio de permiso nuevo se aplique


Aplicar modo caja
a Modo , vea Nota abajo

casillas de slo se aplica a Unix o Mac "Tipo de permiso" por lo que ser en
Modo
verificacin gris si Windows est seleccionado

las opciones son Unix , Mac o Windows ; seleccione el tipo que


seleccin de
Tipo de permiso coincida con el tipo de cliente que accede al volumen / conjunto
balas
de datos

si est marcada, los permisos tambin se aplicarn a los


Establecer
subdirectorios del volumen / conjunto de datos; si ya existen
permiso caja
datos en el volumen / conjunto de datos, cambie los permisos en
recursivamente
el lado del cliente para evitar un retraso de rendimiento
Nota

Las casillas de verificacin Aplicar propietario (usuario) , Aplicar propietario


(grupo) y Aplicar modo permiten ajustar el comportamiento de los permisos de cambio. De forma
predeterminada, todas las casillas se comprueban y FreeNAS restablece el propietario, grupo y modo cuando
se hace clic en el botn Cambiar . Estas casillas de verificacin permiten elegir qu ajustes cambiar. Por
ejemplo, para cambiar solo la configuracin de propietario (grupo) , desmarque las casillas Aplicar
propietario (usuario) y Aplicar modo .

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.

8.1.3. Crear conjunto de datos

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

ZFS proporciona un aprovisionamiento grueso utilizando cuotas y un aprovisionamiento delgado utilizando el


espacio reservado.

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

Ajuste Valor Descripcin

Nombre del obligatorio; introduzca un nombre nico para el conjunto de


cuerda
conjunto de datos datos

comentarios breves o notas de usuario sobre este conjunto de


Comentarios cuerda
datos

Men consulte la seccin sobre Compresin para obtener una


Nivel de compresin
desplegable descripcin de los algoritmos disponibles

seleccione el tipo de recurso compartido que se utilizar en el


Men conjunto de datos; las opciones son UNIX para un recurso
Tipo de accin
desplegable compartido NFS, Windows para un recurso compartido SMB
o Mac para un recurso compartido AFP

las opciones son sensibles (por defecto, se supone que los


nombres de archivo son sensibles a maysculas y
Men
Sensibilidad del caso minsculas), insensible (se supone que los nombres de
desplegable
archivo no distinguen entre maysculas y minsculas)
o mixtos (entiende ambos tipos de nombres de archivo)

controla si el tiempo de acceso para los archivos se actualiza


Heredar,
cuando se leen; establecer esta propiedad en Off evita
Habilitar atime Activar o
producir trfico de registro al leer archivos y puede resultar
Desactivar
en ganancias de rendimiento significativas

slo disponible en modo avanzado ; default


de 0 deshabilita las cuotas; especificar un valor significa
Cuota para este
entero utilizar no ms que el tamao especificado y es adecuado
conjunto de datos
para conjuntos de datos de usuario para evitar que los
usuarios acumulen espacio disponible

Cuota para este slo disponible en modo avanzado ; un valor especificado


conjunto de datos y entero se aplica tanto a este conjunto de datos como a cualquier
todos los nios conjunto de datos secundario

slo disponible en modo avanzado ; el valor


Espacio reservado predeterminado de 0 es ilimitado;especificar un valor
para este conjunto de entero significa mantener al menos este espacio libre y es adecuado
datos para conjuntos de datos que contienen registros que podran
ocupar todo el espacio libre disponible
Tabla 8.1.4 Opciones del conjunto de datos de ZFS

Ajuste Valor Descripcin

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

Deduplicacin de Men lea la seccin de Deduplicacin antes de realizar un cambio


ZFS desplegable en esta configuracin

slo disponible en modo avanzado ; mientras que ZFS


adapta automticamente el tamao del registro
Men dinmicamente para adaptarse a los datos, si los datos tienen
Tamao del Registro
desplegable un tamao fijo (por ejemplo, una base de datos),
coincidiendo con ese tamao puede resultar en un mejor
rendimiento

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.

Si la desduplicacin se cambia a On , los bloques de datos duplicados se eliminan de forma sncrona. El


resultado es que slo se almacenan datos nicos y que los componentes comunes se comparten entre los
archivos. Si la desduplicacin se cambia a Verify , ZFS realizar una comparacin de byte a byte cuando dos
bloques tengan la misma firma para asegurarse de que el contenido del bloque es idntico. Dado que las
colisiones de hash son extremadamente raras, Verify normalmente no vale la pena el xito de rendimiento.

Nota

Una vez habilitada la deduplicacin, la nica forma de desactivarla es utilizar


el zfs set dedup=off dataset_name de Shell . Sin embargo, cualquier dato que ya haya sido
deduplicado no ser desduplicado. Slo los datos recin almacenados despus del cambio de propiedad no se
deduplicarn. La nica manera de eliminar los datos duplicados existentes es copiar todos los datos del
conjunto de datos, establecer la propiedad en off y, a continuacin, copiar los datos de
nuevo. Alternativamente, cree un nuevo conjunto de datos con la desduplicacin de ZFS desactivada,
copie los datos al nuevo conjunto de datos y destruya el dataset original.
Propina

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.

Si selecciona Desactivado como nivel de compresin al crear un conjunto de datos o zvol, la


compresin no se utilizar en el conjunto de datos / zvol. Esto no se recomienda, ya que el uso de lz4 tiene un
impacto de rendimiento insignificante y permite una mayor capacidad de almacenamiento.

8.1.4. Crear zvol

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 .

Tabla 8.1.5 Opciones de configuracin zvol

Ajuste Valor Descripcin

zvol Nombre cuerda obligatorio; ingrese un nombre para el zvol


Tabla 8.1.5 Opciones de configuracin zvol

Ajuste Valor Descripcin

Comentarios cuerda comentarios breves o notas de usuario acerca de este zvol

especifique el tamao y el valor como 10Gib ; si el tamao es ms


Tamao para del 80% de la capacidad disponible, la creacin fallar con un error
entero
este zvol de "fuera de espacio" a menos que el tamao de Fuerza est
marcado

por defecto, el sistema no le permitir crear un zvol si esa operacin


Tamao de la llevar el pool a ms del 80% de capacidad; mientras NO se
caja
fuerza recomienda , marcando esta casilla forzar la creacin del zvol en
esta situacin

Nivel de Men consulte la seccin sobre Compresin para obtener una descripcin
compresin desplegable de los algoritmos disponibles

utilizado para proporcionar aprovisionamiento delgado; utilizar con


Volumen
caja precaucin para cuando esta opcin est seleccionada, escritura se
escaso
producir un error cuando la agrupacin tiene poco espacio

slo est disponible en modo avanzado y por defecto se basa en


Tamao de Men el nmero de discos en la agrupacin; puede ajustarse para que
bloque desplegable coincida con el tamao de bloque del sistema de archivos que se
formatear en el destino iSCSI

8.1.5. Importar disco

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.

Fig. 8.1.6 Importacin de un disco


Utilice el men desplegable para seleccionar el disco que va a importar, seleccione el tipo de sistema de
archivos en el disco y busque el dataset de ZFS que contenga los datos copiados. Al hacer clic en Importar
volumen , se monta el disco, se copia su contenido en el conjunto de datos ZFS especificado y se desmonta
el disco una vez finalizada la operacin de copia.

8.1.6. Volumen de importacin

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.

Fig. 8.1.7 Pantalla de volumen de importacin inicial


Si est importando una agrupacin ZFS no cifrada, seleccione No: Saltar a la importacin para
abrir la pantalla que se muestra en la Figura 8.1.8 .

Fig. 8.1.8 Importacin de un volumen no cifrado


Los volmenes existentes deben estar disponibles para la seleccin en el men desplegable. En el ejemplo que
se muestra en la Figura 8.1.8 , el sistema FreeNAS tiene un conjunto ZFS existente y no cifrado. Una vez
seleccionado el volumen, haga clic en el botn Aceptar para importar el 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 .

8.1.6.1. Importar un conjunto cifrado

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 .

Fig. 8.1.9 Descifrar discos antes de importar un grupo ZFS


Seleccione los discos del grupo cifrado, busque la ubicacin de la clave de cifrado guardada, ingrese la frase de
contrasea asociada a la clave y haga clic en Aceptar para desencriptar los discos.

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.

8.1.7. Ver discos

Storage Volumes View Disks muestra todos los discos reconocidos por el sistema
FreeNAS . Un ejemplo se muestra en la Figura 8.1.10 .

Fig. 8.1.10 Visualizacin de discos


Se muestra la configuracin actual de cada dispositivo. Haga clic en una entrada de disco y en el
botn Editar para cambiar su configuracin. Las opciones configurables se describen en la Tabla 8.1.6 .
Tabla 8.1.6 Opciones de disco

Ajuste Valor Descripcin

valor de slo lectura que muestra el nombre del dispositivo


Nombre cuerda
FreeBSD para el disco

De serie cuerda valor de slo lectura que muestra el nmero de serie del disco

Descripcin cuerda Opcional

indica el tiempo de inactividad (en minutos) antes de que el


Men convertidor entre en modo de espera para conservar
HDD en espera
desplegable energa; este mensaje del foro demuestra cmo determinar si
una unidad ha girado hacia abajo

Administracin
Men predeterminado es Desactivado , puede seleccionar un perfil de
avanzada de
desplegable administracin de energa en el men
energa

Men el valor predeterminado es Desactivado ; puede ser modificado


Nivel acstico
desplegable para los discos que entienden AAM

habilitado de forma predeterminada si el disco admite


Habilitar SMART caja SMART; desmarcando esta casilla deshabilitar
cualquier prueba SMART configurada para el disco

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 .

La funcin Wipe se proporciona cuando se debe descartar un disco no utilizado.

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.

8.1.8. View Volumes


Storage Volumes View Volumes is used to view and further configure existing ZFS pools,
datasets, and zvols. The example shown in Figure 8.1.11 shows one ZFS pool ( volume1 ) with two datasets
(the one automatically created with the pool, volume1 , and dataset1 ) and one zvol ( zvol1 ).

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.

Fig. 8.1.13 Volume Status


Selecting a disk in Volume Status and clicking its Edit Disk button shows the screen in Figure
8.1.14 . Table 8.1.6 summarizes the configurable options.
Fig. 8.1.14 Editing a Disk
Nota

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:

Change Permissions: edit the dataset's permissions as described in Change Permissions .

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.

Create Dataset: used to create a child dataset within this dataset.

Create zvol: create a child zvol within this dataset.

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.

8.1.8.1. Managing Encrypted Volumes

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.

8.1.9. View Multipaths


FreeNAS uses gmultipath(8) to provide multipath I/O support on systems containing hardware that is capable
of multipath. An example would be a dual SAS expander backplane in the chassis or an external JBOD.

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.

8.1.10. Replacing a Failed Drive


With any form of redundant RAID, failed drives must be replaced as soon as possible to repair the degraded
state of the RAID. Depending on the hardware's capabilities, it might be necessary to reboot to replace the
failed drive. Hardware that supports AHCI does not require a reboot.

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.

8.1.11. Replacing Drives to Grow a ZFS Pool


The recommended method for expanding the size of a ZFS pool is to pre-plan the number of disks in a vdev
and to stripe additional vdevs using Volume Manager as additional capacity is needed.

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:

1. Shut down the system.


2. Install one new disk.
3. Start up the system.
4. Go to Storage Volumes , select the pool to expand and click the Volume Status button. Select
a disk and click the Replacebutton. Choose the new disk as the replacement.
5. The status of the resilver process can be viewed by running zpool status . When the new disk has
resilvered, the old one will be automatically offlined. The system is then shut down to physically remove
the replaced disk. One advantage of this approach is that there is no loss of redundancy during the
resilver.

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.

8.2. Periodic Snapshot Tasks


A periodic snapshot task allows scheduling the creation of read-only versions of ZFS volumes and datasets at a
given point in time. Snapshots can be created quickly and, if little data changes, new snapshots take up very
little space. For example, a snapshot where no files have changed takes 0 MB of storage, but as changes are
made to files, the snapshot size changes to reflect the size of the changes.

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

Ajuste Valor Descripcin

Volumen / Men seleccionar un volumen de ZFS, el conjunto de datos, o zvol


base de datos desplegable existente

seleccione esta casilla para tomar instantneas separadas del


recursiva caja volumen / base de datos y cada uno de sus nios conjuntos de
datos; si no se controla, una nica instantnea se toma de slo el
Tabla 8.2.1 opciones al crear una instantnea peridica

Ajuste Valor Descripcin

volumen / conjunto de datos especificado, pero no cualquier nio


conjuntos de datos

nmero entero perodo de tiempo para retener la instantnea en este sistema; si se


Lifetime
y el men replica la instantnea, no se elimina del sistema receptor cuando el
instantnea
desplegable tiempo de vida expira

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

Men con qu frecuencia debe tomar instantneas


Intervalo
desplegable entre Begin y End veces

Da casillas de
qu das de la semana para tomar instantneas
laborable verificacin

desactivar para desactivar la tarea instantnea programada sin


Habilitado caja
eliminarlo

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.

8.3. Replication Tasks


Replication is the duplication of snapshots from one FreeNAS system to another computer. When a new
snapshot is created on the source computer, it is automatically replicated to the destination computer.
Replication is typically used to keep a copy of files on a separate system, with that system sometimes being at
a different physical location.

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.

8.3.1. Examples: Common Configuration


The examples shown here use the same setup of source and destination computers.

8.3.1.1. Alpha (Source)

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 .

8.3.2. Example: FreeNAS to FreeNAS Semi-Automatic


Setup
FreeNAS offers a special semi-automatic setup mode that simplifies setting up replication. Create the
replication task on Alpha by clicking Replication Tasks and Add
Replication . alphavol/alphadata is selected as the dataset to replicate. betavol is the destination volume
where alphadata snapshots are replicated. The Setup mode dropdown is set to Semi-automatic as shown
in Figure 8.3.2 . The IP address of Beta is entered in the Remote hostname field. A hostname can be
entered here if local DNS resolves for that hostname.

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.

Fig. 8.3.3 Temporary Authentication Token on Destination


On the Alpha system, paste the copied temporary authorization token string into the Remote Auth
Token field as shown in Figure 8.3.4.

Fig. 8.3.4 Temporary Authentication Token Pasted to Source


Finally, click the OK button 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.

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.

8.3.3. Example: FreeNAS to FreeNAS or Other Systems,


Manual Setup
This example uses the same basic configuration of source and destination computers shown above, but the
destination computer is not required to be a FreeNAS system. Other operating systems can receive the
replication if they support SSH, ZFS, and the same features that are in use on the source system. The details of
creating volumes and datasets, enabling SSH, and copying encryption keys will vary when the destination
computer is not a FreeNAS system.

8.3.3.1. Encryption Keys

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.

Fig. 8.3.5 Copy the Replication Key


On Beta , select Account Users View Users . Click the root account to select it, then
click Modify User . Paste the copied key into the SSH Public Key field and click OK as shown in Figure
8.3.6 .
Fig. 8.3.6 Paste the Replication Key
Back on Alpha , create the replication task by clicking Replication Tasks and Add
Replication . alphavol/alphadata is selected as the dataset to replicate. The destination volume
is betavol . The alphadata dataset and snapshots are replicated there. The IP address of Betais entered in
the Remote hostname field as shown in Figure 8.3.7 . A hostname can be entered here if local DNS
resolves for that hostname.

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.

Table 8.3.1 Replication Task Options

Ajuste Valor Descripcin

ZFS volume or dataset on the source computer containing the


drop-down
Volume/Dataset snapshots to be replicated; the drop-down menu is empty if a
menu
snapshot does not already exist

ZFS volume on the remote or destination computer which will


Remote ZFS store the snapshots; if the destination dataset is not present, it
cuerda
Volume/Dataset will be created; /mnt/ is assumed, do not include it in the
path

Recursively replicate
when checked, also replicate snapshots of datasets that are
child dataset's checkbox
children of the main dataset
snapshots

when checked, delete previous snapshots on the remote or


Delete stale snapshots checkbox destination computer which are no longer present on the
source computer

choices are lz4 (fastest) , pigz (all rounder) , plzip (best


Replication Stream drop-down compression) , or Off (no compression); selecting a
Compression menu compression algorithm can reduce the size of the data being
replicated

limit replication speed to the specified value in


Limit (kB/s) entero
kilobytes/second; default of 0 is unlimited

replication is not allowed to start before this time; times


drop-down
Empezar entered in the Begin and End fields set when replication can
menu
occur

drop-down replication must start by this time; once started, replication


Fin
menu will continue until it is finished
Table 8.3.1 Replication Task Options

Ajuste Valor Descripcin

uncheck to disable the scheduled replication task without


Habilitado checkbox
deleting it

drop-down
Setup mode Manual or Semi-automatic
menu

Nombre de host IP address or DNS name of remote computer where


cuerda
remoto replication is sent

the port used by the SSH server on the remote or destination


Remote port cuerda
computer

Dedicated User
checkbox allow a user account other than root to be used for replication
Enabled

drop-down only available if Dedicated User Enabled is checked;


Dedicated User
menu select the user account to be used for replication

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.

Fig. 8.3.8 Replication Task List


Nota

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.5. Replication Encryption


The default Encryption Cipher Standard setting provides good security. Fast is less secure
than Standard but can give reasonable transfer rates for devices with limited cryptographic speed. For
networks where the entire path between source and destination computers is trusted, the Disabled option
can be chosen to send replicated data without encryption.

8.3.6. Limiting Replication Times


The Begin and End times in a replication task make it possible to restrict when replication is allowed. These
times can be set to only allow replication after business hours, or at other times when disk or network activity
will not slow down other operations like snapshots or Scrubs . The default settings allow replication to occur
at any time.
These times control when replication task are allowed to start, but will not stop a replication task that is
already running. Once a replication task has begun, it will run until finished.

8.3.7. Troubleshooting Replication


Replication depends on SSH, disks, network, compression, and encryption to work. A failure or
misconfiguration of any of these can prevent successful replication.

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:

ssh -vv -i /data/ssh/replication 10.0.0.118

On the first connection, the system might say

No matching host key fingerprint found in DNS.


Are you sure you want to continue connecting (yes/no)?

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.

8.3.7.3. Manual Testing

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.

zfs send alphavol/alphadata@auto-20161206.1110-2w | ssh -i


/data/ssh/replication 10.0.0.118 zfs recv betavol

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:

zfs destroy -R betavol/alphadata@auto-20161206.1110-2w

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 .

Error messages here can indicate any remaining problems.

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.

Scrubs are scheduled and managed with Storage Scrubs .

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

Ajuste Valor Descripcin

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

Descripcin cuerda Opcional


Table 8.4.1 ZFS Scrub Options

Ajuste Valor Descripcin

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

Mes checkboxes scrub occurs on the selected months

scrub occurs on the selected days; default is Sunday to least impact


Day of week checkboxes
users

Habilitado checkbox uncheck to disable the scheduled scrub without deleting it

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.

Snapshots have icons on the right side for several actions.

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:

select the column or leave the default of Any Column .


select the condition. Possible conditions are: contains (default), is , starts with , ends with , does not
contain , is not , does not start with , does not end with , and is empty .
enter a value that meets your view criteria.
click the Filter button to save your filter and exit the define filter screen. Alternately, click the + button
to add another 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.

Fig. 8.6.1 Adicin de un VMware Snapshot


Tabla 8.6.1 VMware Opciones de instantneas

Ajuste Valor Descripcin

Nombre de direccin IP o nombre de host de VMware; cuando la agrupacin,


cuerda
host este es el servidor vCenter para el clster

Nombre de usuario en el host VMware suficiente permiso para snapshot


cuerda
usuario mquinas virtuales

Contrasea cuerda contrasea asociada al nombre de usuario

Sistema de Men
el sistema de archivos de instantnea
archivos ZFS desplegable

Almacn de Men despus de introducir el nombre de host , nombre de


datos desplegable usuario y contrasea , haga clic en Fetch almacenes de
Tabla 8.6.1 VMware Opciones de instantneas

Ajuste Valor Descripcin

datos para poblar el men y seleccione el almacn de datos con la


que sincronizar

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.

Estos tipos de acciones y servicios estn disponibles:

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 .

10.1. Acciones de Apple (AFP)


FreeNAS utiliza el servidor AFP de Netatalk para compartir datos con los sistemas de Apple. En esta seccin
se describe la pantalla de configuracin para el ajuste fino de las cuotas AFP creadas con el Asistente . A
continuacin, proporciona ejemplos de configuracin para utilizar el Asistente para crear un recurso
compartido de invitados, configurar Time Machine para realizar copias de seguridad en un conjunto de datos
del sistema FreeNAS y para conectarse al recurso compartido desde un cliente Mac OS X.

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.

Fig. 10.1.1 Creacin de un recurso compartido de AFP


Nota

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.

Tabla 10.1.1 Opciones de configuracin de recursos de AFP

Ajuste Valor Descripcin

navegue hasta el volumen / conjunto de datos para compartir; no


botn de anida volmenes adicionales, conjuntos de datos o enlaces
Camino
exploracin simblicos debajo de esta ruta, ya que Netatalk no admite
totalmente esa

nombre del volumen que aparece en el cuadro de


Nombre cuerda dilogo conectar con el servidordel equipo Mac; limitado a 27
caracteres y no puede contener un perodo

Compartir
cuerda comentario opcional, slo disponible en modo avanzado
Comentario

slo disponible en modo avanzado ; lista delimitada por comas


de usuarios y / o grupos permitidos donde nombregrupo
Lista de permisos cuerda comienza con un @ ; tenga en cuenta que la adicin de una
entrada denegar cualquier usuario / grupo que no est
especificado

slo disponible en modo avanzado ; lista delimitada por comas


de usuarios y / o grupos denegados donde nombregrupo
Deny List cuerda comienza con un @ ; tenga en cuenta que la adicin de una
entrada permitir a todos los usuarios / grupos que no se
especifiquen

slo disponible en modo avanzado ; lista delimitada por comas


Acceso de slo
cuerda de usuarios y / o grupos que slo tienen acceso de lectura donde
lectura
nombregrupo comienza con un @

slo disponible en modo avanzado ; lista delimitada por comas


Acceso de lectura
cuerda de usuarios y / o grupos que tienen acceso de lectura y escritura
y escritura
donde nombregrupo comienza con un @

cuando se verifica, FreeNAS se anuncia como un disco de Time


Mquina del Machine para que pueda ser encontrado por Macs; debido a una
caja
tiempo limitacin en la forma en que la Mac se ocupa de los problemas
de bajo espacio de disco cuando mltiples Mac comparten el
Tabla 10.1.1 Opciones de configuracin de recursos de AFP

Ajuste Valor Descripcin

mismo volumen, la comprobacin de Time Machine en varios


recursos podra dar lugar a copias de seguridad intermitentes
fallidas

Nmeros de slo disponible en modo avanzado ; habilitar cuando el nmero


caja
dispositivo cero de dispositivo no es constante a travs de un reinicio

slo disponible en modo avanzado ; si est marcada, AFP no


establece la ruta del volumen al enumerar la lista de
Sin estad caja
volmenes; til para el montaje automtico o volmenes creados
por un script preexec

slo disponible en modo avanzado ; habilitar los privilegios


AFP3 UNIX Unix compatibles con OSX 10.5 y versiones posteriores; no lo
caja
Privs habilite si la red contiene clientes Mac OS X 10.4 o menos, ya
que no admiten esta funcin

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

slo disponible en modo avanzado ; umask utilizado para


Predeterminado
entero archivos recin creados, por defecto es 000 (cualquiera puede
umask
leer, escribir y ejecutar)

Los anfitriones slo disponible en modo avanzado ; lista de nombres de host o


cuerda
permiten direcciones IP permitidos por comas, espacios o tabulaciones

slo disponible en modo avanzado ; lista separada por comas,


Hosts Deny cuerda espacios o tabulaciones de nombres de host o direcciones IP
denegados

Parmetros parmetros afp.conf adicionales no cubiertos por otros campos


cuerda
Auxiliares de opcin

10.1.1. Creacin de acciones de invitado AFP


AFP admite los inicios de sesin de invitados, lo que significa que los usuarios de Mac OS X pueden acceder a
la cuota de AFP sin necesidad de que sus cuentas de usuario se creen o se importen en el sistema FreeNAS .

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 .

10.1.2. Creacin de participaciones autenticadas y de mquinas de tiempo

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 .

Para configurar Time Machine en el cliente Mac OS X, vaya


a System Preferences Time Machine que abre la pantalla que se muestra en la Figura
10.1.7 . Haga clic en ON y un men emergente muestra el sistema FreeNAS como una opcin de copia de
seguridad. En nuestro ejemplo, aparece como backup_user1 en "freenas" . Resalte el sistema FreeNAS y haga
clic en Usar disco de copia de seguridad . Se abre una barra de conexin y se solicita la contrasea de la
cuenta de usuario; en este ejemplo, la contrasea que se estableci para la cuenta user1 .

Fig. 10.1.7 Configuracin de Time Machine en Mac OS X Lion


Si Time Machine no pudo completar la copia de seguridad. No se pudo crear la imagen del disco de copia
de seguridad (error 45) al realizar una copia de seguridad en el sistema FreeNAS , se debe crear una imagen
de sparsebundle utilizando estas instrucciones .

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.

10.2. Acciones de Unix (NFS)


FreeNAS es compatible con el sistema de archivos de red (NFS). Los clientes utilizan el comando mount para
montar el recurso compartido. Una vez montado, el recurso compartido NFS aparece como slo otro
directorio en el sistema cliente. Algunas distribuciones Linux requieren la instalacin de software adicional
para montar un recurso compartido NFS. En sistemas Windows, habilite Servicios para NFS en las ediciones
Ultimate o Enterprise o instale una aplicacin cliente NFS.

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 .

Tabla 10.2.1 Opciones de recurso de NFS

Modo
Ajuste Valor Descripcin
avanzado

navegue hasta el volumen o conjunto de datos que se


botn de
Camino va a compartir; haga clic en Agregar ruta
exploracin
adicional para seleccionar varias rutas
Tabla 10.2.1 Opciones de recurso de NFS

Modo
Ajuste Valor Descripcin
avanzado

establecer el nombre de recurso compartido; si se deja


Comentario cuerda vaco, share name es la lista de las entradas
de ruta seleccionadas

lista de redes permitidas en la red / mscara de


Redes
cuerda notacin CIDR, como 1.2.3.0/24 , delimitado por el
autorizadas
espacio; dejar vaco para permitir que todos

Direcciones lista de direcciones IP o nombres de host permitidos,


IP o hosts cuerda delimitado por espacios; dejar vaco para permitir que
autorizados todos

Todos los cuando est marcada, permita que el cliente monte


caja
directorios cualquier subdirectorio dentro del Path

Solo lectura caja prohibir la escritura a la parte

inhibir diagnsticos syslog de otra manera tiles para


Tranquilo caja evitar algunos mensajes de error
molestos; ver exportaciones (5) para ejemplos

Usuario de Men cuando se selecciona un usuario, el usuario root est



Maproot desplegable limitado a los permisos de ese usuario

Grupo de Men cuando se selecciona un grupo, el usuario root tambin



Maproot desplegable est limitado a los permisos de ese grupo

Usuario Men los permisos del usuario especificado son utilizados



Mapall desplegable por todos los clientes

Grupo Men los permisos del grupo especificado son utilizados por

Mapall desplegable todos los clientes

slo aparece si Habilitar NFSv4 est marcado


en Services NFS ; las opciones son sys o estas
opciones de Kerberos: krb5 (slo
Seguridad seleccin autenticacin), krb5i (autenticacin e integridad)
o krb5p (autenticacin y privacidad); si se agregan
varios mecanismos de seguridad a la
columna Seleccionadausando las flechas, utilice los
Tabla 10.2.1 Opciones de recurso de NFS

Modo
Ajuste Valor Descripcin
avanzado

botones Arriba o Abajo para listar en orden de


preferencia

Al crear los recursos compartidos NFS, tenga en cuenta los siguientes puntos:

1. Los clientes especificarn el Camino al montar el recurso compartido.


2. Las opciones Maproot y Mapall son exclusivas, lo que significa que solo se puede usar una, la GUI no
permite ambas. Las opciones de Mapall reemplazan las opciones de Maproot . Para restringir slo los
permisos del usuario root , establezca la opcin Maproot . Para restringir los permisos de todos los
usuarios, defina las opciones de Mapall .
3. Cada volumen o conjunto de datos se considera que es su propio sistema de archivos y NFS no es capaz de
cruzar los lmites del sistema de archivos.
4. La red o el host debe ser nico por recurso y por sistema de archivos o directorio.
5. La opcin Todos los directorios slo se puede utilizar una vez por recurso compartido por sistema de
archivos.

Para entender mejor estas restricciones, considere el siguiente escenario donde hay:

2 redes denominadas 10.0.0.0/8 y 20.0.0.0/8


un volumen de ZFS llamado volume1 con 2 conjuntos de datos denominados dataset1 y dataset2
dataset1 tiene un directorio llamado directory1

Debido a la restriccin # 3, se muestra un error al intentar crear un recurso compartido NFS como este:

Redes autorizadas establecidas en 10.0.0.0/8 20.0.0.0/8


Ruta establecida en /mnt/volume1/dataset1 y /mnt/volume1/dataset1/directory1

En su lugar, establezca un Path de /mnt/volume1/dataset1 y marque el cuadro Todos los directorios .

Ese directorio tambin podra estar restringido a una de las redes creando dos acciones en su lugar:

Primer recurso compartido NFS:


Redes autorizadas definidas en 10.0.0.0/8
Ruta establecida en /mnt/volume1/dataset1

Segundo recurso compartido NFS:

Redes autorizadas establecidas en 20.0.0.0/8


Ruta establecida en /mnt/volume1/dataset1/directory1

Tenga en cuenta que esto requiere la creacin de dos acciones. No se puede hacer con una sola accin.

10.2.1. Ejemplo de configuracin

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.

Un mejor escenario es hacer lo siguiente:

1. Especifique la cuenta de nadie incorporada que se utilizar para el acceso NFS.


2. En la pantalla Cambiar permisos del volumen / conjunto de datos que se est compartiendo, cambie el
propietario y el grupo a nadiey establezca los permisos segn sus necesidades.
3. Seleccione a nadie en los mens desplegables de Mapall User y Mapall Group para compartir
en Sharing Unix (NFS)Shares .

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.

10.2.2. Conexin al recurso

Los siguientes ejemplos comparten esta configuracin:

1. El sistema FreeNAS est en la direccin IP 192.168.2.2 .


2. Se crea un conjunto de datos denominado /mnt/volume1/nfs_share1 y los permisos establecidos
en la cuenta de usuario nobody y en el grupo nobody .
3. Se crea un recurso compartido NFS con estos atributos:
Ruta de /mnt/volume1/nfs_share1 : /mnt/volume1/nfs_share1
Redes Autorizadas : 192.168.2.0/24
Todos los directorios estn marcados
MapAll El usuario est configurado como nobody
Grupo MapAll est configurado para nadie

10.2.2.1. De BSD o Linux

El recurso compartido NFS est montado en sistemas BSD o Linux que necesitan acceso con este comando
ejecutado como superusuario o con sudo :

mount -t nfs 192.168.2.2:/mnt/volume1/nfs_share1 / mnt

-t nfs especifica el tipo de sistema de archivos del recurso compartido


192.168.2.2 es la direccin IP del sistema FreeNAS
/ mnt / volume / nfs_share1 es el nombre del directorio que se va a compartir, un conjunto de datos en
este caso
/ mnt es el punto de montaje en el sistema cliente. Debe ser un directorio vaco existente. Los datos del
recurso compartido NFS aparecen en este directorio en el equipo cliente.

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) .

10.2.2.3. Desde Mac OS X

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 .

10.3. Acciones de WebDAV


En FreeNAS , se pueden crear particiones WebDAV para que los usuarios autenticados puedan examinar el
contenido del volumen, conjunto de datos o directorio especificado desde un navegador web.

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:

protocolo: // direccin_IP: nmero_puerto / nombre_compartido

dnde:

protocolo: es http o https , dependiendo del Protocolo configurado en Services WebDAV .


Direccin IP: es la direccin IP o el nombre de host del sistema FreeNAS . Tenga cuidado al configurar una
direccin IP pblica para asegurarse de que el firewall de la red slo permite el acceso a sistemas
autorizados.
port_number: est configurado en Services WebDAV . Si se debe acceder al sistema
FreeNAS mediante una direccin IP pblica, considere cambiar el nmero de puerto predeterminado y
asegrese de que el firewall de la red slo permite el acceso a sistemas autorizados.
nombre_compartido: est configurado en Sharing WebDAV Shares .

Al ingresar la URL en un navegador web, aparecer un mensaje emergente de autenticacin. Introduzca un


nombre de usuario de webdavy la contrasea configurada en Services WebDAV .

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.

Para crear un recurso compartido de WebDAV, haga clic


en Sharing WebDAV Shares Add WebDAV Share que abrir la pantalla que se muestra en
la Figura 10.3.1 .

Fig. 10.3.1 Adicin de un recurso WebDAV


La Tabla 10.3.1 resume las opciones disponibles.
Tabla 10.3.1 Opciones para compartir WebDAV

Ajuste Valor Descripcin

Nombre de ruta de
cuerda ingrese un nombre para el recurso compartido
acceso compartido

Comentario cuerda Opcional

botn de
Camino busque el volumen / conjunto de datos para compartir
exploracin

si est marcado, los usuarios no pueden escribir en el


Solo lectura caja
recurso compartido

Cambiar la propiedad si est marcada, establece automticamente el contenido


caja
de usuarios y grupos del recurso compartido en el usuario y grupo webdav

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 .

10.4. Acciones de Windows (SMB)


FreeNAS utiliza Samba para compartir volmenes utilizando el protocolo SMB de Microsoft. SMB est
integrado en los sistemas operativos Windows y Mac OS X y la mayora de los sistemas Linux y BSD preinstalan
el cliente Samba con el fin de proporcionar soporte para SMB. Si su distro no lo hizo, instale el cliente Samba
utilizando el repositorio de software de la distro.

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 .

Fig. 10.4.1 Adicin de un recurso SMB


La Tabla 10.4.1 resume las opciones al crear un recurso compartido de SMB. Algunos ajustes slo estn
disponibles despus de hacer clic en el botn Modo avanzado . Para escenarios de comparticin sencilla, no
se necesitan opciones de modo avanzado . Para escenarios de comparticin ms complejos, slo cambie una
opcin de modo avanzado despus de comprender completamente la funcin de esa opcin. smb.conf
(5) proporciona ms detalles para cada opcin configurable.

Tabla 10.4.1 Opciones para una porcin de SMB

Ajuste Valor Descripcin

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

Nombre cuerda obligatorio; nombre de la accin

Comentario cuerda slo disponible en modo avanzado ; descripcin opcional

establece las ACL para permitir lectura / escritura para propietario


Aplicar permisos / grupo y slo lectura para otros; debe ser desmarcada slo
caja
predeterminados cuando se crea un recurso compartido en un sistema que ya tiene
establecidas las ACL personalizadas

Exportar solo slo disponible en modo avanzado ; prohbe el acceso de


caja
lectura escritura a la

slo disponible en modo avanzado ; cuando se comprueba, los


Se puede acceder
usuarios ven el contenido de / homes (incluyendo otros directorios
a los clientes de caja
de inicio de otros usuarios) y cuando no estn marcados, los
red
usuarios slo ven su propio directorio de inicio

slo disponible en modo avanzado ; los archivos eliminados se


mueven a una .recycleoculta en la carpeta raz
Exportar Papelera
caja del .recycle compartido; el directorio .recycle se puede
de reciclaje
eliminar para recuperar el espacio y se .recycle crear
automticamente cuando se elimina un archivo

Mostrar archivos slo disponible en modo avanzado ; si est activado, el atributo


caja
ocultos ocultado de Windows no se establece cuando se crean nombres de
Tabla 10.4.1 Opciones para una porcin de SMB

Ajuste Valor Descripcin

archivo que comienzan con un punto (un archivo oculto


Unix); los archivos existentes no se ven afectados

si est marcada, no se requiere ninguna contrasea para


Permitir acceso
caja conectarse al recurso compartido y todos los usuarios comparten
de invitados
los permisos del usuario invitado definido en el servicio SMB

Only Allow Guest slo disponible en modo avanzado ; requires Allow guest
caja
Access access to also be checked; forces guest access for all connections

slo disponible en modo avanzado ; comma-, space-, or tab-


Hosts Allow cuerda
delimited list of allowed hostnames or IP addresses

slo disponible en modo avanzado ; comma-, space-, or tab-


delimited list of denied hostnames or IP addresses; allowed hosts
Hosts Deny cuerda
take precedence so can use ALL in this field and specify allowed
hosts in Hosts Allow

slo disponible en modo avanzado ; adds virtual file system


VFS Objects seleccin modules to enhance functionality; Table 10.4.2 summarizes the
available modules

used to configure home directory shadow copies on a per-share


Periodic Snapshot Men
basis; select the pre-configured periodic snapshot task to use for
Task desplegable
the share's shadow copies

slo disponible en modo


Parmetros
cuerda avanzado ; additional smb4.conf parameters not covered by
Auxiliares
other option fields

Note the following regarding some of the Advanced Mode settings:

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 :

lanman auth = yes

To configure lanman authentication for pre-NT authentication, add these lines instead:

client lanman auth = yes


client plaintext auth = yes

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.

Table 10.4.2 Available VFS Modules

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

aio_fork enables async I/O

aio_posix enables asynchronous I/O on systems running POSIX kernels

implements async I/O in Samba vfs using a pthread pool instead of the internal
aio_pthread
Posix AIO interface

logs share access, connects/disconnects, directory opens/creates/removes, and


auditora
file opens/closes/renames/unlinks/chmods to syslog

cacheprime primes the kernel file data cache


Table 10.4.2 Available VFS Modules

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

expand_msdfs enables support for Microsoft Distributed File System (DFS)

extd_audit sends audit logs to both syslog and the Samba log files

fake_acls stores file ownership and ACLs as extended attributes

fake_perms allows roaming profile files and directories to be set as read-only

enhances OS X support by providing the SMB2 AAPL extension and Netatalk


Fruta
interoperability (see NOTE below table)

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

linux_xfs_sgid used to work around an old Linux XFS bug

media_harmony allows Avid editorial workstations to share a network drive

netatalk eases the co-existence of SMB and AFP shares

provides Extended Attributes (EAs) support so they can be used on filesystems


posix_eadb
which do not provide native support for EAs
Table 10.4.2 Available VFS Modules

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

allows Microsoft shadow copy clients to browse shadow copies on Windows


shadow_copy
shares

shadow_copy_test shadow copy testing

provides shell-script callouts for snapshot creation and deletion operations


shell_snap
issued by remote clients using the File Server Remote VSS Protocol (FSRVP)

implements dummy versions of all VFS modules (useful to VFS module


skel_opaque
developers)

implements dummy passthrough functions of all VFS modules (useful to VFS


skel_transparent
module developers)

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_depot experimental module to store alternate data streams in a central directory

streams_xattr enables storing of NTFS alternate data streams in the file system

syncops ensures metadata operations are performed synchronously

time_audit logs system calls that take longer than the number of defined milliseconds

unityed_media allows multiple Avid clients to share a network drive

emulate Microsoft's MoveSecurityAttributes=0 registry option, setting the ACL


winmsa for file and directory hierarchies to inherit from the parent directory into which
they are moved
Table 10.4.2 Available VFS Modules

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.

10.4.1. Configuring Unauthenticated Access


SMB supports guest logins, meaning that users can access the SMB share without needing to provide a
username or password. This type of share is convenient as it is easy to configure, easy to access, and does not
require any users to be configured on the FreeNAS system. This type of configuration is also the least secure
as anyone on the network can access the contents of the share. Additionally, since all access is as the guest
user, even if the user inputs a username or password, there is no way to differentiate which users accessed or
modified the data on the share. This type of configuration is best suited for small networks where quick and
easy access to the share is more important than the security of the data on the share.

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 .

Fig. 10.4.2 Creating an Unauthenticated SMB Share


Click the Next button twice, then the Confirm button to create the share. The Wizard automatically creates a
dataset for the share and starts the SMB service so the share is immediately available. The new share is also
be added to Sharing Windows (SMB) .

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) .

Fig. 10.4.3 Creating an Authenticated SMB Share


Fig. 10.4.4 Creating the User and Group
The authenticated share can now be tested from any SMB client. For example, to test an authenticated share
from a Windows system, open Explorer and click on Network . For this configuration example, a system
named FREENAS appears with a share named smb_user1 . If you click on smb_user1 , a Windows Security pop-
up screen prompts for that user's username and password. Enter the values that were configured for that
share, in this case user user1 . After authentication, the user can copy data to and from the SMB share.

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.

Status Local Remote Network


-------------------------------------------------- ----------------------
OK \\FREENAS\smb_user1 Microsoft Windows Network
The command completed successfully.

To clear the cache:

net use * /DELETE


You have these remote connections:
\\FREENAS\smb_user1
Continuing will cancel the connections.

Do you want to continue this operation? <Y/N> [N]: y

An additional warning is shown if the share is currently open in Explorer:

There are open files and/or incomplete directory searches pending on the
connection
to \\FREENAS|smb_user1.

Is it OK to continue disconnecting and force them closed? <Y/N> [N]: y


The command completed successfully.

The next time a share is accessed with Explorer, you will be prompted to authenticate.

10.4.3. Configuring Shadow Copies


Shadow Copies , also known as the Volume Shadow Copy Service (VSS) or Previous Versions, is a Microsoft
service for creating volume snapshots. Shadow copies allow you to easily restore previous versions of files
from within Windows Explorer. Shadow Copy support is built into Vista and Windows 7. Windows XP or 2000
users need to install the Shadow Copy client .

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

10.5. Block (iSCSI)


iSCSI is a protocol standard for the consolidation of storage data. iSCSI allows FreeNAS to act like a storage
area network (SAN) over an existing Ethernet network. Specifically, it exports disk devices over an Ethernet
network that iSCSI clients (called initiators) can attach to and mount. Traditional SANs operate over fibre
channel networks which require a fibre channel infrastructure such as fibre channel HBAs, fibre channel
switches, and discrete cabling. iSCSI can be used over an existing Ethernet network, although dedicated
networks can be built for iSCSI traffic in an effort to boost performance. iSCSI also provides an advantage in an
environment that uses Windows shell programs; these programs tend to filter Network Location but iSCSI
mounts are not filtered.

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.

Extent: the storage unit to be shared. It can either be a file or a device.

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:

1. Review the target global configuration parameters.


2. Create at least one portal.
3. Determine which hosts are allowed to connect using iSCSI and create an initiator.
4. Decide if authentication will be used, and if so, whether it will be CHAP or mutual CHAP. If using
authentication, create an authorized access.
5. Cree un objetivo.
6. Create either a device or a file extent to be used as storage.
7. Associate a target with an extent.
8. Start the iSCSI service in Services Control Services .

The rest of this section describes these steps in more detail.

10.5.1. Target Global Configuration


Sharing Block (iSCSI) Target Global Configuration , shown in Figure 10.5.1 ,
contains settings that apply to all iSCSI shares. Table 10.5.1 summarizes the settings that can be configured in
the Target Global Configuration screen.

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

Ajuste Valor Descripcin

see the Constructing iSCSI names using the iqn. format section
Base Name cuerda
of RFC 3721 if unfamiliar with this format

space delimited list of hostnames or IP addresses of ISNS servers with


ISNS Servers cuerda
which to register the system's iSCSI targets and portals

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 .

Fig. 10.5.2 Adding an iSCSI Portal


Table 10.5.2 Portal Configuration Settings

Ajuste Valor Descripcin

optional description; portals are automatically assigned a numeric


Comentario cuerda
group ID

configures the authentication level required by the target for


Discovery Men
discovery of valid devices, where None will allow anonymous
Auth Method desplegable
discovery while CHAP and Mutual CHAPrequire authentication

Discovery Men select a user created in Authorized Access if the Discovery Auth
Auth Group desplegable Method is set to CHAP or Mutual CHAP

Men select the IP address associated with an interface or the wildcard


direccin IP
desplegable address of 0.0.0.0(any interface)

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 .

Fig. 10.5.3 Adding an iSCSI Initiator


Table 10.5.3 summarizes the settings that can be configured when adding an initiator.

Table 10.5.3 Initiator Configuration Settings

Ajuste Valor Descripcin

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

Ajuste Valor Descripcin

Comentario cuerda optional description

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.

Fig. 10.5.4 Sample iSCSI Initiator Configuration


10.5.4. Authorized Accesses
If you will be using CHAP or mutual CHAP to provide authentication, you must create an authorized access
in Sharing Block(iSCSI) Authorized Accesses Add Authorized Access . This
screen is shown in Figure 10.5.5 .

Nota
This screen sets login authentication. This is different from discovery authentication which is set in Target
Global Configuration .

Fig. 10.5.5 Adding an iSCSI Authorized Access


Table 10.5.4 summarizes the settings that can be configured when adding an authorized access:

Table 10.5.4 Authorized Access Configuration Settings

Ajuste Valor Descripcin

allows different groups to be configured with different authentication


Identificacin
entero profiles; for instance, all users with a Group ID of 1 will inherit the
del grupo
authentication profile associated with Group 1

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

password to be associated with User ; the iSCSI standard requires that


Secreto cuerda
this be between 12 and 16 characters
Table 10.5.4 Authorized Access Configuration Settings

Ajuste Valor Descripcin

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

CHAP does not work with GlobalSAN initiators on Mac OS X.

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.

Fig. 10.5.6 Viewing Authorized Accesses


10.5.5. Targets
Next, create a Target using Sharing Block (iSCSI) Targets Add Target , as shown
in Figure 10.5.7 . A target combines a portal ID, allowed initiator ID, and an authentication method. Table
10.5.5 summarizes the settings that can be configured when creating a Target.

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).

Fig. 10.5.7 Adding an iSCSI Target


Table 10.5.5 Target Settings

Ajuste Valor Descripcin

required value; base name will be appended automatically


Target Name cuerda
if it does not start with iqn

Target Alias cuerda optional user-friendly name

Men
Portal Group ID leave empty or select number of existing portal to use
desplegable

Men select which existing initiator group has access to the


Initiator Group ID
desplegable target

Men
Auth Method choices are None , Auto , CHAP , or Mutual CHAP
desplegable

Authentication Group Men None or integer representing number of existing


number desplegable authorized access

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

Ajuste Valor Descripcin

name of extent; if the Extent size is not 0 , it cannot be an existing


Extent Name cuerda
file within the volume/dataset

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

only appears if File is selected; browse to an existing file and


use 0 as the Extent size , orbrowse to the volume or dataset,
Path to the browse
click Close , append the Extent Name to the path, and specify a
extent button
value in Extent size ; extents cannot be created inside the jail root
directory
Table 10.5.6 Extent Configuration Settings

Ajuste Valor Descripcin

Men only appears if Device is selected; select the unformatted disk,


Dispositivo
desplegable controller, zvol, zvol snapshot, or HAST device

only appears if File is selected; if the size is specified as 0 , the file


Extent size entero must already exist and the actual file size will be used; otherwise,
specify the size of the file to create

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

only appears if File or a zvol is selected; when the specified


Available Space
cuerda percentage of free space is reached, the system issues an alert;
Threshold
see VAAI Threshold Warning

Comentario cuerda Opcional

if checked, an initiator can bypass normal access control and access


Enable TPC caja any scannable target; this allows xcopy operations otherwise
blocked by access control

Xen initiator
caja check this box when using Xen as the iSCSI initiator
compat mode

do NOT change this setting when using Windows as the initiator;


Men only needs to be changed in large environments where the number
LUN RPM
desplegable of systems using a specific RPM is needed for accurate reporting
statistics

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.

Table 10.5.7 Target/Extents Configuration Settings

Ajuste Valor Descripcin

Objetivo Men desplegable select the pre-created target

LUN ID Men desplegable select the value of the ID or type in the desired value

Grado Men desplegable select the pre-created extent

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.

10.5.8. Connecting to iSCSI


To access the iSCSI target, clients must use iSCSI initiator software.

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.

10.5.9.1. Zvol Based LUN

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.

10.5.9.2. LUN Extensin de archivos basado


Hacer crecer una medida de archivos basado en LUN, vaya a determinar el camino de la extensin de archivo
para crecer. Shell abrir a crecer en la medida. Este ejemplo crece por 2
G:Services iSCSI File Extents View File Extents/mnt/volume1/data

truncar -s + 2 g / mnt / volume1 / datos

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

Das könnte Ihnen auch gefallen