Subversion hosting, CVS hosting, Trac hosting, Bugzilla hosting and software collaboration Providing hosted Subversion, CVS, Trac and Bugzilla repositories
 

May 8, 2008

Getting ElasticDrive to Work Under FreeBSD

Filed under: Operating Systems — Tags: , , — Greg Larkin @ 2:38 pm

Hi everyone,

I recently learned of the ElasticDrive application that implements a disk device backed by Amazon S3 and other kinds of storage services. To determine whether I could easily deploy an infinitely-scalable disk device on my FreeBSD servers, I downloaded ElasticDrive and proceeded to install it on a FreeBSD 7.0 virtual machine.

There are a few prerequisites, such as FUSE and Python setuptools, but those are easily installed with the FreeBSD ports system. If I can get ElasticDrive to work, it will be handy to package it as a port for one-command installation.
In the mean time, I installed it manually and edited the /etc/elasticdrive.cfg to point to my Amazon S3 account. I reduced the size of the S3 backing store to a 100Mb disk:

[drives]
#Path to fuse is the path to the device mount folder. NOT your fuse libraries
fuseblock|/mnt/elasticdrive="s3://mySecret:mySecretToo@aws.amazon.com/?bucket=myBucket&
stripesize=65536&blocksize=4096&blocks=25600&sizebyblocks=1"

After I fired up the tool, I saw my ElasticDrive file:

fbsd70# ls -al /mnt/elasticdrive
total 102403
drwxr-xr-x  2 root  wheel          0 Dec 31  1969 .
drwxr-xr-x  4 root  wheel        512 May  7 13:36 ..
-rw-r--r--  1 root  wheel  104857600 Dec 31  1969 ed0
-r--r--r--  1 root  wheel        391 Dec 31  1969 stats
fbsd70# du -sh /mnt/elasticdrive
100M    /mnt/elasticdrive

Cool - this looks promising!

FreeBSD uses the mdconfig command to create a file-backed loop device, similar to the Linux losetup command. This is too easy:

fbsd70# mdconfig -a -t vnode -f /mnt/elasticdrive/ed0 -u 0
fbsd70# ls -al /dev/md0*
crw-r-----  1 root  operator    0, 101 May  8 12:32 /dev/md0
crw-r-----  1 root  operator    0, 106 May  8 12:32 /dev/md0a
crw-r-----  1 root  operator    0, 107 May  8 12:32 /dev/md0c
fbsd70# fdisk /dev/md0
******* Working on device /dev/md0 *******
parameters extracted from in-core disklabel are:
cylinders=12 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=12 heads=255 sectors/track=63 (16065 blks/cyl)

