D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Permissions are a pain

 

On 28/06/14 12:07, Neil Winchurst wrote:
> On Sat, 28 Jun 2014 08:40:13 +0100
> Daniel Robinson <manipula@xxxxxxxxx> wrote:
> 
>> On 28 Jun 2014 08:38, "Neil Winchurst" <barnaby@xxxxxxxxxxxx> wrote:
>>
>>> On Fri, 27 Jun 2014 18:28:59 +0100
>>> Kai Hendry <hendry@xxxxxxxxxxxxxxxx> wrote:
>>>
>>>> Yes, users.
>>>>
>>>> For my sd card:
>>>>
>>>> /dev/mmcblk0p1 /mnt/sd auto noauto,noatime,users,nofail 0 0
>>>>
>>>
>>> Sorry, don't follow that. One stick works as expected, the other
>>> does not. Whichever one I use the fstab file is the same. I don't
>>> touch that at all. The properties on the sticks look the same, so I
>>> am at a loss.
>>>
>>> Neil
> 
>> Set the permissions on the stick to be set for the group "users" as
>> read and write.
>> Why on earth it's set as root I do not know!
> 
> I have tried several ways to do that but so far I have failed. If I
> click on the icon that appears on the desktop and go to Permissions
> they are greyed out. If I try in a terminal screen, using sudo and
> chmod I don't get any error message but nothing changes. I can open up
> my file manager as root and then I can copy and paste of course, but
> that is not a good idea.
> 
> Baffled still,
> 
> Neil
> 

Pro tip: nuke the offending USB stick, and start again from scratch -
this time, format it as NTFS rather than native as ext3/4. While that
might sound weird, NTFS is a perfectly decent filesystem and Linux can
handle it with no problem. Cross platform support is also excellent so
you'll have no issues with r/w access on Windows (obviously) and r/o
support on Mac OS (unless you install proper drivers from Paragon or
whoever). As long as you have ntfs-3g installed then your system will
just take care of everything for you and you won't have to worry about
permissions and other weirdness.

For example, I have a 16Gb NTFS formatted Windows USB installer drive
lying around, so I plug it in:

ghost@failbot:~$ mount | grep USB
/dev/sde1 on /media/ghost/Windows USB type fuseblk
(rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)

I did nothing whatsoever to enable this - no fstab entries (you
shouldn't need them for mounting USB devices in 2014!) or special
procedures required, works 100% of the time on any random machine I add
it to.

In your case, you need to go brute force mode Neil:

sudo chown -Rv neil:neil /media/neil/usb-device

Where "neil" is presumed to be your username and the path should be
changed to wherever your device is getting mounted. Or umount it, and
mount it again manually wherever you like. Either way, 'touch
/path/to/usb-device/hello.world' afterwards should create the file for
you in the root of your thumbdrive without complaints.

Cheers

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq