Ok I am writing this article also for me as a reminder of what commands to use and what are the best options. At this point in time I have the plan to build a home NAS system with ISCSI, NFS, CIFS (samba) functionallity and completely stop the usage of harddrives in my local workstation network that is now 2 linux desktop machines and 2 windows XP machines. Also I want a good and reliable storage device that protects the data on it.

So in a few simple words I want a nas that can automate the process for each workstation.

For a first remark to boot ISCSI devices from the network without buying expensive network cards you can check out http://www.etherboot.org this site offers the most functionallity to boot from your network with every kind of operating system.

What I already worked out is that I need a DHCP server that can boot images for PXE, all my pc’s at home support gigabit ethernet PXE, so I can easily feed the workstation the correct gPXE rom and that will boot ISCSI targets from the mainserver.

The mainserver I have ordered is a simple Intel core 2 Duo E2140 cpu that supports 64-bit extensions, this cpu will be run on an Asus Pq5-premium motherboard with 10 sata-II and 4 gigabit ethernet ports. The harddrives are 2 seagate baracuda’s 5900rpm 1.5TB devices that will in mirror. The cache (l2arc) and the log (zil) device will be an Intel X-25-M 80 gigabyte and a Intel X-25-E 32 gigabyte. Equiped with 6 gigabytes of ram and installed with the latest build (version 133) from http://www.genunix.org it should be a cool and fast device with an eye towards the future if I need more disk space or a faster cpu (quad core e.g.) or more memory, or even more bandwidth on my local network.

Ok before planning this I had to figure out what Opensolaris is, and what I have been reading about ZFS was true. So this weekend I pulled out a small dell optiplex with a simple p4 2.4ghz processor and 1,2GB of ram and a small IDE 40 gigabyte disk. And installed opensolaris on it the latest build ofcourse because I wanted a cool thing that people called deduplication, just like our netapp in the colo does and snapshots are not bad either to have.

Here are some commands i’ve used, as always I won’t give a lot of text, you just have to figure that out it are rough guidelines.

- format (leave with control-c format as root will give you all information you need in what kind of disks you have.)

- zpool create tank mirror c4d0p1 c4d1p1 (where c4d0p1 and the other are your hd’s, this creates a mirror from two of the devices)

- zpool add tank log c4d2p1 (this will be the 32gb ssd as the ZIL / LOG device this will give a write performance boost as stated in other documentation.)

- zpool add tank cache c4d3p1 (this will be the 80 gigabyte CACHE / L2ARC device that will give read performance.)

So now we have created a /tank pool that has maximum write and read performance. Don’t ask me how much performance it will give since I don’t have the hardware yet and can’t test much about it, but if you google on L2arc and Zil with ZFS and Opensolaris you can find a lot of documents giving performance figures and they are outstanding!

For the people that need to ask, I have tested this on my small pc on the same drive in different partitions and that really sucks, but I have to wait until the good stuff is delivered.

Now let’s fire up the compression and the deduplication.

- zfs set compression=on tank
- zfs set dedup=on tank

For a little example I have put my /home/dennis directory from my local linux pc on that newly created drive. My directory is about 9.6 gigabytes and houses are sort of stuff, and the compression brought it down to about 7.4 gigabytes and the deduplication (rules!) brought it down to 6.2 gigabytes! So that will save a lot of space considering the stuff I will put on it.

So since I am new to Opensolaris and it’s command structure I figured out how to get a NFS share that I need to share documents between the two linux hosts and the windows hosts

- zfs create tank/share
- zfs sharenfs=on tank/share

Allow only one host:
- zfs sharenfs=rw=@192.168.1.119,root=@192.168.1.119 tank/share

Allow all the hosts on your subnet:
- zfs sharenfs=rw=@192.168.1.0/24,root=@192.168.1.0/24 tank/share

Ofcourse windows hosts don’t like NFS so we need to use CIFS (samba) to get them to our share.

- pkg install SUNWsmbs
- pkg install SUNWsmbskr
- svcadm enable -r smb/server
- zfs sharesmb=on tank/share
- zfs sharesmb=rw=@192.168.1.0/24 tank/share
- vi /etc/pam.conf and add the following line:
other password required pam_smb_passwd.so.1 nowarn
- create a local user that you will use to access the windows share

Now you can access with that user the share from your windows computer.

If you want to call your share something like COOLSHARE only because it is possible:

- zfs set sharesmb=name=COOLSHARE tank/share

And if you want to join a workgroup with your solaris server then just type:

- smbadm join -w YourWorkGroup

Since I wanted to etherboot all workstations with ISCSI i needed also to support ISCSI, a good thing is that all my computers are already installed so I will “dd” the complete drive towards a image and set it up in an ISCSI share, but for now just let’s enable it on the opensolaris server.

- pkg install SUNWiscsitgt
- svcadm enable iscsitgt
- zfs create -V 5G tank/iscsi
- zfs set shareiscsi=on tank/iscsi
- iscsitadm create target -b /dev/zvol/rdsk/tank/iscsi iscsi
- iscsitadm list target -v

How cool and simple is that? To show that it works I had to install a package on my ubuntu workstation:

- aptitude install open-iscsi
- iscsiadm -m discovery -t sendtargets -p 192.168.1.136 (.136 is
the opensolaris server and returns the following:
192.168.1.136:3260,1 iqn.1986-03.com.sun:02:40cd2097-db92-ce54-8864-84e64ff4a5a4

And maybe some errors with IPV6, but you can ignore those.
)

- iscsiadm -m node –targetname iqn.1986-03.com.sun:02:40cd2097-db92-ce54-8864-84e64ff4a5a4 -p 192.168.1.136:3260 –login

And ….

[49773.143342] scsi5 : iSCSI Initiator over TCP/IP
[49773.440133] scsi 5:0:0:0: Direct-Access SUN SOLARIS 1 PQ: 0 ANSI: 5
[49773.440375] sd 5:0:0:0: Attached scsi generic sg2 type 0
[49773.441179] sd 5:0:0:0: [sdb] 10485760 512-byte logical blocks: (5.36 GB/5.00 GiB)
[49773.447472] sd 5:0:0:0: [sdb] Write Protect is off
[49773.447482] sd 5:0:0:0: [sdb] Mode Sense: 67 00 00 08
[49773.449828] sd 5:0:0:0: [sdb] Write cache: disabled, read cache:
enabled, doesn't support DPO or FUA
[49773.452632] sdb: unknown partition table
[49773.461441] sd 5:0:0:0: [sdb] Attached SCSI disk

So that’s all for now, what I have to do now is wait for my hardware to arrive, install the machine and the software, and make some tests with booting over ISCSI and sharing all the stuff between the workstation all from opensolaris.

What I have been reading about is that opensolaris uses a different DHCP server then the DHCP3D server from linux, so maybe I will install virtualbox on the home server and setup a ubuntu server to take care of the PXE booting/addressing stuff. I will keep you notified.

Owh I was looking how many memory there was in use on the pc, you can find it with the commando top, or even cooler try this:

- echo “::memstat” | mdb -k