Looks like initdb is just a tad too strict when checking to make sure
the data directory is empty. Yesterday I created a new data directory
as it's own filesystem (linux ext2), it includes a lost+found directory.
To initdb this means that the directory is no longer empty and it refuses
to run. While I hope to never need lost+found, e2fsck will recreate it
if it is missing (it is safer to create it when the filesystem is stable).
My quick fix to allow the lost+found directory:
--- src/bin/initdb/initdb.sh 2001/03/13 21:37:15 1.122
+++ src/bin/initdb/initdb.sh 2001/03/22 15:45:46
@@ -402,7 +402,7 @@# find out if directory is emptypgdata_contents=`ls -A "$PGDATA" 2>/dev/null`
-if [ x"$pgdata_contents" != x ]
+if [ x"$pgdata_contents" != x -a "$pgdata_contents" != "lost+found" ]then ( echo "$CMDNAME: The directory
$PGDATAexists but is not empty."
This fix works for ext2, but will (obviously) not work if the filesystem
uses something other than "lost+found".
Steve Stock
steve@technolope.org