Re: [gentoo-user] USB permission/owner - change not allowed as root

2014-01-01 Thread Neil Bothwick
On Tue, 31 Dec 2013 19:14:36 -0700, Joseph wrote:

 If I remove the mounting line from fstab they mount with correct
 permission joseph:users but the mount point is reference as UUID and
 it makes it hard to reference it in bash scripts. 

MOUNTPOINT=$(mount | awk '/^\/dev\/sdb1/ {print $3}')

Then you can let the automounter take care of everything for you. If you
use /etc/fstab, the device is mounted as root, but because you have a
mixture of filesystems you can specify the correct options for one
without breaking another. It is far simpler to let the automounter take
care of all of this and just handle the movable mount point.

There is probably a udisks option that sets the mount point to the device
name rather than the volume name or UUID, good luck finding it :)


-- 
Neil Bothwick

Exercise daily. Eat wisely. Die anyway.


signature.asc
Description: PGP signature


Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-31 Thread Alan McKinnon
On 31/12/2013 04:30, waben...@gmail.com wrote:
 Am Dienstag, 31.12.2013 um 01:38
 schrieb Neil Bothwick n...@digimed.co.uk:
 
 On Mon, 30 Dec 2013 17:52:56 +0100, waben...@gmail.com wrote:

 For some reason or another the system doesn't like my fstab entry:
 /dev/sdb1  /media/stickauto
 noauto,rw,users  0  0  

 AFAIK the option to permit user mount is user and not users.
 Could this cause the problem?

 user and users are both valid, slightly different, options.
 
 THX for the info, I didn't know that.


It's all fully described in the mount man page.

You should read that man page to discover what mount can do.


-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-31 Thread Alan McKinnon
On 30/12/2013 19:22, Joseph wrote:
 On 12/30/13 17:36, Randolph Maaßen wrote:
 [snip]

 With the line in fstab:

 /dev/sdb1   /media/stickautonoauto,rw,users
 0  0

 Some USB stick are mounted as root:root and I can not change that
 even as
 root.
 When I remove this like from fstab.
 The USB stick are mounting correctly as joseph:users owner except
 they have
 different mounting location which I don't like.

 -- 
 Joseph


 You can specify the user/group that mounts a device with some mount
 options. I think they are uid=username/gid=groupname but I'm not
 sure and unfortunatly not on my Linux box at the moment.
 
 I've tried in fstab:
 /dev/sdb1   /media/stickauto   
 noauto,uid=1000,gid=100,umask=0770  0
 
 but I'm getting an error:
 Error mounting system-managed device /dev/sdb1: Command-line `mount
 /media/stick' exited with non-zero exit status 32: mount: wrong fs
 type, bad option, bad superblock on /dev/sdb1,
 
 What am I missing?
 

mount cannot auto-identify the fs type on your USB stick, or /dev/sdb1
is the wrong node.

blkid as Bruce mentioned will help identify what is really going on.
Also, tail -f /var/log/messages, insert the stick, and post the entries
that produces.




-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-31 Thread Joseph

On 12/31/13 10:49, Alan McKinnon wrote:

On 30/12/2013 19:22, Joseph wrote:

On 12/30/13 17:36, Randolph Maaßen wrote:
[snip]


With the line in fstab:

/dev/sdb1   /media/stickautonoauto,rw,users
0  0

Some USB stick are mounted as root:root and I can not change that
even as
root.
When I remove this like from fstab.
The USB stick are mounting correctly as joseph:users owner except
they have
different mounting location which I don't like.

--
Joseph



You can specify the user/group that mounts a device with some mount
options. I think they are uid=username/gid=groupname but I'm not
sure and unfortunatly not on my Linux box at the moment.


I've tried in fstab:
/dev/sdb1   /media/stickauto
noauto,uid=1000,gid=100,umask=0770  0

but I'm getting an error:
Error mounting system-managed device /dev/sdb1: Command-line `mount
/media/stick' exited with non-zero exit status 32: mount: wrong fs
type, bad option, bad superblock on /dev/sdb1,

What am I missing?



mount cannot auto-identify the fs type on your USB stick, or /dev/sdb1
is the wrong node.

blkid as Bruce mentioned will help identify what is really going on.
Also, tail -f /var/log/messages, insert the stick, and post the entries
that produces.




--
Alan McKinnon
alan.mckin...@gmail.com


Thank you for the hints, here is the output of: tail -f /var/log/messages
My line if fstab is: 
/dev/sdb1		/media/stick	auto	noauto,rw,user

and this USB below file are mounted as root:root (not joseph:users)

Dec 31 09:02:16 syscon7 kernel: [231771.029376] usb 8-1: new high-speed USB 
device number 33 using xhci_hcd
Dec 31 09:02:16 syscon7 kernel: [231771.042189] usb 8-1: default language 0x0409
Dec 31 09:02:16 syscon7 kernel: [231771.043442] usb 8-1: udev 33, busnum 8, 
minor = 928
Dec 31 09:02:16 syscon7 kernel: [231771.043445] usb 8-1: New USB device found, 
idVendor=058f, idProduct=6366
Dec 31 09:02:16 syscon7 kernel: [231771.043447] usb 8-1: New USB device 
strings: Mfr=1, Product=2, SerialNumber=3
Dec 31 09:02:16 syscon7 kernel: [231771.043448] usb 8-1: Product: Mass Storage 
Device
Dec 31 09:02:16 syscon7 kernel: [231771.043450] usb 8-1: Manufacturer: Generic
Dec 31 09:02:16 syscon7 kernel: [231771.043451] usb 8-1: SerialNumber: 
058F63666433
Dec 31 09:02:16 syscon7 kernel: [231771.043515] usb 8-1: usb_probe_device
Dec 31 09:02:16 syscon7 kernel: [231771.043517] usb 8-1: configuration #1 
chosen from 1 choice
Dec 31 09:02:16 syscon7 kernel: [231771.043614] usb 8-1: Successful Endpoint 
Configure command
Dec 31 09:02:16 syscon7 kernel: [231771.043689] usb 8-1: adding 8-1:1.0 (config 
#1, interface 0)
Dec 31 09:02:16 syscon7 kernel: [231771.043722] usb-storage 8-1:1.0: 
usb_probe_interface
Dec 31 09:02:16 syscon7 kernel: [231771.043726] usb-storage 8-1:1.0: 
usb_probe_interface - got id
Dec 31 09:02:16 syscon7 kernel: [231771.043728] usb-storage 8-1:1.0: USB Mass 
Storage device detected
Dec 31 09:02:16 syscon7 kernel: [231771.043787] scsi41 : usb-storage 8-1:1.0
Dec 31 09:02:17 syscon7 kernel: [231772.175846] scsi 41:0:0:0: Direct-Access
 Multiple Card  Reader 1.00 PQ: 0 ANSI: 0
Dec 31 09:02:17 syscon7 kernel: [231772.176055] sd 41:0:0:0: Attached scsi 
generic sg2 type 0
Dec 31 09:02:18 syscon7 kernel: [231772.836523] sd 41:0:0:0: [sdb] 62333952 
512-byte logical blocks: (31.9 GB/29.7 GiB)
Dec 31 09:02:18 syscon7 kernel: [231772.836932] sd 41:0:0:0: [sdb] Write 
Protect is off
Dec 31 09:02:18 syscon7 kernel: [231772.836934] sd 41:0:0:0: [sdb] Mode Sense: 
03 00 00 00
Dec 31 09:02:18 syscon7 kernel: [231772.837316] sd 41:0:0:0: [sdb] No Caching 
mode page present
Dec 31 09:02:18 syscon7 kernel: [231772.837318] sd 41:0:0:0: [sdb] Assuming 
drive cache: write through
Dec 31 09:02:18 syscon7 kernel: [231772.838812] sd 41:0:0:0: [sdb] No Caching 
mode page present
Dec 31 09:02:18 syscon7 kernel: [231772.838815] sd 41:0:0:0: [sdb] Assuming 
drive cache: write through
Dec 31 09:02:18 syscon7 kernel: [231772.846512]  sdb: sdb1
Dec 31 09:02:18 syscon7 kernel: [231772.848062] sd 41:0:0:0: [sdb] No Caching 
mode page present
Dec 31 09:02:18 syscon7 kernel: [231772.848065] sd 41:0:0:0: [sdb] Assuming 
drive cache: write through
Dec 31 09:02:18 syscon7 kernel: [231772.848067] sd 41:0:0:0: [sdb] Attached 
SCSI removable disk
Dec 31 09:02:25 syscon7 udisksd[3624]: Mounted /dev/sdb1 (system) at 
/media/stick on behalf of uid 1000

--
Joseph



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-31 Thread Alan McKinnon
On 31/12/2013 18:06, Joseph wrote:
 On 12/31/13 10:49, Alan McKinnon wrote:
 On 30/12/2013 19:22, Joseph wrote:
 On 12/30/13 17:36, Randolph Maaßen wrote:
 [snip]

 With the line in fstab:

 /dev/sdb1   /media/stickauto   
 noauto,rw,users
 0  0

 Some USB stick are mounted as root:root and I can not change that
 even as
 root.
 When I remove this like from fstab.
 The USB stick are mounting correctly as joseph:users owner except
 they have
 different mounting location which I don't like.

 -- 
 Joseph


 You can specify the user/group that mounts a device with some mount
 options. I think they are uid=username/gid=groupname but I'm not
 sure and unfortunatly not on my Linux box at the moment.

 I've tried in fstab:
 /dev/sdb1   /media/stickauto
 noauto,uid=1000,gid=100,umask=0770  0

 but I'm getting an error:
 Error mounting system-managed device /dev/sdb1: Command-line `mount
 /media/stick' exited with non-zero exit status 32: mount: wrong fs
 type, bad option, bad superblock on /dev/sdb1,

 What am I missing?


 mount cannot auto-identify the fs type on your USB stick, or /dev/sdb1
 is the wrong node.

 blkid as Bruce mentioned will help identify what is really going on.
 Also, tail -f /var/log/messages, insert the stick, and post the entries
 that produces.




 -- 
 Alan McKinnon
 alan.mckin...@gmail.com
 
 Thank you for the hints, here is the output of: tail -f /var/log/messages
 My line if fstab is: /dev/sdb1/media/stickauto   
 noauto,rw,user
 and this USB below file are mounted as root:root (not joseph:users)
 
 Dec 31 09:02:16 syscon7 kernel: [231771.029376] usb 8-1: new high-speed
 USB device number 33 using xhci_hcd
 Dec 31 09:02:16 syscon7 kernel: [231771.042189] usb 8-1: default
 language 0x0409
 Dec 31 09:02:16 syscon7 kernel: [231771.043442] usb 8-1: udev 33, busnum
 8, minor = 928
 Dec 31 09:02:16 syscon7 kernel: [231771.043445] usb 8-1: New USB device
 found, idVendor=058f, idProduct=6366
 Dec 31 09:02:16 syscon7 kernel: [231771.043447] usb 8-1: New USB device
 strings: Mfr=1, Product=2, SerialNumber=3
 Dec 31 09:02:16 syscon7 kernel: [231771.043448] usb 8-1: Product: Mass
 Storage Device
 Dec 31 09:02:16 syscon7 kernel: [231771.043450] usb 8-1: Manufacturer:
 Generic
 Dec 31 09:02:16 syscon7 kernel: [231771.043451] usb 8-1: SerialNumber:
 058F63666433
 Dec 31 09:02:16 syscon7 kernel: [231771.043515] usb 8-1: usb_probe_device
 Dec 31 09:02:16 syscon7 kernel: [231771.043517] usb 8-1: configuration
 #1 chosen from 1 choice
 Dec 31 09:02:16 syscon7 kernel: [231771.043614] usb 8-1: Successful
 Endpoint Configure command
 Dec 31 09:02:16 syscon7 kernel: [231771.043689] usb 8-1: adding 8-1:1.0
 (config #1, interface 0)
 Dec 31 09:02:16 syscon7 kernel: [231771.043722] usb-storage 8-1:1.0:
 usb_probe_interface
 Dec 31 09:02:16 syscon7 kernel: [231771.043726] usb-storage 8-1:1.0:
 usb_probe_interface - got id
 Dec 31 09:02:16 syscon7 kernel: [231771.043728] usb-storage 8-1:1.0: USB
 Mass Storage device detected
 Dec 31 09:02:16 syscon7 kernel: [231771.043787] scsi41 : usb-storage
 8-1:1.0
 Dec 31 09:02:17 syscon7 kernel: [231772.175846] scsi 41:0:0:0:
 Direct-Access Multiple Card  Reader 1.00 PQ: 0 ANSI: 0
 Dec 31 09:02:17 syscon7 kernel: [231772.176055] sd 41:0:0:0: Attached
 scsi generic sg2 type 0
 Dec 31 09:02:18 syscon7 kernel: [231772.836523] sd 41:0:0:0: [sdb]
 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB)
 Dec 31 09:02:18 syscon7 kernel: [231772.836932] sd 41:0:0:0: [sdb] Write
 Protect is off
 Dec 31 09:02:18 syscon7 kernel: [231772.836934] sd 41:0:0:0: [sdb] Mode
 Sense: 03 00 00 00
 Dec 31 09:02:18 syscon7 kernel: [231772.837316] sd 41:0:0:0: [sdb] No
 Caching mode page present
 Dec 31 09:02:18 syscon7 kernel: [231772.837318] sd 41:0:0:0: [sdb]
 Assuming drive cache: write through
 Dec 31 09:02:18 syscon7 kernel: [231772.838812] sd 41:0:0:0: [sdb] No
 Caching mode page present
 Dec 31 09:02:18 syscon7 kernel: [231772.838815] sd 41:0:0:0: [sdb]
 Assuming drive cache: write through
 Dec 31 09:02:18 syscon7 kernel: [231772.846512]  sdb: sdb1
 Dec 31 09:02:18 syscon7 kernel: [231772.848062] sd 41:0:0:0: [sdb] No
 Caching mode page present
 Dec 31 09:02:18 syscon7 kernel: [231772.848065] sd 41:0:0:0: [sdb]
 Assuming drive cache: write through
 Dec 31 09:02:18 syscon7 kernel: [231772.848067] sd 41:0:0:0: [sdb]
 Attached SCSI removable disk
 Dec 31 09:02:25 syscon7 udisksd[3624]: Mounted /dev/sdb1 (system) at
 /media/stick on behalf of uid 1000
 


That looks normal. Having lines in fstab for removable media is not a
good solution in general - insert two sticks and the second one doesn't
have a matching line (it isn't /dev/sdb1)


That's why automounter apps were developed so you can get the config out
of fstab and replace it with something more generic somewhere else.

udisks is the app you are suing for this and it's the most common
solution chosen by most DEs.

When was udisks last updated on your system?
What 

Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-31 Thread wabenbau
Am Dienstag, 31.12.2013 um 10:31
schrieb Alan McKinnon alan.mckin...@gmail.com:

 On 31/12/2013 04:30, waben...@gmail.com wrote:
  Am Dienstag, 31.12.2013 um 01:38
  schrieb Neil Bothwick n...@digimed.co.uk:
  
  On Mon, 30 Dec 2013 17:52:56 +0100, waben...@gmail.com wrote:
 
  For some reason or another the system doesn't like my fstab
  entry: /dev/sdb1 /media/stickauto
  noauto,rw,users  0  0  
 
  AFAIK the option to permit user mount is user and not users.
  Could this cause the problem?
 
  user and users are both valid, slightly different, options.
  
  THX for the info, I didn't know that.
 
 
 It's all fully described in the mount man page.
 
 You should read that man page to discover what mount can do.

THX for the hint. It's always good to RTFM. :-)

In the meantime I read the man page and now I understand the difference
between the users and the user option. But as I'm the only physical
user on my computer it doesn't makes a difference for me.




Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-31 Thread Bruce Hill
On Tue, Dec 31, 2013 at 09:06:38AM -0700, Joseph wrote:
 
 Thank you for the hints, here is the output of: tail -f /var/log/messages
 My line if fstab is: 
 /dev/sdb1 /media/stickautonoauto,rw,user
 and this USB below file are mounted as root:root (not joseph:users)
 
 Dec 31 09:02:16 syscon7 kernel: [231771.029376] usb 8-1: new high-speed USB 
 device number 33 using xhci_hcd
 Dec 31 09:02:16 syscon7 kernel: [231771.042189] usb 8-1: default language 
 0x0409
 Dec 31 09:02:16 syscon7 kernel: [231771.043442] usb 8-1: udev 33, busnum 8, 
 minor = 928
 Dec 31 09:02:16 syscon7 kernel: [231771.043445] usb 8-1: New USB device 
 found, idVendor=058f, idProduct=6366
 Dec 31 09:02:16 syscon7 kernel: [231771.043447] usb 8-1: New USB device 
 strings: Mfr=1, Product=2, SerialNumber=3
 Dec 31 09:02:16 syscon7 kernel: [231771.043448] usb 8-1: Product: Mass 
 Storage Device
 Dec 31 09:02:16 syscon7 kernel: [231771.043450] usb 8-1: Manufacturer: Generic
 Dec 31 09:02:16 syscon7 kernel: [231771.043451] usb 8-1: SerialNumber: 
 058F63666433
 Dec 31 09:02:16 syscon7 kernel: [231771.043515] usb 8-1: usb_probe_device
 Dec 31 09:02:16 syscon7 kernel: [231771.043517] usb 8-1: configuration #1 
 chosen from 1 choice
 Dec 31 09:02:16 syscon7 kernel: [231771.043614] usb 8-1: Successful Endpoint 
 Configure command
 Dec 31 09:02:16 syscon7 kernel: [231771.043689] usb 8-1: adding 8-1:1.0 
 (config #1, interface 0)
 Dec 31 09:02:16 syscon7 kernel: [231771.043722] usb-storage 8-1:1.0: 
 usb_probe_interface
 Dec 31 09:02:16 syscon7 kernel: [231771.043726] usb-storage 8-1:1.0: 
 usb_probe_interface - got id
 Dec 31 09:02:16 syscon7 kernel: [231771.043728] usb-storage 8-1:1.0: USB Mass 
 Storage device detected
 Dec 31 09:02:16 syscon7 kernel: [231771.043787] scsi41 : usb-storage 8-1:1.0
 Dec 31 09:02:17 syscon7 kernel: [231772.175846] scsi 41:0:0:0: Direct-Access  
Multiple Card  Reader 1.00 PQ: 0 ANSI: 0
 Dec 31 09:02:17 syscon7 kernel: [231772.176055] sd 41:0:0:0: Attached scsi 
 generic sg2 type 0
 Dec 31 09:02:18 syscon7 kernel: [231772.836523] sd 41:0:0:0: [sdb] 62333952 
 512-byte logical blocks: (31.9 GB/29.7 GiB)
 Dec 31 09:02:18 syscon7 kernel: [231772.836932] sd 41:0:0:0: [sdb] Write 
 Protect is off
 Dec 31 09:02:18 syscon7 kernel: [231772.836934] sd 41:0:0:0: [sdb] Mode 
 Sense: 03 00 00 00
 Dec 31 09:02:18 syscon7 kernel: [231772.837316] sd 41:0:0:0: [sdb] No Caching 
 mode page present
 Dec 31 09:02:18 syscon7 kernel: [231772.837318] sd 41:0:0:0: [sdb] Assuming 
 drive cache: write through
 Dec 31 09:02:18 syscon7 kernel: [231772.838812] sd 41:0:0:0: [sdb] No Caching 
 mode page present
 Dec 31 09:02:18 syscon7 kernel: [231772.838815] sd 41:0:0:0: [sdb] Assuming 
 drive cache: write through
 Dec 31 09:02:18 syscon7 kernel: [231772.846512]  sdb: sdb1
 Dec 31 09:02:18 syscon7 kernel: [231772.848062] sd 41:0:0:0: [sdb] No Caching 
 mode page present
 Dec 31 09:02:18 syscon7 kernel: [231772.848065] sd 41:0:0:0: [sdb] Assuming 
 drive cache: write through
 Dec 31 09:02:18 syscon7 kernel: [231772.848067] sd 41:0:0:0: [sdb] Attached 
 SCSI removable disk
 Dec 31 09:02:25 syscon7 udisksd[3624]: Mounted /dev/sdb1 (system) at 
 /media/stick on behalf of uid 1000
 
 -- 
 Joseph

The blkid output would have shown this device, it's UUID, and filesystem.

At any rate, for my flash drives I want them mounted with perms for rw for
user mingdao, so I put something like this in /etc/fstab:

baruch ~ # blkid /dev/sdc1
/dev/sdc1: LABEL=AMD UUID=CA00-9136 TYPE=vfat 
baruch ~ # grep CA00-9136 /etc/fstab
UUID=CA00-9136  /AMDvfat
noauto,users,rw,gid=1000,dmask=0002,fmask=0113  0 0

Different for NTFS, of course. And btw, I don't automount anything anything
that is plugged in. Just my preference.

As Alan mentioned, man mount would be a good read; as well as man fstab.
And, did I give you a link to an article on file permissions?

The difference between user and users mean simply that with user only the
user who mounted the device can unmount it; with users any user can unmount
it, not just the user who mounted it.

Cheers,
Bruce
-- 
List replies preferred.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Don't top-post: http://en.wikipedia.org/wiki/Top_post#Top-posting



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-31 Thread Joseph

On 12/31/13 12:03, Bruce Hill wrote:

[snip]


The blkid output would have shown this device, it's UUID, and filesystem.

At any rate, for my flash drives I want them mounted with perms for rw for
user mingdao, so I put something like this in /etc/fstab:

baruch ~ # blkid /dev/sdc1
/dev/sdc1: LABEL=AMD UUID=CA00-9136 TYPE=vfat
baruch ~ # grep CA00-9136 /etc/fstab
UUID=CA00-9136  /AMDvfat
noauto,users,rw,gid=1000,dmask=0002,fmask=0113  0 0

Different for NTFS, of course. And btw, I don't automount anything anything
that is plugged in. Just my preference.

As Alan mentioned, man mount would be a good read; as well as man fstab.
And, did I give you a link to an article on file permissions?

The difference between user and users mean simply that with user only the
user who mounted the device can unmount it; with users any user can unmount
it, not just the user who mounted it.

Cheers,
Bruce


Thanks for the input.
In my case blkid is not showing any LABEL

It depends on what USB I insert:

#blkid /dev/sdb1
/dev/sdb1: UUID=2f5fc53e-4f4c-4e74-b9c4-fca316b47fea TYPE=ext2

#blkid 
/dev/sdb1: UUID=3136-3934 TYPE=vfat


so it would be hard to specify UUID in fstab for each momory card I insert.
In the past the line in fstab:
/dev/sdb1   /media/stickautonoauto,rw,users
0  0

mounted both ext2 and vfat USB as /media/stick so it is easier to reference 
to it in scripts.
But after recent update if I have this line in fstab the ext2 USB is mounted as joseph:users 
but vfat USB is mounted as root:root 

If I remove the mounting line from fstab they mount with correct permission joseph:users but the mount point is reference as UUID and it makes it hard to reference 
it in bash scripts. 


--
Joseph



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-30 Thread Alan McKinnon
On 30/12/2013 09:51, Edward M wrote:
 On Sun, 29 Dec 2013 19:42:33 -0700
 Joseph syscon...@gmail.com wrote:
 
 After recent upgrade when I mount my USB and try as root:

 chown joseph:users /media/stick/Ancient-Electricity_new.ppt 
 chown: changing ownership of
 ‘/media/stick/Ancient-Electricity_new.ppt’: Operation not permitted

 file ownership is:
 -rwxr-xr-x 1 root root 5796864 Mar  6  2013
 Ancient-Electricity_new.ppt

 
 
 I too ran the chown command on my USB flash and got the same
 response as you did:
 
 localhost001 media # chown cru:users flash-drive1/
   chown: changing ownership of ‘flash-drive1/’: Operation not
 permitted
 
   drwxr-xr-x 7 root root 16384 Dec 31  1969 flash-drive1  
 
   Don't know what to tell you. interestingmy says Dec 31 1969. 



Read the man page for mount, section vfat.


You can't change the owner as FAT doesn't have a concept of owner, so
it's simulated at mount time. You can't change it at runtime.

To change it you have to umount the device and remount it using the
appropriate option, all in the man page


-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-30 Thread Edward M
On Mon, 30 Dec 2013 10:38:03 +0200
Alan McKinnon alan.mckin...@gmail.com wrote:

 On 30/12/2013 09:51, Edward M wrote:
  On Sun, 29 Dec 2013 19:42:33 -0700
  Joseph syscon...@gmail.com wrote:
  
  After recent upgrade when I mount my USB and try as root:
 
  chown joseph:users /media/stick/Ancient-Electricity_new.ppt 
  chown: changing ownership of
  ‘/media/stick/Ancient-Electricity_new.ppt’: Operation not permitted
 
  file ownership is:
  -rwxr-xr-x 1 root root 5796864 Mar  6  2013
  Ancient-Electricity_new.ppt
 
  
  
  I too ran the chown command on my USB flash and got the same
  response as you did:
  
  localhost001 media # chown cru:users flash-drive1/
chown: changing ownership of ‘flash-drive1/’: Operation
  not permitted
  
drwxr-xr-x 7 root root 16384 Dec 31  1969 flash-drive1  
  
Don't know what to tell you. interestingmy says Dec 31 1969. 
 
 
 
 Read the man page for mount, section vfat.
 
 
 You can't change the owner as FAT doesn't have a concept of owner, so
 it's simulated at mount time. You can't change it at runtime.
 
 To change it you have to umount the device and remount it using the
 appropriate option, all in the man page
 
 

  Thank you for the explanation. I appreciate it a lot. I will
  read the man page for mount and experiment a little. 



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-30 Thread Joseph

On 12/30/13 10:38, Alan McKinnon wrote:

[snip]

I too ran the chown command on my USB flash and got the same
response as you did:

localhost001 media # chown cru:users flash-drive1/
  chown: changing ownership of ‘flash-drive1/’: Operation not
permitted

  drwxr-xr-x 7 root root 16384 Dec 31  1969 flash-drive1

  Don't know what to tell you. interestingmy says Dec 31 1969.




Read the man page for mount, section vfat.


You can't change the owner as FAT doesn't have a concept of owner, so
it's simulated at mount time. You can't change it at runtime.

To change it you have to umount the device and remount it using the
appropriate option, all in the man page


I don't think it has anything to do with FAT.
Everything was working just find on my system before upgrade.

With the line in fstab:
/dev/sdb1   /media/stickautonoauto,rw,users
0  0

Some USB stick are mounted as root:root and I can not change that even as root.
When I remove this like from fstab.
The USB stick are mounting correctly as joseph:users owner except they have 
different mounting location which I don't like.

--
Joseph



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-30 Thread Randolph Maaßen
2013/12/30 Joseph syscon...@gmail.com:
 On 12/30/13 10:38, Alan McKinnon wrote:

 [snip]

 I too ran the chown command on my USB flash and got the same
 response as you did:

 localhost001 media # chown cru:users flash-drive1/
   chown: changing ownership of ‘flash-drive1/’: Operation not
 permitted

   drwxr-xr-x 7 root root 16384 Dec 31  1969 flash-drive1

   Don't know what to tell you. interestingmy says Dec 31 1969.




 Read the man page for mount, section vfat.


 You can't change the owner as FAT doesn't have a concept of owner, so
 it's simulated at mount time. You can't change it at runtime.

 To change it you have to umount the device and remount it using the
 appropriate option, all in the man page


 I don't think it has anything to do with FAT.
 Everything was working just find on my system before upgrade.

 With the line in fstab:

 /dev/sdb1   /media/stickautonoauto,rw,users
 0  0

 Some USB stick are mounted as root:root and I can not change that even as
 root.
 When I remove this like from fstab.
 The USB stick are mounting correctly as joseph:users owner except they have
 different mounting location which I don't like.

 --
 Joseph


You can specify the user/group that mounts a device with some mount
options. I think they are uid=username/gid=groupname but I'm not
sure and unfortunatly not on my Linux box at the moment.

-- 
Mit freundlichen Grüßen / Best regards

Randolph Maaßen



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-30 Thread wabenbau
Am Sonntag, 29.12.2013 um 21:12
schrieb Joseph syscon...@gmail.com:

 For some reason or another the system doesn't like my fstab entry:
 /dev/sdb1 /media/stickauto
 noauto,rw,users  0  0

AFAIK the option to permit user mount is user and not users. Could
this cause the problem?



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-30 Thread Joseph

On 12/30/13 17:36, Randolph Maaßen wrote:
[snip]


With the line in fstab:

/dev/sdb1   /media/stickautonoauto,rw,users
0  0

Some USB stick are mounted as root:root and I can not change that even as
root.
When I remove this like from fstab.
The USB stick are mounting correctly as joseph:users owner except they have
different mounting location which I don't like.

--
Joseph



You can specify the user/group that mounts a device with some mount
options. I think they are uid=username/gid=groupname but I'm not
sure and unfortunatly not on my Linux box at the moment.


I've tried in fstab:
/dev/sdb1   /media/stickauto
noauto,uid=1000,gid=100,umask=0770  0

but I'm getting an error:
Error mounting system-managed device /dev/sdb1: Command-line `mount /media/stick' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad 
superblock on /dev/sdb1,


What am I missing?

--
Joseph



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-30 Thread Bruce Hill
On Sun, Dec 29, 2013 at 07:42:33PM -0700, Joseph wrote:
 After recent upgrade when I mount my USB and try as root:
 
 chown joseph:users /media/stick/Ancient-Electricity_new.ppt 
 chown: changing ownership of ‘/media/stick/Ancient-Electricity_new.ppt’: 
 Operation not permitted
 
 file ownership is:
 -rwxr-xr-x 1 root root 5796864 Mar  6  2013 Ancient-Electricity_new.ppt

The thread kinda zig-zagged off on me, so hope you don't mind a post here.

Perhaps this guide would be as nice a read for you as it was for me. It brings
back memories as I started using Linux in June, 2003, just before he wrote it:

http://www.linuxquestions.org/linux/answers/Security/Quick_and_Dirty_Guide_to_Linux_File_Permissions

Second, please issue blkid and give the line for this USB device.

Cheers,
Bruce
-- 
List replies preferred.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Don't top-post: http://en.wikipedia.org/wiki/Top_post#Top-posting



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-30 Thread Neil Bothwick
On Mon, 30 Dec 2013 17:52:56 +0100, waben...@gmail.com wrote:

  For some reason or another the system doesn't like my fstab entry:
  /dev/sdb1   /media/stickauto
  noauto,rw,users  0  0  
 
 AFAIK the option to permit user mount is user and not users. Could
 this cause the problem?

user and users are both valid, slightly different, options.


-- 
Neil Bothwick

In 1750 Issac Newton became discouraged when he fell up a flight of
stairs.


signature.asc
Description: PGP signature


Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-30 Thread wabenbau
Am Dienstag, 31.12.2013 um 01:38
schrieb Neil Bothwick n...@digimed.co.uk:

 On Mon, 30 Dec 2013 17:52:56 +0100, waben...@gmail.com wrote:
 
   For some reason or another the system doesn't like my fstab entry:
   /dev/sdb1 /media/stickauto
   noauto,rw,users  0  0  
  
  AFAIK the option to permit user mount is user and not users.
  Could this cause the problem?
 
 user and users are both valid, slightly different, options.

THX for the info, I didn't know that.




Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-29 Thread Dale
Joseph wrote:
 After recent upgrade when I mount my USB and try as root:

 chown joseph:users /media/stick/Ancient-Electricity_new.ppt chown:
 changing ownership of ‘/media/stick/Ancient-Electricity_new.ppt’:
 Operation not permitted

 file ownership is:
 -rwxr-xr-x 1 root root 5796864 Mar  6  2013 Ancient-Electricity_new.ppt


Is it mounted Read Only?  It's the only thing I can think of.  I'm not
sure if that would keep it from changing it if it is either. 

Dale

:-)  :-) 

