What would I find in /var/lib/ directory?

23

1

I'm trying to do some detective work and am hunting down a PostgreSQL installation.

I've only got some low level access and cannot see inside the folder, but have found this likely candidate

/var/lib/pgsql/

Do you think my search is over?

Do you think my data is in there too?

I realise this is a highly stupid and speculative question. But I'm after a good guess.

in.spite

Posted 2009-08-10T15:19:12.847

Reputation: 1 457

It would be a lot less speculative if you told us how postgres ended up on the system. Was it compiled and installed manually? Or with a package manager? What Linux distro is this? – innaM – 2009-08-10T15:36:44.420

It was installed as part of another piece of software called Lyris Listmanager. I believe this is the flavour Red Hat Linux 7.3 with PostgreSQL 7.3.2 – in.spite – 2009-08-11T07:08:53.737

Answers

29

For a description of what usually ends up in the /Var directory: http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/Linux-Filesystem-Hierarchy.html#var

/var/lib

Holds dynamic data libraries/files like the rpm/dpkg database and game scores. Furthermore, this hierarchy holds state information pertaining to an application or the system. State information is data that programs modify while they run, and that pertains to one specific host. Users shouldn't ever need to modify files in /var/lib to configure a package's operation. State information is generally used to preserve the condition of an application (or a group of inter-related applications) between invocations and between different instances of the same application. An application (or a group of inter-related applications) use a subdirectory of /var/lib for their data. There is one subdirectory, /var/lib/misc, which is intended for state files that don't need a subdirectory; the other subdirectories should only be present if the application in question is included in the distribution. /var/lib/'name' is the location that must be used for all distribution packaging support. Different distributions may use different names, of course.

I would bet your data is in there, but not the executable files.

alumb

Posted 2009-08-10T15:19:12.847

Reputation: 1 354

4

/var/lib/pgsql is where Postgres stores all its internal data, including the data you put into a database. It's not, however, in a format that anybody could really see. Unlike MySQL which makes a separate file for each file and index, PostgreSQL stores its data in files with numeric names and in a dense opaque binary format.

Paul Tomblin

Posted 2009-08-10T15:19:12.847

Reputation: 1 962