Actually, it was me that mentioned the find command and that was just a starting point for the debug process.
First, regardless of how you choose to proceed, I would recommend that you ensure that you have a backup copy of your drive since experimenting with the only copy you have is inherently dangerous.
I’ve never used an hfsplus formatted drive with Linux but it appears to be supported so that is not necessarily a problem. If it were me, though, I would use an ext4 filesystem as that is pretty much the de facto standard with Linux. That would require you to either repartition your existing drive (DANGER: This would result in a total loss of data, which means you need a copy of the drive before proceeding) or you could use another drive, partition and format it to use ext4 and then copy everything onto it.
Should you choose to proceed with the hfsplus formatted drive… look for a line in /etc/fstab that defines the mount point for /mnt/usb1. (fstab is what describes the drive to Linux and tells it where and how to mount it.) Most likely, you have specified ‘ro’ on that line instead of ‘rw’. To correct this, you need to edit /etc/fstab as root and change that to ‘rw’ instead (I recommend making a copy just in case you suffer fat finger syndrome.) After saving the modified file, as root, execute: “umount /dev/sda2” and then either “mount /mnt/usb1” or just “mount -a”. In theory, your problem ‘could’ be fixed at this point but, as BobSnot pointed out, possibly not if journaling is enabled. I also found this (mounting hfsplus rw on linux – rudis worklog) when I did a search for hfsplus filesytems under Linux. The dmesg command may give you a more definitive answer as to whether this is a viable alternative or not.
Speaking to the commands I gave you in my original reply, my assumption was that not all of the files/directories were owned by your account or plex so, in order to act upon ALL of them, you either needed to ‘su’ to root (which would require the root account to be defined as a login account which, by default, it is not under Linux) or you needed to prefix the commands that I gave with ‘sudo’ (which you appear to have done later, when you got the file system is mounted read-only error). The intent of the permissions that I gave you was to determine whether your problem was being caused by some combination of directory/file ownership and/or permissions. The reason for using find instead of just doing a recursive chmod is to ensure that the execute bit gets set correctly, depending upon whether the object is a directory or a file. Typically, you are going to want to have permissions of 755 on directories and 644 on files (read/write to owner and read only to everyone else for files, with the execute bit set for directories.) I intended to have you open up write permissions to directories to 777 temporarily, to see if it was an ownership problem and, later, change the permissions to 755 after any errant ownership was straightened out.
Given the above, you should consider the following when setting up the ownership and permissions of your library(ies):
- Out of the box, the plex account is defined as nologin, meaning you cannot directly login to it nor can you su to it, so you cannot directly issue commands using the plex account.
- If everything is owned by the account/group combination plex:plex (I’m betting it isn’t), you need to use ‘sudo’ (to run commands as either root or plex) to manage your files. If you are happy using sudo for every command you execute then run a recursive chown plex:plex and stop reading here.
- If everything is owned by an account/group other than plex:plex then you can manage your directories and files using that account but plex is going to have difficulties recording live tv and deleting files (you can allow users to do this this via settings in plex).
The caveat to #2 and #3 is if your personal account and plex are both members of the same group, all of your directories are owned by that same group and the group write bit is set on all of the directories, then both plex and your personal account (or any other account that is a member of the group, for that matter) can manage the files/directories.
The caveat to the caveat is that this applies ONLY to existing directories UNLESS you specifically manage the group ownership and group permissions of any new directories OR the setgid bit is set on the directories AND the umask in effect at the time any new directory is created is set to 002. Basically, setgid on a directory causes any directory created within it to take on the group ownership of the parent directory and the umask 002 causes directory permissions to default to 775 and file permissions to default to 664.
The caveat to the caveat to the caveat is that umask is not an absolute. It is more of a suggestion that can be overridden/ignored within scripting and/or executables, which appears to be the case with plex. Therefore, even if setgid is set on the parent directory and new directories are created with the desired group ownership, the group write bit is NOT set and only the plex account can manage the directory.
As I stated in my original reply, I have opted to keep ownership of my main (or ‘permanent’) libraries under my own account/group instead of plex:plex ownership. Doing so prevents anyone (i.e. a guest, family member, a pet randomly stepping on a remote control, etc.) from deleting any of my source files via the plex application, regardless of what the setting in plex may be set to. The only exception to this is my live tv/dvr library directories, which are under plex ownership with 777 permissions. This allows me to run a script under my own id via cron to convert the huge ts files down to a more manageable mp4 file, which is then stuffed into a recorded tv/movie library as appropriate. I opted for the wide open approach since the default umask for plex appears to be 022 and, well, I was just too lazy to figure out whether plex would respect a ‘umask 002’ command or not or where to add it if plex did. (Sorry ChuckPa, but this is a use case that contradicts you on the use of 777 permissions…) Because plex defaults to umask 022, I do periodically need to run a chmod on any new directories created by the dvr process so the scripting can manage the files within them. If anybody knows where I can add a umask 002 command and have it take effect, I would appreciate the information.