Re: [ubuntu-uk] Changing File/Folder permissions

2009-04-29 Thread Neil Greenwood
2009/4/28 mac ammonius.grammati...@gmx.co.uk:
 Neil Greenwood wrote:
 Thanks mac.

 I was trying to avoid having to run a command every time I plug the
 drive in though.


 I don't have to run it every time.  Once assigned to the labelled drive,
 the permissions are persistent.  I'm looking at one of mine now, that I
 just plugged in.  It has mounted as if owned by the logged-in user on
 this machine.  (That's why I think you do have to 'sudo chown -R' the
 drive to the current user - and it will then be owned by $USER).  The
 folder permissions are 755;  files look to be 644, unless otherwise
 specified.

Ah! Maybe I should have tried it, rather than just expecting it to
fail next time I plugged it in.

Thanks for the feedback. I'll give it a go when I've finished upgrading...

 (It's very useful to give the drive a label, so that it's always
 referred to by the same name, and you aren't messing about with
 different /dev names.)

I already do this, at least with most of my removable drives.

 Mine (several of them) just plug in and work, irrespective of who's the
 logged-in user.

Cofion,
Neil.

-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/


Re: [ubuntu-uk] Changing File/Folder permissions

2009-04-28 Thread mac
Neil Greenwood wrote:
 I have a similar issue with my ext3 formatted USB hard disk.
 
 When hotplugged, it's owned by root and I cannot create files or
 directories as my normal user. What do I need to change so that all
 users can create files/directories in the root when it's plugged in
 and automounted?

Here's what I do:

(Can't remember if I change the ownership with chown first.  SIAS!)

Mount the drive.  Then

chmod -R +w /media/drivelabel

(And if you need to give it a label:

To relabel do

sudo e2label device label

e.g.
sudo e2label /dev/sdg1 MyUSB


HTH

mac

-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/


Re: [ubuntu-uk] Changing File/Folder permissions

2009-04-28 Thread Neil Greenwood
2009/4/28 mac ammonius.grammati...@gmx.co.uk:
 Neil Greenwood wrote:
 I have a similar issue with my ext3 formatted USB hard disk.

 When hotplugged, it's owned by root and I cannot create files or
 directories as my normal user. What do I need to change so that all
 users can create files/directories in the root when it's plugged in
 and automounted?

 Here's what I do:

 (Can't remember if I change the ownership with chown first.  SIAS!)

 Mount the drive.  Then

 chmod -R +w /media/drivelabel

 (And if you need to give it a label:

 To relabel do

 sudo e2label device label

 e.g.
 sudo e2label /dev/sdg1 MyUSB


 HTH

 mac


Thanks mac.

I was trying to avoid having to run a command every time I plug the
drive in though.

Cofion/Regards,
Neil.

-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/


Re: [ubuntu-uk] Changing File/Folder permissions

2009-04-28 Thread mac
Neil Greenwood wrote:
 Thanks mac.
 
 I was trying to avoid having to run a command every time I plug the
 drive in though.


I don't have to run it every time.  Once assigned to the labelled drive, 
the permissions are persistent.  I'm looking at one of mine now, that I 
just plugged in.  It has mounted as if owned by the logged-in user on 
this machine.  (That's why I think you do have to 'sudo chown -R' the 
drive to the current user - and it will then be owned by $USER).  The 
folder permissions are 755;  files look to be 644, unless otherwise 
specified.

(It's very useful to give the drive a label, so that it's always 
referred to by the same name, and you aren't messing about with 
different /dev names.)

Mine (several of them) just plug in and work, irrespective of who's the 
logged-in user.

HTH

Mac



-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/


Re: [ubuntu-uk] Changing File/Folder permissions

2009-04-27 Thread mac
Stephen Garton wrote:
 I have a spare drive in my machine, formatted as fat32... 
 Any idea why this would be, and/or how I can change the permissions to my
 user?

AFAIK you can't set permissions on FAT32

mac



-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/


Re: [ubuntu-uk] Changing File/Folder permissions

2009-04-27 Thread Matthew Daubney
On Mon, 2009-04-27 at 12:57 +0100, Stephen Garton wrote:
 Afternoon All,
 
 I have a spare drive in my machine, formatted as fat32. All of the
 folders in this drive (automounts to /media/storage) as listed as
 being owned by root. When I try to change this (I've tried sudo chown
 -R and sudo nautilus) I get permission denied errors.
 
 Any idea why this would be, and/or how I can change the permissions to
 my user?
 
 Thanks,
 
 Steve Garton
 sheepeatingtaz.co.uk

You can use the uid and gid options with mount to make it mount fat32
drives as if you own all the files. e.g.

sudo mount /dev/sdX /media/MOUNTPOINT -o uid=1000,gid=1000

HTH

-Matt Daubney


signature.asc
Description: This is a digitally signed message part
-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/


Re: [ubuntu-uk] Changing File/Folder permissions

2009-04-27 Thread Stephen Garton
2009/4/27 Matthew Daubney m...@daubers.co.uk

 On Mon, 2009-04-27 at 12:57 +0100, Stephen Garton wrote:
  Afternoon All,
 
  I have a spare drive in my machine, formatted as fat32. All of the
  folders in this drive (automounts to /media/storage) as listed as
  being owned by root. When I try to change this (I've tried sudo chown
  -R and sudo nautilus) I get permission denied errors.
 
  Any idea why this would be, and/or how I can change the permissions to
  my user?
 
  Thanks,
 
  Steve Garton
  sheepeatingtaz.co.uk

 You can use the uid and gid options with mount to make it mount fat32
 drives as if you own all the files. e.g.

 sudo mount /dev/sdX /media/MOUNTPOINT -o uid=1000,gid=1000

 HTH

 -Matt Daubney

 --
 ubuntu-uk@lists.ubuntu.com
 https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
 https://wiki.ubuntu.com/UKTeam/



Cheers Matt (and Chris),

I'll edit fstab to add these options see if that helps.

Steve Garton
sheepeatingtaz.co.uk
-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/


Re: [ubuntu-uk] Changing File/Folder permissions

2009-04-27 Thread Daniel Drummond
Matthew Daubney wrote:
 On Mon, 2009-04-27 at 14:28 +0100, mac wrote:
 Matthew Daubney wrote:
 You can use the uid and gid options with mount to make it mount fat32
 drives as if you own all the files. e.g.

 sudo mount /dev/sdX /media/MOUNTPOINT -o uid=1000,gid=1000

 That's useful to know.  I guess, though, you couldn't preserve other 
 ownerships / permissions if you tried to rsync to a FAT32 drive?

 mac
 
 Unfortunately not, as those things are stored by the file system. You
 can set the default permissions for things though, but I can't remember
 the option for that off the top of my head.
 
 -Matt Daubney
 
I usually use a umask=0022 option in the particular entry in /etc/fstab 
- that works for me.

Dan

-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/