Archive

Archive for the ‘Geek Stuff’ Category

ZFS Drive Replacement

July 9th, 2011 No comments

My home storage server has been a source of annoyance for a few months now. I had upgraded it from an Intel Atom board to a E5500 and had some major stability issues involving bad RAM and a bad motherboard. After finally getting it stable, I learned one of my 2TB drives in my RAIDZ pool had started reporting a slightly smaller size, making it unable to participate in the pool. Luckily, the drive was still under warranty, and replacing it is a stupidly easy process, which I’ve decided to document here.

[chip@sumo ~]$ zpool status
  pool: storage
 state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas exist for
        the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://www.sun.com/msg/ZFS-8000-2Q
 scrub: none requested
config:

        NAME                STATE     READ WRITE CKSUM
        storage             DEGRADED     0     0     0
          raidz1            DEGRADED     0     0     0
            label/2TBdisk1  UNAVAIL      0     0     0  cannot open
            label/2TBdisk2  ONLINE       0     0     0
            label/2TBdisk3  ONLINE       0     0     0

errors: No known data errors

As you can see, 2TBdisk1 has failed and is unavailable. Since these SATA controllers support hot-swap, I just hooked up the new drive while the box was running. FreeBSD didn’t automatically detect the new drive, so I had to instruct it to rescan the SATA device. Normally I would expect atacontrol reinit to do this, but I ended up having to detach and attach the appropriate ata chain to get it to see the new drive.

[chip@sumo ~]$ sudo atacontrol detach ata2
[chip@sumo ~]$ sudo atacontrol attach ata2
Master:  ad4 < SAMSUNG HD204UI/1AQ10001 > SATA revision 2.x
Slave:       no device present

With the new drive now being recognized, I applied a GEOM label to it, then replaced the failed drive in the ZFS pool.

[chip@sumo ~]$ sudo glabel label 2TBdisk4 /dev/ad4
[chip@sumo ~]$ sudo zpool replace storage label/2TBdisk1 label/2TBdisk4
[chip@sumo ~]$ zpool status
  pool: storage
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
 scrub: resilver in progress for 0h0m, 0.12% done, 4h40m to go
config:

        NAME                  STATE     READ WRITE CKSUM
        storage               DEGRADED     0     0     0
          raidz1              DEGRADED     0     0     0
            replacing         DEGRADED     0     0     0
              label/2TBdisk1  UNAVAIL      0     0     0  cannot open
              label/2TBdisk4  ONLINE       0     0     0  554M resilvered
            label/2TBdisk2    ONLINE       0     0     0
            label/2TBdisk3    ONLINE       0     0     0

errors: No known data errors

Once the replacement process was finished, zpool status goes back to normal:

[chip@sumo ~]$ zpool status
  pool: storage
 state: ONLINE
 scrub: resilver completed after 5h49m with 0 errors on Fri Jul  1 23:23:08 2011
config:

	NAME                STATE     READ WRITE CKSUM
	storage             ONLINE       0     0     0
	  raidz1            ONLINE       0     0     0
	    label/2TBdisk4  ONLINE       0     0     0  437G resilvered
	    label/2TBdisk2  ONLINE       0     0     0
	    label/2TBdisk3  ONLINE       0     0     0

errors: No known data errors

Overall a remarkably painless process, all without taking the machine offline!

Categories: Geek Stuff Tags: , ,

Eye-Fi Madness

August 30th, 2010 No comments

I set out with a simple goal this evening, to change my Eye-Fi card’s upload destination from Facebook, where it was putting each image in it’s own album, to simply uploading to Hindenburg via FTPS. This led to a fun filled evening of debugging and data recovery!

The configuration change on the Eye-Fi Manager side was easy enough, simply selecting FTP as the upload mechanism and filling in a few fields. For the server side of things, I decided to go with ProFTPD, largely because I’ve used it in the past and the configuration is pretty simple. I’d never used FTPS before, but it’s pretty easy to enable with ProFTPD, just a few configuration directives:

TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol SSLv3 TLSv1
TLSRequired on
TLSRSACertificateFile /usr/local/etc/kyzoku.2bithacker.net.cert
TLSRSACertificateKeyFile /usr/local/etc/kyzoku.2bithacker.net.key
TLSVerifyClient off
TLSRenegotiate none