fdisk: invalid fdisk partition table found
Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 63, size 192717 (94 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 1;
end: cyl 11/ head 254/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
fbsd70#

Ok, let’s create a filesystem and test it out:

fbsd70# newfs /dev/md0a
/dev/md0a: 100.0MB (204784 sectors) block size 16384, fragment size 2048
using 4 cylinder groups of 25.00MB, 1600 blks, 3200 inodes.
super-block backups (for fsck -b #) at:
160, 51360, 102560, 153760
cg 0: bad magic number

Woops - what’s this now?! Looking at the newfs source code, this error is generated when data read back from the disk doesn’t match data written to the disk.

I’ve tried to figure out what the problem is using truss and other techniques, and I’ve contacted ElasticDrive to see if they have any ideas. So far, nothing has worked.

If anyone else has an idea how to troubleshoot this, let me know.

Keep in touch,
Greg


Share this with others: del.icio.us:Getting ElasticDrive to Work Under FreeBSD  digg:Getting ElasticDrive to Work Under FreeBSD  newsvine:Getting ElasticDrive to Work Under FreeBSD  furl:Getting ElasticDrive to Work Under FreeBSD  reddit:Getting ElasticDrive to Work Under FreeBSD  fark:Getting ElasticDrive to Work Under FreeBSD  blogmarks:Getting ElasticDrive to Work Under FreeBSD  Y!:Getting ElasticDrive to Work Under FreeBSD  magnolia:Getting ElasticDrive to Work Under FreeBSD

April 26, 2008

Who’s Going To BSDCan 2008?

Filed under: Operating Systems — Tags: , , — Greg Larkin @ 4:15 pm

Hi everyone,

I just registered for the BSDCan 2008 conference in Ottawa, ON, Canada on 5/16 and 5/17. I’m really looking forward to meeting some of the folks that I’ve exchanged emails with over the past couple of years while learning and using FreeBSD and maintaining some ports.

Is anyone reading this post going to be at the conference, too? If you want to meet up, drop me a line and let me know. I hope to leave the conference with a lot of new FreeBSD knowledge and hear about how others use it and what to expect in future versions.

I’m also just looking forward to getting back to Ottawa. We’ve mostly visited there in the winter for the Winterlude and cross-country skiing at Parc Gatineau. If you enjoy freezing your tail off in mid-February (-30F at night not unheard of!) and skating on the Rideau Canal with 50,000 other fun-loving souls, you’ve got to visit!

I imagine that the warmer months will be very nice as well, and I do hope to see some of the Tulip Festival while I’m there.

Keep in touch,
Greg


Share this with others: del.icio.us:Who's Going To BSDCan 2008?  digg:Who's Going To BSDCan 2008?  newsvine:Who's Going To BSDCan 2008?  furl:Who's Going To BSDCan 2008?  reddit:Who's Going To BSDCan 2008?  fark:Who's Going To BSDCan 2008?  blogmarks:Who's Going To BSDCan 2008?  Y!:Who's Going To BSDCan 2008?  magnolia:Who's Going To BSDCan 2008?

April 20, 2008

Updated FreeBSD 7.0 VMware Image Now Available

Filed under: Operating Systems — Tags: , , — Greg Larkin @ 4:22 pm

Hi everyone,

I updated the ports tree and repackaged the FreeBSD 7.0 VMware virtual machine that turned out to be corrupted in my earlier release. I apologize for anyone who was inconvenienced, and I still don’t know how part of one of the disks was corrupted, since the source image was fine.

Anyway, you can find the new download here: VMware 7.0 virtual machine with ZFS enabled

If you run into any problems, please contact me.

Keep in touch,
Greg


Share this with others: del.icio.us:Updated FreeBSD 7.0 VMware Image Now Available  digg:Updated FreeBSD 7.0 VMware Image Now Available  newsvine:Updated FreeBSD 7.0 VMware Image Now Available  furl:Updated FreeBSD 7.0 VMware Image Now Available  reddit:Updated FreeBSD 7.0 VMware Image Now Available  fark:Updated FreeBSD 7.0 VMware Image Now Available  blogmarks:Updated FreeBSD 7.0 VMware Image Now Available  Y!:Updated FreeBSD 7.0 VMware Image Now Available  magnolia:Updated FreeBSD 7.0 VMware Image Now Available

April 18, 2008

Update: Need Help with VMware Workstation Running on Microsoft Vista

Filed under: Operating Systems — Tags: , — Greg Larkin @ 5:36 pm

Hi everyone,

In a previous post, I asked for assistance about getting a FreeBSD 7.0 virtual machine running on VMware Workstation on MS Windows Vista. Well, it turns out I didn’t need any help after all - the torrent file was corrupted!

Somehow, one of the 2Gb slices of the VM’s boot disk was truncated to ~1.4Gb. I don’t know how it happened - perhaps during the ZIP compression. It’s very odd, because the rest of the slices were fine.

Anyway, I’m preparing a new torrent, and I’ll post the link when it’s ready.

Keep in touch,
Greg


Share this with others: del.icio.us:Update: Need Help with VMware Workstation Running on Microsoft Vista  digg:Update: Need Help with VMware Workstation Running on Microsoft Vista  newsvine:Update: Need Help with VMware Workstation Running on Microsoft Vista  furl:Update: Need Help with VMware Workstation Running on Microsoft Vista  reddit:Update: Need Help with VMware Workstation Running on Microsoft Vista  fark:Update: Need Help with VMware Workstation Running on Microsoft Vista  blogmarks:Update: Need Help with VMware Workstation Running on Microsoft Vista  Y!:Update: Need Help with VMware Workstation Running on Microsoft Vista  magnolia:Update: Need Help with VMware Workstation Running on Microsoft Vista

April 10, 2008

Need Help with VMware Workstation Running on Microsoft Vista

Filed under: Operating Systems — Tags: , — Greg Larkin @ 11:02 am

Hi everyone,

A couple of weeks ago, I made a FreeBSD 7.0 + ZFS VMware image torrent available on the SourceHosting.net BitTorrent Tracker. A reader of this blog contacted me a couple of days ago about a boot problem he’s having with the image, and I was wondering if anyone out there can reproduce it and/or provide a solution? Here are the particulars:

  • Host OS: Microsoft Windows Vista
  • VMware Workstation version 6.0.3 build – 80004
  • FreeBSD 7.0 + ZFS VMware image (torrent)

Initially, it appears that the VMware image ZIP did not unpack correctly, because this error is displayed:

VMware Workstation Error Message

However, checking the directory where the ZIP file was unpacked shows that the file does exist:

Virtual Machine Directory Listing

I tried to debug the problem from here since I don’t have Vista installed anywhere, but nothing has worked yet. He sees the same problem with VMware Player, too, so I wonder if it’s something to do with Vista permissions or some other security setting.

If someone has an idea what the problem could be, let me know.

Keep in touch,
Greg


Share this with others: del.icio.us:Need Help with VMware Workstation Running on Microsoft Vista  digg:Need Help with VMware Workstation Running on Microsoft Vista  newsvine:Need Help with VMware Workstation Running on Microsoft Vista  furl:Need Help with VMware Workstation Running on Microsoft Vista  reddit:Need Help with VMware Workstation Running on Microsoft Vista  fark:Need Help with VMware Workstation Running on Microsoft Vista  blogmarks:Need Help with VMware Workstation Running on Microsoft Vista  Y!:Need Help with VMware Workstation Running on Microsoft Vista  magnolia:Need Help with VMware Workstation Running on Microsoft Vista

March 20, 2008

Loading The Laptop With DesktopBSD

Filed under: Operating Systems — Tags: , — Greg Larkin @ 6:21 pm

Hi everyone,

As you may have noticed, I’m a pretty big proponent of FreeBSD. Lately, I’ve been interested in building a laptop that is light, has long battery life, can do basic email checking/web site browsing/remote server admin over SSH/etc. A bonus would be if I could run FreeBSD in a VMware VM and work on my ports if I’m stuck on a long plane ride.

Wait a minute - forget the VM! I’ll just run DesktopBSD directly on the laptop and have everything I need:

  • Email - check (Thunderbird)
  • Web browsing - check (FF, natch)
  • SSH - check
  • Full /usr/ports tree - check!

I’ve got version 1.6 loaded up on my venerable IBM Thinkpad 600x that had been mothballed for a couple of years, and after replacing the CMOS battery (go away nasty POST 161/163 errors!), and replacing the first-gen wireless PCMCIA card with a Linksys WPC54G, things are humming along nicely.

I did have to wrestle with the drivers for the Linksys card, guided largely by a helpful post on TaoSecurity, but eventually I got it working.

I’m currently in building the OpenOffice 2.x port so I can really get things done remotely, but it has been compiling for 2+ days now (!), and there’s no indication when it will finish!

I’ll post more about DesktopBSD as I get further into it.

Keep in touch,
Greg


Share this with others: del.icio.us:Loading The Laptop With DesktopBSD  digg:Loading The Laptop With DesktopBSD  newsvine:Loading The Laptop With DesktopBSD  furl:Loading The Laptop With DesktopBSD  reddit:Loading The Laptop With DesktopBSD  fark:Loading The Laptop With DesktopBSD  blogmarks:Loading The Laptop With DesktopBSD  Y!:Loading The Laptop With DesktopBSD  magnolia:Loading The Laptop With DesktopBSD

March 18, 2008

FreeBSD 7.0 VMware Image Available

Filed under: Operating Systems — Tags: , , — Greg Larkin @ 12:18 pm

Hi everyone,

Since FreeBSD 7.0 was recently released, I figured it’s a good time to put a VMware image together and have a look. Probably one of the most interesting new enhancements is the addition of the ZFS filesystem. I can’t wait to try that out, and it should make managing disk space a lot easier in the context of the SourceHosting.net service.

You can find the zipped image on the SourceHosting.net BitTorrent tracker. Some notes about the image:

  • The VM has been configured with 768Mb of memory. You can reduce it to 512Mb, but the ZFS documentation says “Me want more memory!
  • The root password is “password”
  • ZFS is enabled by default
  • The /usr/ports filesystem is located in a ZFS pool
  • The Ethernet interface is bridged to the host and uses DHCP

I tested this VM in VMware Server and VMware Player, and it seems to work fine. If you have any questions or problems, feel free to post comments here.

Keep in touch,
Greg


Share this with others: del.icio.us:FreeBSD 7.0 VMware Image Available  digg:FreeBSD 7.0 VMware Image Available  newsvine:FreeBSD 7.0 VMware Image Available  furl:FreeBSD 7.0 VMware Image Available  reddit:FreeBSD 7.0 VMware Image Available  fark:FreeBSD 7.0 VMware Image Available  blogmarks:FreeBSD 7.0 VMware Image Available  Y!:FreeBSD 7.0 VMware Image Available  magnolia:FreeBSD 7.0 VMware Image Available

March 10, 2008

Installing VMware Tools In A FreeBSD 7.0 Guest

Filed under: Operating Systems — Tags: , — Greg Larkin @ 7:35 pm

Hi everyone,

I’ve got FreeBSD 7.0 downloaded and running as a VMware Server virtual machine so I can start checking it out and get a feel for how it works. Once ZFS is deemed stable for production, I’ll plan to migrate to the 7.x series.

The first thing I generally do after setting up a new VM is install VMware Tools. Wait - scratch that. The first thing I have to do before installing VMware Tools is install Perl, since it’s not part of the FreeBSD base system. That’s easy enough:

cd /usr/ports/lang/perl5.8 &amp;&amp; make WITH_GDBM=yes install clean

Ok, on to the VMware Tools installer! After starting the vmware-install.pl script, I answered a bunch of questions (used all default responses), and finally was met with this somewhat odd message:

VMware Tools Installation Failure Under FreeBSD 7.0 Guest

Wait a minute - I’m pretty sure I’m installing in a virtual machine here! Initially, I pored through the installation Perl script and discovered that it executes vmware-checkvm to determine if it’s running inside a VM or not. Ok, let’s try that by hand:

vmware-checkvm Failure Under FreeBSD 7.0 Guest

That’s a problem! vmware-checkvm is a statically-linked binary, and to get it working, the FreeBSD compat6x port needs to be installed. The compat6x port installs a variety of libraries that were found in FreeBSD 6.x but have had their versions bumped for FreeBSD 7.0.

cd /usr/ports/misc/compat6x &amp;&amp; make install clean

Hmm, still no joy after doing that - vmware-checkvm is still core dumping. After more Googling and nosing about in the VMware Tools installation script, I learned that VMware expects the libc.so.6 library installed by compat6x to be in /lib. However, all compat{3,4,5,6}x ports install their libraries in /usr/local/lib/compat to avoid messing with the base system.

A simple symbolic link gets libc.so.6 in place for VMware:

ln -s /usr/local/lib/compat/libc.so.6 /lib

And now success, right? Wrong!

VMware Tools Installation Fails Again

I’m not logged in over the network, so why am I getting this message? It turns out that tcsh (root shell in FreeBSD) is setting the REMOTEHOST environment variable, even though I’m logged in at the VM’s console.

The solution is a simple command:

unsetenv REMOTEHOST

Start up the VMware Tool installer one more time, and now it works!

Maybe the newest version of VMware Server supports FreeBSD 7.0 natively, so I’ll have to test that out soon. Details will be posted here when I do!

Keep in touch,
Greg


Share this with others: del.icio.us:Installing VMware Tools In A FreeBSD 7.0 Guest  digg:Installing VMware Tools In A FreeBSD 7.0 Guest  newsvine:Installing VMware Tools In A FreeBSD 7.0 Guest  furl:Installing VMware Tools In A FreeBSD 7.0 Guest  reddit:Installing VMware Tools In A FreeBSD 7.0 Guest  fark:Installing VMware Tools In A FreeBSD 7.0 Guest  blogmarks:Installing VMware Tools In A FreeBSD 7.0 Guest  Y!:Installing VMware Tools In A FreeBSD 7.0 Guest  magnolia:Installing VMware Tools In A FreeBSD 7.0 Guest

March 6, 2008

FreeBSD Port For CodeIgniter Upgraded to 1.6.1

Filed under: Software Development — Tags: , , , , , — Greg Larkin @ 7:01 pm

Hi everyone,

I’ve submitted some new FreeBSD port upgrades over the past week, including new support for CodeIgniter 1.6.1. In addition to the version bump of the upstream distribution, I also added some new bits to allow customization of certain CI files. The port is also careful to avoid removing those modified files when a new port upgrade comes along.

The reference for how to handle user-configurable files installed as part of a port can be found in the excellent FreeBSD Porter’s Handbook in the Configuration Files section.

In the new CodeIgniter port, the following user-configurable files are installed:

<INSTALL_DIR>/index.php
<INSTALL_DIR>/index.php.sample
<INSTALL_DIR>/system/application/config/autoload.php
<INSTALL_DIR>/system/application/config/autoload.php.sample
<INSTALL_DIR>/system/application/config/config.php
<INSTALL_DIR>/system/application/config/config.php.sample
<INSTALL_DIR>/system/application/config/database.php
<INSTALL_DIR>/system/application/config/database.php.sample
<INSTALL_DIR>/system/application/config/hooks.php
<INSTALL_DIR>/system/application/config/hooks.php.sample
<INSTALL_DIR>/system/application/config/mimes.php
<INSTALL_DIR>/system/application/config/mimes.php.sample
<INSTALL_DIR>/system/application/config/routes.php
<INSTALL_DIR>/system/application/config/routes.php.sample
<INSTALL_DIR>/system/application/config/smileys.php
<INSTALL_DIR>/system/application/config/smileys.php.sample
<INSTALL_DIR>/system/application/config/user_agents.php
<INSTALL_DIR>/system/application/config/user_agents.php.sample

What this does is install a reference copy of each file (*.sample) that is not expected to be edited by the user. The actual file that CodeIgniter uses to render pages (no .sample suffix) is user-configurable as needed.

Then some crazy-looking shell code in the pkg-plist file makes sure that any edited files are not removed if the port is deinstalled or upgraded (reformatted for readability):

@unexec if cmp -s %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php.sample \

    %D/%%WWWDIR%/%%CI_CONF_DIR%%/autoload.php; then \

    rm -f %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php; else \

    %%ECHO_MSG%% "===> Customized %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php \

    has not been removed"; fi

%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php.sample

@exec if [ ! -f %D/%%WWWDIR%%/%%CI_CONF_DIR%%/autoload.php ]; then \

    cp -p %D/%F %B/autoload.php; fi

This concept needs to be implemented in several of the other ports that I maintain, including CakePHP and Prado. If anyone has a list of files that are user-configurable in each of those frameworks, please send it along!

Keep in touch,
Greg


Share this with others: del.icio.us:FreeBSD Port For CodeIgniter Upgraded to 1.6.1  digg:FreeBSD Port For CodeIgniter Upgraded to 1.6.1  newsvine:FreeBSD Port For CodeIgniter Upgraded to 1.6.1  furl:FreeBSD Port For CodeIgniter Upgraded to 1.6.1  reddit:FreeBSD Port For CodeIgniter Upgraded to 1.6.1  fark:FreeBSD Port For CodeIgniter Upgraded to 1.6.1  blogmarks:FreeBSD Port For CodeIgniter Upgraded to 1.6.1  Y!:FreeBSD Port For CodeIgniter Upgraded to 1.6.1  magnolia:FreeBSD Port For CodeIgniter Upgraded to 1.6.1

February 6, 2008

RSS Feed for FreeBSD /usr/ports/UPDATING

Filed under: Operating Systems — Tags: , — Greg Larkin @ 10:44 am

Hi everyone,

Since I’ve transitioned to FreeBSD, one thing I haven’t done regularly is keep track of the /usr/ports/UPDATING file. This file contains important information about incompatible changes to ports that could cause a port upgrade to break or yield unexpected results. Therefore, it’s important to check it before running a wholesale upgrade on a production server.

I’ve been using Awasu as my desktop RSS reader, and every time I find something I want to keep track of without having to remember to do so, I look for an RSS feed. The contents of the UPDATING file seem a natural fit for delivery as an RSS feed, but a few Google searches yielded no results.

Finally, I went straight to the freebsd-ports mailing list archive, and simply searched for “rss”. Lo and behold, Alex Kapranoff set up a feed back in 2005: http://lists.freebsd.org/mailman/htdig/freebsd-ports/2005-June/024285.html

The feed URL is http://kapranoff.ru/~kappa/files/ports.UPDATING.rss20.xml, for anyone who’s interested. Thanks Alex!

Keep in touch,
Greg


Share this with others: del.icio.us:RSS Feed for FreeBSD /usr/ports/UPDATING  digg:RSS Feed for FreeBSD /usr/ports/UPDATING  newsvine:RSS Feed for FreeBSD /usr/ports/UPDATING  furl:RSS Feed for FreeBSD /usr/ports/UPDATING  reddit:RSS Feed for FreeBSD /usr/ports/UPDATING  fark:RSS Feed for FreeBSD /usr/ports/UPDATING  blogmarks:RSS Feed for FreeBSD /usr/ports/UPDATING  Y!:RSS Feed for FreeBSD /usr/ports/UPDATING  magnolia:RSS Feed for FreeBSD /usr/ports/UPDATING
Pages: 1 2 Next

Powered by WordPress