<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5542935378307664221</id><updated>2011-12-12T14:29:08.373-08:00</updated><title type='text'>Implementation Details</title><subtitle type='html'>A blog about the little details of operating and programming computers, from domain administration to that extremely undocumented code that keyboards send to PCs, which will cause the keyboard to stop working if you don't respond to it correctly...  you know the one, right?</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://implementationdetails.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://implementationdetails.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Craig Putnam</name><uri>http://www.blogger.com/profile/12813041563120703491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5542935378307664221.post-3822279232159813476</id><published>2011-12-12T13:43:00.000-08:00</published><updated>2011-12-12T14:29:08.390-08:00</updated><title type='text'>Building a SAN for backup and remote replication, part 3</title><content type='html'>&lt;div&gt;In &lt;a href="http://implementationdetails.blogspot.com/2011/11/building-san-for-backup-and-remote_09.html"&gt;part 2&lt;/a&gt;, I laid out the hardware for my SAN and recommended that no one follow my example.  In this part, I want to talk about preparing the operating system.  I lied about covering iSCSI Enterprise Target and DRBD.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since we need to differentiate between the two SANs, I will use “local device” to refer to the SAN that will go on the local network and “remote device” to refer to the remote replication target.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Installing the base system mostly consists of stripping out things that you don’t need and disabling what you can’t get rid of.  I’m a big fan of turning off unneeded services as a way to increase security; I just wish that CentOS felt the same way.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I wrote these instructions as part of formal documentation for the poor guy (or girl) who comes after me who has to maintain this system and fix it when it breaks.  Despite my efforts, the documentation was out of date by the time the system went live.  I’ve included some notes in italics where I don’t have exact instructions since I changed the configuration on the fly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, an apology about this post's formatting.  I wish the default Blogger.com tools were a bit better; as it is, everything but bold and italic markups disappear when I publish the post.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Collect settings&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are a handful of settings you’ll want to know before you install the software.  Here is the list I came up with:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;local-fqdn&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The fully-qualified domain name of the local device.  This is used by DRBD to decide what part of its configuration file applies to which computer.   This does not necessarily need to match the domain name of the local SAN as resolved by DNS.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;local-ip&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The IP address of the local SAN within the office network.  This is probably a private IP address.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;i&gt;remote-temp-ip&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The temporary IP address of the remote SAN while it is being built and tested within the office network.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;local-gateway&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The gateway address of the office network.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;local-subnet&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The IP subnet of the office network.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;i&gt;local-netmask&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The IP subnet mask of the office network in &lt;a href="http://en.wikipedia.org/wiki/IPv4_subnetting_reference"&gt;CIDR notation&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;local-public-ip&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The public IP address of the office gateway.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;remote-fqdn&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The fully-qualified domain name of the remote SAN.  This is used by DRBD to decide what part of its configuration file applies to which computer.  This does not necessarily need to match the domain name of the remote SAN as resolved by DNS.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;remote-ip&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The IP address of the remote SAN.  This is a public IP address&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;remote-gateway&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The gateway address used by the remote SAN.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;remote-subnet&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The IP subnet to which the remote device belongs.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;remote-netmask&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The IP subnet mask of the office network in CIDR notation.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;third-party-ip&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;A public IP address of a third party that will manage the remote SAN.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;ini-user&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The user name given by the office server that will use the iSCSI volume.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;ini-password&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The password given by the office server that will use the iSCSI volume.  Due to various operating system restrictions, this should be exactly 12 characters long.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;iscsi-qualified-name&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The SAN &lt;a href="http://en.wikipedia.org/wiki/Iscsi#Addressing"&gt;IQN name&lt;/a&gt;, shared by both SANs.&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;admin-email&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The email address of the SAN administrator, for event notifications&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;host-email&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The email address of each SAN, which may not necessarily correspond to a real mailbox&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;mail-server&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The name of your email server or mail exchanger&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Install the operating system&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;The CentOS installer can use either text or graphics mode.  The graphics mode installer may have problems with some Intel onboard video controllers.  These instructions follow a text-mode installation, and use an FTP site as the install source.  You can use arrow keys to move among the fields and options in the text-mode interface.  Press the spacebar to select check boxes and radio buttons.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Boot to the CentOS 5.6 install disc.  At the boot prompt, enter&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;linux text&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Choose your language and keyboard layout.  In the installation method dialog, choose &lt;span class="Apple-style-span"&gt;FTP&lt;/span&gt;.  Under &lt;span class="Apple-style-span"&gt;Enable IPv4 support&lt;/span&gt;, select &lt;span class="Apple-style-span"&gt;Manual Configuration&lt;/span&gt; and deselect &lt;span class="Apple-style-span"&gt;Enable IPv6 support&lt;/span&gt;.  Enter the local IP address if this is the local SAN, or the temporary remote IP address if this is the remote SAN.  Enter the local netmask, gateway, and DNS server.  Enter the name of a server that mirrors the CentOS distribution and the FTP directory of the installation files, which should end with &lt;span class="Apple-style-span"&gt;/os/i386&lt;/span&gt; or &lt;span class="Apple-style-span"&gt;/os/x86_64&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;I can't think of a good reason to use a 32-bit operating system, especially if you are using new hardware.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Select text mode instead of VNC.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If this is the first time the hard disks have been used, the installer will prompt to initialize each empty disk.  Select &lt;span class="Apple-style-span"&gt;Yes&lt;/span&gt; for each disk on which you will install the operating system.  Select &lt;span class="Apple-style-span"&gt;No&lt;/span&gt; for the data disks.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Choose &lt;span class="Apple-style-span"&gt;Create custom layout&lt;/span&gt;. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;These instructions configure the device to use the swap volume on each OS drive as a separate volume.  This is not very bright, since it meant that the OS could crash if one of the OS drives drops out.  The right way to do this is to configure the physical swap partitions as software RAID volumes, configure a mirror on top of them, and format that mirror as a swap volume.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;Select &lt;span class="Apple-style-span"&gt;New&lt;/span&gt;.  Change the file system type to &lt;span class="Apple-style-span"&gt;swap&lt;/span&gt;.  For allowable drives, choose just the first operating system drive.  Set the size to half the size of physical RAM.  Select &lt;span class="Apple-style-span"&gt;OK&lt;/span&gt;.  Select &lt;span class="Apple-style-span"&gt;New&lt;/span&gt;.  Change the file system type to &lt;span class="Apple-style-span"&gt;software RAID&lt;/span&gt;.  For allowable drives, choose just the first operating system drive.  Select Fill all available space.  Select &lt;span class="Apple-style-span"&gt;OK&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Create the same two partitions on the second operating system drive.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Select &lt;span class="Apple-style-span"&gt;RAID&lt;/span&gt;.  Set the mount point to &lt;span class="Apple-style-span"&gt;/&lt;/span&gt;.  Leave the file system type as &lt;span class="Apple-style-span"&gt;ext3&lt;/span&gt;.  Set the RAID level to &lt;span class="Apple-style-span"&gt;RAID1&lt;/span&gt;.  Select &lt;span class="Apple-style-span"&gt;OK&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Accept the defaults in each Boot Loader Configuration dialog.  When prompted for the location of the boot loader, choose the first operating system hard drive (probably &lt;span class="Apple-style-span"&gt;/dev/sda&lt;/span&gt;) rather than the RAID volume (&lt;span class="Apple-style-span"&gt;/dev/md0&lt;/span&gt;).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Choose to configure network interface &lt;span class="Apple-style-span"&gt;eth0&lt;/span&gt;.  The default settings should be to activate the interface on boot and enable IPv4.   Verify the IP, netmask, gateway and DNS addresses.  In the &lt;span class="Apple-style-span"&gt;Hostname Configuration&lt;/span&gt; dialog, enter the fully qualified domain name of the system.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In &lt;span class="Apple-style-span"&gt;Time Zone Selection&lt;/span&gt;, select the correct time zone or geographical area.  Most likely the system does not use UTC, so deselect that option.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enter the root password.  For ease of maintenance, this should be the same for both devices.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the &lt;span class="Apple-style-span"&gt;Package selection&lt;/span&gt; dialog, deselect each package.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Keep choosing &lt;span class="Apple-style-span"&gt;Next&lt;/span&gt; until the installer starts.  The installer should format the root volume and install the operating system.  When the installer reports that the installation is complete, click &lt;span class="Apple-style-span"&gt;Reboot&lt;/span&gt;.  Remove the installer CD and wait for the system to reboot.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Disable SELinux&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the first boot, CentOS will display a Setup Agent dialog.  Choose &lt;span class="Apple-style-span"&gt;Firewall configuration&lt;/span&gt;.  Under &lt;span class="Apple-style-span"&gt;SELinux&lt;/span&gt;, choose &lt;span class="Apple-style-span"&gt;Disabled&lt;/span&gt;.  The Setup Agent will disappear if you don’t touch any keys after a couple of minutes - you can get it back by typing:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;firstboot&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Remove unneeded packages and update the system&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;At this point, you can remotely connect to the system with SSH.  Log in as root.  At the shell prompt, enter the following to remove unneeded packages:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;yum -y erase fetchmail NetworkManager bluez* ccid desktop-file-utils&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;yum -y erase dnsmasq ifd-egate irda-utils isdn4k-utils mutt pcmciautils&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;yum -y erase slrn talk wpa_supplicant yp*&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To update the system, enter the following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;yum -y update&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;reboot&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Disable unneeded services&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Disable unneeded services, including gpm, netfs, nfslock, pcscd, portmap,  rpcgssd, rpcidmapd, and rpcsvcgssd.  Use the following one-line command:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;for f in gpm netfs nfslock portmap rpcgssd rpcidmapd rpcsvcgssd; do chkconfig --del $f; service $f stop; done&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Configure the firewall&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Replace the firewall configuration in &lt;span class="Apple-style-span"&gt;/etc/sysconfig/iptables&lt;/span&gt; with the following configuration.  Fill in the IP addresses for the local and remote private networks and the local and remote public IP addresses.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;*filter&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;:INPUT ACCEPT [0:0]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;:FORWARD ACCEPT [0:0]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;:OUTPUT ACCEPT [0:0]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;:AllowedServices - [0:0]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;:AllowedHosts - [0:0]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# Always allow traffic on loopback, filter all other incoming&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A INPUT -i lo -j ACCEPT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A INPUT -j AllowedServices&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A FORWARD -j AllowedServices&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;## List of services to allow&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# Existing connections&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A AllowedServices -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# NTP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A AllowedServices -p udp -m udp --dport 123 -j AllowedHosts&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# SSH, iSCSI, DRBD Proxy, DRBD&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A AllowedServices -m state --state NEW -p tcp -m multiport --dports 22,3260,7788,7789 -j AllowedHosts&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# ICMP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A AllowedServices -p icmp --icmp-type any -j AllowedHosts&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# Reject everything else&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A AllowedServices -j DROP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;## List of hosts to allow&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# The local private network&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A AllowedHosts -s &lt;i&gt;local-subnet&lt;/i&gt;/&lt;i&gt;local-netmask&lt;/i&gt; -j ACCEPT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# The local device's public IP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A AllowedHosts -s &lt;i&gt;local-public-ip&lt;/i&gt; -j ACCEPT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# The remote device’s IP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A AllowedHosts -s &lt;i&gt;remote-ip&lt;/i&gt; -j ACCEPT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# Optional: allow some third party to administer the devices&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A AllowedHosts -s &lt;i&gt;third-party-ip&lt;/i&gt; -j ACCEPT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;# Reject everyone else&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;-A AllowedHosts -j DROP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;COMMIT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note that this firewall works for both the local and remote SANs.  This makes recovery easier if you have to bring the remote SAN into the local network.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Install NTP&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is not critical to synchronize time on the NTP server, but it is useful.  Run the following commands to install and configure NTP:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;yum -y install ntp&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;chkconfig ntpd on&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;service ntpd start&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Configure Logwatch&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Install the sendmail configuration compiler.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;yum -y install sendmail-cf&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Edit &lt;span class="Apple-style-span"&gt;/etc/mail/sendmail.mc&lt;/span&gt;.  Find the line&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;dnl define(`SMART_HOST', `smtp.your.provider')dnl&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Replace it with:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;define(`SMART_HOST', `&lt;i&gt;mail-server&lt;/i&gt;')&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note that the dnl phrases are removed from the beginning and ending of the line, effectively uncommenting it.  Save the file and run the following commands to compile the configuration and enable the sendmail service:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;m4 /etc/mail/sendmail.mc &amp;gt; /etc/mail/sendmail.cf&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;chkconfig --level 235 sendmail on&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;service sendmail start&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Edit &lt;span class="Apple-style-span"&gt;/etc/logwatch/conf/logwatch.conf&lt;/span&gt; and add the following lines:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;MailTo=&lt;i&gt;admin-email&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;MailFrom=&lt;i&gt;host-email&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Limited possibilities&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You know how every high school valedictorian speech includes a phrase along the lines of “unlimited possibilities?”  I have found that the best way to get things done is to limit the possibilities to exactly what you need.  If you are designing a SAN, forget about also making it a NAS, and a web server, and a French fry chopper.  And if you’re just going to use it for backup, don’t bother with LVM.  Anything beyond what you actually need is a distraction.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the next part, I promise to get to iSCSI Enterprise Target and DRBD.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5542935378307664221-3822279232159813476?l=implementationdetails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://implementationdetails.blogspot.com/feeds/3822279232159813476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5542935378307664221&amp;postID=3822279232159813476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/3822279232159813476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/3822279232159813476'/><link rel='alternate' type='text/html' href='http://implementationdetails.blogspot.com/2011/12/building-san-for-backup-and-remote.html' title='Building a SAN for backup and remote replication, part 3'/><author><name>Craig Putnam</name><uri>http://www.blogger.com/profile/12813041563120703491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5542935378307664221.post-4726196230482064560</id><published>2011-11-09T12:27:00.001-08:00</published><updated>2011-11-09T12:56:34.621-08:00</updated><title type='text'>Building a SAN for backup and remote replication, part 2</title><content type='html'>&lt;div style="text-align: left;"&gt;In &lt;a href="http://implementationdetails.blogspot.com/2011/11/building-san-for-backup-and-remote.html"&gt;part 1&lt;/a&gt;, I complained about OpenFiler.  In this part, I want to talk about hardware.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;This is a single SAN as I built it.  (Remember that you need 2 identical SANs for replication.)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;• &lt;a href="http://www.supermicro.com/products/chassis/2U/825/SC825TQ-R700LP.cfm"&gt;SuperMicro 825TQ-R700LPB&lt;/a&gt; 2U rack-mount case with 700W redundant power supply&lt;br /&gt;• 8 &lt;a href="http://www.seagate.com/ww/v/index.jsp?vgnextoid=21ba38661f2a4210VgnVCM1000001a48090aRCRD&amp;amp;vgnextchannel=f424072516d8c010VgnVCM100000dd04090aRCRD&amp;amp;locale=en-US"&gt;Seagate Constellation ES ST32000644NS&lt;/a&gt; 2TB 7200RPM SATA 3.0Gb/s 3.5" “enterprise” hard drive&lt;br /&gt;• 2 Seagate Barracuda ST3160316AS 160GB 7200RPM SATA 6.0Gb/s 3.5" internal hard drives&lt;br /&gt;• &lt;a href="http://www.supermicro.com/products/motherboard/Xeon/C202_C204/X9SCM.cfm"&gt;SuperMicro X9SCM&lt;/a&gt; Micro-ATX motherboard&lt;br /&gt;• &lt;a href="http://ark.intel.com/products/53422/Intel-Core-i3-2100-Processor-(3M-Cache-3_10-GHz)"&gt;Intel Core i3-2100&lt;/a&gt; dual-core processor&lt;br /&gt;• Crucial 8GB (2 x 4GB) 240-Pin DDR3 SDRAM ECC Unbuffered DDR3 1333 memory (model &lt;a href="http://www.crucial.com/store/partspecs.aspx?imodule=CT2KIT51272BA1339"&gt;CT2KIT51272BA1339&lt;/a&gt;)&lt;br /&gt;• &lt;a href="http://www.highpoint-tech.cn/USA/rr2640x4.htm"&gt;HighPoint RocketRAID 2640X4&lt;/a&gt; PCI-Express x4 SATA / SAS (Serial Attached SCSI) controller card&lt;br /&gt;• &lt;a href="http://www.startech.com/Cards-Adapters/HDD-Controllers/SATA-Cards/2-Port-PCI-Express-Internal-SATA-Controller-Card~PEXSATA22I"&gt;Startech PEXSATA22I&lt;/a&gt; PCI-Express SATA controller card&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Each SAN cost $3000, so the pair was $6000 (plus software, discussed in another post).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;If you want to use a SuperMicro case, get a SuperMicro motherboard.  The cases often have a proprietary front panel connector.  The 825TQ comes with 8 hot-swap SATA/SAS bays, two internal bays for a pair of 3.5” drives, and a built-in slim DVD-ROM drive.  It’s a good case but I did have a couple of nitpicks.  The hot-swap cages are a bit flimsy:  every time I pull out a cage I feel like I’m going to break the handle.  And – not that I was likely to use them anyhow – the &lt;a href="http://en.wikipedia.org/wiki/SGPIO"&gt;SGPIO&lt;/a&gt; cables were incredibly short, failing to reach from the hot-swap backplane to the HighPoint controller card.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;The motherboard itself included the most feature-filled BIOS I have ever seen on a Micro-ATX board.  The BIOS is &lt;a href="http://en.wikipedia.org/wiki/UEFI"&gt;UEFI&lt;/a&gt;, onboard SATA ports can be configured as hot-swap, the text-mode display can be echoed to a serial port, and each of the onboard network adapters can act as an iSCSI host-bus adapter.  Given more time, I would have loved to play with that last feature.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;The processor is the cheapest &lt;a href="http://www.computerworld.com/s/article/9203478/What_Intel_s_Sandy_Bridge_chips_offer_you"&gt;Sandy Bridge&lt;/a&gt; available.  SANs don’t need a lot of raw processing power.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;The motherboard supports ECC memory, so that’s what I used.  I get a little uneasy at the idea of tens of billlions of extremely transient memory bits with no error correction.  If I had my way, every computer with more than 4GB of RAM would include ECC.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;The motherboard also has dual Intel gigabit NICs.  (Broadcom and Realtek NICs are popular low-cost alternatives – just say no.)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;Storage subsystem, or why the simplest thing that could possibly work can get complicated fast&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;The star of any SAN is the storage subsystem, and this is where I could have done better.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;I opted for Seagate Constellation ES drives.  While Seagate says that the Constellation series are “enterprise” drives, in reality they are the minimum drives that you should accept in a server room.  The &lt;a href="http://en.wikipedia.org/wiki/Serial_attached_SCSI"&gt;SAS &lt;/a&gt;version of this series is what is known as “near-line SAS”, which is SATA guts combined with a SAS interface.  Real SAS drives like Seagate’s Cheetah series have faster rotational speeds and are (supposedly) built to tighter specifications with greater reliability guarantees.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Since high performance or uptime is not a primary concern, the Constellation ES is acceptable.  I have had a single drive out of the 16 drop out, and it started working again when I pulled and reattached it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Here is an image of one of the SANs, with 11 SATA cables (8 data drives, 2 boot drives, and a DVD drive):&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/-hwW30JfaFzQ/Trrj7uujI0I/AAAAAAAAAAc/HXb0FXPuI3o/s1600/messy-cables.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img src="http://2.bp.blogspot.com/-hwW30JfaFzQ/Trrj7uujI0I/AAAAAAAAAAc/HXb0FXPuI3o/s320/messy-cables.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5673097295921619778" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 240px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Messy, isn’t it?  The amazing thing is how reliable it’s been.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are 6 hard drives attached to the motherboard and another 4 to the HighPoint controller.  I relegated the DVD drive to its own little controller.  If I were to do this again, I would find a case with a backplane that supported &lt;a href="http://en.wikipedia.org/wiki/Serial_attached_SCSI#Connectors"&gt;SFF-8087&lt;/a&gt; connectors and a compatible SAS controller.  At that point, I would also go with near-line SAS drives, since they cost more or less the same as enterprise SATA drives.  With one more tweak, I could reduce the number of data cables from 11 to 3.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The final tweak has to do with the thing I am least happy about the SANs as I built them.  I put in a pair of consumer-grade Seagate Barracuda drives.  Like all consumer-grade drives, quality is a crap shoot (perhaps Russian roulette would be a better analogy).  Two of the four total drives went bad in the first couple of months of operation, and since the OS drives were not hot-swap, fixing them required shutting down the SAN to pull the failed drive and shutting it down again when the replacement drive arrived a couple of weeks later.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If I had used a hardware RAID controller instead of depending on software RAID, I could have stored the operating system on a small volume on the data drives.  With software RAID, it’s only possible to boot to a mirror.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Alternatively, it turns out that the X9SCM motherboard includes an internal USB port.  Although I haven’t found it yet, someone has to have posted a guide to minimizing disk writes on a Linux server to maximize flash drive life.  With that guide and a cheap thumb drive, I could replace the OS drives.  The thumb drive wouldn’t be redundant, but it should be possible to save and restore the OS volume without too much pain.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Which leads me to the final component of the storage subsystem: the controllers.  I mentioned before that I used 4 onboard SATA ports with hot-swap enabled.  The other 4 SATA ports came from a HighPoint RocketRAID 2640x4 acting as a non-RAID controller.  I would not use this card again in a Linux system.  I struggled to find a working driver, even trying to build my own.  I finally had success with driver version 1.3 (built Dec 3 2010 09:50:48).  The card is perfectly stable, but I spent a lot of time worrying that it would never work.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;We must prepare for tomorrow night!&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So my next SAN (assuming anyone ever lets me build one again) will use a case with SFF-8087 connectors on the hot-swap backplane, near-line SAS hard drives, and a SAS RAID controller with good Linux support.  I’m guessing I would add about $400 to the cost of each SAN, mostly for the RAID controller.  There would be some savings from eliminating the OS drives and the additional SATA controller.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I’m tempted by the &lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16816151039"&gt;Areca &lt;/a&gt;series of controllers, but I’m put off by the active cooling solution on their cards.  Unless the fan uses ball bearings instead of the more common sleeve bearing, the least bit of dust will eventually cause the fan to seize and make the RAID chipset hotter than having no fan at all.  &lt;a href="http://forums.storagereview.com/index.php/topic/23355-fan-on-my-areca-raid-card-is-going-bad/"&gt;This thread&lt;/a&gt; discusses some options.  More likely, I would go with a controller that cools with a simple heat sink and depend on the case’s fans for cooling.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the next part, I’ll talk about iSCSI Enterprise Target and DRBD.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5542935378307664221-4726196230482064560?l=implementationdetails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://implementationdetails.blogspot.com/feeds/4726196230482064560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5542935378307664221&amp;postID=4726196230482064560' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/4726196230482064560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/4726196230482064560'/><link rel='alternate' type='text/html' href='http://implementationdetails.blogspot.com/2011/11/building-san-for-backup-and-remote_09.html' title='Building a SAN for backup and remote replication, part 2'/><author><name>Craig Putnam</name><uri>http://www.blogger.com/profile/12813041563120703491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-hwW30JfaFzQ/Trrj7uujI0I/AAAAAAAAAAc/HXb0FXPuI3o/s72-c/messy-cables.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5542935378307664221.post-4449128536062003124</id><published>2011-11-01T11:54:00.000-07:00</published><updated>2011-11-01T12:40:28.616-07:00</updated><title type='text'>Building a SAN for backup and remote replication, part 1</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;I've often said that any idiot can build a computer and a &lt;a href="http://www.tomshardware.com/"&gt;lot&lt;/a&gt; &lt;a href="http://www.maximumpc.com/tags/buildapc"&gt;of&lt;/a&gt; &lt;a href="http://www.cluboc.net/"&gt;idiots&lt;/a&gt; &lt;a href="http://www.totalpcgaming.com/tag/hardware/"&gt;do&lt;/a&gt;.  Likewise, it is remarkably easy to build a SAN from off-the-shelf parts and open-source software, but it’s much harder to build one that works well.  This series documents what I learned – and the mistakes I made – while designing and building an inexpensive iSCSI SAN solution for backup and remote replication.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;A client wanted to create a disaster recovery backup system and replicate it offsite.  The client had too much data for an ad-hoc solution but was too small to afford the often breathtaking prices of replication solutions from vendors like EMC.  They were already replicating some data using a pair of StoreVault S500’s, but they were flakey and difficult to manage.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;I designed a pair of SANs that met the following requirements:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo1"&gt;&lt;!--[if !supportLists]--&gt;&lt;span class="Apple-style-span" &gt;1)&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;      &lt;/span&gt;&lt;!--[endif]--&gt;Least cost.  I needed the lowest possible cost while meeting the system’s functional requirements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo1"&gt;&lt;!--[if !supportLists]--&gt;&lt;span class="Apple-style-span" &gt;2)&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;      &lt;/span&gt;&lt;!--[endif]--&gt;Replication.  I needed to replicate data from a local device to a remote device, over a slow and insecure Internet connection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo1"&gt;&lt;!--[if !supportLists]--&gt;&lt;span class="Apple-style-span" &gt;3)&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;      &lt;/span&gt;&lt;!--[endif]--&gt;Data integrity.  Loss of data should be extremely unlikely.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;Explicitly absent from my list of requirements were:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span class="Apple-style-span" &gt;1)&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;      &lt;/span&gt;&lt;!--[endif]--&gt;High performance.  This was a backup target used by a single computer.  It did not need to be fast.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span class="Apple-style-span" &gt;2)&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;      &lt;/span&gt;&lt;!--[endif]--&gt;Maximum uptime.  I actually ended up with a system that has good uptime, but it wasn’t something I focused on.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;&lt;b&gt;Some terminology&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;If you’re new to iSCSI, you’ll need to know some terms.  An iSCSI &lt;i&gt;target&lt;/i&gt; is the computer that holds the actual storage.  This is the SAN.  An iSCSI &lt;i&gt;initiator&lt;/i&gt; is the computer that accesses the storage.  The initiator pretends to have a SCSI controller card, the network pretends to be a SCSI cable, the target pretends to be one or more SCSI drives, and everything works great until the network fails.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;&lt;b&gt;Picking the software, or why OpenFiler sucks&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;Microsoft offers an iSCSI target, free with the purchase of Windows Server.  Windows Server 2008 starts at around $800.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;Linux and BSD offer iSCSI targets, free with the download of your favorite distribution.  There are even a few distributions that include an iSCSI target built-in and ready to run.  One such distribution is &lt;a href="http://www.openfiler.com/"&gt;OpenFiler&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;It has been about a year since I evaluated OpenFiler, so maybe things have changed since then.  OpenFiler is a general-purpose Linux-based file server distribution.  It has a web-based GUI.  I found that it had issues:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-top:0in" type="disc"&gt;  &lt;li class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;The port for the      GUI is 446, instead of the standard &lt;a href="http://en.wikipedia.org/wiki/Https"&gt;port 443&lt;/a&gt;.  Why?       This is a single-purpose server; I can’t imagine what other website      they would expect to serve.       Fortunately, a scholar and a gentleman by the name of Justin J. Novak published some &lt;a href="http://notes.ozmonet.com/Openfiler"&gt;simple commands&lt;/a&gt; to      switch the GUI to port 443.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;Whoever(s) assembled the      GUI focused on functional groupings rather than use-case scenarios.  To set up iSCSI I had to construct a      RAID array, allocate an LVM volume, create an iSCSI target volume, set up initiator      authentication, and set up target volume authentication – all on different      tabs, sub-tabs, and sections.  Oh,      yes, this is how things were arranged in OpenFiler – main tabs along the      top of the page, sub-tabs below them, and sections, not below the sub-tabs      as sub-sub-tabs, but as menus along the left-hand side of the page.  And sometimes little popup windows      demonstrating some web developer’s l33t coding skillz.  Navigating OpenFiler’s GUI was an exercise      in confusion.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;Fortunately, if you want      to do anything the least bit out of the ordinary with OpenFiler, you need      to resort to the command line.  This      includes replication, which was touted as a feature of OpenFiler but was      completely unsupported by the GUI.       In fact, to get replication to work, you needed to &lt;a href="http://greg.porter.name/wiki/HowTo:Openfiler#Make_required_tweaks_to_address_the_Openfiler_2.3_reboot_issue"&gt;hack the Linux      boot script&lt;/a&gt; (for Windows users, this is the glorified equivalent of      autoexec.bat).  I had to go even      further and manually alter the order in which daemons loaded, since LVM      kept taking control of my replication volume.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;It was difficult to add      packages to OpenFiler.  I tried and      failed to install various VPN packages, finally concluding that OpenFiler and/or      &lt;a href="http://wiki.rpath.com/wiki/rPath_Linux"&gt;rPath Linux&lt;/a&gt; (the base distribution) were overtly hostile to customization.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;Eventually I entirely abandoned the GUI, doing everything from the command line.  At that point I realized that there was no point in using OpenFiler at all.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" &gt;Instead, I fell back on my favorite server distribution: &lt;a href="http://www.centos.org/"&gt; CentOS&lt;/a&gt;.  To be fair, it’s the only server distribution I use, but it works great.  On top of CentOS, I installed &lt;a href="http://iscsitarget.sourceforge.net/"&gt;iSCSI Enterprise Target&lt;/a&gt; (iet), &lt;a href="http://www.drbd.org/"&gt;Distributed Replicated Block Device&lt;/a&gt; (DRBD), and the not-so-free replication helper &lt;a href="http://www.linbit.com/en/products-services/drbd-proxy/"&gt;drbd-proxy&lt;/a&gt;.  I’ll get to those, but in the next article I want to talk about hardware, which brings us back to the beginning.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5542935378307664221-4449128536062003124?l=implementationdetails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://implementationdetails.blogspot.com/feeds/4449128536062003124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5542935378307664221&amp;postID=4449128536062003124' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/4449128536062003124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/4449128536062003124'/><link rel='alternate' type='text/html' href='http://implementationdetails.blogspot.com/2011/11/building-san-for-backup-and-remote.html' title='Building a SAN for backup and remote replication, part 1'/><author><name>Craig Putnam</name><uri>http://www.blogger.com/profile/12813041563120703491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5542935378307664221.post-8720672349441927617</id><published>2010-02-22T20:20:00.000-08:00</published><updated>2010-02-22T20:37:52.075-08:00</updated><title type='text'>Disabling medium strength ciphers in Gene6 FTP Server</title><content type='html'>&lt;span style="font-family:arial;"&gt;I recently brought a client’s site into &lt;/span&gt;&lt;a style="font-family: arial;" href="http://en.wikipedia.org/wiki/Payment_Card_Industry_Data_Security_Standard"&gt;PCI Compliance&lt;/a&gt;&lt;span style="font-family:arial;"&gt; as tested by &lt;a href="http://www.securitymetrics.com/"&gt;SecurityMetrics&lt;/a&gt;. There was a non-obvious issue that required some detective work.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;SecurityMetrics reported that the FTP server – Gene6 version 3 – supports a medium-strength cipher. Their diagnostic message stated:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;The remote service supports the use of medium strength SSL ciphers. Description : The remote host supports the use of SSL ciphers that offer medium strength encryption, which we currently regard as those with key lengths at least 56 bits and less than 112 bits.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;It would have been nice if the report stated which medium strength ciphers the FTP server supports.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The &lt;a href="http://www.g6ftpserver.com/forum/"&gt;Gene6 support forum&lt;/a&gt; offered no clues about what ciphers Gene6 supports or uses by default. I did find out that the GUI manager doesn’t offer a way to choose what ciphers the server uses, but &lt;a href="http://www.g6ftpserver.com/forum/index.php?showtopic=1214"&gt;there is a configuration file option&lt;/a&gt;. I can enter:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;SSLCipherList=THIS-CIPHER:THAT-CIPHER&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;(Apparently SSL cipher names are always capitalized.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The key came from &lt;a href="http://stephenventer.blogspot.com/2006/07/openssl-cipher-strength.html"&gt;a blog post about OpenSSL cipher strengths&lt;/a&gt;. You can use the OpenSSL command-line tool to initiate an SSL connection with a web service, like so:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;openssl s_client -connect www.google.com:443 -cipher AES256-SHA&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;If the connection succeeds, then the service supports that cipher. Some ciphers have SSL2 and SSL3 variants. OpenSSL seems to default to the stronger variant. To test the SSL2 variant of a cipher, do this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;openssl s_client -connect www.google.com:443 -cipher RC4-MD5 -ssl2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I knew from another Gene6 forum post that &lt;a href="http://www.g6ftpserver.com/forum/index.php?showtopic=1786"&gt;Gene6 uses OpenSSL’s cipher names&lt;/a&gt;. You can get list of ciphers with this command:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;openssl ciphers -v&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Each line describes a cipher in shorthand, like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;EDH-RSA-DES-CBC3-SHA SSLv3 Kx=DH Au=RSA Enc=3DES(168) Mac=SHA1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The number in parenthesis is the key length.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;After running through the list of ciphers returned by the copy of OpenSSL on my workstation (0.9.08l), I found that Gene6 supports the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;AES256-SHA&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DES-CBC3-SHA&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;AES128-SHA&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;RC4-SHA&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;RC4-MD5&lt;span style="font-family:arial;"&gt; (SSL3 only)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;DES-CBC-SHA&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The last cipher on the list has a 56-bit key length, unacceptably short by modern standards. So, the line I needed to add to the Gene6 domain configuration file was:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;SSLCipherList=AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5542935378307664221-8720672349441927617?l=implementationdetails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://implementationdetails.blogspot.com/feeds/8720672349441927617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5542935378307664221&amp;postID=8720672349441927617' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/8720672349441927617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/8720672349441927617'/><link rel='alternate' type='text/html' href='http://implementationdetails.blogspot.com/2010/02/disabling-medium-strength-ciphers-in.html' title='Disabling medium strength ciphers in Gene6 FTP Server'/><author><name>Craig Putnam</name><uri>http://www.blogger.com/profile/12813041563120703491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5542935378307664221.post-3596040890172519504</id><published>2008-06-09T10:16:00.000-07:00</published><updated>2008-06-09T10:35:22.960-07:00</updated><title type='text'>Using a script to add a Windows printer form</title><content type='html'>&lt;span style="font-family: arial;"&gt;A client of mine uses a custom paper size for plotting architectural proofs.  The plotters themselves support the paper size, but the client also needs to plot to that size when creating a PDF.  Since PDF printers are local devices, they needed to add the form to each workstation.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Since there seems to be very little on the net regarding how to manipulate printer forms, here's how:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;1.  Download and install the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd"&gt;Windows 2003 Resource Kit Tools&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;2.  Distribute &lt;span style="font-family: courier new;"&gt;prnadmin.dll&lt;/span&gt; from the kit.  The default location is &lt;span style="font-family: courier new;"&gt;C:\Program Files\Windows Resource Kits\Tools&lt;/span&gt;.  I set up the network logon script to copy the file to &lt;span style="font-family: courier new;"&gt;C:\bin&lt;/span&gt; on each workstation.&lt;br /&gt;&lt;br /&gt;3. Install the font.  I used the following logon script (forgive the mangled formatting).&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;'----------------------------&lt;br /&gt;' InstallForm15x21.vbs&lt;br /&gt;' by Craig Putnam&lt;br /&gt;' 20080609&lt;br /&gt;' Installs a custom 15x21 printer form on workstations.&lt;br /&gt;' This script requires prnadmin.dll to be present in the netlogon bin folder.&lt;br /&gt;'----------------------------&lt;br /&gt;&lt;br /&gt;option explicit&lt;br /&gt;&lt;br /&gt;const FORM_NAME = "15x21"&lt;br /&gt;const FORM_HEIGHT = 21&lt;br /&gt;const FORM_WIDTH  = 15&lt;br /&gt;&lt;br /&gt;const INCHES = 25400&lt;br /&gt;&lt;br /&gt;dim shell : set shell = createObject("Wscript.Shell")&lt;br /&gt;dim master : set master = quietCreateObject("PrintMaster.PrintMaster.1")&lt;br /&gt;if master is nothing then&lt;br /&gt;   runProgram("regsvr32 /s c:\bin\prnadmin.dll")&lt;br /&gt;   set master = createObject("PrintMaster.PrintMaster.1")&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;if not formExists(FORM_NAME) then&lt;br /&gt;   createForm FORM_NAME, FORM_HEIGHT, FORM_WIDTH, INCHES&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;'----------------------------&lt;br /&gt;' Creates a printer form on this computer.&lt;br /&gt;'&lt;br /&gt;' Inputs: name: string: The name of the form.&lt;br /&gt;'         width: The width of the form.&lt;br /&gt;'         height: The height of the form.&lt;br /&gt;'         unit: The unit conversion factor.  The base unit for form size is&lt;br /&gt;'  microns (1/1,000,000 of a meter).&lt;br /&gt;'----------------------------&lt;br /&gt;sub createForm(name,width,height,unit)&lt;br /&gt;   dim heightInMicrons, widthInMicrons&lt;br /&gt;   heightInMicrons = height * unit&lt;br /&gt;   widthInMicrons = width * unit&lt;br /&gt;   dim form : set form = createObject("Form.Form.1")&lt;br /&gt;   form.name = name&lt;br /&gt;   form.setSize heightInMicrons, widthInMicrons&lt;br /&gt;   form.setImageableArea 0, 0, heightInMicrons, widthInMicrons&lt;br /&gt;   master.formAdd form&lt;br /&gt;   set form = nothing&lt;br /&gt;end sub&lt;br /&gt;&lt;br /&gt;'----------------------------&lt;br /&gt;' Determines whether a printer form of the given name exists on this computer.&lt;br /&gt;'&lt;br /&gt;' Inputs: name: string: The name of the form.&lt;br /&gt;' Returns: boolean: Whether a form of the give name exists on this computer.&lt;br /&gt;'----------------------------&lt;br /&gt;function formExists(name)&lt;br /&gt;   dim form&lt;br /&gt;   for each form in master.forms&lt;br /&gt;      if form.name = name then&lt;br /&gt;         formExists = true&lt;br /&gt;         exit function&lt;br /&gt;      end if&lt;br /&gt;   next&lt;br /&gt;   formExists = false&lt;br /&gt;end function&lt;br /&gt;&lt;br /&gt;'----------------------------&lt;br /&gt;' Creates an object without generating an error if creation fails.&lt;br /&gt;'&lt;br /&gt;' Inputs: name: string: The name of the object.&lt;br /&gt;' Returns: The object, or the nothing value if creation fails.&lt;br /&gt;'----------------------------&lt;br /&gt;function quietCreateObject(name)&lt;br /&gt;   on error resume next&lt;br /&gt;  &lt;br /&gt;   set quietCreateObject = createObject(name)&lt;br /&gt;   if err &lt;&gt; 0 then&lt;br /&gt;      err.clear&lt;br /&gt;      set quietCreateObject = nothing&lt;br /&gt;   end if&lt;br /&gt;end function&lt;br /&gt;&lt;br /&gt;'----------------------------&lt;br /&gt;' Runs the given program.  Directs all output to the log file.  Note that if&lt;br /&gt;'  the program requires input from stdin, it will hang.&lt;br /&gt;'&lt;br /&gt;' Inputs: program: string: The program to run.  This must be an executable&lt;br /&gt;'  that Windows can natively execute.&lt;br /&gt;'----------------------------&lt;br /&gt;function runProgram(program)&lt;br /&gt;   on error resume next&lt;br /&gt;  &lt;br /&gt;   dim process :    set process = shell.exec(program)&lt;br /&gt;    while process.status = 0&lt;br /&gt;      wscript.echo process.stdout.readAll&lt;br /&gt;      wscript.echo process.stderr.readAll&lt;br /&gt;      wscript.sleep 2&lt;br /&gt;   wend&lt;br /&gt;   wscript.echo process.stdout.readAll&lt;br /&gt;   wscript.echo process.stderr.readAll&lt;br /&gt;  &lt;br /&gt;   set process = null&lt;br /&gt;end function&lt;br /&gt;&lt;br /&gt;'--------&lt;br /&gt;' End of script InstallForm15x21.vbs&lt;br /&gt;'--------&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;If you want to use the script-as is, replace &lt;span style="font-family: courier new;"&gt;FORM_NAME&lt;/span&gt;, &lt;span style="font-family: courier new;"&gt;FORM_WIDTH&lt;/span&gt;, and &lt;span style="font-family: courier new;"&gt;FORM_HEIGHT&lt;/span&gt; with the appropriate values.  Windows measures forms in millionths of a meter, thus the inches conversion factor.  If you want to customize the script, the resource kit includes decent documentation in &lt;span style="font-family: courier new;"&gt;prnadmin.doc&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5542935378307664221-3596040890172519504?l=implementationdetails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://implementationdetails.blogspot.com/feeds/3596040890172519504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5542935378307664221&amp;postID=3596040890172519504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/3596040890172519504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/3596040890172519504'/><link rel='alternate' type='text/html' href='http://implementationdetails.blogspot.com/2008/06/using-script-to-add-windows-printer.html' title='Using a script to add a Windows printer form'/><author><name>Craig Putnam</name><uri>http://www.blogger.com/profile/12813041563120703491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5542935378307664221.post-4157913488148257303</id><published>2008-05-03T20:18:00.000-07:00</published><updated>2008-05-03T20:37:01.474-07:00</updated><title type='text'>The Case of the Mysterious Underscore</title><content type='html'>Why does this happen?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&gt;dir /b *_*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Foo+.pdf&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Some File _Some City_.pdf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Highly weird.  I'm pretty sure that the second file doesn't have any underscores.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://technet2.microsoft.com/windowsserver/en/library/552ed70a-208d-48c4-8da8-2e27b530eac71033.mspx?mfr=true"&gt;Microsoft's excellent command-line reference&lt;/a&gt; provides an explanation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&gt;dir /x *_*&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;05/03/2008  09:32 PM   1234 FOO_~1.PDF   Foo+.pdf&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;05/03/2008  09:28 PM   1234 SOMEFI~1.PDF Some File _Some City_.pdf&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5542935378307664221-4157913488148257303?l=implementationdetails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://implementationdetails.blogspot.com/feeds/4157913488148257303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5542935378307664221&amp;postID=4157913488148257303' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/4157913488148257303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/4157913488148257303'/><link rel='alternate' type='text/html' href='http://implementationdetails.blogspot.com/2008/05/case-of-mysterious-underscore.html' title='The Case of the Mysterious Underscore'/><author><name>Craig Putnam</name><uri>http://www.blogger.com/profile/12813041563120703491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5542935378307664221.post-3960806523281209041</id><published>2008-02-08T11:31:00.001-08:00</published><updated>2009-10-22T19:15:42.289-07:00</updated><title type='text'>Recovering from a corrupt Exchange data store (the easy way)</title><content type='html'>&lt;span style="font-family:arial;"&gt;Say you have an Exchange server go down and, for some reason, you don't have backups of the mail store. Say further that you can't remount the store. There are many articles from Microsoft and others on magic tricks you can do to fix a glocked store, but it turns out that there's a very easy method that should work nicely with smaller organizations.&lt;br /&gt;&lt;br /&gt;In this scenario, Exchange has been completely destroyed and must be rebuilt from scratch.&lt;br /&gt;&lt;br /&gt;By default, Outlook uses cached mode for Exchange accounts. All of each user's data is stored on their local computer, in (hopefully) perfect condition. With Exchange offline, go to each user's workstation, fire up Outlook, and export the user's mailbox to a PST. Then bring up Exchange and mount an empty private data store. For each user, delete and recreate their email profile, connect to their Exchange account, and use Outlook to re-import their data from the aforementioned PST.  Email has now been recovered.&lt;br /&gt;&lt;br /&gt;Obviously this doesn't work for public data stores. But most people are just interested in their emails, contacts, and calendar, so taking care of those will give you breathing room to work on fixing the public store.&lt;br /&gt;&lt;br /&gt;As to how I came to offer this tip, I don't want to talk about it. :)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5542935378307664221-3960806523281209041?l=implementationdetails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://implementationdetails.blogspot.com/feeds/3960806523281209041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5542935378307664221&amp;postID=3960806523281209041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/3960806523281209041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/3960806523281209041'/><link rel='alternate' type='text/html' href='http://implementationdetails.blogspot.com/2008/02/recoving-from-corrupt-exchange-data.html' title='Recovering from a corrupt Exchange data store (the easy way)'/><author><name>Craig Putnam</name><uri>http://www.blogger.com/profile/12813041563120703491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5542935378307664221.post-6413011188475741224</id><published>2008-02-01T18:03:00.000-08:00</published><updated>2008-02-01T20:55:23.149-08:00</updated><title type='text'>Replication on a StoreVault S500</title><content type='html'>&lt;span style="font-family: arial;"&gt;I purchased a pair of &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.netapp.com/"&gt;NetApp&lt;/a&gt;&lt;span style="font-family: arial;"&gt; &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.storevault.com/"&gt;StoreVault&lt;/a&gt;&lt;span style="font-family: arial;"&gt; S500 &lt;/span&gt;&lt;a style="font-family: arial;" href="http://en.wikipedia.org/wiki/Storage_area_network"&gt;SAN&lt;/a&gt;&lt;span style="font-family: arial;"&gt; units for a client recently.  The client has a fairly large volume of data for a small business - about a terabyte's worth of images, which they expect to double in a year.  One of the things they wanted to do is make an offsite backup of the data.  I tried for about two years to do ad-hoc backup over the Internet, but it never worked well.  NetApp offers closely-integrated replication as part of the StoreVault package, and the price is about half what you'd pay for EMC/Dell, so we went for it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Detail the first:  The S500 comes with a dozen 500GB hard drives, giving you 6 trillion bytes of raw storage.  That's 5.457 terabytes.  (If you're replicating the entire unit, you need a second S500, giving a total of 12,000,000,000,000 raw bytes, but moving on...)  It uses a dual-parity variant of RAID 4, which eats a trillion bytes.  That's now 4.547 TB.  (I chose not to reserve a hot spare given the fact that the entire system is going to be replicated.)  It uses a checksum scheme that stores parity on every ninth sector, which uses up, um, 1/9th of the storage.  That's now 4.04TB.  NetApp packs breakfast food into their file system, called WAFL, which apparently reduces fragmentation and has 10% overhead.  That's now 3.64TB.  One of the big features of StoreVaults is file system snapshots, which are a prerequisite for replication.  Snapshot overhead is supposedly variable, but I haven't worked out how to use anything other than the default 20%.  That's now 2.91TB.  Oh, there's about 5% overhead for managing RAID.  That's now 2.76TB.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;All of this is documented in a hard-to-find whitepaper (I had to log into the reseller site to get it).  What isn't documented is the massive 700GB or so you have to set aside in order to successfully set up replication.  Why?  Just in case you need the room, as far as I can tell.  Actual space that you can see from an &lt;/span&gt;&lt;a style="font-family: arial;" href="http://en.wikipedia.org/wiki/Iscsi#Initiator"&gt;initiator&lt;/a&gt;&lt;span style="font-family: arial;"&gt; is about 2TB.  That's two extremely well-protected, massively redundant terabytes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;By way of disclaimer, I'm bad at math, but &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.storevault.com/products/standbychassis.html"&gt;not as bad as NetApp's marketers&lt;/a&gt;&lt;span style="font-family: arial;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Detail the second:  The StoreVault Manager software is a "&lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.storevault.com/products/sw_storevault_manager.html"&gt;simplified&lt;/a&gt;&lt;span style="font-family: arial;"&gt;" user interface for the StoreVault.  By simplified, NetApp means buggy and unresponsive.  The UI appears to be based on some kind of Web front-end pretending to be a Windows program, so there are little oddities such as not being able to click on things that should be clickable, and response times measured in seconds for almost every action.  I don't know why anyone thinks that HTML / JavaScript / Ajax / whatever make good general-purpose UI's.  As far as the simplification goes, I found myself repeatedly telnetting into the unit to fix problems that I couldn't resolve with the UI.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Detail the third:  Initial configuration is easy, as is setting up &lt;/span&gt;&lt;a style="font-family: arial;" href="http://en.wikipedia.org/wiki/Storage_area_network#Storage_sharing"&gt;LUNs&lt;/a&gt;&lt;span style="font-family: arial;"&gt;.  It takes a little fiddling to associate specific LUNs with specific initiators, but it's fairly well documented.  Here is what isn't documented:  in order to successfully set up LUN replication, your DNS configuration needs to be &lt;/span&gt;&lt;span style="font-style: italic; font-family: arial;"&gt;perfect&lt;/span&gt;&lt;span style="font-family: arial;"&gt;.  If there is a configuration problem, StoreVault Manager will offer highly detailed error messages like, "Permission denied."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;When you set up a replica (and presumably whenever a replication occurs) the target unit verifies that the source unit is who it says it is by performing a &lt;/span&gt;&lt;a style="font-family: arial;" href="http://en.wikipedia.org/wiki/Reverse_dns"&gt;reverse DNS lookup&lt;/a&gt;&lt;span style="font-family: arial;"&gt;.  If the source unit's PTR record doesn't match, the replication fails.  Fair enough.  Weirdly, the PC on which StoreVault Manager is running must be able to resolve the target unit's unqualified &lt;/span&gt;&lt;a style="font-family: arial;" href="http://en.wikipedia.org/wiki/Fqdn"&gt;host name&lt;/a&gt;&lt;span style="font-family: arial;"&gt; in order to perform any operations on a replica once it has been established.  That could mean editing the PC's hosts file.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Oh, yes, StoreVault tech support loves to edit the /etc/hosts files on the S500's.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Detail the fourth:  If you ever have to reset the StoreVault to factory defaults, be aware that you may need to manually delete the LUNs.  Oh, and have a null modem cable handy, since in my case the StoreVault wasn't accessible over the network until I applied some initial settings through the serial console.  Port settings are 9600-8N1-None, since that isn't documented either.&lt;br /&gt;&lt;br /&gt;Despite the above, the StoreVault S500 seems to work.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5542935378307664221-6413011188475741224?l=implementationdetails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://implementationdetails.blogspot.com/feeds/6413011188475741224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5542935378307664221&amp;postID=6413011188475741224' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/6413011188475741224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/6413011188475741224'/><link rel='alternate' type='text/html' href='http://implementationdetails.blogspot.com/2008/02/replication-on-storevault-s500.html' title='Replication on a StoreVault S500'/><author><name>Craig Putnam</name><uri>http://www.blogger.com/profile/12813041563120703491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5542935378307664221.post-2892163701269181877</id><published>2008-01-24T13:41:00.000-08:00</published><updated>2008-01-24T15:17:10.008-08:00</updated><title type='text'>WMI through firewalls</title><content type='html'>&lt;span style="font-family:arial;"&gt;Don't you love undocumented details?  Take, for instance, the Windows Management Instrumentation service.  This lets you query and control nearly any aspect of a Windows system.  For instance, this morning I wanted to query the registry from VBScript.  The line to get an object to query the registry goes something like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;set reg = getobject("winmgmts:\\" &amp;amp; computerName &amp;amp; "\root\default:StdRegProv")&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;In most examples on the Web, computerName ends up being ".", the current computer.  This works very well.  But I didn't really want to query the registry on my own computer.  I wanted to query the registry on 50 of a client's computers to audit the installation of a particular software package.  Every workstation that I queried came back with error 462: "The remote server machine does not exist or is unavailable."  Oddly, I could successfully connect to the registries on Windows 2003 and Windows 2000 Server systems.&lt;br /&gt;&lt;br /&gt;Windows XP includes a command-line utility called reg which can query the registry on remote computers.  It worked on all of the workstations.  Why did it work when the line of script does not?&lt;br /&gt;&lt;br /&gt;The reg utility does not use WMI.  It opens a pipe called \\computerName\IPC$\winreg, then gets a query object from that pipe.  All of the workstations run Windows XP Pro SP2 or Windows Vista Business with the firewall enabled.  I have the firewall set to enable file sharing on all of the workstations, so the reg utility worked fine.&lt;br /&gt;&lt;br /&gt;After a few hours of research, I found an MSDN Technet article entitled &lt;a href="http://technet2.microsoft.com/windowsserver/en/library/b8057a7a-a0d3-40b5-8224-ea6a4f5e17231033.mspx?mfr=true"&gt;Enable or Disable the Remote Administration Exception&lt;/a&gt; which lists the following command:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;netsh firewall set service type = remoteadmin mode = enable&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Run this on each workstation, and it allows WMI to work through the firewall.  You can also set a group policy.  Open the appropriate policy and go to Computer Configuration/Administrative Templates/Network/Network Connections/Windows Firewall/Domain Profile.  Open the properties for &lt;span style="font-family:courier new;"&gt;Windows Firewall: Allow remote administration exception&lt;/span&gt; and choose &lt;span style="font-family:courier new;"&gt;Enabled&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;And that is today's implementation detail.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5542935378307664221-2892163701269181877?l=implementationdetails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://implementationdetails.blogspot.com/feeds/2892163701269181877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5542935378307664221&amp;postID=2892163701269181877' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/2892163701269181877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5542935378307664221/posts/default/2892163701269181877'/><link rel='alternate' type='text/html' href='http://implementationdetails.blogspot.com/2008/01/dont-you-love-undocumented-details-take.html' title='WMI through firewalls'/><author><name>Craig Putnam</name><uri>http://www.blogger.com/profile/12813041563120703491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