However, this doesn’t appear to work. Based on the xferlog and tls.log, it appears the Eye-Fi client was connecting, but the data session was failing, but it did give the helpful message of “client did not reuse SSL session, rejecting data connection (see TLSOption NoSessionReuseRequired)”. This option is undocumented, and is actually “TLSOptions NoSessionReuseRequired” (note the plural), but it does solve the problem. Apparently clients are expected to reuse the TLS session between the control and data channels, but Eye-Fi doesn’t.

So, that’s working, but now my Eye-Fi card isn’t able to be read in either of our cameras or my laptop. Not sure what happened, but it appears the partition table became corrupt this evening. The card still had the only copy of a lot of our Comic-Con photos on it, and I really didn’t want to lose them. First, I decided to get a disk image of the SD card using Mac OS X’s Disk Utility. Then, I had remembered hearing about some open source software for recovering images from damaged cards, and after a quick Googling, I came up with PhotoRec.

PhotoRec is extremely easy to use. It opened up a terminal window with a curses interface, prompting through selecting a disk to scan, a place to save the found files, then initiating a scan of the Eye-Fi, turning up all of my missing images, along with a handful of other files that I didn’t realize were on the card (including an SQLite database, maybe used by Eye-Fi?) So happy I didn’t lose all those photos, and will have to work on getting them uploaded. Unfortunately, I think I’ve lost the ability to geotag those photos though…

Categories: Geek Stuff Tags: ,

Introductory ManchLUG Meeting

August 24th, 2010 No comments

Earlier tonight was the first meeting of the new ManchLUG chapter of the GNHLUG at Wings Your Way in Manchester. I’d been tossing around the idea of organizing this chapter for a while, but hadn’t found the round tuits. Kenta came along and wrangled things together, and this first meeting at least turned out pretty well. We had 18 people registered for the event beforehand, and I think our total turn-out ended up being around 26 people.

The meeting itself was pretty casual, just some announcements and just general chatter for most of it. I’m hoping to have more organization for next month, perhaps with some discussion topics or a quick presentation. One person brought up the topic of media center computers, so maybe we can find someone to talk about their experience building such a thing with open source tech. I’ve taken a stab at it in the past with my MythTV box, but was never terribly happy with the results, and just use a WD HD TV Live to stream stuff from my storage server today.

Overall, I think everyone had a good time, and I’m hoping this will be a successful chapter.

Categories: Geek Stuff Tags: , ,

Powerline Home Network

December 15th, 2008 2 comments

During Thursday’s ice storm I decided to power down my FreeBSD box at home, which acts as my router and file server. Unfortunately, it didn’t want to boot back up afterwards, and since it didn’t have a monitor on it, I couldn’t really debug it. This prodded me into finally moving my cable modem/router set up from the corner of the home office to the front closet. This led to the problem of how to get connectivity to the stuff in the entertainment center.

In the past I had used a Linksys WRT54g running dd-wrt, configured to be a wireless client and acting as a bridge, but for streaming video and gaming I don’t really like using wireless. I had replaced the wireless bridge with a long piece of cable running around the living room and into the office, but that would have been really ugly to run into the closet. So, over the weekend I decided to pick up a Linksys PLK300, a pair of Powerline AV adapters, one with a built-in 4 port switch. Brought them home, plugged them in, and it just worked. I’m somewhat impressed, I was expecting some sort of issue, since I have one of them plugged into the surge protection side of a UPS.

So now in the front closet I have the cable coming into the apartment to a 2-way splitter (previously a 2-way then a 4-way, which may have been causing some of my signal issues) then into my cable modem, which connects to one side of my FreeBSD router/file server, which then connects to a WRT54g running dd-wrt, which provides wireless connectivity, then the single port powerline adapter plugs into that. Then in the entertainment center, it’s just the XBox 360 and TiVo connected to the powerline adapter with the 4-port switch.

Overall I freed up a 5-port switch, an 8-port switch, a bunch of Cat5, and some space in the office.

Next, I think I’m going to reconfigure the WRT to do some VLANs, trunking them into my FreeBSD box, and put my Fonera and DynWiFi Meraki on their own VLAN.

Categories: Geek Stuff Tags: , , , ,

LG 37LB5D

June 7th, 2008 No comments

