Re: [ADMIN] unable to find data folder postgres9.4

Поиск
Список
Период
Сортировка
От Kris Deugau
Тема Re: [ADMIN] unable to find data folder postgres9.4
Дата
Msg-id 6b96a059-d2c1-7391-1fe2-b0b5e1b7b1bf@vianet.ca
обсуждение исходный текст
Ответ на Re: [ADMIN] unable to find data folder postgres9.4  (John Scalia <jayknowsunix@gmail.com>)
Ответы Re: [ADMIN] unable to find data folder postgres9.4  (srilinux <srilinux09@gmail.com>)
Список pgsql-admin
John Scalia wrote:
> At a
> minimum, every mounted filesystem contains a directory in it called
> "lost+found", so if you don't see that, it may not be a proper
> filesystem, or the mount is broken. Without knowing what you're using
> for the disks, or the O/S, it's hard for me to guess what you really
> should have or if it's broken.

Bind mounts are closer to "hard link across filesystems".  The mounted
directory may or may not actually be at the root of the physical
filesystem it lives on.

So, for instance, if I have /dev/bigdisk mounted to /mnt/bigdisk, I can
then bind mount /mnt/bigdisk/kdeugau-media to /home/kdeugau/media, and I
will not see a lost+found in /home/kdeugau/media.

Personally, the main use case I've found for bind mounts is to fool
programs that refuse to follow symlinks into effectively doing so anyway.

srilinux wrote:
> All Thank you very much for providing your inputs
>
> Now after reboot I can see the pgsql data
>
> I am trying to bind mount to new storage allocated
>
> when I do so it is empty again
>
> any suggestions ?
>
> echo "/ProdD/NusAp1/pgsql /var/lib/pgsql bind bind 0 0" >> /etc/fstab
>
>  mount --bind /ProdD/NusAp1/pgsql /var/lib/pgsql
>
> cd /ProdD/NusAp1/pgsql   is empty and /var/lib/pgsql is also empty

This reads to me like you've been using whatever filesystem
/var/lib/pgsql is on, and now you need to expand, but you've just gone
and mounted the new filesystem space over top of /var/lib/pgsql without
copying the files into the new space.

In this respect, a bind mount acts just like any other filesystem mount,
and not a symlink or hard link.  You need to copy or move the files from
the target (eg, /var/lib/pgsql) into the new location before mounting
the new filesystem to the old location.  Otherwise you end up with both
locations (apparently) empty.  Your files are still safe on the old
filesystem, but you won't be able to access them.

Make sure to stop Postgres before copying the files, and I'd suggest
copying instead of moving to make sure things work before arranging to
actually delete the originals.

-kgd


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

Предыдущее
От: John Scalia
Дата:
Сообщение: Re: [ADMIN] [ADMIN] Replication mode Master-Slave - maintenance question.
Следующее
От: srilinux
Дата:
Сообщение: Re: [ADMIN] unable to find data folder postgres9.4