pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Deugau <kdeugau@vianet.ca>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: unable to find data folder postgres9.4
Date: Thu, 23 Mar 2017 14:30:02 -0400
Message-ID: <6b96a059-d2c1-7391-1fe2-b0b5e1b7b1bf@vianet.ca> (raw)
In-Reply-To: <CABzCKRDZ0m06GKRx1GjmScwQvi9jKStAY9AtX_joz+6qDx3KOg@mail.gmail.com>
References: <1490193308081-5951232.post@n3.nabble.com>
	<CY4PR11MB1575F84748E1F14AA8CCDFCEA73C0@CY4PR11MB1575.namprd11.prod.outlook.com>
	<1490198768108-5951275.post@n3.nabble.com>
	<CY4PR11MB157552D0A388434DB2E60E84A73C0@CY4PR11MB1575.namprd11.prod.outlook.com>
	<1490199328781-5951282.post@n3.nabble.com>
	<CAJ3VpNvrt2cr-w3+nxZB-OJgXjVZpmkpOZ+AmuoZxBYd+Pty=g@mail.gmail.com>
	<1490199989700-5951293.post@n3.nabble.com>
	<CABzCKRA4COJBOq-BZuPnJzxxp36V6WELhy_HH+g5LBQzKVZ+4A@mail.gmail.com>
	<1490279831325-5951533.post@n3.nabble.com>
	<CABzCKRCwtEojC6czNcEAcKYxhKx-KeLZT1ZRBeZAJAYjhE3ocw@mail.gmail.com>
	<1490286210389-5951559.post@n3.nabble.com>
	<CABzCKRDZ0m06GKRx1GjmScwQvi9jKStAY9AtX_joz+6qDx3KOg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (34+ messages)  latest in thread

Message-ID: <6b96a059-d2c1-7391-1fe2-b0b5e1b7b1bf@vianet.ca>
Permalink:  ../6b96a059-d2c1-7391-1fe2-b0b5e1b7b1bf@vianet.ca/
Also on:    postgresql.org/message-id/6b96a059-d2c1-7391-1fe2-b0b5e1b7b1bf@vianet.ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: kdeugau@vianet.ca
  Subject: Re: unable to find data folder postgres9.4
  In-Reply-To: <6b96a059-d2c1-7391-1fe2-b0b5e1b7b1bf@vianet.ca>
  References: <1490193308081-5951232.post@n3.nabble.com> <CY4PR11MB1575F84748E1F14AA8CCDFCEA73C0@CY4PR11MB1575.namprd11.prod.outlook.com> <1490198768108-5951275.post@n3.nabble.com> <CY4PR11MB157552D0A388434DB2E60E84A73C0@CY4PR11MB1575.namprd11.prod.outlook.com> <1490199328781-5951282.post@n3.nabble.com> <CAJ3VpNvrt2cr-w3+nxZB-OJgXjVZpmkpOZ+AmuoZxBYd+Pty=g@mail.gmail.com> <1490199989700-5951293.post@n3.nabble.com> <CABzCKRA4COJBOq-BZuPnJzxxp36V6WELhy_HH+g5LBQzKVZ+4A@mail.gmail.com> <1490279831325-5951533.post@n3.nabble.com> <CABzCKRCwtEojC6czNcEAcKYxhKx-KeLZT1ZRBeZAJAYjhE3ocw@mail.gmail.com> <1490286210389-5951559.post@n3.nabble.com> <CABzCKRDZ0m06GKRx1GjmScwQvi9jKStAY9AtX_joz+6qDx3KOg@mail.gmail.com> <6b96a059-d2c1-7391-1fe2-b0b5e1b7b1bf@vianet.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox