change permissions on subdirectory
by deretsigernu from LinuxQuestions.org on (#4YS1W)
Hi,
My computer dual boots Slackware 14.2-64-current and Windows 10. Along with partitions for the two OSes, I have another partition that has the file system ntfs-3g. I use this to store data that are used in both OSes, such as data spreadsheets or GIS files.
I installed PostgreSQL-12.1 on Slackware and I am working with the post-installation set up. From the documentation, these are the main steps:
Code:./configure
make
su
make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql testI created a new directory on the data partition as
/fat-d/projects_and_data/data/linux/pgsql/data
For step 7, "chown postgres /usr/local/pgsql/data", I modified the command to
Code:bash-5.0# chown postgres /fat-d/projects_and_data/data/linux/pgsql/databut when I check the directory, the ownership doesn't change.
Code:bash-5.0# ls -la /fat-d/projects_and_data/data/linux/pgsql/data
total 0
drwxrwxrwx 1 root root 0 Feb 1 11:23 .
drwxrwxrwx 1 root root 144 Feb 1 11:23 ..I'm not sure what exactly is causing this problem. I suspect it has something to do with the configuration somewhere, but not sure of that. I was wondering if it has something to do with fstab? Here is my /etc/fstab:
Code:/dev/sda7 swap swap defaults 0 0
/dev/sda5 / ext4 defaults 1 1
/dev/sda2 /boot/efi vfat defaults 1 0
/dev/sda4 /fat-c ntfs-3g fmask=133,dmask=022 1 0
/dev/sda6 /fat-d ntfs-3g fmask=111,dmask=000 1 0
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro,comment=x-gvfs-show 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs nosuid,nodev,noexec 0 0That's just a guess though. How would I get the new directory I created for PostgreSQL to be owned by user postgres? I don't want to create the ...pgsql/data directory on the linux partition because that partition is pretty small and could fill up quickly with data files.


My computer dual boots Slackware 14.2-64-current and Windows 10. Along with partitions for the two OSes, I have another partition that has the file system ntfs-3g. I use this to store data that are used in both OSes, such as data spreadsheets or GIS files.
I installed PostgreSQL-12.1 on Slackware and I am working with the post-installation set up. From the documentation, these are the main steps:
Code:./configure
make
su
make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql testI created a new directory on the data partition as
/fat-d/projects_and_data/data/linux/pgsql/data
For step 7, "chown postgres /usr/local/pgsql/data", I modified the command to
Code:bash-5.0# chown postgres /fat-d/projects_and_data/data/linux/pgsql/databut when I check the directory, the ownership doesn't change.
Code:bash-5.0# ls -la /fat-d/projects_and_data/data/linux/pgsql/data
total 0
drwxrwxrwx 1 root root 0 Feb 1 11:23 .
drwxrwxrwx 1 root root 144 Feb 1 11:23 ..I'm not sure what exactly is causing this problem. I suspect it has something to do with the configuration somewhere, but not sure of that. I was wondering if it has something to do with fstab? Here is my /etc/fstab:
Code:/dev/sda7 swap swap defaults 0 0
/dev/sda5 / ext4 defaults 1 1
/dev/sda2 /boot/efi vfat defaults 1 0
/dev/sda4 /fat-c ntfs-3g fmask=133,dmask=022 1 0
/dev/sda6 /fat-d ntfs-3g fmask=111,dmask=000 1 0
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro,comment=x-gvfs-show 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs nosuid,nodev,noexec 0 0That's just a guess though. How would I get the new directory I created for PostgreSQL to be owned by user postgres? I don't want to create the ...pgsql/data directory on the linux partition because that partition is pretty small and could fill up quickly with data files.