`setfont t` is the internet’s next rickroll.Posted at 6:33pm on Sun 26 Aug 2012
Just lost a 24-port switch, NIC, and video card to lightning because Time Warner told me twice to stop surge protecting my coax cable.Posted at 4:04pm on Sun 26 Aug 2012
“Contributors are awesome. If you're thinking about contributing, that means you're thinking about being awesome.” (http://t.co/56XCgXZV)Posted at 9:19pm on Sun 19 Aug 2012
With all my different means of file access set up on the server, I’ve got to set up all my workstations to attach to it. Just to rehash what I’ll set up:
Before setting up NFS access, emphatically take note that NFS doesn’t translate permissions based on user and group names, but rather by the numeric UID and GID.
Since my file server will be the most coveted machine on my network, and will be ground zero for any file that matters, I’ll centralize permissions and UID/GIDs there as well. The best way to do this is to pick a block somewhere in the thousands (preferably well beyond 1000, which is what some Linux distributions start at by default; OpenSolaris starts at 100). Whenever I need to create a new user that needs file server access, I’ll just create them on the file server first, within the bounds of my custom UID/GID block, then create them on the client machine(s) using that same numeric UID and GID. Any *nix distribution that matters has command line options you can use when creating a new user to specify a custom UID/GID pair, so this isn’t a big hairy deal, really.
My UID/GID block will start at 2000. I’m saving the 2000 pair for something else. My
brian user thusly has a new UID and GID of
2001. There are five simple steps to changing this on client machines:
/etc/passwdfile very carefully to change the UID. Take note of the old one. Some distributions will let you do this via
/etc/groupfile very carefully to change the GID. Take note of the old one. Some distributions will let you do this via
find / -uid 1000as root to determine which files are owned by the old UID (in this case, 1000).
find / -gid 1000as root to determine which files are owned by the old GID (again, 1000).
chgrp 2001on files owned by the old UID and GID, respectively. In my case, I was able to do a
chown -R 2001.2001 /home/brianas I didn’t own any other files elsewhere on the system.
With all that out of the way, I can prep the permissions on my ZFS filesystems.
root@sol:~# groupadd -g 2001 brian root@sol:~# usermod -u 2001 brian root@sol:~# chown -R brian:brian /Storage00/* root@sol:~# chmod 770 /Storage00/* root@sol:~# ls -l /Storage00/ total 16 drwxrwx--- 2 brian brian 2 2009-04-28 10:13 Backups drwxrwx--- 2 brian brian 2 2009-05-01 03:49 Databases drwxrwx--- 2 brian brian 2 2009-04-28 10:13 Development drwxrwx--- 2 brian brian 4 2009-05-16 19:14 Documents drwxrwx--- 2 brian brian 2 2009-04-28 10:13 Media drwxrwx--- 2 brian brian 2 2009-04-28 10:13 Software drwxrwx--- 2 brian brian 2 2009-04-28 12:13 Virtualization drwxrwx--- 2 brian brian 2 2009-04-28 10:13 WWW
You’ll see everything is ready on the server. If you’re following along, you can do whatever you want to with your groups here. Mine are set up in much the same way I did the user permissions so I’m not going to repeat everything.
I’ve logged in as root on my Linux server and made sure that I’ve got all the necessary NFS client packages installed. Now for the moment of truth:
root@shuttle:/# mkdir /sol root@shuttle:/# mkdir /sol/Backups root@shuttle:/# mkdir /sol/Databases root@shuttle:/# mkdir /sol/Development root@shuttle:/# mkdir /sol/Documents root@shuttle:/# mkdir /sol/Software root@shuttle:/# mkdir /sol/WWW root@shuttle:/# mount sol:/Storage00/Backups /sol/Backups root@shuttle:/# mount sol:/Storage00/Databases /sol/Databases root@shuttle:/# mount sol:/Storage00/Development /sol/Development root@shuttle:/# mount sol:/Storage00/Documents /sol/Documents root@shuttle:/# mount sol:/Storage00/Software /sol/Software root@shuttle:/# mount sol:/Storage00/WWW /sol/WWW root@shuttle:/# cd /sol root@shuttle:/sol# ls -l total 12 drwxrwx--- 2 brian brian 2 2009-04-28 10:13 Backups drwxrwx--- 2 brian brian 2 2009-05-01 03:49 Databases drwxrwx--- 2 brian brian 2 2009-04-28 10:13 Development drwxrwx--- 2 brian brian 4 2009-05-16 19:14 Documents drwxrwx--- 2 brian brian 2 2009-04-28 10:13 Software drwxrwx--- 2 brian brian 2 2009-04-28 10:13 WWW
Looks like everything mounted successfully! On the file server I’ll create a file under Documents, then check to see if I can read and write to it from the Linux server:
brian@sol:~$ echo "Hello from sol" > /Storage00/Documents/sol_test
brian@shuttle:~$ cd /sol/Documents brian@shuttle:/sol/Documents$ ls -l total 1 -rw-r--r--+ 1 brian brian 6 2009-05-16 20:17 sol_test brian@shuttle:/sol/Documents$ echo "Modified from shuttle" >> sol_test brian@shuttle:/sol/Documents$ cat sol_test Hello from sol Modified from shuttle brian@shuttle:/sol/Documents$ echo "Test" > shuttle_test brian@shuttle:/sol/Documents$
Perfect! Everything’s set up under Linux. I could add each mount point to my
/etc/fstab so it gets mounted upon startup, but this is only the test file server.
Under SMB everything regarding permissions is much easier. Under Windows and Mac OS X, all we really need to do is enter our user name and password for the file server and we’re pretty much ready to go.
I’ve done just that by locating the server in Explorer’s “network” tree. I then used SOL\brian as the username, opened the Documents share, and copied a PDF file to make sure writing works:
Excellent – now on to iSCSI.
This isn’t how I intend to use iSCSI but nevertheless I still want to make sure it works. Vista includes a very handy iSCSI Initiator control panel applet, making it extremely easy to mount an iSCSI disk.
A quick rundown:
Now that it’s connected, I can format it by using the Disk Management console.
I’ll right-click the unallocated space on the new disk, and choose “New Simple Volume”, using the maximum amount of space, the “I:” drive letter, and a name of “iSCSI Volume”. Once it is formatted, Explorer shows the drive and it is ready for use as a normal disk.
Success! Everything’s ready under Windows, and I’ve verified that copying files to the iSCSI volume works.
The file server appears automagically in Finder, and once I use the “Connect As” button to enter my file server username and password, I see the list of shares, open the Documents share (which OS X will mount as a volume), and copy a PDF to it:
With everything running smoothly with my test file server, I’ll be purchasing hardware for the real deal. There’s a good possibility I’ll document the hardware here, but it may be a while before the actual purchase happens.
However, with all this documented, the amount of time I spend between turning on my real file server and being able to use it should be very minimal.
In any event, I hope this series has helped someone at least become familiar with OpenSolaris, ZFS, iSCSI, and the magnitude of what can be accomplished through a little planning and testing.