Friday, July 31, 2009

ZFS, CIFS (Samba), OpenSolaris, and Windows Hanging out

I'm pretty pumped. I came home early from work this morning (went in at 4am, came home at 8am), and went to work on the server. First because the raid card wasn't supported in Solaris or OpenSolaris, and I couldn't find third party drivers for it, I moved the 4x 500GB Western Digital Caviar Blue harddrives to the onboard SATA controller. Next, I had some issues with Synergy yesterday where it would take some time to shift between the Windows box and the OpenSolaris box. Fresh out of ideas and sleep, I added in a second NIC which did nothing, as it wasn't supported. I then realized I forgot to turn off my desktop extension to include the second monitor on my Windows box, which would explain the extra "time" or movement necessary to get between the two monitors/systems. I'm with stupid.

I started up the system and tried to remember what to do. This site had some helpful information, but didn't work perfectly, so what I'm showing you is for OpenSolaris 2009.11 and may not work on other versions or even your install. First off, I tried to get the CIFS service working. I did these commands:
#rem_drv smbsrv
#pkg install SUNWsmbskr
#pkg install SUNWsmbs
#add_drv smbsrv
#svccfg import /var/svc/manifest/network/smb/server.xml

And then ran into issues. The smb service showed as running in maintenance mode. A quick google turned up nothing, so I remembered my issues last night and did the magical reboot. When the machine came back up, smb was right there with it. Hooray! I win a prize.

Next, I needed to attach to my workgroup

#svcadm enable -r smb/server
#smbadm join -w WORKGROUP

WORKGROUP is, well, my workgroup name. It connected happily now that I wasn't in maintenance mode anymore. The walkthrough said that there was issues with CIFS and Unix style passwords, so I changed the pam configuration a bit to fix that.

#echo other password required pam_smb passwd.so.1 nowarn >> /etc/pam.conf

After a quick vim to make sure it was truly there, I did

#passwd

That's not what my username is. That's a secret I care not to share. So I was all set! Time for some ZFS zaniness!

The walkthrough I was using directed me to access the ZFS gui at https://localhost:6879/zfs, which I immediately tried and failed at. After more googling, it appears that its not installed and I didn't want to deal with a gui anyways since I had seen a good walkthrough elsewhere without any gui. Enter Simon's Blog! This is what I did:

#format

I know had the list of my harddrives and their names.

#zpool create tank raidz2

I did raidz2 because I'm paranoid and built the file server because I hate losing data and didn't want to anymore. This created a new pool called tank, which is viewable by this command:

#zpool status tank

Also, to see raw data space, and true available space respectively,

#zpool list tank
#zfs list tank

Due to the face that I'm using raidz2, half of my space goes to parity/mirroring/magical protection. Next I set up my destination for my storage space.
#zfs create test/home
#zfs create test/home/media
A quick
#zfs list
showed the mounts to be available, so I moved to the directories and gave my user ownership with
#chown media
#chgrp staff media

Next, I shared it like no preschool teacher could've taught. (if you are a preschool teacher, I apologize and insist I meant no offense, its just where I was taught to share (preschool was where I was taught to share))

#zfs set sharesmb=on test/home/media

Next, find out what its named

#sharemgr show -vp

Then

#svcadm enable -r smb/server

And like that, my server was up and running. I was sceptical. It seemed easy, but why would it be? I switched to the Windows box, did a run \\\media, and BAM there came the sign in. For username, don't forget to put \ otherwise it will most likely try and sign you in as a local (local to the windows box) user. This isn't right. Anyways, after a second of soul searching Windows popped up a new file browser with my test file in it! I was hooked (up). Next, I mapped that baby to my Z: drive, and switched my "Documents", "Desktop", "Downloads", "Pictures", and "Music" folders all to the OpenSolaris box and waited while all of it transferred across. Hooray! Now when I save anything in my documents or pictures folders its replicated protected and error checked! No one will know otherwise! In a word, I'm super pumped. Unfortunately I'm limiting out at 10-ish MB/s transfers, but that's because my windows box NIC can't seem to convince my switch that it can run at gigabit, instead of 100mbit. An item for another day.

No comments:

Post a Comment