New Jersey’s source for Open Source Consulting since 1998

More Samba fun OR “unable to find suitable server”

September 5th, 2008 by faber

For anyone following the saga, I’ve been trying to do a migration NT4 (yes, NT 4) to Samba running LDAP as a backend.  I’ve done migrations in the past and they have not been this painful.  Here’s the latest goodie:

As part of the migration, you ned to get the SID from the NT 4 PDC. And as every piece of documentation that I’ve come across says, you do that with the following command:

net rpc getsid -S DOMAINNAME -U Administrator%password

and you should see something like this:

Storing SID S-1-5-21-123456789-123456789-123456789 for Domain DOMAINNAME in secrets.tdb

That’s what ALL the books and web pages and everything else I’ve come across said to do. I could swear it was working on Monday but Tuesday afternoon when I ran the code I got this:

Unable to find a suitable server.

After fighting with this since Tuesday afternoon (it’s now Friday morning), digging out my old NT books, firing up Wireshark and digging into NetBIOS calls, I have finally found the solution, dear friends, and I am here to tell you what that solution is so you don’t waste several days with this problem.

And that solution? What is it, you ask?

Give the command the IP Address of the PDC. IOW,

net rpc getsid -S DOMAINNAME -I 192.168.1.88 -U Administrator%password

Why do none of the docs say this?

Back to the migration…

Technorati Tags: , ,

Problems with Samba and vampiring an NT 4 DC

September 2nd, 2008 by faber

I’m trying to migrate an NT 4 Enterprise Edition PDC to a Samba 3.0.23 BDC running on Suse 10.2. According to everything I read, this should be easy, but it’s not working.

If I do
net rpc vampire -S WINNT -W MYDOMAIN -U Administrator

I get
[2008/09/02 17:59:07, 0] rpc_client/cli_pipe.c:cli_rpc_pipe_open_schannel(2673)
cli_rpc_pipe_open_schannel: failed to get schannel session key from server WINNT for domain MYDOMAIN.

[2008/09/02 17:59:07, 0] utils/net_rpc.c:run_rpc_command(151)
Could not initialise schannel netlogon pipe. Error was NT_STATUS_INVALID_NETWORK_RESPONSE

If I set server schannel = no and client schannel = no, I get

Fetching DOMAIN database
Failed to fetch domain database: NT_STATUS_INVALID_COMPUTER_NAME

