Device is busy and is mounted multiple times

So, I’ve got a mount point that is used by a backup script, it seems that this script has been mounting the remote device via samba and not unmounting (umount) it at the end of it’s task. Now the server has it’s knickers well and truely in a knot. I know a good old fashioned reboot will sort it out, but I don’t want to do that.

umount as a normal user returns
[code]umount: it seems /mnt/o is mounted multiple times[/code]

When run as root it returns (6 times)
[code]umount: /mnt/o: device is busy[/code]
Continue Reading »

Technorati Tags: ,

Find the difference between two folders or drives

I’ve got a hard disk with bad sectors and I’ve also got a shiney new one. So I’ve copied over the files from the old drive to the new. Alas, I’ve had to click “Skip” to get past the bad files and I have no idea which files didn’t make the transfer. A quick search online for a nice tool to compare the two drives has left be empty handed. I searched for “dirdiff” and everything, but nothing. And anyway I don’t want do know if the files are different, only what files are missing.
Continue Reading »

Vacuuming of database failed to re-find parent key.

So then, it’s late in the day, the database is long overdue a vacuum so I set it off and left it. Apparently it fails two minutes in with:

vacuumdb: vacuuming of database "xxxxxx" failed: ERROR: failed to re-find parent key in "pg_class_relname_nsp_index"

So, after changing my underpants. I find the cure quite quickly with:

REINDEX INDEX pg_class_relname_nsp_index;

Thank the lord for that. Lesson of the day. Don’t switch off vacuum with postgresql because postgres don’t like it!

Technorati Tags: , ,

Using the MaxMind geoip database - Part 4 - Testing the longitude and latitudes

Just a simple bit of code this, almost an evolution of the previous test program. It looks up your own ip address and spits out the longitude and latitude of your country. On with the code! Continue Reading »

Using the MaxMind geoip database - Part 3 - Getting the longitude and latitudes

I thought this was going to take me ages and I was going to have to spend year finding a database of coorditates for countries. I was wrong, my search led me to the MaxMind site again. Their data comes from the CIA World Fact Book, but they’ve compiled it into a nice list for us.

I’m over simplifying the situation again here, but I’m created a simple table to which we’ll match up country codes from the geo_ip data to the country codes in the latlon list. Later I think I’ll be delving into a proper country database with foreign keys and stuff. But not now. Firstly this program will get the codes into the database. Place those codes into a file and upload to your site, then run this php code. Continue Reading »