Archive

Posts Tagged ‘freebsd’

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: , ,

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: , , , ,

IRC Moment

May 5th, 2005 No comments
-!- Topic for #freebsd: #freebsdhelp for help, #freebsd for cars, porn, and hate.
[FumBa] Hey, I was wondering if someone could give me some advice. Working 
        with PPPoE / Natd / IPFW.
[FumBa] i am wondering how my IPFW rules should be formed. do i use tun0 or 
        the external network interface
[FumBa] do i use tun- and allow everything thru the external interface? and will 
        natd work, even tho it is strongly suggested to use ppp's nat functions?
[Number-6] what does the topic say?
[FumBa] Ohh man
[FumBa] So how bout that movie with the naked chick in the car?
[Number-6] hated it.

(well, it made me laugh anyway)

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