vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I'm trying to move my databases to another drive. With postmaster off, I create: /home/pgsql mv /var/lib/pgsql/data/base /home/pgsql/ I make sure that /home/pgsql is owned by postgres, and only 'rwx' for the owner. All the permissions look fine. from /var/lib/pgsql/data, I do ln -s /home/pgsql/base Of course the link permissions look like: lrwxrwxrwx 1 postgres postgres 16 Sep 28 14:21 base -> /home/pgsql/base The postmaster starts, but attempts to access the database complain that permission is denied: $ psql -l psql: FATAL: could not access directory "/var/lib/pgsql/data/base/1": Permission denied Any clues about why this won't work? I've searched the archives, but most references were to invalid permissions on the directories and I'm pretty sure I've got those right. All my pgsql dirs look pretty much like: drwx------ 3 postgres postgres 4096 Sep 28 14:21 pgsql Both in the original /var/lib/pgsql area, and the /home/pgsql area. ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |
| |||
| Hi Jeffrey Jeffrey Tenny wrote: > I'm trying to move my databases to another drive. > > With postmaster off, I create: > > /home/pgsql > > mv /var/lib/pgsql/data/base /home/pgsql/ > > > I make sure that /home/pgsql is owned by postgres, and only 'rwx' for > the owner. All the permissions look fine. > > from /var/lib/pgsql/data, I do > > ln -s /home/pgsql/base > > Of course the link permissions look like: > > lrwxrwxrwx 1 postgres postgres 16 Sep 28 14:21 base -> /home/pgsql/base > > > The postmaster starts, but attempts to access the database complain > that permission is denied: > > $ psql -l > psql: FATAL: could not access directory "/var/lib/pgsql/data/base/1": > Permission denied > > > Any clues about why this won't work? > I've searched the archives, but most references were to invalid > permissions on the directories and I'm pretty sure I've got those right. > > All my pgsql dirs look pretty much like: > drwx------ 3 postgres postgres 4096 Sep 28 14:21 pgsql > > Both in the original /var/lib/pgsql area, and the /home/pgsql area. > Try to issue chown -R postgres.postgres /home/pgsql Sergiusz ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| |||
| Jeffrey Tenny <jeffrey.tenny@comcast.net> writes: > I'm trying to move my databases to another drive. On what platform? One theory that fits the available facts is that you're running on a machine with SELinux enabled; the usual selinux policy forbids the postmaster from accessing files outside /var/lib/pgsql. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| |||
| Sorry, I take that back. The platform is Fedora Core 4, so SELinux may be a concern, though during the installation I selected all the minimal options for SELinux because I wasn't prepared to deal with it. Apologies for the previous incorrect answer, I was typing it on a Redhat 9 machine :-) Jeffrey Tenny wrote: > The platform is Redhat 9, so no SELinux. > > Tom Lane wrote: > >> Jeffrey Tenny <jeffrey.tenny@comcast.net> writes: >> >>> I'm trying to move my databases to another drive. >> >> >> >> On what platform? >> >> One theory that fits the available facts is that you're running on a >> machine with SELinux enabled; the usual selinux policy forbids the >> postmaster from accessing files outside /var/lib/pgsql. >> >> regards, tom lane >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 6: explain analyze is your friend >> > ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| The platform is Redhat 9, so no SELinux. Tom Lane wrote: > Jeffrey Tenny <jeffrey.tenny@comcast.net> writes: > >>I'm trying to move my databases to another drive. > > > On what platform? > > One theory that fits the available facts is that you're running on a > machine with SELinux enabled; the usual selinux policy forbids the > postmaster from accessing files outside /var/lib/pgsql. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend > ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| |||
| Sergiusz Jarczyk wrote: > > Try to issue chown -R postgres.postgres /home/pgsql > I checked the ownership, and it was already ok because aside from the 'root' creation of the alternate directory location and assigning it the correct ownership and permissions, I did the 'mv' of the old directory to the new location logged in as 'postgres'. Ditto the symlink creation (did it as 'postgres'). ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |
| |||
| I've been focusing on the potentially simpler case of just relocating the 'base' directory, so that I don't have to worry about whether postmaster is finding my config files and such. I was hoping the symlink would be a pretty transparent operation, and it doesn't seem that other people have had difficulty doing similar th ings. Sergiusz Jarczyk wrote: > Hi again > Have you tried to run the postmaster with the new location by hand, i.e.: > postmaster -i -D /home/pgsql > > Sergiusz > > ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |
| |||
| Hi again Have you tried to run the postmaster with the new location by hand, i.e.: postmaster -i -D /home/pgsql Sergiusz ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |
| |||
| Jeffrey Tenny <jeffrey.tenny@comcast.net> writes: > Sorry, I take that back. The platform is Fedora Core 4, so SELinux may > be a concern, though during the installation I selected all the minimal > options for SELinux because I wasn't prepared to deal with it. Better check what /usr/sbin/getenforce tells you, then... or look in /var/log/messages to see if the postmaster's operations are being refused. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| ||||
| Tom Lane wrote: > Jeffrey Tenny <jeffrey.tenny@comcast.net> writes: > >>Sorry, I take that back. The platform is Fedora Core 4, so SELinux may >>be a concern, though during the installation I selected all the minimal >>options for SELinux because I wasn't prepared to deal with it. > > > Better check what /usr/sbin/getenforce tells you, then... or look in > /var/log/messages to see if the postmaster's operations are being > refused. > Interesting. getenforce says "Enforcing". There are no suspicious messages in /var/log/messages or any other log I can find there. ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |
| Thread Tools | |
| Display Modes | |
|
|