The random rantings of a concerned programmer.

Fuck you, FreeBSD

May 08th, 2009 | Category: Random

dsfargeg I know I promised I’d post more rants about Haskell but I lied. I’ve been trying to set up a fucking router for my house, which means netbooting FreeBSD then installing from that. FUCKING HELL WHAT A PAIN IN THE ASS. I mean, netbooting is easy as fuck to set up, but occasionally there are strange hardware issues which cause everything to shit itself without reason.

can’t work out which disk we’re booting from

This nasty little fuck crawled out of the PXE loader somewhere. It didn’t make much sense to me — why the fuck would PXE be trying to load from a disk when we’re fucking netbooting? A little searching turned up this tidbit, which instructs you to rebuild pxeboot with -DLOADER_TFTP_SUPPORT=yes.

Fuck my life.

bootpc_fakeup_interface: set if addr, error=22

This kernel panic happens like 95% of the time when booting the fucking machine. I’m staring at the code right now, and at the core, it’s simply reporting the failure of the following call –

ifioctl(so, SIOCSIFADDR, (caddr_t) ireq, td);

It’s trying to set the inet4 address of the interface to 0.0.0.0 and failing somewhere. Piece of shit. As a note, error 22 is EINVAL — invalid argument. Now to figure out what the fuck would throw that shit.

Here’s a hand-generated call graph for ifioctl (because it takes about an hour to recompile a kernel on this old machine, it’s faster to do it this way than to put debug printfs in -_-) –

ifioctl
- ifhwioctl
- *so->so_proto->pr_usrreqs->pru_control

Actually, that wasn’t too bad. ifhwioctl doesn’t return EINVAL anywhere, which means it’s coming from the other call. It looks kind of messy (yeah, that’s a function call using a function pointer) but it makes sense — this is part of the networking code, and that’s a callback provided by the driver. In this particular case, the hardware is using the fxp driver, which makes the following lines in net/if.c make me scratch my head (since I run without INET6) –

 2287         if ((oif_flags ^ ifp->if_flags) & IFF_UP) {
 2288 #ifdef INET6
 2289                 DELAY(100);/* XXX: temporary workaround for fxp issue*/
 2290                 if (ifp->if_flags & IFF_UP) {
 2291                         int s = splimp();
 2292                         in6_if_up(ifp);
 2293                         splx(s);
 2294                 }
 2295 #endif
 2296         }

Actually, my buildkernel just finished, so I’m going to first try moving that one line of code outside the INET6 block (since I can re-run buildkernel with -DNOCLEAN to quickly apply the changes)… yeah that didn’t work. FUCK. Into the fxp driver to look for the function being called.

And the PSU just died.

FUUUUUUUUUUUUUUUUUUUUUUUCK.

2 comments

(Untitled)

April 21st, 2009 | Category: Random

I had a machine upstairs hooked up to the cable modem acting as both a wireless router and a SMB/NFS server. Yesterday, we noticed some young birds had taken up a nest on our roof and were tweeting away.

You might not think these two pieces of data are related, but they are. Those weren’t birds — the sounds were coming from the primary hard drive of our router. FUUUUUUUUUUUU. For some reason, two of the three drives in the machine failed. Sounds like some kind of mechanical failure in the primary drive, and on one of the data drives the partition table was completely screwed up (though I managed to rebuild it by hand). As I was dumping the data off this second drive, I noticed something that I had forgotten to do –

The RAID5 array that I built isn’t encrypted with GELI. So I just wiped it and layered GELI on top of the RAID5 volume — it was really incredibly easy to do. Except now I’m filling the 2.6TB volume from /dev/random before running newfs (and re-copying over all my data) and fuck this is going to take forever. But now I’ve got a secure volume for all of my totally legal material. Huzzah.

3 comments

gvinum + FreeBSD

April 17th, 2009 | Category: Random

On CURRENT back in February, some changes were commited to gvinum (the frontend for vinum) which made the interface not suck balls. Before you had to weave some weird magic configuration file and sacrifice your first male child:

$ gvinum printconfig
drive gvinumdrive3 device /dev/ad8
drive gvinumdrive2 device /dev/ad6
drive gvinumdrive1 device /dev/ad3
drive gvinumdrive0 device /dev/ad1
volume gv0
plex name gv0.p0 org raid5 512s vol gv0
sd name gv0.p0.s3 drive gvinumdrive3 len 6s driveoffset 265s plex gv0.p0 plexoffset 1536s
sd name gv0.p0.s2 drive gvinumdrive2 len 6s driveoffset 265s plex gv0.p0 plexoffset 1024s
sd name gv0.p0.s1 drive gvinumdrive1 len 6s driveoffset 265s plex gv0.p0 plexoffset 512s
sd name gv0.p0.s0 drive gvinumdrive0 len 6s driveoffset 265s plex gv0.p0 plexoffset 0s

