LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to change access to flash drive? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-access-to-flash-drive-4175416347/)

susja 07-12-2012 08:41 AM

How to change access to flash drive?
 
Hello,
I'm using Plex Media Server and provide path to Videos folder to scan. Now I started to use flash drive as well and added the path to flash drive to scan as well. I realized that it failed to scan flash. Log shows this error:
Jul 08, 2012 20:27:29 [0xb7750700] DEBUG - Scanning USB with 0 current items in the database...
Jul 08, 2012 20:27:29 [0xb7750700] DEBUG - Performing a scan with 'Plex Movie Scanner' (language: en virtual: 0).
Jul 08, 2012 20:27:29 [0xb7750700] DEBUG - * Scanning /media/62744BA250E521E0
Jul 08, 2012 20:27:29 [0xb7750700] WARN - Caught exception while scanning USB: boost::filesystem::directory_iterator::construct: Permission denied: "/media/62744BA250E521E0"
The user running Plex is plex:
# id plex
uid=115(plex) gid=127(plex) groups=127(plex)
Permission on flash:
eliya@Linda:/media/62744BA250E521E0$ ls -ld .
drwx------ 1 eliya eliya 4096 Jul 8 10:46 .
I added user 'plex' to group 'eliya' but I can't modify group access for flash using chmod
I tried to share flash drive but it didn't help me.
I also tried to play with this flash on Windows machine and granted 'Full' access to everyone but back on Linux it didn't make any difference.
My question: how could I grant user 'plex' access to scan /media/62744BA250E521E0 ?
Thanks

Didier Spaier 07-13-2012 02:26 AM

Which filesystem is installed on the flash drive?

jv2112 07-13-2012 04:24 AM

The permisions on the drive are only open for the owner. I am not familiar with that software but unless it runs with root permisions it will get denied.

Change the permisions to 770 then add yourself to the group the software is.

You would need to use sudo / su to process the commands. I have sudo in the examples below.

Code:


sudo chmod -R 770 /path/to/drive


sudo usermod -Ga plex your_user_name


susja 07-13-2012 05:14 AM

Thanks for reply
I fixed my issue by reformatting NTFS to ext3
Thanks

susja 07-13-2012 10:15 AM

Well I was happy to earlier :)
Really by changing from NTFS to ext3 I was able to modify permission but my TV box ( which I am going to use flash with ) recognize only FAT 32 or NTFS.
Well I have to format back to NTFS and again have original issue.

Didier Spaier 07-13-2012 10:42 AM

Why not FAT 32?

susja 07-13-2012 11:03 AM

Originally flash came with FAT32 but it has limitations of the file size of 4Gb. That's why I used NTFS.
Now I am trying to format it on windows OS . Maybe it'll give me more options for permission change

honeybadger 07-13-2012 01:14 PM

It is generally not recommened to use journled file system (like ext3,4)on flash drives it is better to use the non-journaled file systems (like vfat or fat32)
My 2 cents.

susja 07-13-2012 01:28 PM

I realized that I have NTFS on my flash. I reformatted it to ext3 and was able modify all permission that I needed. But the problem is that my TV box ( which I'm going to use with this flash ) does not support NTFS ( only FAT 32 and NTFS ). Well I had to reformat again to NTFS and hit the wall. Neither owner (eliya) nor root could modify anything on this flash drive?
Any ideas how to work around it?
Thanks

honeybadger 07-14-2012 04:06 AM

Fat or vfat file systems do not have any permission bits. Something is definately wrong here. What you have to do is:
1. Plug the flash drive in and check 'dmesg' to see where the flash drive has mounted.
2. Mount the flash drive - using root - "mount /dev/<device-name> /mnt/tmp" (device name is the value that comes up in dmesg eg. sda1.
3. As root you can access the flash drive using its mount point. eg "cp -rfv some-file /mnt/tmp"

This is all that needs to be done. If you want to delete that file then you have to 'cd /mnt/tmp' and look and modify all the files.
If you can do this all is good. Once this works out we can let you know how to change the permissions of the flash drive.

susja 07-14-2012 11:54 PM

thanks to those who tried to help me
I resolved my issue by modifying /etc/fstab

Thanks


All times are GMT -5. The time now is 09:30 PM.