Jun 092012

Renaming a jail FreeBSD jails are a great tool. Whether you are using them to virtualize some of your systems (like I am) or to isolate certain processes, they are flexible enough and reliable enough to use for production. Recently, I had to retire some old jails and add some new jails. Instead of just deleting one and creating an new jail, I wanted to rename the existing jail. I figured this was easier than recompiling all the apps that my jail would require. A few notes on this decision: My jails are all very similar. In this case, I was moving from one version of PostgreSQL to another One jail is called pg74 (as in PostgreSQL 7.4) I was going to retire pg74 (which does regression tests on Bacula against PostgreSQL 7.4) and create pg91 Also, I am using ezjail to administer my jails. This tool is used several times in this article. That […]

Feb 122012

Restoring an INOPERABLE 3Ware unit I’ve been using a 3Ware 9550SX-8LP since 2006. Over the weekend, I encountered the first problem with it. It became inoperable. That’s an overstatement, but the problem was easily fixed. After a reboot to upgrade the kernel, Nagios alerted me to a problem. I checked via the command line and found this situation: # tw_cli info c0 Ctl Model (V)Ports Drives Units NotOpt RRate VRate BBU ———————————————————————— c0 9550SX-8LP 8 8 3 1 4 1 OK # tw_cli info c0 Unit UnitType Status %RCmpl %V/I/M Stripe Size(GB) Cache AVrfy —————————————————————————— u0 RAID-10 OK – – 64K 195.548 ON ON u1 SPARE OK – – – 69.2404 – ON u2 RAID-10 INOPERABLE – – 64K 195.548 OFF ON Port Status Unit Size Blocks Serial ————————————————————— p0 OK u2 69.25 GB 145226112 WD-WMAKE2379003 p1 OK u1 69.25 GB 145226112 WD-WMAKE2379069 p2 OK u0 69.25 GB 145226112 WD-WMAKE2379066 p3 OK u0 69.25 GB […]

Aug 092011

grep, sed, and awk for fun and profit I recently moved this website to a new website. After doing that, I noticed a lot more captcha failures. I don’t think there are more automated attempts. logcheck on the new server is not configured to ignore the log messages. Tonight, I thought I’d do something about them. The Log messages The log messages look like this: Aug 6 23:09:06 gelt FreeBSDDiary[43547]: captcha failure: user=’Marina’ IP=’′ email=’marinapetrova08@gmail.com’ Aug 6 23:21:18 gelt FreeBSDDiary[43870]: captcha failure: user=’MigoneWoorope’ IP=’′ email=’jeffer.s.o.n.v.3.v@gmail.com’ Aug 6 23:50:19 gelt FreeBSDDiary[47046]: captcha failure: user=’apelealcoxy’ IP=’′ email=’southfan@southpark.jatsu.pl’ These messages are created by some custom code I have added to Phorum Granted, the message isn’t exactly easy to parse. If I was doing this again, I would rethink my output. Parsing the output My goal: get a list of IP addresses and the number of failed capchas for each. This is my first attempt: $ bunzip2 -c /var/log/messages.* […]

Feb 052011

Bacula – copying a job; doing it better I recently wrote about Bacula’s Copy job option. In that solution, I used an approach which copied all uncopied jobs from disk to tape. I’ve found a few annoyances with that initial approach and now I’m experimenting with a new approach. An added side-effect: less wear on the tape library. My initial approach used the Selection Type = PoolUncopiedJobs. My new approach, originally discarded, will use Selection Type = SQL Query, three jobs, each with a different pool. The results are much smoother and faster. Duplicate Job Control By default, Bacula allows for duplicate jobs. For the purposes of defining a duplicate job, Bacula goes by the job name. Various directives for fine tuning of duplicates. This comes into play with the solution I have selected. The approach I am using will select multiple jobs for copying. Thus, the potential for duplicates is high, and almost guaranteed […]

Jan 092011