And The Goog is of no help. :-(

I guess the next thing to try is a reinstall?

Technorati Tags: , , ,

Solved:Mutt’s not seeing new emails!

August 8th, 2008 by faber

For the past couple of weeks, mutt hasn’t been seeing any new emails coming in. I have the regular setup: fetchmail handing off the emails to procmail and in my .muttrc I have several mailboxes configured.

After sending myself numerous emails and watching the [acm]times with the stat command, I found the problem: Google Desktop!

Google Desktop was indexing my mailboxes as soon as they were being written to thereby changing the mtime and atime which is how mutt determines whether new email is waiting.

Solution: either turn off Google Desktop (a rather severe solution, if you ask me) or, better yet, tell GD to not index your mailboxes folder via the Preferences.

BTW, I’m under the impression that if you use maildir format, you won’t have this problem (I use mbox format). I’ve yet to test this theory.

Technorati Tags: ,

Troubleshooting a hard drive crash, part deux

July 29th, 2008 by faber

In an earlier post, I gave you the the data needed to diagnose a hard drive failure and several symptoms of the failure. In this post, we’ll go over my observations and fixes.

First problem

I mentioned that partitions 6 and 7 were complaining of errors. Naturally, the way to fix these is to run a file system check on the partitions. The relevant fstab entries tell us that the partitions have ext2 file systems on them, so running fsck is called for.

Oh, but wait, we don’t have the root password. No problem, we boot into KNOPPIX and run fsck from there.

But what partitions do you run fsck on? Note that fdisk -l reports the partitions on /dev/sdb but fstab reports partitions on /dev/sda! They can’t both be right, can they?

Yes, they can. While we only have one hard drive, which I verified by actually opening up the machine (remember, ALWAYS check your assumptions!), we have two different operating systems, each of which does things slightly differently. My guess is KNOPPIX saw the RAID controller as /dev/sda and the hard drive as /dev/sdb whereas the original operating system, Mandrake 10.1, was using the RAID drivers and saw the drive as sda. So I knew it was safe to run fsck.

Second problem

This problem is trickier. According to fdisk -l, we have a FAT file system smaller than 32 M, but the client tells us he has 45 GB of data stored on this partition. So what gives?

Look very closely at the output of fdisk. You’ll notice three things:

  1. partition 8 is only one block long,
  2. there is no partition 9, and,
  3. there is a three block gap between the end of partition 7 and the beginning of partition 8

Item one tells you the partition table is corrupt; it doesn’t make any sense to have a partition that’s one block long.

Item two may indicate that someone removed the partition but forgot to take it out of fstab and while that would cause major problems on booting, it wouldn’t stop us from booting. Besides, the clients didn’t have the technical know-how to do that.

Item three, while technically is allowed (meaning there’s nothing stopping you from doing it), it’s just a Bad Thing.

So, how to fix it? If we knew how big partition 8 or 9 was, we could calculate how big the other partition was, but we don’t have that info. We know from fstab that partition 9 was the /tmp directory and since the /tmp directory doesn’t have to be on a separate partition (although it is Good Practice), we can ignore it. So I made an executive decision and reset partition 8 to be the rest of the drive.

Now we have a new problem

With the new partition 8 now spanning the old 8 and 9 partitions, we are going to have problems with the filesystem on the new partition, namely, the superblock is corrupt and the files from the old partition 9 won’t “fit” into the new filesystem. Since old partition 9 was originally mounted on /tmp, I don’t care what happens to that data, so we’re left with the superblocks problem.

Running fsck complained that no superblock could be found. The canned response to that is “use a backup superblock”. The trick is to find one. The easiest way is to use the testdisk utility that is part of KNOPPIX. testdisk found backup superblocks at 32768, 98304, and 163840. So running fsck -b 32768 -B 4096 fixed the filesystem!

N.B.: Notice that the first superblock was found at the 32768/4096 - 1 = 7th backup position. It looked like the backup superblocks at positions 1, 3, and 5 were corrupted (yes, we’re using spares superblocks). Fortunately, I decided to use testdrive instead of trying each backup superblock in turn until I found one.

At this point, I rebooted the machine and…

It boots!

Well, sorta’. The system complained that /var/run didn’t exist. I have no idea why it didn’t exist, but it was easy enough to fix. Reboot and the system came up, except for Webmin. After checking the proper directories and config files which, naturally, had not changed, I did a strace -f -o strace.out /sbin/service webmin start to discover that webmin couldn’t write to /var/run/webmin. Another easy fix and a reboot.

Finally, the system booted and was running normally!

Technorati Tags: , , , ,

Troubleshooting a hard drive crash

July 29th, 2008 by faber

I got a call today from a new client, M. Four years or so ago, M’s company bought a Linux-based file server from a local company that is now defunct. Some time ago, the mirrored drive went bad and the system kept running as Linux systems are wont to do. Unfortunately, the now-defunct company didn’t set up the machine for the standard practice of emailing periodic announcements of hardware status.

Sometime last week, the last drive died. M did the usual things to bring it back, but eventually took it to a data recovery company that was able to clone the drive. When M got the drive back to the office and put it in the machine, he got errors about “no superblock found on /dev/sda8″. He called me first thing this morning.

I won’t go into all of the gory details about diagnosing the problem; I’ll just give you the meat of the problem: when the system booted, the following were found:

  • partitions sda6 and sda7 had errors
  • partitions sda8 and sda9 complained of no superblock
  • booting into Knoppix and running fdisk showed the following (block count omitted):
  • Device    Boot      Start         End       System
    /dev/sdb1   *           1         318       Linux
    /dev/sdb2             319       19929       Linux
    /dev/sdb5             319         445       W95 Ext'd (LBA)
    /dev/sdb6             446        1719       Linux
    /dev/sdb7            1720        3631       Linux
    /dev/sdb8            3634        3635       FAT 16 < 32M
  • and /mnt/sdb1/etc/fstab showed the following:
    /dev/sda1        /
    /dev/sda8        /home
    /dev/sda9        /tmp
    /dev/sda6        /usr
    /dev/sda7        /var
    /dev/sda5        swap
  • despite copious documentation, no one knew the root password.

From this data, you should be able to figure out what is wrong with the system.

Can you tell me how to fix it? :-) I’ll tell you how I fixed it in a later post.

Technorati Tags: , , , , ,

My Android Application Is Alive!!!!

July 6th, 2008 by faber

I’ve got my first Android application written! It’s a lame little todo list, but it’s MY lame little todo list! :-) And the best part is, I was able to backport it to userspace version mc3 and my lame little app is running on the Nokia n810!

Yes! It’s ALIVE!!!!!!!!!!!!!!

Now to get maps and GPS working…

Technorati Tags: , , ,

Hacking Android fun

July 5th, 2008 by faber

This holiday weekend, I’m spending my time just hacking Google’s Android. I’m writing a location-based todo list (yes, a unique idea, I know). The purpose of the exercise is to learn how to write Android code in Eclipse.

So far, it is a fun experience. I’m only one day into a three-day personal hackathon but I’ve got something working already. I need to add a little more database code, write the GPS stuff and then put it on the n810. I’ll let you know how much progress I make today.

