Recientemente tengo libre un servidor y puedo realizar ciertos experimentos con Debian al conectarlo a una SAN iSCSI Dell EqualLogic haciendo pruebas, por lo cual nos animamos a realizar este pequeño escrito al respecto. El servidor tendrá como sistema operativo Debian Squeeze 6.0.6 usando la versión de 64 bits.
Partimos de una instalación muy simple mediante la imagen llamada business card, una pequeña ISO de poco mas de 50 MB que solo contendrá el sistema básico.
El equipo tiene seis tarjetas de red, usaremos la interfaz eth0 como nuestra interfaz principal de administración y las interfaces eth2 y eth3 se conectaran a la red iSCSI.
root@elmulo:~# lspci | grep net
01:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
01:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
02:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
04:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
04:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
Nos basaremos en la siguiente wiki para realizar el procedimiento: Bonding.
root@elmulo:~# aptitude install ifenslave-2.6
The following NEW packages will be installed:
ifenslave-2.6
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 18.4 kB of archives. After unpacking 143 kB will be used.
Get:1 http://mirrors.kernel.org/debian/ squeeze/main ifenslave-2.6 amd64 1.1.0-17 [18.4 kB]
Fetched 18.4 kB in 0s (36.7 kB/s)
Selecting previously deselected package ifenslave-2.6.
(Reading database ... 14392 files and directories currently installed.)
Unpacking ifenslave-2.6 (from .../ifenslave-2.6_1.1.0-17_amd64.deb) ...
Processing triggers for man-db ...
Setting up ifenslave-2.6 (1.1.0-17) ...
update-alternatives: using /sbin/ifenslave-2.6 to provide /sbin/ifenslave (ifenslave) in auto mode.
Después de la instalación del paquete nos toca configurar nuestro archivo de red para especificar los parámetros del bond a crear que básicamente serán que interfaces de red se usaran así como el tipo de bonding que utilizaremos. Los parámetros de nuestra primera interfaz fueron establecidos desde la instalación del sistema operativo, lo demás lo adicionaremos de una manera similar especificando dirección de red, mascara, interfaces, tipo de bond y parámetros adicionales.
root@elmulo:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.100.51
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 192.168.100.254
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8 8.8.4.4
auto bond0
iface bond0 inet static
address 172.16.0.151
netmask 255.255.0.0
network 172.16.0.0
slaves eth2 eth3
bond-mode balance-rr
bond-miimon 100
bond-downdelay 200
bond-updelay 200
Necesitamos configurar el modulo del kernel y creamos un archivo dentro de modprobe.d como se muestra a continuación.
root@elmulo:~# cd /etc/modprobe.d/
root@elmulo:/etc/modprobe.d# cat > aliases-bond.conf
alias bond0 bonding
options bonding mode=0 miimon=100
Levantamos la interfaz recién creada.
root@elmulo:/etc/modprobe.d# cd
root@elmulo:~# ifup bond0
Verificamos los parámetros de red y confirmamos que la interfaz bond esta activa y las interfaces asociadas a este también se encuentran en el mismo estado y se agregan en la información que se despliega junto a la interfaz primaria.
root@elmulo:~# ifconfig
bond0 Link encap:Ethernet HWaddr 00:21:9b:9f:18:72
inet addr:172.16.0.151 Bcast:172.16.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth0 Link encap:Ethernet HWaddr 00:21:9b:9f:18:6e
inet addr:192.168.100.51 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::221:9bff:fe9f:186e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:22819 errors:0 dropped:0 overruns:0 frame:0
TX packets:3978 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9070886 (8.6 MiB) TX bytes:338475 (330.5 KiB)
Interrupt:36 Memory:d2000000-d2012800
eth2 Link encap:Ethernet HWaddr 00:21:9b:9f:18:72
UP BROADCAST SLAVE MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:32 Memory:d6000000-d6012800
eth3 Link encap:Ethernet HWaddr 00:21:9b:9f:18:72
UP BROADCAST SLAVE MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:42 Memory:d8000000-d8012800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:392 (392.0 B) TX bytes:392 (392.0 B)
Verificando los registros del sistema vemos que el bond se activo pero no esta operativo debido a que no se han conectado cables de red a los componentes de la LAN.
root@elmulo:~# tail -n 20 -f /var/log/messages
Nov 23 06:25:01 elmulo rsyslogd: [origin software="rsyslogd" swVersion="4.6.4" x-pid="1095" x-info="http://www.rsyslog.com"] rsyslogd was HUPed, type 'lightweight'.
Nov 23 09:57:19 elmulo kernel: [105971.052864] bnx2: eth0 NIC Copper Link is Up, 1000 Mbps full duplex
Nov 23 09:57:19 elmulo kernel: [105971.053236] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Nov 23 10:21:58 elmulo kernel: [107449.542754] Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)
Nov 23 10:21:58 elmulo kernel: [107449.542758] bonding: MII link monitoring set to 100 ms
Nov 23 10:21:58 elmulo kernel: [107449.544150] bonding: bond0: setting mode to balance-rr (0).
Nov 23 10:21:58 elmulo kernel: [107449.544173] bonding: bond0: Setting MII monitoring interval to 100.
Nov 23 10:21:58 elmulo kernel: [107449.544195] bonding: bond0: Setting up delay to 200.
Nov 23 10:21:58 elmulo kernel: [107449.544210] bonding: bond0: Setting down delay to 200.
Nov 23 10:21:59 elmulo kernel: [107449.561893] bonding: bond0: doing slave updates when interface is down.
Nov 23 10:21:59 elmulo kernel: [107449.561895] bonding: bond0: Adding slave eth2.
Nov 23 10:21:59 elmulo kernel: [107449.561897] bonding bond0: master_dev is not up in bond_enslave
Nov 23 10:21:59 elmulo kernel: [107449.654579] bnx2: eth2: using MSIX
Nov 23 10:21:59 elmulo kernel: [107449.654912] bonding: bond0: enslaving eth2 as an active interface with a down link.
Nov 23 10:21:59 elmulo kernel: [107449.690706] bonding: bond0: doing slave updates when interface is down.
Nov 23 10:21:59 elmulo kernel: [107449.690711] bonding: bond0: Adding slave eth3.
Nov 23 10:21:59 elmulo kernel: [107449.690713] bonding bond0: master_dev is not up in bond_enslave
Nov 23 10:21:59 elmulo kernel: [107449.774441] bnx2: eth3: using MSIX
Nov 23 10:21:59 elmulo kernel: [107449.774768] bonding: bond0: enslaving eth3 as an active interface with a down link.
Nov 23 10:21:59 elmulo kernel: [107449.778043] ADDRCONF(NETDEV_UP): bond0: link is not ready
Conectamos una de las interfaces.
Nov 23 10:33:27 elmulo kernel: [108137.887591] bnx2: eth2 NIC Copper Link is Up, 1000 Mbps full duplex, receive & transmit flow control ON
Nov 23 10:33:27 elmulo kernel: [108137.947373] bonding: bond0: link status up for interface eth2, enabling it in 200 ms.
Nov 23 10:33:28 elmulo kernel: [108138.147249] bonding: bond0: link status definitely up for interface eth2.
Nov 23 10:33:28 elmulo kernel: [108138.147615] ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
Conectamos la segunda interfaz.
Nov 23 10:48:00 elmulo kernel: [109009.830462] bnx2: eth3 NIC Copper Link is Up, 1000 Mbps full duplex, receive & transmit flow control ON
Nov 23 10:48:00 elmulo kernel: [109009.902823] bonding: bond0: link status up for interface eth3, enabling it in 200 ms.
Nov 23 10:48:00 elmulo kernel: [109010.102699] bonding: bond0: link status definitely up for interface eth3.
Ahora nuestro bond esta completamente activo en modo round-robin, lo podemos verificar con la siguiente instrucción.
root@elmulo:~# cat /sys/class/net/bond0/bonding/mode
balance-rr 0
Cambiaremos el MTU del bond y de las interfaces que lo componen para conectarnos usando Jumbo Frames a nuestro equipo de almacenamiento.
root@elmulo:~# ifconfig eth2 mtu 9000
root@elmulo:~# ifconfig eth3 mtu 9000
root@elmulo:~# ifconfig bond0 mtu 9000
Lista la parte de conexión pasamos a la parte de aplicación instalando el iniciador de iSCSI.
root@elmulo:~# aptitude install open-iscsi
The following NEW packages will be installed:
open-iscsi
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 332 kB of archives. After unpacking 868 kB will be used.
Get:1 http://mirrors.kernel.org/debian/ squeeze/main open-iscsi amd64 2.0.871.3-2squeeze1 [332 kB]
Fetched 332 kB in 1s (297 kB/s)
Selecting previously deselected package open-iscsi.
(Reading database ... 15954 files and directories currently installed.)
Unpacking open-iscsi (from .../open-iscsi_2.0.871.3-2squeeze1_amd64.deb) ...
Processing triggers for man-db ...
Setting up open-iscsi (2.0.871.3-2squeeze1) ...
Ponemos el servicio en automático.
root@elmulo:~# vim /etc/iscsi/iscsid.conf
.
node.startup = automatic
.
Reiniciamos el servicio.
root@elmulo:~# /etc/init.d/open-iscsi restart
Unmounting iscsi-backed filesystems: Unmounting all devices marked _netdev.
Disconnecting iSCSI targets:.
Stopping iSCSI initiator service:.
Starting iSCSI initiator service: iscsid.
Setting up iSCSI targets:
iscsiadm: No records found!
.
Mounting network filesystems:.
root@elmulo:~# cat /etc/iscsi/initiatorname.iscsi
## DO NOT EDIT OR REMOVE THIS FILE!
## If you remove this file, the iSCSI daemon will not start.
## If you change the InitiatorName, existing access control lists
## may reject this initiator. The InitiatorName must be unique
## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.
InitiatorName=iqn.1993-08.org.debian:01:cdfe4ea8ecd0
Utilizaremos el acceso por IQN que lo obtuvimos del archivo initiatorname.iscsi, mas adelante veremos que esta es una de las formas de autenticación de EqualLogic para acceder a un volumen.
InitiatorName=iqn.1993-08.org.debian:01:cdfe4ea8ecd0
Ahora el siguiente paso es crear un volumen en nuestra SAN para poder continuar, lo crearemos con un tamaño de 150 GB, a continuación se muestran los pasos mediante el CLI de EqualLogic que ejemplifican este proceso.
Entramos mediante telnet a la linea de comandos del sistema EqualLogic.
gabriel@giskard:~$ telnet 172.16.0.XXX
Trying 172.16.0.XXX...
Connected to 172.16.0.XXX.
Escape character is '^]'.
PS Series Storage Arrays
Unauthorized Access Prohibited
login: gabriel
Password:
Welcome to Group Manager
Copyright 2001-2011 Dell, Inc.
Grupo2>
32722:315:EQL2:netmgtd:22-Nov-2012 19:41:16.596159:rcc_util.c:738:INFO:25.2.9:CLI: Login to account gabriel succeeded.
Mediante la instrucción volume create Fotos-Sin 150GB, creamos un volumen llamado Fotos-Sin con un tamaño de 150 GB, que tomara los parámetros predeterminados del sistema.
Grupo2> volume create Fotos-Sin 150GB
Volume creation succeeded.
iSCSI target name is iqn.2001-05.com.equallogic:0-8a0906-48624a509-b290018545850
aed-fotos-sin.
Grupo2>
32728:10471:EQL2:MgmtExec:22-Nov-2012 19:42:30.709363:VolInfo.cc:79:INFO:8.2.2:Volume 'Fotos-Sin' successfully created.
Para ver la descripción del volumen creado utilizamos la instrucción volume show Fotos-Sin.
Grupo2> volume show Fotos-Sin
_____________________________ Volume Information ______________________________
Name: Fotos-Sin Size: 150GB
VolReserve: 150GB VolReserveInUse: 0MB
ReplReserveInUse: 0MB iSCSI Alias: Fotos-Sin
iSCSI Name: ActualMembers: 1
iqn.2001-05.com.equallogic:0-8a0906- Snap-Warn: 10%
48624a509-b290018545850aed-fotos-sin Snap-Depletion: delete-oldest
Description: Snap-Reserve: 100%
Snap-Reserve-Avail: 100% (150GB) Permission: read-write
DesiredStatus: online Status: online
Connections: 0 Snapshots: 0
Bind: Type: not-replicated
ReplicationReserveSpace: 0MB Replicas: 0
ReplicationPartner: Pool: default
Transmitted-Data: 0MB Received-Data: 0MB
Pref-Raid-Policy: none Pref-Raid-Policy-Status: none
Thin-Provision: disabled Thin-Min-Reserve: 0% (0MB)
Thin-Growth-Warn: 0% (0MB) Thin-Growth-Max: 0% (0MB)
ReplicationTxData: 0MB MultiHostAccess: disabled
iSNS-Discovery: disabled Replica-Volume-Reserve: 0MB
Thin-Clone: N Template: N
Administrator:
_______________________________________________________________________________
_______________________________ Access Records ________________________________
ID Initiator Ipaddress AuthMethod UserName Apply-To
--- ----------------------------- --------------- ---------- ---------- --------
____________________________ Operations InProgress ____________________________
ID StartTime Progress Operation Details
-- -------------------- -------- ----------------------------------------------
Grupo2>
Y aquí es donde daremos acceso a nuestro servidor mediante su IQN al volumen de Fotos-Sin, con la siguiente instrucción: volume select Fotos-Sin access create initiator iqn.1993-08.org.debian:01:cdfe4ea8ecd0
Initiator:iqn.1993-08.org.debian:01:cdfe4ea8ecd0
Target: iqn.2001-05.com.equallogic:0-8a0906-48624a509-b290018545850aed-fotos-sin
Grupo2> volume select Fotos-Sin access create initiator iqn.1993-08.org.debian:0
1:cdfe4ea8ecd0
Access control record created with ID 1.
Grupo2> volume select Fotos-Sin access show
ID Initiator Ipaddress AuthMethod UserName Apply-To
--- ----------------------------- --------------- ---------- ---------- --------
1 iqn.1993-08.org.debian:01:cdf *.*.*.* none both
e4ea8ecd0
Grupo2>
Volvemos a la parte de nuestro servidor para continuar el proceso y lo haremos lanzando un descubrimiento a la dirección IP de nuestro sistema de almacenamiento para ver los volúmenes a los que tenemos acceso.
root@elmulo:~# iscsiadm -m discovery -t st -p 172.16.0.XXX
172.16.0.XXX:3260,1 iqn.2001-05.com.equallogic:0-8a0906-48624a509-b290018545850aed-fotos-sin
root@elmulo:~# iscsiadm -m node
172.16.0.XXX:3260,1 iqn.2001-05.com.equallogic:0-8a0906-48624a509-b290018545850aed-fotos-sin
Después de descubrir nuestro target iniciamos sesión en el para conectarnos y empezar a trabajar con el como si fuera un disco duro mas en nuestro sistema.
root@elmulo:~# iscsiadm -m node --targetname "iqn.2001-05.com.equallogic:0-8a0906-48624a509-b290018545850aed-fotos-sin" --portal "172.16.0.XXX:3260" --login
Logging in to [iface: default, target: iqn.2001-05.com.equallogic:0-8a0906-48624a509-b290018545850aed-fotos-sin, portal: 172.16.0.XXX,3260]
Login to [iface: default, target: iqn.2001-05.com.equallogic:0-8a0906-48624a509-b290018545850aed-fotos-sin, portal: 172.16.0.XXX,3260]: successful
Después de conectarnos vamos a nuestro storage a ver un poco de sus logs y notamos que efectivamente se conecto usando Jumbo Frames (MTU 9000), using Jumbo Frame length.
32901:10603:EQL2:MgmtExec:25-Nov-2012 00:01:47.137815:targetAttr.cc:759:INFO:7.2.14:iSCSI login to target '172.16.0.XXX:3260, iqn.2001-05.com.equallogic:0-8a0906-48624a509-b290018545850aed-fotos-sin' from initiator '172.16.0.151:50683, iqn.1993-08.org.debian:01:cdfe4ea8ecd0' successful, using Jumbo Frame length.
Con fdisk vemos que tenemos nuestro dispositivo listo para crear una partición en el, nos dice que son 161.1 GB pero nosotros creamos un espacio de 150, lo que pasa que nos lo esta mostrando con tomando como base 1000 y no 1024, 150*1024*1024*1024 = 161061273600 bytes.
root@elmulo:~# fdisk -l
.
.
Disk /dev/sdc: 161.1 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/sdc doesn't contain a valid partition table
Creamos una partición primaria de tipo Linux usando todo el espacio disponible.
root@elmulo:~# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x228dfc1d.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19581, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-19581, default 19581):
Using default value 19581
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 83
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Volvemos a verificar con fdisk y ya nos indica la partición lista, solo queda darle formato con algún sistema de archivos propios de Linux.
root@elmulo:~# fdisk -l
.
.
Disk /dev/sdc: 161.1 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x228dfc1d
Device Boot Start End Blocks Id System
/dev/sdc1 1 19581 157284351 83 Linux
Vamos a dar formato a la partición con el sistema de archivos ext4.
root@elmulo:~# mkfs.ext4 /dev/sdc1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
9830400 inodes, 39321087 blocks
1966054 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1200 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Creamos un directorio donde poder montar nuestra nueva partición.
root@elmulo:~# mkdir /U1
root@elmulo:~# mount /dev/sdc1 /U1/
root@elmulo:~# mount
/dev/mapper/elmulo-root on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sda1 on /boot type ext2 (rw)
/dev/sdc1 on /U1 type ext4 (rw)
Vemos que esta montada correctamente por lo tanto ya podemos empezar a guardar unos cuantos archivos.
root@elmulo:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/elmulo-root
134526224 53112252 74580412 42% /
tmpfs 2024052 0 2024052 0% /lib/init/rw
udev 2018716 164 2018552 1% /dev
tmpfs 2024052 0 2024052 0% /dev/shm
/dev/sda1 233191 15946 204804 8% /boot
/dev/sdc1 154816488 191936 146760336 1% /U1
Antes de empezar a copiar y hacer otras pruebas, veremos que tanto afecto en tamaño al volumen los pasos de crear una partición y dar formato, para eso necesitamos conectarnos a nuestro EqualLogic y sacar unos datos. En el desplegado de información del volumen en la sección de Access Records se encuentra nuestro servidor mediante su IQN y de que actualmente tiene ocupado 3.79 GB debido a la creación de la partición y el formato del sistema de archivos y que debido a esos procedimientos el volumen recibió 2.47 GB de información.
Grupo2> volume show Fotos-Sin
_____________________________ Volume Information ______________________________
Name: Fotos-Sin Size: 150GB
VolReserve: 150GB VolReserveInUse: 3.79GB
ReplReserveInUse: 0MB iSCSI Alias: Fotos-Sin
iSCSI Name: ActualMembers: 1
iqn.2001-05.com.equallogic:0-8a0906- Snap-Warn: 10%
48624a509-b290018545850aed-fotos-sin Snap-Depletion: delete-oldest
Description: Snap-Reserve: 100%
Snap-Reserve-Avail: 100% (150GB) Permission: read-write
DesiredStatus: online Status: online
Connections: 1 Snapshots: 0
Bind: Type: not-replicated
ReplicationReserveSpace: 0MB Replicas: 0
ReplicationPartner: Pool: default
Transmitted-Data: 1MB Received-Data: 2.47GB
Pref-Raid-Policy: none Pref-Raid-Policy-Status: none
Thin-Provision: disabled Thin-Min-Reserve: 0% (0MB)
Thin-Growth-Warn: 0% (0MB) Thin-Growth-Max: 0% (0MB)
ReplicationTxData: 0MB MultiHostAccess: disabled
iSNS-Discovery: disabled Replica-Volume-Reserve: 0MB
Thin-Clone: N Template: N
Administrator:
_______________________________________________________________________________
_______________________________ Access Records ________________________________
ID Initiator Ipaddress AuthMethod UserName Apply-To
--- ----------------------------- --------------- ---------- ---------- --------
1 iqn.1993-08.org.debian:01:cdf *.*.*.* none both
e4ea8ecd0
____________________________ Operations InProgress ____________________________
Si tomamos el parámetro de que 150 GB son 161061273600 bytes, y que mediante el comando df el sistema nos muestra que tenemos un disco con un tamaño de 154816488 kB que son 158532083712 bytes, tenemos una diferencia de 2529189888 bytes que son 2.36 GB aproximadamente los cuales se ven disminuidos como resultado de los procesos de partición y formato. Ahora vamos a realizar una prueba de copiado para lo cual generaremos un archivo de 50 GB y lo copiaremos en nuestro nuevo almacenamiento.
root@elmulo:~# dd if=/dev/zero of=/tmp/archivo50G bs=1G count=50
50+0 records in
50+0 records out
53687091200 bytes (54 GB) copied, 548.544 s, 97.9 MB/s
root@elmulo:~# ls -l /tmp/
total 52480056
-rw-r--r-- 1 root root 53687091200 Oct 7 19:58 archivo50G
root@elmulo:~# cp /tmp/archivo50G /U1/
Le llevo 7 minutos copiar 50 GB mediante el comando cp, vamos a ver cuanto le lleva copiar los mismos 50 GB directamente con el comando dd.
root@elmulo:~# dd if=/dev/zero of=/U1/archivo50G-DD bs=1G count=50
50+0 records in
50+0 records out
53687091200 bytes (54 GB) copied, 433.233 s, 124 MB/s
Nos arroja 433 segundos que son poco mas que 7 minutos que es el mismo tiempo de la primer copia, vemos el estado del volumen que muestra ya su espacio ocupado.
Grupo2> show volume Fotos-Sin
_____________________________ Volume Information ______________________________
Name: Fotos-Sin Size: 150GB
VolReserve: 150GB VolReserveInUse: 103.74GB
ReplReserveInUse: 0MB iSCSI Alias: Fotos-Sin
iSCSI Name: ActualMembers: 1
iqn.2001-05.com.equallogic:0-8a0906- Snap-Warn: 10%
48624a509-b290018545850aed-fotos-sin Snap-Depletion: delete-oldest
Description: Snap-Reserve: 100%
Snap-Reserve-Avail: 100% (150GB) Permission: read-write
DesiredStatus: online Status: online
Connections: 1 Snapshots: 0
Bind: Type: not-replicated
ReplicationReserveSpace: 0MB Replicas: 0
ReplicationPartner: Pool: default
Transmitted-Data: 1MB Received-Data: 102.49GB
Pref-Raid-Policy: none Pref-Raid-Policy-Status: none
Thin-Provision: disabled Thin-Min-Reserve: 0% (0MB)
Thin-Growth-Warn: 0% (0MB) Thin-Growth-Max: 0% (0MB)
ReplicationTxData: 0MB MultiHostAccess: disabled
iSNS-Discovery: disabled Replica-Volume-Reserve: 0MB
Thin-Clone: N Template: N
Administrator:
_______________________________________________________________________________
Borramos los archivos anteriores y volvemos a crear un archivo de 100 GB.
root@elmulo:~# dd if=/dev/zero of=/U1/archivo100G-DD bs=1G count=100
100+0 records in
100+0 records out
107374182400 bytes (107 GB) copied, 869.745 s, 123 MB/s
Le tomo 14 minutos y medio la copia de 100 GB, el tiempo concuerda con que seria el doble.
Ya con esto realizado, podemos instalar un servicio como SAMBA, FTP, como disco duro para maquinas virtuales o simplemente para respaldos de archivos. Más adelante pretendo documentar un poco mas cuestiones como recuperar archivos a partir de un snapshot o incrementar el tamaño del volumen.
Referencias para saber más:
http://phenobarbital.wordpress.com/2011/06/22/linux-guia-rapida-de-network-bonding-en-debian/
http://wiki.debian.org/Bonding
http://www.howtoforge.com/using-iscsi-on-debian-lenny-initiator-and-target