File in the /sys directory are part of sysfs, the system filesytem.
They not real files on a disk. They are attributes of device drivers
and are intended to give user application a way to find out about the
state of the device drivers, and to control them. The idea is similar
to the old-fangled ioctl() system call, but with meaningful names,
rather than random ioctl numbers, and with human-readable values that
you read and write.

The directory structure is created by the kernel, and the 'files' are
created by each device driver depending on what it can (or wants to)
tell you or allow you to control.

I am surprised that you have managed to create files in the /sys directory.

It is strange that the directory '/sys/devices/platform/nct6775.2608
exists without any 'files' in it: I would expect to see SOME entries
there.

This suggests that the device driver is not being loaded, or is being
loaded but being populated in a different place in /sys.

* are you using the same version of kernel as the sample -- the file
name you provided is different from the one in the example

* is the device driver (kernel module) being loaded? Use lsmod to see
which modules are currently loaded.

Stephen Irons

On 13 October 2015 at 16:26, Bryce Stenberg <[email protected]> wrote:
> Hi,
>
> I was trying to create a file called 'pwm1' manually as that is what the 
> script creates - just has a number in it to tell the fanoveride process how 
> to work stuff, but script was failing with permission denied.
> ( all based on a discussion at 
> https://community.netgear.com/t5/New-to-ReadyNAS/How-to-control-fanspeed-on-a-RN104/td-p/911970
>  ).
>
> I can write to other places on same drive so is mounted read/write.
>
> So, even if nothing happens, with previous permissions I should be able to 
> write where I like as root shouldn't I?
>
> Cheers, Bryce.
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Eliot 
> Blennerhassett
> Sent: Tuesday, October 13, 2015 3:58 PM
> To: Canterbury Linux Users Group
> Subject: Re: [Linux-users] Permissions: root access but can't write to file?
>
> On 13/10/15 15:39, Bryce Stenberg wrote:
>> Sorry, I should add the file doesn't currently exist so is not in use, I'm 
>> trying to create it again...
>>
>
> I don't think copying a file into a device dir is going to do anything.
>  The 'files' depend on the underlying device driver(?), so maybe the
> driver was updated with the firmware update so it doesn't expose the (?)
> fan control.
>
> What was the name and contents of the file you are trying to recreate?
>
>
>> -----Original Message-----
>> From: [email protected] 
>> [mailto:[email protected]] On Behalf Of Bryce 
>> Stenberg
>> Sent: Tuesday, October 13, 2015 3:38 PM
>> To: Canterbury Linux Users Group
>> Subject: [Linux-users] Permissions: root access but can't write to file?
>>
>> Hi,
>>
>> I've ssh'd into a Netgear NAS box to do a quick hack to adjust the fan 
>> speeds up (previous adjustments disappeared on latest firmware update). I 
>> need to do this as  Netgear's defaults are a bit low, at different times 
>> I've already had two 3TB drives fail possibly related to running hot.
>>
>> Anyway, I'm trying to copy a file into '/sys/devices/platform/nct6775.2608' 
>> but get:
>> -bash: Permission denied
>>
>> I think this is based on debian but not sure, nor do I know how to tell.
>>
>> The directory listing for 'nct6775.2608' is:
>>
>> drwxr-xr-x  4 root root    0 Oct 13 14:37 nct6775.2608
>>
>>
>> Sudo doesn't seem to exist, and I am connected as 'root'. I read the above 
>> permissions to say root should be able to read, write and execute - but not 
>> today :(
>>
>> So I've added files here in the past, before this update, does anyone have 
>> any idea what I might be missing?
>>
>> Thanks,
>>   Bryce Stenberg.
>> _______________________________________________
>> Linux-users mailing list
>> [email protected]
>> http://lists.canterbury.ac.nz/mailman/listinfo/linux-users
>> _______________________________________________
>> Linux-users mailing list
>> [email protected]
>> http://lists.canterbury.ac.nz/mailman/listinfo/linux-users
>>
>
> _______________________________________________
> Linux-users mailing list
> [email protected]
> http://lists.canterbury.ac.nz/mailman/listinfo/linux-users
> _______________________________________________
> Linux-users mailing list
> [email protected]
> http://lists.canterbury.ac.nz/mailman/listinfo/linux-users
_______________________________________________
Linux-users mailing list
[email protected]
http://lists.canterbury.ac.nz/mailman/listinfo/linux-users

Reply via email to