Re: BUG #15810: Using custom directory on external HDD gives permission error

From: Omer Ozarslan <omerfaruko(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15810: Using custom directory on external HDD gives permission error
Date: 2019-05-17 03:29:15
Message-ID: CAMsVCmV05-RioKDHLKj-Z9Xinm9YiQtcC5YO-BxYzEeuvZqtHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, May 16, 2019 at 6:43 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Thu, May 16, 2019 at 04:15:39PM +0000, PG Bug reporting form wrote:
> > Is there some way to circumvent this check without changing format
> > of the HDD?
>
> That's weird. If the data folder fed to initdb already exists and is
> empty, then permissions on the path are enforced to 0700 or 0750 (if
> using --allow-group-access) automatically to prevent this error when
> starting Postgres for bootstrapping. If the path does not exist, then
> the data folder is created with proper permissions. In any case, you
> should not see this error.
>
> Are you using some specific mounting options?

I plug the HDD in and it gets mounted automatically. I'm not entirely sure
about default options used by Debian (Gnome 3?) for mounting it. These
might be relevant:

$ mount -t fuseblk
/dev/sda1 on /media/omer/My Book type fuseblk
(rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)

On Thu, May 16, 2019 at 6:59 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> I'm kind of disinclined to provide a way to skip the permissions
> check though, especially in view of the fact that there's no good
> reason to use a Windows filesystem as native storage for Unix.
>

I agree using exFAT on a linux system isn't ideal. I have an external HDD I
occasionally use with both Win7 and Debian hosts. I needed to store a few
TBs of data, so the available space in my HDD didn't suffice. I decided to
host it on external HDD. I had figured out support on linux for modifying
exFAT was way better than support on Windows for modifying ext4, hence I
had preferred going with exFAT for the external HDD format to begin with.

This database won't face production. I will be the only person submitting
queries. So, I hope performance degradation caused by using FUSE would be
acceptable in my case.

> There are other things that are likely to not work either, eg
> symlinks for tablespaces.
>

Would it be possible to provide a way to skip permission check and then let
it fail in case user needs to use these specific features? I don't expect
to use tablespaces for example. Does lack of these permissions (or other
unix fs features like symlinks) bring some limitations to the point the
database cannot function at all?

Best,
Omer

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Omer Ozarslan 2019-05-17 03:39:19 Re: BUG #15810: Using custom directory on external HDD gives permission error
Previous Message Amit Langote 2019-05-17 00:51:58 Re: inconsistent results querying table partitioned by date