Sysfs is a Linux filesystem, normally mounted on /sys, which provides information about hardware and kernel components.

learn more… | top users | synonyms

1
vote
0answers
23 views

Multiple entries in /proc/bus/input/devices for same device

I have one USB touchscreen connected to my hardware setup but using cat /proc/bus/input/devices gives me two entries for the same device : I: Bus=0003 Vendor=2965 Product=5023 Version=0110 N: Name="...
1
vote
0answers
17 views

How to delete a device parameter for a cgroup?

Values of a specific parameter (for example, blkio.throttle.write_bps_device) for all devices are stored in a single file. echo "$MAJOR:$MINOR $LIMIT" > blkio.throttle.write_bps_device inserts/...
2
votes
1answer
43 views

Unable to edit the /sys/block/sdX/device/queue_depth file

I'm trying to increase my SSD's queue depth value with the following command: echo 64 > /sys/block/sda/device/queue_depth But I receive the following error: bash: echo: write error: Invalid ...
2
votes
1answer
63 views

How to find the pci slot of an usb controller in Linux?

I have a nearly common Linux machine here. So, it has a PCI (*-X, etc) bus, on that some USB controllers, and I have USB devices on these USB controllers. Similar to this: $ lspci|grep USB 00:12.0 ...
4
votes
2answers
92 views

Get block device model name and manufacturer from pseudo-fs

[gala@arch ~]$ sudo !! sudo hdparm -i /dev/sda /dev/sda: Model=KINGSTON SHFS37A120G, FwRev=603ABBF0, SerialNo=50026B725B0A1515 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol&...
0
votes
2answers
24 views

Is sysfs a strict subset of procfs? [duplicate]

Is the information that the Linux kernel provides to the user via sysfs a strict subset of the information that the Linux kernel provides to the user via procfs? If not, then which information is ...
1
vote
1answer
59 views

Programmatically determine the IRQs associated with a network interface

What is the most reliable way to programmatically determine the IRQs associated with a network interface, given the name of the interface (e.g. eth0)? I'm okay with a best-effort approach, but I'd ...
0
votes
0answers
41 views

Is there a way to get partition information of a disk with sysfs?

my first question here - so please, don't be too hard with me... As the title says: I am wondering if there is a way to get partition information of a disk with sysfs. I know about some different ...
0
votes
1answer
47 views

Synchronous I/O on sysfs files

I'd like to guarantee that what I write to a sysfs file (specifically the /sys/class/gpio files) is sync'd to the actual register. The code I had initially opened the file with the O_SYNC flag, which ...
1
vote
0answers
49 views

Methods to find out what remounts /sys readonly (RHEL 6.7)

A few colleagues intermittently have issues with suspending/hibernating their computers (running RHEL 6.7, normal workstation install, nothing special). As it turned out, the problem was that /sys was ...
1
vote
0answers
153 views

when running `udevadm test`: `no db file to read /run/udev/data/+gpio_sw:PA7: No such file or directory`

I am trying to write an udev rule that matches a GPIO Pin of my Orange Pi (the GPIOs use the gpio-sunxi kernel module). My ultimate goal is to let users who are member of a particular group access ...
1
vote
0answers
120 views

Reconstructing dmidecode binary dump from /sys/firmware/dmi/tables

Background dmidecode utility is able to create a raw binary dump using --dump-bin option: root@here:~$ dmidecode --dump-bin foo.dump which can be re-used on another machine, producing effect as if ...
3
votes
2answers
491 views

sysfs and devtmpfs

Ulrich Dangel explains very well the difference between devtmpfs and udev. What about sysfs? I understand that the kernel uses sysfs to export device nodes to user space to be used by udev. So ...
1
vote
0answers
52 views

A/D pins always read max (1023)

I am using the Aria G25 board from Acme Systems. I have their Terra board breakout. I have also asked this question on their google groups but thought it might be a more general issue so have posted ...
0
votes
0answers
107 views

Getting the block device from an udev scsi_disk subsystem (udev C API)

I am using the udev C API to monitor connection and disconnection of SATA drives. struct udev_monitor *mon; mon = udev_monitor_new_from_netlink(udev, "udev"); ...
1
vote
1answer
67 views

Are Modules listed under /sys/module all the Loaded Modules?

I'm wondering if I can use the directory listing of /sys/module instead of lsmod to get a list of currently loaded modules. Is that the list of loaded modules only? Or maybe that combined with /sys/...
3
votes
2answers
752 views

What is the difference between /sys/block/sda1/stat and /sys/block/xvda1/stat?