One thing I’ve noticed though: Although Eclipse is a pretty cool IDE and Android seems like a good framework, I can’t help feeling like I’ve done this before. The design patterns are defintely the same ones I used 25 years ago. Sure, the IDE was Turbo C and the framework wasn’t object-oriented but it still feels the same.

And since a car analogy is always an appropriate metaphor for a technical topic, I’ll repharse the above to ask “Why does it feel like I’m driving an ‘85 Camaro with spinning LED rims?”

Anyway, back to the hack…

Technorati Tags: , ,

symfony and Open Flash Charts

June 28th, 2008 by faber

I’ve been playing with symfony for a project I’m working on called Intelligence Exchange. So far, it’s been pretty cool, even if the learning curve is a bit steep.

As a sub-project, I want to write a cool-looking dashboard to monitor database activity. After looking around a while, I stumbled upon OpenFlashCharts. It looks good, it’s free and, best of all, it’s Free. I’m really looking forward to digging through its code RSN since I’ve been wanting to learn Flash. There’s even a symfony plugin for OpenFlashCharts! What more could one ask for?

Better frakkin’ documentation, that’s what! On the plugin download page, the example they give doesn’t work (on a properly configured system anyway).

If you look at the example given, the code snippet at the bottom of the page for the view template is this:


<? use_helper("OpenFlashChart"); ?>
...
...
...
<?= open_flash_chart( 300, 300, 'example/chartData'); ?>

Well, on my Macbook running php5, that <?= thingie does nothing. Why? Because “short open tags” (SOT), as they are known, are A Bad Thing and no one should be using them in this day and age. Hell, the general consensus back in the year 2000 was not to use them! Why they’re still being allowed eight years later is another bitch I’ve got with the designers of PHP!

The above isn’t quite true. Even with the short open tags, the code was *still being executed*. My system is configured NOT to use the SOT. To me, <sarcasm>and I may be a bit naive here </sarcasm>, if something is configured not to work, I expect it not to work! but I was able to sprinkle echo commands throughout the Helper code and see the results! IOW, the code was still being executed! WTF?!

To make the above example work, change the above line to read like this:


<?php echo open_flash_chart( 300, 300, 'example/chartData'); ?>

now the example pie chart shows up!

Technorati Tags: , , , , ,

More Android Fun with the Nokia n810

June 24th, 2008 by faber

Well, I got the touchscreen working, thanks to the android_touchscreen_neov2.diff patch.

This tutorial is pretty good for getting Android running on the 810. If you go with the “Doing it the hard way (from source)” method, you’ll find there are a three problems with it:

  1. I forget what the first problem is. :-)
  2. The second problem is in the step 7 “Download (and build!) busybox”. After you do ‘make menuconfig’ you need to configure busybox to create a statically linked binary. The default configuration (using shared libraries) does not work. To make a statically linked binary, go to “Busybox Settings” -> “Build Options” and select “Build BusyBox as a static binary (no shared libs)”. If you don’t do this, you will get the error “not found” when you try to tar the system files in step 11.
  3. There’s something flaky wrt the file system directions. Following his steps caused the cylon eye to repeat forever. Using his “binary” in the first section worked perfectly. I’ll let you know when I track the down the problem (unless I am the problem, of course :-).

One thing I noticed is I have Wifi capabilities in Android when there aren’t supposed to be any Wifi drivers since the existing ones are proprietary. A colleague of mine noticed the same thing, but he got Wifi only after properly configuring OS2008 before booting into Android.

So, I’m beginning to wonder: is Android an OS and an application stack, or “just” an application stack? I’ve got to do some more research on this but probably not this week; I’ve got paying clients that need attending to.

So, until then, as the captivating Nadia G. used to say…

Alla prossima!

Technorati Tags: ,

Hacking the Android

June 23rd, 2008 by faber

Well, I finally got to play with Google’s Android this weekend. I “installed” a version of it on a Nokia n810. I say “installed” because the procedure was simply (?!) flashing a new kernel and running a script from the micro-SD card. I’ve got to look into the code some more, build a custom kernel, boot into init, and all that Good Stuff. Then I have to read up on the SDK and start hacking away.

The Nokia n810 is a nice little machine. My only complaint is the default font size in the browser is too small. Imagine taking all of the content you see in your browser window on your desktop and then shrinking it down to a screen that fits easily in your palm. Yeah, it’s a little hard to read.

The whole process took me back to Ye Olde Days of Linux (ca. 1995) when compiling kernels was de riguer, and you had to search all over the place for patches, and the instructions weren’t always quite right.

It looks like I may be playing with this alot more in the near future! Keep your fingers crossed!

Technorati Tags: ,

« Previous Entries  


Linux New Jersey powered by WordPress Wordpress Template Design was Done In Style.
Entries (RSS) and Comments (RSS).