devices

How can I turn off a USB Lamp in Ubuntu?

How can I turn off a USB Lamp in Ubuntu? I bought a USB lamp that I want to turn ON/OFF using commands (my purpose is to setup some CRON jobs to turn it ON at certain times). I researched several answers, but none worked. I tried outputting to /sys/bus/usb/drivers/usb/unbind, /sys/bus/usb/devices/usb1/power/level, the uhubctl tool, using …

Total answers: 1

What's the reason to add a symlink to /dev directory with udev rules?

What's the reason to add a symlink to /dev directory with udev rules? I understand that you can write custom udev rules to create a symlink in /dev directory. But what is the use of having a symlink in /dev? What is the symlink linking to? I know you can interact with regular links in …

Total answers: 1

Which service creates /dev/fb0 node?

Which service creates /dev/fb0 node? I want to update the console-setup.service to detect screen resolution using fbset -s and adjust console font size accordingly. For fbset, I need /dev/fb0 to be present, but I don’t know which service I should create a dependency on. How is /dev/fb0 created on startup? Asked By: Tomasz Garbus || …

Total answers: 1

Are device nodes stored as files or just special entries in directories?

Are device nodes stored as files or just special entries in directories? My question is related to the way device nodes are implemented in Linux. I know there are pseudo files systems like udev or devtmpfs available – in this case there is no real storage behind and the file system is an illusion presented …

Total answers: 1

How to change the major and minor number of a device file?

How to change the major and minor number of a device file? I am currently working with an Embedded Linux Board and need to use the serial port, which is represented by the device file /dev/ttyS0. Upon running the command ls -l, I observed that the major and minor numbers for this device are 247 …

Total answers: 1

Question about the major number of disk device files

Question about the major number of disk device files We have some older RHEL 5.8 systems running with the disk array (HP P2000) via the FC HBA (qla2xxx). They all worked fine for many years, until recently when we suddenly noticed that there are a few lun disks from the same disk array with a …

Total answers: 1

Is there a way to determine which module corresponds to which major number?

Is there a way to determine which module corresponds to which major number? In Linux, the device files in /dev have major and minor numbers: # ll /dev … crw–w—- 1 root tty 4, 8 Jan 5 09:02 tty8 crw–w—- 1 root tty 4, 9 Jan 5 09:02 tty9 crw-rw—- 1 root dialout 4, 64 …

Total answers: 1

Datasheets as references in making device drivers

Datasheets as references in making device drivers Aside from FreeBSD or Linux operating systems’ design structure and C programming knowledge, are datasheets enough as additional references in making device drivers? Asked By: ordinary_guy || Source No, they’re not. A datasheet contains data about what the device can do. For example, an airplane’s datasheet would contain …

Total answers: 1

Create duplicate link for /dev/mapper devices – Consequences

Create duplicate link for /dev/mapper devices – Consequences I have an Ubuntu 18.04 server that is not able to perform "sudo apt upgrade" at the moment. It is receiving this message whenever we try to update any packages: /usr/sbin/grub-probe: error: failed to get canonical path of `/dev/mapper/rootvg-rootlv’. run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1 The …

Total answers: 1

Can device numbers change after reboot?

Can device numbers change after reboot? I’m building a service that checks for file uniqueness on block devices. File uniqueness on a system appears that it can be guaranteed through the pair (st_dev, st_ino), where st_dev is the device number and st_ino is the inode number. These values come directly from the stat system call. …

Total answers: 2

How can I make a loopback file descriptor in bash?

How can I make a loopback file descriptor in bash? I want to be able to write data to a file descriptor then read it back later in bash. This would look like: # some line to create LOOPBACK_FD echo foo >${LOOPBACK_FD} cat <${LOOPBACK_FD} # foo is printed I know that I can use variables …

Total answers: 1

udev rule not working on Arch to disable touchpad when USB mouse connected

udev rule not working on Arch to disable touchpad when USB mouse connected I’m trying to write a udev rule to disable (and re-enable) my trackpad when a USB mouse is connected. Currently, my rule looks like: ACTION=="add", ATTRS{bInterfaceProtocol}=="02", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceSubClass}=="01", ENV{REMOVE_CMD}="/usr/bin/synclient TouchpadOff=0", RUN+="/usr/bin/synclient TouchpadOff=1" and I’ve saved this in /etc/udev/rules.d/99-mouse-touchpad.rules and reloaded using udevadm …

Total answers: 1

Why does udev automatically whitelist my RAID card and what is the function of this whitelisting?

Why does udev automatically whitelist my RAID card and what is the function of this whitelisting? I’ve been learning to use udev and noticed that when I run udevadm test –action="add" /sys/block/sdc I see the following: GROUP 6 /usr/lib/udev/rules.d/50-udev-default.rules:59 IMPORT ‘scsi_id –export –whitelisted -d /dev/sdc’ /usr/lib/udev/rules.d/60-persistent-storage.rules:50 starting ‘scsi_id –export –whitelisted -d /dev/sdc’ ‘scsi_id –export –whitelisted …

Total answers: 1

Can't remove or unmount loop device on Debian

Can't remove or unmount loop device on Debian I have a loop device which shows up when I do losetup –all that I have been unable to remove. So, I basically got myself into this issue because a created a raw image of a microSD card and then I used kpartx to mount the partitions …

Total answers: 1

Why isn't my CH341a Device Getting Assigned a Device Path (/dev/ttyUSB0)

Why isn't my CH341a Device Getting Assigned a Device Path (/dev/ttyUSB0) I have a CH341a Programmer and when I plug it into a usb port everything seems to be working except it doesn’t get assigned to a Device Path (eg /dev/ttyUSB0). Does anyone have any clue as to why this might be happening, or how …

Total answers: 2

What is `/dev/sda0`? Is it a standard thing?

What is `/dev/sda0`? Is it a standard thing? While trying to understand this other question, I encountered /dev/sda0 being mentioned. I have some experience in Linux and I’m used to this scheme where sda, sdb, … are devices and sda1, sda2, … , sdb1, sdb2, … are partitions (each inside the respective device). In this …

Total answers: 4

How can I permanently change a network device name in CentOS8?

How can I permanently change a network device name in CentOS8? I want to permanently change the device name of a network interface using a portable script. The interface gets the ugly name of enp02fghjkl1. I want to give a pretty name of netface1. I have tried using ip link and nmcli and so many …

Total answers: 1

What happens when Linux goes out of letters for drives?

What happens when Linux goes out of letters for drives? Let’s say I have 50 USB flash drives. I assume they get to be /dev/sda to /dev/sdz. What comes after /dev/sdz? Asked By: DEKKER || Source It will go to /dev/sdaa, /dev/sdab, /dev/sdac, etc. Here is a comment from the source code: /** * sd_format_disk_name …

Total answers: 1

How do I "get write permission for device files" in Linux?

How do I "get write permission for device files" in Linux? I have just install brightnessctl to control my screen brightness, but can only run it as root. Doing otherwise prints the suggestion I "get write permission for device files". What is the correct way to do this? I would also like to be able …

Total answers: 3

How to mute/unmute default sound output

How to mute/unmute default sound output What’s the generic way to mute/unmute my system’s default sound output? $ amixer set Master mute amixer: Unable to find simple control ‘Master’,0 $ amixer scontrols Simple mixer control ‘IEC958’,0 Simple mixer control ‘IEC958’,1 Simple mixer control ‘IEC958’,2 Simple mixer control ‘IEC958’,3 Simple mixer control ‘IEC958’,4 Simple mixer control …

Total answers: 3