SOLVED: Permissions of Files

evylrat
Posts: 106
Joined: Sun Jan 02, 2011 6:37 pm

SOLVED: Permissions of Files

Postby evylrat » Fri Feb 27, 2015 1:05 am

A casual glance through my files on Amahi last night (Amahi 6) led me to believe files are missing.
I jumped into /mnt/samba/directory and /var/hda/files/directory and sure enough permissions where mixed up.
I've had a mess around CHMODing both directories to 0755 and CHOWNing both to 1stadmin:users but it's still not letting me see some files, or delete some directories within that folder. Using PUTTY on my PC, some files in /var/hda/files/directory are in RED, rather than GREEN. Not sure what that means.
I notice there is also a mix of permissions on folders on all my shares; some are root, some are 1stadmin:users and some are user:500

What's the best way to reset all these permissions? CHMOD and CHOWN? I'm need details! I'm only a linux novice.

Thanks in advance.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Permissions of Files

Postby bigfoot65 » Fri Feb 27, 2015 12:54 pm

When you do the commands, they should look like this:

Code: Select all

chown -R 1stadminuser:users /var/hda/files/sharename chmod -R 775 /var/hda/files/sharename
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

evylrat
Posts: 106
Joined: Sun Jan 02, 2011 6:37 pm

Re: Permissions of Files

Postby evylrat » Sun Mar 01, 2015 10:05 am

Many thanks for this. I've ran this on the shares within /var/hda/files/
Now, the directory that's giving me trouble; there are files within /var/hda/files/ but they are NOT shown in /mnt/samba/
The files (as viewed in putty) in /var/hda/files/ appear in red.
lrwxrwxrwx 1 1stadminuser users 127 Apr 25 2014 Alpari_745374_2011-12-30.pdf -> /var/hda/files/drives/drive3/gh/Docs/Finance/Alpari/Alpari Account Statements/745374/Daily/2011-12/Alpari_745374_2011-12-30.pdf

Now, browsing to this folder gives me an permission denied. Is it safe to run the CHMOD CHOWN commands on the GH files / directoriest too?

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Permissions of Files

Postby bigfoot65 » Sun Mar 01, 2015 11:30 am

NEVER mess with the files in the /gh folders. This is explicitly mentioned on the Greyhole wiki page.

Recommend you stop mount_shares_locally, remove the directories, then start it:

Code: Select all

service mount_shares_locally stop rm -rf /mnt/samba/* service mount_shares_locally start
That should clear up anything that is incorrect.

If you still have files missing, then run the appropriate Greyhole commands to fix symbolic link. You can find this by doing:

Code: Select all

greyhole --help
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

evylrat
Posts: 106
Joined: Sun Jan 02, 2011 6:37 pm

Re: Permissions of Files

Postby evylrat » Mon Mar 02, 2015 11:11 am

I know you were going to say not to mess with GH, that's why I asked first :)
I stopped the mount shares locally service, removed the folders, restarted then ran FSCK with the FIND ORPHANED FILES option.
Still no joy yet.
Example;
1stuseradmin@hda:/mnt/samba/Docs/Finance/Alpari/Alpari Account Statements/745374/Daily/2011-12$
(no files shown)

1stuseradmin@hda:/var/hda/files/Docs/Finance/Alpari/Alpari Account Statements/745374/Daily/2011-12$ ls -l
total 88
lrwxrwxrwx 1 1stuseradmin users 127 Apr 25 2014 Alpari_745374_2011-12-01.pdf -> /var/hda/files/drives/drive2/gh/Docs/Finance/Alpari/Alpari Account Statements/745374/Daily/2011-12/Alpari_745374_2011-12-01.pdf

1stuseradmin@hda:/var/hda/files/drives/drive2/gh/Docs/Finance/Alpari/Alpari Account Statements/745374/Daily$ cd 2011*
-bash: cd: 2011-12: Permission denied

So the local mount point shows nothing, the files directory shows a load of red files, and the actual location won't let me access it.
No rush for this, just curious how some files have gotten "lost" on the drives. and I wonder how many more files have hidden themselves.

Just for completeness, a debug of one of the rogue files;
http://pastebin.com/Wf0d1773

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Permissions of Files

Postby bigfoot65 » Mon Mar 02, 2015 1:51 pm

The red indicates the file link is broken. Try this:

Code: Select all

greyhole -X
That will find a good copy of a file and repair the symbolic link.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

evylrat
Posts: 106
Joined: Sun Jan 02, 2011 6:37 pm

Re: Permissions of Files

Postby evylrat » Tue Mar 03, 2015 12:33 am

Ran that twice; once last night.
I noticed this morning that /var/hda/files/drives/ only contained one directory. So I rebooted and reran greyhole -X.
Same results as earlier.
/mnt/samba/Docs/ is empty
/var/hda/files/Docs/ shows lots of red symbolic links
/var/hda/files/drives/drive2/gh/Docs/ (and the other copies) shows access denied.
Just realised, that's something I didn't mention, this share is set to use maximum number of copies.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Permissions of Files

Postby bigfoot65 » Tue Mar 03, 2015 3:26 pm

The RED links indicate the file is missing. Did you check the Greyhole Trash? Wonder if the files are in there. Also since you have copies set to maximum, the files should appear on other drives in the /gh folder as well.

You can do:

Code: Select all

chown -R 1stadmin:users /var/hda/files
It will then set all files on the Greyhole drives to your 1st admin user as it is with the shares.

Is there something that occurred to your HDA that may have caused this? Not sure I understand how this could have happened on it's own.

BTW, I presume you are using command line to look at these files as root user. If not, that may be why you get permission denied.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

evylrat
Posts: 106
Joined: Sun Jan 02, 2011 6:37 pm

Re: Permissions of Files

Postby evylrat » Wed Mar 04, 2015 2:51 pm

BTW, I presume you are using command line to look at these files as root user. If not, that may be why you get permission denied.
Oh boy... Well, I ran as you suggested, followed by greyhole -X and the missing files are back.
Thank you very very much!

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Permissions of Files

Postby bigfoot65 » Wed Mar 04, 2015 2:54 pm

Awesome! So we can consider this resolved then I presume.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

Who is online

Users browsing this forum: No registered users and 10 guests