On my local machine, I have /sys/block/sda1/stat. On an Amazon machine, I have /sys/block/xvda1/stat. When I run cat /sys/block/sda1/stat or cat /sys/block/xvda1/stat both give 11 fields of output. ...
0
votes
4answers
1k views

How to get hard disk information from /proc and/or /sys

How can I get hard disk capacity, usage, etc. using the /proc or /sys filesystems? If it is possible, please tell me which file(s) I need to process to get that information.
2
votes
1answer
378 views

What is the relationship (similarity and differences) between /proc/devices and /dev entries in Linux?

When we register a driver, the "name" parameter shows up in /proc/devices, yet we can write to the devices using the entry in /dev corresponding to the device. What are the core ideas behind /proc and ...
3
votes
1answer
220 views

Why am I able to write a module parameter with READ ONLY permissions?

I wrote the following simple linux kernel module to test the param feature: #include<linux/module.h> int a = 5; module_param(a, int, S_IRUGO); int f1(void){ printk(KERN_ALERT "hello ...
21
votes
4answers
2k views

Making Linux read swap back into memory

The Linux kernel swaps out most pages from memory when I run an application that uses most of the 16GB of physical memory. After the application finishes every action (typing commands, switching ...
1
vote
1answer
151 views

Reading from sysfs returns EINVAL

box101:~ # cat /sys/class/net/eno1/carrier cat: /sys/class/net/eno1/carrier: Invalid argument What the...? OK, so what does strace say? ... open("/sys/class/net/eno1/carrier", O_RDONLY) = 3 fstat(3,...
2
votes
1answer
131 views

Managing settings from /sys directory in arch

I can manage /proc directory settings with sysctl and config files in /etc/sysctl.d but is there equivalent tool for the /sys directory? I want to change the I/O scheduler to bfq permanently. Should ...
0
votes
1answer
99 views

How to figure out primary/secondary IDE channel via sysfs (if possible)

Though I've got quite a good basic understanding of sysfs meanwhile, there are still things I cannot solve on my own. For a starter, I'd like to figure out via sysfs (later by scripting of course) ...
5
votes
1answer
1k views

Difference between /dev and /sys

Exactly what is the difference between devfs and sysfs? Both seem to maintain a list of hardwares attached to the system. Then why the need for 2 separate fs even arose? As far as I can get /sys ...
1
vote
1answer
713 views

Allow non-root user go get network traffic statistics

I know that I can use cat /sys/class/net/eth0/statistics/rx_bytes to see the amount of received bytes. Sadly I only can run this command as root. When I am another user, I get cat: /sys/class/net/...
4
votes
0answers
2k views

Is it possible to get network interface index not via /sys?

So what I'm looking for is an interface index (or name) but the real one. if_nametoindex(3) and ioctl(2) don't seem to help me here. Now the only way I found how to do this is via /sys. Let me ...
4
votes
1answer
1k views

Getting information from sysfs

I'm creating a script for polling information about network interfaces. For this I get some data from /sysfs. Everything went fine until I wanted to clarify all possible states of an interface (Which ...
7
votes
1answer
103 views

How do I know what decompression algorithms are compiled-in into the linux kernel?

If /proc/config.gz is unavailable, how do I know what decompression algorithms the running kernel is capable of using on a compressed cpio initramfs? Is the gzip algorithm always available, even when ...
3
votes
1answer
315 views

How do I find out what filesystem drivers are compiled-in into the linux kernel?

On a running linux system, what is a portable (among linux distributions) way to find out what filesystems the current kernel has compiled-in (not through modules) support for? Consider for example ...
1
vote
1answer
252 views

Accessing GPIO after kernel boots

my rootfs.cpio has only following files: [root@localhost extract]# ls dev init tmp dev has console only. init is cross-compiled from the program given at the end: Then I make a my image and ...
2
votes
1answer
394 views

USB modalias. Meaning of numeric values

For the USB modaliases, I know that the values corresponding to the device's vendor and product ids can be found here: http://www.linux-usb.org/usb.ids Which online resources and/or kernel source ...
16
votes
1answer
8k views

Difference between /dev and /sys/class?

What is the difference between the device representation in /dev and the one in /sys/class? Is one preferred over the other? Is there something one offers and the other doesn't?
4
votes
4answers
9k views

Unable to write to a GPIO pin despite file permissions on /sys/class/gpio/gpio18/value

This is on a Raspberry Pi. Here's the output of sudo ls -lL /sys/class/gpio/gpio18: -rwxrwx--- 1 root gpio 4096 Mar 8 10:50 active_low -rwxrwx--- 1 root gpio 4096 Mar 8 10:52 ...
0
votes
1answer
2k views

/sys/class filesystem on Linux

On Linux (Ubuntu 11.10 on a ARM processor in my case) I was looking for a way to measure CPU temperature. I found out that a cat /sys/class/thermal/thermal_zone0/temp did the trick. Now I wonder: ...
3
votes
3answers
2k views

How to find out easily whether a block device (or a part of it) is mounted somehow

I want to know what the easiest way is to determine (without root privilege) whether a block device (say sdb) or any part of it is mounted (and which part of it). Checking /proc/mounts for sdb is not ...
3
votes
1answer
2k views

Kernel recognizes USB device but then I can't find it in /sys or /dev

When I connect my Samsung 390G (a cheap cell phone!) to Ubuntu 13.04, dmesg seems to indicate that the storage device thereon is recognizable: [Sun Dec 29 01:26:10 2013] scsi16 : usb-storage 2-1.2:1....
3
votes
2answers
2k views

Kernel module parameters vs /sys/class/… explanation

I was making (my first) kernel module to play with the gpio pins of my pandaboard and interrupts. Already "built-in", I noticed you can do (briefly) cd /sys/class/gpio echo 138 > export # a file ...
7
votes
2answers
2k views

Which of proc, sys etc. should be bind-mounted (or not) when chrooting into a “replacement” distribution?

This answer to another question basically boils down to chrooting into another Linux distribution in order to mainly use that as a replacement to its too restricted (but irreplaceable) parent. The ...
3
votes
1answer
152 views

Finding a char device in /sys using a Bash script?

I have one of these and I am trying to write a Bash script for finding the device path in /sys. My approach goes something like this: start in /sys/modules/usbled since this is the name of the ...
3
votes
1answer
444 views

Using Bash to write to a device in /sys?

I have one of these: Basically, it's a USB device with three LEDs (red, green, and blue). The Linux kernel has supported this device through the usbled module for quite some time now. However, I ...
5
votes
2answers
345 views

Can you identify transport via sysfs?

I'm writing a script, and I'm interested in being able to identify the transport class (fc - "fibre channel", scsi, iscsi, etc.) for a given block device. I can retrieve this information via ls -l /...
2
votes
1answer
322 views

CONFIG_GPIO_SYSFS makes /sys/class/leds disappear

I have an embedded Linux board I'm working on, with a button and a couple LEDs. By default, I can control the LEDs via /sys/class/leds/redled/brightness However, I have no way to monitor the ...
9
votes
3answers
5k views

Why does rsync fail to copy files from /sys in Linux?

I have a bash script which uses rsync to backup files in Archlinux. I noticed that rsync failed to copy a file from /sys, while cp worked just fine: # rsync /sys/class/net/enp3s1/address /tmp ...
2
votes
0answers
2k views

How to retrieve sysfs devpath of a USB flash drive given its corresponding partition sysfs path?

I have a USB flash drive connected to a hub. Its storage device partition devpath in sysfs is /devices/pci0000:00/0000:00:12.2/usb6/6-1/6-1.2/6-1.2:1.0/host10/target10:0:0/10:0:0:0/block/sdb/sdb1. I ...
1
vote
2answers
688 views

Is there a generic approach to automatically make some sysfs controls ch{own,mod} user-accessible?

My current primary question motivator: $ ls -l /sys/devices/platform/samsung total 0 -rw-r--r-- 1 root root 4096 27. jaan 14:17 battery_life_extender drwxr-xr-x 3 root root 0 19. jaan 18:40 leds ...
12
votes
3answers
5k views

How does systemd-tmpfiles work?

I'm trying to change the value of /sys/bus/usb/devices/4-3/power/wakeup at every boot (4-3 according to my lsusb, it's the keyboard ID). The default value is: # cat /sys/bus/usb/devices/4-3/power/...
0
votes
0answers
398 views

Settings value in /sys/devices/platform/i8042/serio1/serio2/speed as no effect

I'm following this tutorial to ajust the TrackPoint speed for my Lenovo T420. However, setting a value in /sys/devices/platform/i8042/serio1/serio2/speed has no effect. The trackpoint is unaffected ...
15
votes
4answers
568 views

How do I learn what I can do with /proc and /sys

I'd like to know more about the advanced uses of the /proc and /sys virtual filesystems, but I don't know where to begin. Can anyone suggest any good sources to learn from? Also, since I think sys has ...
46
votes
4answers
17k views

What is the difference between procfs and sysfs?

What is the difference between procfs and sysfs? Why are they made as file systems? As I understand it, proc is just something to store the immediate info regarding the processes running in the ...