But in the new release of gvinum, instead of creating that pig disgusting configuration file and passing it to gvinum create, you can simply invoke it with

$ gvinum raid5 -n gv0 ad1 ad3 ad6 ad8

and boom, there’s your new volume to run newfs on or whatever.

For some reason though, the RAID5 volume is horribly slow for me:

$ dd if=/dev/zero of=test bs=1m count=100
100+0 records in
100+0 records out
 bytes transferred in 9.002813 secs (11647204 bytes/sec)

11MB/s write speed is paltry compared to the 33MB/s both my laptop’s single drive and the gmirror array in the same machine get. This might be a problem with the shitty on-board Intel controller I’m using, or it might be a problem with the disks (because I’m using different disks for the RAID1 and RAID5 volumes), though the read speeds on the RAID5 are fine. I’m testing speeds with systat which isn’t really accurate for benchmarking — I’ll have to tinker around with it more later.

I figure I can test the disks by pulling a drive off the RAID5 and snapping the RAID1 and do tests on one of each of the type of disk. I don’t think there’s a way to simulate a disk failure — I tried first using gvinum detach gv0.p0.s0, but simply got an error code spit back at me. Next I took one of the disks and overwrote the partition table, thinking that gvinum might be using that. It doesn’t :D

So now I’m rebuilding the volume with gvinum rebuildparity gv0.p0, getting all kinds of parity errors to the syslog etc; we’ll have to see what happens when it finishes running. I suspect that the only way for me to break the volume is to physically remove the disk or something which is bleh :(

2 comments

(Untitled)

April 15th, 2009 | Category: Random

I ditched work a little early today. I’m migrating our website over from a pig disgusting Cold Fusion mess over to pig disgusting Drupal. It’s a fucking nightmare — how the hell did I turn into a fucking PHP developer? Times like these make me want to build up a non-webshit portfolio and go shopping for a new job, though the market around here is kind of shitty for that right now.

Started tinkering around with Haskell + OpenGL last night. Using some old C code of mine as a reference, I got textures and vertex arrays working fine, should hammer out VBO’s and I should have everything I need to render with. Don’t know what kind of game or program I’d write though, so I’ll probably just get bored with it. I put the shit code on github because as shitty as github is (slow as fuck Ruby web interface) it’s kind of nice to have a free remote, public VCS. And git itself isn’t too bad.

Right now I’m compiling CURRENT from source, over NFS, on a netbooted machine (because I forgot the goddamn install CD at work fucking AGAIN and I’m sick of having shit strewn around my desk). It’s pulling the source off NFS, but /usr/obj is on a disk. Figure I’ll buildkernel + buildworld then install them to the disk, then boot off that. Pulling the source over NFS takes surprisingly little bandwidth — I assumed the network link would be the bottleneck. I guess it’s pulling on-demand, so it just adds latency to each request. Should have unionfs’d the UFS mount over the NFS mount and pulled all the stuff over concurrent to the install (via find . | xargs touch or similar).

Took me fucking ages to sift through all the shit I post to find the nfsbooting notes from 2007 though. I guess I should start tagging posts or something.

2 comments

(Untitled)

April 12th, 2009 | Category: Random

There are currently 658 comments in my WordPress spam queue. Haha, oh wow.

My new lease (for 2009-2011) starts in three weeks; I’m really excited about it. It’s always really fun for me to move around, since it’s an opportunity to cut off all the old cruft that’s collected both in my room and in my lifestyle. And the new house has an extra bedroom which I’m going to fill with bookshelves to store manga and shit (because holy shit I seem to be building up a lethal amount of the shit).

I did some more work on the fucking fileserver-to-be which has been sitting on my bench for weeks. Finally got around to updating the BIOS on the DG33TL that it’s using (so now it can actually read from all of the on-board SATA ports). And scrapped the old flaky PSU. And extracted at least 10 loose screws that were jangling around in the Chieftec case I dug out of my closet (seriously where the fuck did all those screws come from?).

I threw the FreeBSD 7.2-BETA1 iso in there and it didn’t boot for some reason. The hardware I’m using is shitty as hell; it booted and installed ArchLinux just fine so I’m going to give it a shot with a 6.4-RELEASE disk I have at work. Linux is great and all, but I just don’t understand it. I mean sure, I understand the basics. I just have no idea how I’d set up an encrypted, software RAID5 data volume next to a RAID1 system volume in Linux.

Also thought about installing something like FreeNAS but hahaha no1.


[1] The old vinum doesn’t actually write parity data for RAID-5 configurations. This has been fixed in -CURRENT, and I doubt that FreeNAS is going to work 100% on -CURRENT. Otherwise, fuck I’d probably run it.

4 comments

Next Page »