-- 
I am only responsible for what I said ... Not for what you understood or how 
you interpreted my words!




Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-29 Thread Joseph

On 12/29/13 21:41, Dale wrote:

Joseph wrote:

After recent upgrade when I mount my USB and try as root:

chown joseph:users /media/stick/Ancient-Electricity_new.ppt chown:
changing ownership of ‘/media/stick/Ancient-Electricity_new.ppt’:
Operation not permitted

file ownership is:
-rwxr-xr-x 1 root root 5796864 Mar  6  2013 Ancient-Electricity_new.ppt



Is it mounted Read Only?  It's the only thing I can think of.  I'm not
sure if that would keep it from changing it if it is either.

Dale

:-)  :-)

--
I am only responsible for what I said ... Not for what you understood or how 
you interpreted my words!



When I open the USB stick, it doesn't say anything (on the top) read only 
mode.

--
Joseph



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-29 Thread covici

Joseph syscon...@gmail.com wrote:

 On 12/29/13 21:41, Dale wrote:
 Joseph wrote:
  After recent upgrade when I mount my USB and try as root:
 
  chown joseph:users /media/stick/Ancient-Electricity_new.ppt chown:
  changing ownership of ‘/media/stick/Ancient-Electricity_new.ppt’:
  Operation not permitted
 
  file ownership is:
  -rwxr-xr-x 1 root root 5796864 Mar  6  2013 Ancient-Electricity_new.ppt
 
 
 Is it mounted Read Only?  It's the only thing I can think of.  I'm not
 sure if that would keep it from changing it if it is either.
 
 Dale
 
 :-)  :-)
 
  -- 
 I am only responsible for what I said ... Not for what you understood or how 
 you interpreted my words!
 
 
 When I open the USB stick, it doesn't say anything (on the top) read only 
 mode.

