Archive

Archive for June, 2008

Building Wine on Mac OS X

June 8th, 2008

There are probably a bazillion of these posts out there, but I wanted to play with DTrace and Wine in OS X (post on this to come) and had to get the thing built first. This is mainly a “here’s what I did” post, with some “and this is why” sprinkled in.

I grabbed the dependency I was missing (you might need others, like libjpeg and libpng3 that I already had around) and the latest source from git

sudo fink install fontforge git
git clone git://source.winehq.org/git/wine.git \
wine-git

Of course, it’s good practice not to muddy up your source tree, so build in a separate directory

mkdir bwine-git
cd bwine-git

Running just `configure` generates complaints about missing libxslt, libpng, and libjpeg. For libpng and libjpeg, I just needed to point to Fink’s libraries and headers under /sw. It took a little digging to figure out pkg-config had been installed by Fink, but since I wanted to use the system libxml and libxslt under /usr, I had to point pkg-config to the .pc files in /usr/lib/pkgconfig[1].

PKG_CONFIG_PATH=/usr/lib/pkgconfig \
CPPFLAGS=-I/sw/include \
LDFLAGS=-L/sw/lib ../wine-git/configure

I’m directed by configure to `make depend && make`; I purposely leave out a -j2 since 1) it’s a hot day and I don’t want to kill my poor MacBook Pro, and 2) I don’t remember if it works correctly

make depend && make

And finally, test it works

./wine notepad.exe

Unfortunately, I get the message that “Wine cannot find the FreeType font library. To enable Wine to use TrueType fonts please install a version of FreeType greater than or equal to 2.0.5.” Let’s point dyld to our X11 libs (where FreeType lives), and try again

DYLD_FALLBACK_LIBRARY_PATH=/usr/X11/lib \
./wine notepad.exe

Success!

[1] It seems that Wine’s autoconf script takes the value returned from pkg-config, if pkg-config exists, without trying the alternative (values from xslt-config and xml2-config, in this case), even if pkg-config returns an empty string. I might get around to submitting a patch.

Computers, General, OS X ,

Upgrading a RAID-1 array…in only a week

June 8th, 2008

750GB hard disks have been at the $/GB sweet spot for a while now, and now that they’ve hit $100, I decided to upgrade my home directory RAID-1 from 250GB to 750GB. I really dread these upgrades, as there’s always a chance you can really screw things up. So, for when I upgrade to 2TB or whatever in two years, I wrote up some notes.

In my configuration, sdb1 and sdc1 are the partitions currently part of my RAID-1 md0. sdd is one of the 750GB disks. I’m adding one 750GB disk at a time, because 1) I want at least two copies of my data to be available at all times and 2) I only have one free drive bay and don’t want disks dangling next to the machine for hours.

  1. Change the number of active devices in the array from two to three. This will cause any newly added drive to become active (i.e. actually write the array’s data onto the new drive)

    mdadm -G /dev/md0 -n 3

  2. A little burn-in testing for the new disk

    badblocks -svw -t random -p 2 /dev/sdd

  3. Partition, not forgetting to set the partition type to 0xfd, Linux raid autodetect
  4. Add the new drive as a spare to the existing array

    mdadm /dev/md0 --add /dev/sdd1

  5. Once recovery is done (check `mdadm -D /dev/md0`), fail and remove one of the old disks from the array

    mdadm /dev/md0 -f /dev/sdc1 -r /dev/sdc1

  6. Shred the removed drive

    shred -v -n 2 -z /dev/sdc

  7. (Physically) swap out the removed drive and replace it with the second new one
  8. Repeat steps 2-5 above for the second new disk. Hold off on the shredding, as this is going to be our backup
  9. Reset the number of active devices in the array to two

    mdadm -G /dev/md0 -n 2

  10. Grow the array

    sudo mdadm -G /dev/md0 --size=max

  11. Let it resync, then unmount and resize the filesystem

    umount /home
    resize_reiserfs /dev/md0
    mount /home

  12. Finally, if everything seems okay, shred that second old disk

    shred -v -n 2 -z /dev/sdb

…and we’re done! The one annoying thing is that with testing and a couple of resyncs, you end up with loads of down time between really short and simple tasks. So it’s possible (and I speak from experience) to stretch this weekend project out over a whole week.

Computers, General, Linux , ,