2022 Developer Survey is open! Take survey.

Questions tagged [sysfs]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

How to get schedule delay information of each cpu?

I know that the scheduling information of each process can be obtained from procfs, but I don't know how to get the schedule delay information of each cpu. It's better to use procfs or syscall.
user avatar
  • 1
0 votes
1 answer
359 views

How to update/refresh changed partlabels as reported by lsblk?

On Linux, the command lsblk -o partlabel will display the partlabel for block devices. I have used gdisk to change a partlabel. After the change, lsblk is still reporting the old value of the ...
user avatar
  • 1,226
2 votes
1 answer
47 views

Any way to make sysfs file immutable?

I'm trying to make /sys/fs/selinux/enforce always contain "1", and prevent it from being changed. I've been able to do this on /etc/selinux/config by running chattr +i /etc/selinux/config ...
user avatar
0 votes
0 answers
7 views

SysFS fanX_min Attribute Explanation

Is there any documentation on what the sysfs fanX_min (where X is a number) attribute represents? It's part of the sysfs interface and used by some hwmon drivers, but the documentation (https://www....
user avatar
  • 2,087
0 votes
0 answers
23 views

How to mount a disk in pre-init environment

I'm working on a test that starts a VM (in OpenStack) by mounting a disk with pre-provisioned operating system (let's call it vda, with a single partition vda1). Then the test adds a bunch more disks, ...
user avatar
  • 605
0 votes
0 answers
42 views

Linux cpufreq scaling_govenor "ondemand" doesn't work as expected

On a single-core i.MX6solo with 800 MHz, I have set three operating points at around 400, 500 and 800 MHz. At 800 MHz, the system load (according to top) is usually around 55%, every now and then ...
user avatar
  • 11.2k
2 votes
1 answer
121 views

Is there any good documentation on sysfs? [closed]

I'm looking for good documentation for sysfs; the man page is incomplete and even has one sentence that just stops half way through. I've found the Linux kernel documentation but that's a little bit ...
user avatar
0 votes
0 answers
34 views

Change led trigger on disk sleep status changes and activity on Debian 9

I need to control a led on a NAS with a custom Debian 9 firmware as follow: when the disk is powered on and there is no activity > stay on when the disk is powered on and there is activity > ...
user avatar
  • 101
2 votes
2 answers
700 views

How to attach a listener to sysfs files?

How to watch for sysfs file changes (like /sys/class/net/eth0/statistics/operstate) and execute a command on content change? inotify does not work on sysfs I don't want to poll. I want to set a ...
user avatar
0 votes
0 answers
94 views

Matching PCI and Thunderbolt devices

Is there a reliable way to find which PCI devices (eg. video card) are connected via a particular Thunderbolt device (eg. eGPU enclosure, Dock) on a Linux system? Context In my particular use-case, I'...
user avatar
  • 1
3 votes
1 answer
59 views

Can I relate a USB device from /sys to a particular USB connector from Dmidecode?

Having had a bit of an internet-scour, I think the answer may be "No", but: Can I find the USB port description (as per dmidecode) corresponding to the USB device from sysfs? We can ...
user avatar
  • 133
1 vote
0 answers
30 views

sysfs: Correspondence between modules and drivers?

In sysfs, one can find which driver is handling a device. For example, the following shows that the driver handling the device led0 is called leds-gpio. pi@raspberrypi:/sys/devices/platform/leds/leds/...
user avatar
  • 11
0 votes
1 answer
460 views

Concurrent write access to character device file

I am wondering what happens when two processes write to a character device file at the same time. Currently, I am mostly worried about /dev/spidev0.0 on a Raspberry pi. If I assume correctly that it's ...
user avatar
2 votes
0 answers
85 views

understand output and format of `udevadm info /dev/sda1`

Last time I was responsible for a unix system it was AT&T many years ago. I've finally got unix (linux) at home again. Things have changed. I'm working on understanding udev and /sys. The output ...
user avatar
0 votes
1 answer
181 views

Is there a reliable path to specific device events?

I'm running ubuntu linux and I have a bluetooth mouse that I would like to capture evdev events from. The problem is that the event device can potentially be different any time I connect the mouse: ...
user avatar
  • 285
2 votes
5 answers
1k views

Thermal throttling on i7-1185G7

I have a brand new i7-1185G7 laptop whose CPU is being heavily throttled on Linux 5.8.0, even though it's thermals are in bounds (albeit a bit high). $ sensors ucsi_source_psy_USBC000:001-isa-0000 ...
user avatar
  • 193
0 votes
2 answers
854 views

Why, after unmounting cgroup v1, do I still have empty directories under /sys/fs/cgroup?

I just unmounted cgroup version 1, leaving just a single cgroup2 mount on my system. $ mount | grep -i cgroup tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=...
user avatar
  • 22.5k
0 votes
1 answer
230 views

bind ltc2947-spi driver on BeagleBone Black