Okay, LG is going on my personal vendor blacklist, at least for LCD TVs. I bought this LG 37LB5D LCD television back in December to replace my Sony WEGA CRT, and initially I was very happy with it. Then it started having audio issues, which I worked around. Then it started having video issues, where the screen would blank out randomly. I called a repair place, and the guy came out and swapped in a new power supply and control board, and everything was happy once again.

And so it went till today. The audio issue just resurfaced. I’m sitting here watching History HD off my TiVo, with no audio. First it was quick cut outs, now it’s just totally silent.

I suspect it’s something with the HDMI audio decoder. My suspicion is that it overheated and did some permanent damage to itself. I should probably contact the repair guy again and find out if the replacement parts were also under warranty, as it’s probably going to take another set of replacements to make this thing work again.

At this point though, I’m tempted to chuck this one off the balcony and go buy a Sharp AQUOS. We’ve got three of those at work and they’re running great. I suppose this is what I get for trying to save a buck and going with the cheap brand.

Categories: Geek Stuff Tags: , , ,

Signature

April 15th, 2008 1 comment

Recently someone pointed out that the contents of my e-mail signature are getting somewhat outdated, which stuck an idea into my head to update it. For a while now I’ve been using the following:

Chip Marshall &lt;chip@2bithacker.net&gt;     http://weblog.2bithacker.net/
GCM/IT d+(-) s+:++ a26>? C++ UB++++$ P+++$ L- E--- W++ N@ o K- w O M+
V-- PS+ PE Y+ PGP++ t+@ R@ tv@ b++@ DI++++ D+(-) G++ e>++ h>++ r-- y?

That jumbled mess is a Geek Code, a somewhat out of date, condensed representation of me. Given that the guidelines of the Code haven’t been updated since 1996, I’ve started looking into alternatives.

The first one I came across was OmniCode, which offers a similar syntax and a greater flexibility. However, the actual guidelines don’t seem to be well thought-out and the resulting code takes up too much space.

My second finding was the Hacker Key, which is again inspired by the Geek Code, and provides a further condensced format with updated parameters. I created a key pretty quickly, and tried the following on for size:

Chip Marshall &lt;chip@2bithacker.net&gt;        http://weblog.2bithacker.net/
v4sw5PUhw4/5ln5pr5FOPck4ma4u6FLOw5Xm5l5Ui2e4t4/5ARWb7HKOen6a2Xs5IMr2g6CM

It’s a little wider, but only two lines overall, and conveys approx the same amount of information to someone who knows what they’re looking at. I thought it looked kindof odd though, so I shuffled the components around and added in my PGP key ID, resulting in:

Chip Marshall &lt;chip@2bithacker.net&gt;
v4sw5PUhw4/5ln5pr5FOPck4ma4u6FLOw5Xm5l5Ui2e4t4/5ARWb7HKOen6a2Xs5IMr2g6CM
http://weblog.2bithacker.net/                        PGP key ID 43C4819E

It’s still a little wider than I’d like, but I could trim out a parameter or two to bring it back down. Haven’t decided if I really like it overall though yet.

Maybe I just spend too much time on these sorts of things…

PS: Oooh, what if I put the Hacker Key under the URL/PGP key line?

Chip Marshall &lt;chip@2bithacker.net&gt;
http://weblog.2bithacker.net/                        PGP key ID 43C4819E
v4sw5PUhw4/5ln5pr5FOPck4ma4u6FLOw5Xm5l5Ui2e4t4/5ARWb7HKOen6a2Xs5IMr2g6CM

Hmm…

Hindenburg

February 29th, 2008 3 comments

It’s getting to be that time of the month again, when I start whining about how no one donates to the Hindenburg fund. Unfortunately, it’s gotten to the point where it looks like Jason and I are the only ones really using it, and it’s hard to justify the $90/mo to keep it operational.

So, I’m starting to think I need to start selling some services on the box in order to get a regular flow of money coming in. Cheap virtual web hosting seems to be the easiest to do, if I can find buyers who would rather go for my little locally hosted box over one of the larger services. $10/mo seems fair to me, and at that rate I only need to get 9 customers to cover the hosting costs. If I could even get 3 or 4 it would be a big help.

If anyone has ideas for other services, or would be interesting in hosting, let me know. I suppose I should do this in some sort of official fashion via 2 Bit Hacker Consulting.

Categories: Geek Stuff Tags:
Performance Optimization WordPress Plugins by W3 EDGE