initdb and data directories with lost+found

Поиск
Список
Период
Сортировка
От Steve Stock
Тема initdb and data directories with lost+found
Дата
Msg-id 20010322114105.A501@logjam.technolope.org
обсуждение исходный текст
Ответы Re: initdb and data directories with lost+found  (Peter Eisentraut <peter_e@gmx.net>)
Re: initdb and data directories with lost+found  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: RELEASE STOPPER? nonportable int64 constants in pg_crc.c
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Re: pg_upgrade