What file system on the stick? If it is FAT there is no such thing as ownership.
-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-29 Thread Joseph

On 12/29/13 21:41, Dale wrote:

Joseph wrote:

After recent upgrade when I mount my USB and try as root:

chown joseph:users /media/stick/Ancient-Electricity_new.ppt chown:
changing ownership of ‘/media/stick/Ancient-Electricity_new.ppt’:
Operation not permitted

file ownership is:
-rwxr-xr-x 1 root root 5796864 Mar  6  2013 Ancient-Electricity_new.ppt



Is it mounted Read Only?  It's the only thing I can think of.  I'm not
sure if that would keep it from changing it if it is either.


For some reason or another the system doesn't like my fstab entry:
/dev/sdb1   /media/stickautonoauto,rw,users  0  0

I like consistent volume naming so I have the above entry in my fstab
When I remove this like it mounts read/write with correct 
permissions/ownership; why?

--
Joseph



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-29 Thread Joseph

On 12/29/13 23:05, cov...@ccs.covici.com wrote:
[snip]

 file ownership is:
 -rwxr-xr-x 1 root root 5796864 Mar  6  2013 Ancient-Electricity_new.ppt


Is it mounted Read Only?  It's the only thing I can think of.  I'm not
sure if that would keep it from changing it if it is either.

