Tag Archives: mirror

iscsi + mdadm mirror creation

Create a file based LUN:
root@hcst001:/NAS/iscsi# dd if=/dev/zero of=./lun3.img bs=1024k count=10240
root@hcst002:/NAS/iscsi# dd if=/dev/zero of=./lun3.img bs=1024k count=10240

Add lun to /etc/iet/initiators.allow:
iqn.2010-12.side.lan.hcst001:iscsi.lun3 10.1.1.200
iqn.2010-12.side.lan.hcst002:iscsi.lun3 10.1.1.200

Add lun to /etc/iet/ietd.conf:
Target iqn.2011-12.side.lan.hcst001:iscsi.lun3
Lun 3 Path=/NAS/iscsi/lun3.img,Type=fileio
Target iqn.2010-12.side.lan.hcst002:iscsi.lun3
Lun 3 Path=/NAS/iscsi/lun3.img,Type=fileio

Restart iscsitarget:
/etc/init.d/iscsitarget restart

Discover the new luns:
root@hcvm001:~# /usr/bin/iscsiadm -m discovery -t st -p 10.1.1.101
10.1.1.101:3260,1 iqn.2010-12.side.lan.hcst002:iscsi.lun3
10.1.1.101:3260,1 iqn.2010-12.side.lan.hcst002:iscsi.lun2

root@hcvm001:~# /usr/bin/iscsiadm -m discovery -t st -p 10.1.1.104
10.1.1.104:3260,1 iqn.2011-12.side.lan.hcst001:iscsi.lun3
10.1.1.104:3260,1 iqn.2011-12.side.lan.hcst001:iscsi.lun2

Login to the new luns:
/usr/bin/iscsiadm -m node –targetname “iqn.2011-12.side.lan.hcst001:iscsi.lun3” –portal “10.1.1.104:3260” –login
/usr/bin/iscsiadm -m node –targetname “iqn.2010-12.side.lan.hcst002:iscsi.lun3” –portal “10.1.1.101:3260” –login

Quick Solaris Disk Mirror

# format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c1t1d0
/pci@1,0/pci103c,60b0@5/sd@1,0
1. c1t4d0
/pci@1,0/pci103c,60b0@5/sd@4,0

bash-3.00# prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s – /dev/rdsk/c1t4d0s2
fmthard: New volume table of contents now in place.

bash-3.00# metadb -a -f -c2 /dev/dsk/c1t1d0s7 /dev/dsk/c1t4d0s7

/dev/dsk/c1t1d0s1 – – swap – no –
/dev/dsk/c1t1d0s0 /dev/rdsk/c1t1d0s0 / ufs 1
no –
/dev/dsk/c1t1d0s3 /dev/rdsk/c1t1d0s3 /var ufs 1
no –
/dev/dsk/c1t1d0s4 /dev/rdsk/c1t1d0s4 /export ufs 2
yes

bash-3.00# metainit -f d10 1 1 c1t1d0s0
d10: Concat/Stripe is setup
bash-3.00# metainit d20 1 1 c1t4d0s0
d20: Concat/Stripe is setup
bash-3.00# metainit d30 -m d10
d30: Mirror is setup