Having trouble binding a SPI driver on the BeagleBone Black. The driver in question, ltc2947-spi, is in the linux mainline, but not in the beaglebone kernel tree. When I get this working, I'll submit ...
user avatar
4 votes
0 answers
401 views

Why does Linux list USB Host Controller' vendor as "Linux Foundation"?

On any PC where USB host controller is connected to the PCI/PCIE bus I see the following: $ cat /sys/bus/usb/devices/usb1/{idVendor,idProduct,manufacturer,product,serial} 1d6b 0002 Linux 4.14.157-...
user avatar
  • 2,949
0 votes
1 answer
48 views

nvmem device tree naming pattern

In the nvmem.yml there is properties: $nodename: pattern: "^(eeprom|efuse|nvram)(@.*|-[0-9a-f])*$" I have a hard time finding the pattern in the source code itself. Where can I find ...
user avatar
  • 101
0 votes
1 answer
179 views

PCI-E, sysfs and user-id permission weirdness

On our 3.X series kernel, a proprietary PCI-Express device has a proprietary kernel driver. We're seeing some weird errors on trawling PCI capabilities. I can not find any great docs - does anyone ...
user avatar
  • 3
3 votes
1 answer
2k views

How does Linux detect number of "possible" CPUs

I have an AMD CPU with 8 cores and 2 threads per core. Linux (correctly) shows this as 16 "cpus". However, sysfs actually shows 32 "possible" cpus, with 16 of them not present and ...
user avatar
1 vote
1 answer
945 views

Get USB device tree without lsusb

I have a USB device and would like to see what it's parent device is, i.e. which hub it is connected to. The reason is that I'm debugging an issue with sleep mode. However, this is on an embedded ...
user avatar
  • 559
1 vote
0 answers
27 views

Why does "some" line have higher delay that "full" one due to memory pressure?

I have the following stats: cat /sys/fs/cgroup/user.slice/memory.pressure some avg10=0.00 avg60=0.00 avg300=0.00 total=1954777 full avg10=0.00 avg60=0.00 avg300=0.00 total=1626895 The documentation ...
user avatar
  • 3,939
6 votes
2 answers
383 views

Grep inside /sys file returns nothing

I want to search for a string inside the /sys/class/tty/* directories. So I tried with: # grep -rn path -e pattern but it returns nothing. Example: # cat /sys/class/tty/ttySTM0/iomem_base 0x40010000 ...
user avatar
  • 557
0 votes
1 answer
915 views

negetive width in bit field '<anonymous>' while running 'make'

Thank you for reading this question. I was trying to compile a kernel module that works with sysfs, and while executing make I ended up with this error. Can somebody please help me understand what ...
user avatar
0 votes
1 answer
72 views

Easy and elegant way to toggle values in /sys/

What I really want is a NOT and write. I have files that are either 1 or 0, like /sys/class/leds/platform::mute/brightness /sys/class/leds/platform::micmute/brightness What I want is a way to turn ...
user avatar
  • 22.5k
2 votes
0 answers
636 views

how can I remove an event from /dev/input/event*

some specs: os : kubuntu 18.04 driver : thinkapad_acpi 0.26 laptop : thinkpad x1 yoga gen4 I got a new laptop. It's a 2 in 1, I want to be able to use the keyboard in tablet as I'm plugged ...
user avatar
1 vote
1 answer
2k views

What does this linux kernel panic message: sysfs: cannot create duplicate filename mean?

[1.503917] NET: Registered protocol family 17 [ 1.504612] libphy: mdiobus_find: mii bus [igb_enet_mii_bus] found 1.504711] sysfs: cannot create duplicate filename '/kernel/marvell/...
user avatar
0 votes
1 answer
157 views

What does the /sys/class/block/*/hidden file mean?

Block devices(but not partitions) exposed to userspace through sysfs have a file called hidden, but it doesn't appear documented anywhere? What does it mean?
user avatar
0 votes
1 answer
293 views

How to get connected block devices on Linux

What APIs/interfaces are available for this? I think I want sysfs, but according to what various kernel documentation exists, that interface can be summed up as "you're not allowed to use any of this, ...
user avatar
2 votes
1 answer
894 views

What are BSDs' equivalents to /proc and /sys?

The amount of information that can be gathered in linux using the procfs and sysfs which are normally mounted at /proc and /sys is quite substantial. Being not on a FreeBSD install I am amazed to ...
user avatar
  • 517
0 votes
1 answer
2k views

"echo: write error: invalid argument" writing to sysfs

From the instructions for setting up bcache: echo cset.uuid > /sys/block/bcache0/bcache/attach What happens: root@gentooserver ~ # echo 45511b33-6bb8-42d5-a255-3de1749f8dda > /sys/block/...
user avatar
0 votes
0 answers
219 views

sysfs folder symbolic link behavior