ZFS benchmark I have a 64-bit box with a ZFS raidx2 array. It now has 4GB of RAM and I recently purchased another 4GB. I thought I might do some benchmarks on it before and after I install the additional RAM. I will be using the benchmarks/bonnie++ port. The intial tests In this section I will run two intial tests. One will write to a zfs dataset which has compression enabled, and the other will be to a dataset which does not enable compresion. The latter will be first: $ bonnie++ Writing a byte at a time…done Writing intelligently…done Rewriting…done Reading a byte at a time…done Reading intelligently…done start ’em…done…done…done…done…done… Create files in sequential order…done. Stat files in sequential order…done. Delete files in sequential order…done. Create files in random order…done. Stat files in random order…done. Delete files in random order…done. Version 1.96 ——Sequential Output—— –Sequential Input- –Random- Concurrency 1 -Per Chr- –Block– -Rewrite- -Per Chr- […]

Dec 172010

Bacula – copying a job Don’t be fooled by Bacula. Although it is by far the most downloaded Open Source backup program, don’t be intimidated by it. Bacula can handle backing up your single machine, or your entire enterprise. According to SourceForge statistics, Bacula is by far the most downloaded backup software. I’ve been using Bacula for nearly 7 years now. I was in the middle of preparing to deploy another backup package (Amanda) when someone, I forget who, mentioned Bacula to me. I liked it immediately. I liked it so most, I abandoned my plans and deployed Bacula instead. Soon after that, I wrote the PostgreSQL module for Bacula. Bacula stores backup information (what was backed up, from where, and when) in a Catalog. This Catalog is stored in a database. At present, the Catalog can be SQLite (not recommended), MySQL (also, not recommended, but if you have to use it, it’s better than […]

Nov 242010

Bacula: RunBeforeJob on Storage Daemon This article deals with a particular Bacula directive: RunAfterJob This directive, part of a Job resource, is used to run a command after the job completed. In my case, I am collecting statistics regarding tape errors. The directive has many options, including: run before or after the Job run on the client or on the Director run on success run on failure execute a console command For more information on this directive, refer to Job Resource in the Bacula documentation. One interesting note, I found this in the documentation: %v = Volume name (Only on director side) The solution Today I realised that my statistics gathering program must run in the Storage Daemon (SD). Previously, my Director (DIR) and SD were both on the same server. In my new setup, I’ve created a new SD which has 12TB of HDD storage and 10TB of tape storage (but just a 10 […]

Nov 162010

Testing the DLT Now that my tape labels have arrived, it’s time to run those tapes through Bacula. In this article, you’ll see: a list slots command fail a command line mtx-changer command fail the fix via device permissions a label barcodes fail a script to test tapes Oh, that script isn’t actually in this article. It’s in the tape testing article. But I do use it below to determine that my tape drive and my tapes are all in very good condition. Not bad for used gear. Permission is everything After: removing the magazine putting physical labels onto the tapes placing the tapes into the magazine putting the magazine back into the library I sought to see the list of labels I had. I failed: $ bconsole Connecting to Director bacula.example.org:9101 1000 OK: bacula-dir Version: 5.0.3 (04 August 2010) Enter a period to cancel a command. *update slots Automatically selected Catalog: MyCatalog Using Catalog […]

Nov 152010
DLT labels

DLT labels The new labels are in! On Wednesday of last week, I ordered some labels from get-it-low on eBay. They shipped on Thursday, and they arrived today (Monday). The item is listed as New Quantum ATL SDLT DLT Bar Code Labels Tag 6210201-02 and sold for $9.99 plus $5.84 shipping, for a total of $15.83 USD. These labels are for the 220+ DLT labels which I obtained from a friend (he knows who he is). They were decommissioning a whole bunch of DLT drives and these tapes were surplus. Rather than trash them, he overwrote them, several times with different streams of 1s and 0s. Then gave them to me. However, with a tape library which contains a bar-code label, you pretty much want barcodes. The labels Back in May I asked if any of the Bacula users happened to have a bunch of labels sitting around unused. People like to help, especially when […]