Dale

:-)  :-)

 --
I am only responsible for what I said ... Not for what you understood or how 
you interpreted my words!


When I open the USB stick, it doesn't say anything (on the top) read only 
mode.


What file system on the stick? If it is FAT there is no such thing as ownership.


Regardless of the file type, if the system present it as owner/user root
-rwxr-xr-x 1 root root 5796864 Mar  6  2013 Ancient-Electricity_new.ppt

I should be able to change the permission when I login as root, but I can not; 
that is what puzzling me.

--
Joseph



Re: [gentoo-user] USB permission/owner - change not allowed as root

2013-12-29 Thread Edward M
On Sun, 29 Dec 2013 19:42:33 -0700
Joseph syscon...@gmail.com wrote:

 After recent upgrade when I mount my USB and try as root:
 
 chown joseph:users /media/stick/Ancient-Electricity_new.ppt 
 chown: changing ownership of
 ‘/media/stick/Ancient-Electricity_new.ppt’: Operation not permitted
 
 file ownership is:
 -rwxr-xr-x 1 root root 5796864 Mar  6  2013
 Ancient-Electricity_new.ppt
 


I too ran the chown command on my USB flash and got the same
response as you did:

localhost001 media # chown cru:users flash-drive1/
  chown: changing ownership of ‘flash-drive1/’: Operation not
permitted

  drwxr-xr-x 7 root root 16384 Dec 31  1969 flash-drive1  

  Don't know what to tell you. interestingmy says Dec 31 1969.