I encountered this behavior that I can't explain. In the sysfs, there is a symbolic link but it looks impossible to me: me@test:/sys/block/sde$ ll ... lrwxrwxrwx 1 root root 0 Oct 1 2019 device -...
user avatar
  • 467
10 votes
1 answer
4k views

"cd" into /sys/kernel/debug/tracing causes permission change

I've faced a really strange issue today, and am totally helpless about it. Some of the servers I manage are monitored with Nagios. Recently I saw a disk usage probe failing with this error: DISK ...
user avatar
  • 203
0 votes
0 answers
106 views

Group ownership changes by itself on restart

I changed window managers and now need to be able to change /sys/class/backlight/intel_backlight/brightness (because the new wm cannot change screen brightness natively). I created a user group ...
user avatar
  • 1,131
3 votes
0 answers
569 views

How to provide user access to /sys/class/backlight/acpi_video0/brightness programmatically (udev?)

I control backlight through /sys/class/backlight/acpi_video0/brightness with a script (via sudo) that provides a simple script to increment/decrement, set, retrieve and restore last backlight setting ...
user avatar
1 vote
0 answers
2k views

Reading system information (/sys/class/dmi/id) without sudo

I am trying to get a unique system identifier. During research I stumbled on the system serial number which is exactly what I need (also present on the computer case). The serial number is written in ...
user avatar
  • 111
1 vote
0 answers
272 views

Mismatch in USB devices listed by lsusb and sys filesystem

I work on a Ubuntu 18.04 LTS PC. I have a need to find out the USB device name that matches a particular USB device ID. When I run the lsusb command to list USB device interfaces, here is the output I ...
user avatar
2 votes
0 answers
129 views

Some USB devices will automatically reconnect after I unbind it, how to disable it long time?

I'm trying to disable my two USB keyboard on my linux system, the first one can unbind long time until I unplug then plugin and the number lock light is off during this time. But the other one can not ...
user avatar
3 votes
1 answer
671 views

is there any tool to show hierarchy of devices in Linux?

I want to see a tree-like structure of all devices in Linux. In Windows, I can use Device Manager with "show by connection". BSD systems report such data to dmesg in format "child at parent" and have ...
user avatar
3 votes
1 answer
924 views

Why does folder hierarchy in /sys/bus/platform/devices change on reboot?

I'm using conky to show a status of my CPU temperatures, and overall I'm satisfied, except for one thing: Every time I reboot, the temperature status breaks! Looking at conky's stderr I see this: ...
user avatar
  • 131
0 votes
1 answer
1k views

Driver development vs sysfs access vs mmap for GPIOs

I believe I could not fully understand the benefits of writing device drivers in embedded systems for some specific devices, such as GPIO, when there are alternative ways of doing the same job. You ...
user avatar
4 votes
2 answers
2k views

Can user space programs provide/implement sysfs or procfs files to pass data to and from a program?

Kernel space device drivers usually implement directories and file that show through /sys or /proc. Can the long running user space programs do this as well? I have a daemon or long running program ...
user avatar
  • 169
0 votes
1 answer
121 views

After I unbind the Trackpoint driver (psmouse), the driver re-bound when I press it. What causes this?

For background information, see Manual driver binding and unbinding. I can unbind the Trackpoint driver on my Thinkpad: $ cd /sys/bus/serio/drivers/psmouse/ $ ls -l total 0 --w-------. 1 root root ...
user avatar
  • 44.3k
3 votes
1 answer
1k views

Why can't tree fully list /sys/class/hwmon? And how could I do that?

If I understand correctly, in Linux, everything is a path, right down to each piece of hardware. I am trying to get information about how my sensors are structured, so I thought I would just use tree ...
user avatar
10 votes
1 answer
3k views

Debian: cannot remove symlink in /sys/: operation not permitted

I ran some commands without completely understanding them while trying to get screen brightness working and now I'm stuck with a nasty symlink in '/sys/class/backlight/asus_laptop' that I am trying to ...
user avatar
  • 203
3 votes
0 answers
188 views

Linux permanently hung after running a grep command on "/sys/*" directory

I ran the command: sudo grep -r -i RETP /sys/* On two systems: Oracle Linux 7.5 server (256 GB RAM, 2 Intel® Xeon® Gold 6142 Processor) and on my desktop PC with Ubuntu 18.04 (16 GB RAM, Core i5-...
user avatar
1 vote
0 answers
57 views

Can I somehow identify the physical machine from inside an OpenVZ container?

I am using some VPSes in OpenVZ containers. As I can see, our hosting provider somes moves them between his physical machines. It also means unwaited (and unexpected) reboots. I have no technical ...
user avatar
  • 8,374
2 votes
0 answers
721 views

Do Linux cpufreq governers temporarily change sysfs's scaling_max_freq?

The linux documentation of the variable sysfs scaling_max_freq reports Maximum frequency the CPUs belonging to this policy are allowed to be running at (in kHz). This attribute is read-...
user avatar