change permissions on subdirectory
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 /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/data Code:
bash-5.0# ls -la /fat-d/projects_and_data/data/linux/pgsql/data Code:
/dev/sda7 swap swap defaults 0 0 |
i'm slightly surprised that you would approach installing any software the "old fashioned way" .
Slackbuilds.org is usually my first port of call to read up on packages dependencies . So example You need a "postgres" user and group prior to building postgresql. Something like this will suffice for most systems: groupadd -g 209 postgres useradd -u 209 -g 209 -d /var/lib/pgsql postgres but that package is for stable and your on current; so i am . I use slpkg for "diligent" use to install . bash-5.0# slpkg -F postgresql Packages with name matching [ postgresql ] +============================================================================== | Repository Package Size +============================================================================== sbo postgresql-10.10 0 K conrad postgresql-12.1-x86_64-2cf.txz 9240 K |
I tried the sbopkg repository. It supplies 10.x and I keep getting an error message. Like
Code:
psql: could not connect to server: No such file or directoryIs the server running locally and acceptingconnections on Unix domain socket "/tmp/.s.PGSQL.5432"? Code:
postgres does not know where to find the server configuration file. Code:
groupadd -g 209 postgres |
I don't think that's the issue re: changing permissions.
Is /fat-d your NTFS partition? How have you mounted it? NTFS partitions CAN be used w/Unix permissions, although it requires a specific mount option that iirc may break Windows compatibility (I may be wrong about that, and even if I'm right there may be a new way that doesn't break it--it's been a while). |
conrad repo has the x12 conrad postgresql-12.1-x86_64-2cf.txz 9240 K
|
Quote:
Real file owners (and groups) are only supported on Linux(Unix) file systems. |
Quote:
|
Everyone else here is helping the OP, so I'd just like to inject one thing. If you're wanting to have partitions with common access from Win and Lin, then you should always format these partitions as FAT. Makes life much easier. A copy of my /etc/fstab with a win-lin common partition (vfat):
Code:
/dev/sda4 swap swap defaults 0 0 |
@captain sensible
Thanks for the suggestion. I'll look at adding the repo. @ehartman Thank you for answering my specific question. I realize that An Infamous Historian's answer contradicts your answer and I suppose I can try to look into that answer, but if doing as suggested messes up the Windows access to the partition, it kind of defeats the purpose of being able to access the partition from either OS. @vtel57 I used VFAT on one of my earlier laptops that was dual boot. I don't remember what made me switch to NTFS. I think something at the time (years ago now) indicated that NTFS was more reliable. Maybe faster? That might have been when I was using Red Hat as my linux partition. Now, I don't know the exact advantages and disadvantages of using VFAT or NTFS, but so far, NTFS has worked fine on my last 2 dual boots. If VFAT lets me have the mixed linux permissions more easily though, it might be a better option for me. That's going to take some time to figure out. Thanks for mentioning it and giving me some food for thought. |
Well, a FAT32 partition definitely has its drawbacks (file size limits, etc.), but I've always found it easier to work with in Linux.
Anyway, glad you got some help here. Hopefully, you'll get your system all squared away as you need it to be. Cheers! ~Eric |
Quote:
Code:
chmod +x /etc/rc.d/rc.postgresql Quote:
|
Maybe I'm just being dense but in some 20 years of using Slackware as my main I've never had difficulty with NTFS in Linux or in Windows, though I rarely ever even boot an ancient Win7 partition. Point being I find no compulsion or value in reverting to FAT of any kind though the new exFat may be a decent change... I wouldn't know.
All I have ever done is use the fmask and dmask entries just as vtel57 does but on NTFS like this Code:
###excerpt from /etc/fstab### ##NOTE : As applies to installation, although I sometimes just build from source and don't bother with a Slackbuild when no new dependencies are involved (not that Slackbuilds are any bother at all... prolly just habit) still I avoid "make install" simply because it makes uninstall difficult and lacks support data. I either make my own slackbuild or at the very least just "makepkg" so it appears in /var/log/packages/ and is easily uninstalled or upgraded.... ... and speaking of which, why in Hell have some devs in other "more mainstream" distros chosen to cease using the oh so obvious and useful /var/log/packages? Do these people have nothing better to do than make Linux unnecessarily complex? |
@enorbet, do you mean that you have an NTFS partition that has multiple ownerships on it, like what I'm trying to do? My fmask and dmask settings are the same as yours, but I can't create a folder while I'm logged into Slackware that is owned by anyone but root.
Regarding package installation, your description is helpful. I did not know about makepkg or skipping make install. To be clear, if I skip the "make install", I have to either make a custom slackpkg or or use makepkg to finish the install? |
Hi @deretsigernu,
In NTFS-3G FAQ: https://www.tuxera.com/community/ntf...q/#permissions Quote:
Cheers |
@mumahendras3, that link provides a lot of useful information. I will read the material and try to make sense of it. Thanks for pointing to the documentation. I didn't think it was an issue with NTFS-3G, but mount, so getting through NTFS-3G may do the trick for me.
|
I did read up some on NTFS-3G. Looked at most of the software author's site. I tried to get on the forum to ask my question, but like this LQ user indicated, I couldn't find how to register.
As mumahendras3 pointed out, sounds like I need to map the users, Windows and Slackware, on /fat-d. This gets to my question. If I do the mapping (haven't actually tried it yet), do I need to then designate each file with an user/owner? It's unclear to me how NTFS-3G will know which user has permissions on which file. There are thousands of files on that drive and I'm fine with leaving everything as is. I'd rather not have to map users to all the files. I just need to get that one data directory I mentioned above mapped, I guess, to the Slackware postgres user, so that PostgreSQL will function with that directory. |
I finally got my partition configured. Using the definitions found here, I didn't map the users. Instead I changed my fstab file. The line for my "data" partition in fstab, called "/fat-d", was originally:
Quote:
For example, if I Quote:
Quote:
I don't know if it's the most secure set up ever. I've got back-ups and nothing sensitive here. Anyway, I'm glad I got this pulled off. |
All times are GMT -5. The time now is 07:13 AM. |