Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [devices]

devices refers to questions about the Unix/Linux device special files, normally these are under /dev. Do not use this tag for physical devices (for that use e.g. usb or pci).

Filter by
Sorted by
Tagged with
30
votes
1answer
23k 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?
24
votes
1answer
36k views

using devtmpfs for /dev

I have noticed the following option in the kernel: CONFIG_DEVTMPFS Device Drivers -> Generic Driver Options -> Maintain devtmpfs to mount at /dev And I see that it is enabled by default in the ...
12
votes
1answer
9k views

Explain EV in /proc/bus/input/devices data

Can anybody explain to me what the EV value in /proc/bus/input/devices is? The keyboard always has value 120013. Why?
19
votes
3answers
7k views

Monitor what is being sent to /dev/null?

Just for fun: Is there a way to monitor/capture/dump whatever is being written to /dev/null? On Debian, or FreeBSD, if it matters, any other OS specific solutions are also welcome.
5
votes
5answers
19k views

Creating a character device file

How to create the character device files? I have tried cat > xxx^c But I can't create a character device file
17
votes
2answers
11k views

How does /dev/fd relate to /proc/self/fd/?

$ ls -l /dev/stdin /dev/fd/0 lrwx------ 1 tim tim 64 2011-08-07 09:53 /dev/fd/0 -> /dev/pts/2 lrwxrwxrwx 1 root root 15 2011-08-06 08:14 /dev/stdin -> /proc/self/fd/0 $ ls -l /dev/pts/2 /proc/...
13
votes
5answers
41k views

Why does “cat ttyUSB0” not produce output?

I connected an infrared receiver to a USB port ... (the last line of dmesg tells device file) $ dmesg [10496.596063] usb 7-2: new full-speed USB device number 2 using uhci_hcd [10496.751112] usb 7-2: ...
12
votes
3answers
35k views

How do I find out which process is using my V4L2 webcam?

I tried to run the following: $ vlc -I dummy v4l2:///dev/video0 --video-filter scene --no-audio --scene-path webcam.png --scene-prefix image_prefix --scene-format png vlc://quit --run-time=1 ...
8
votes
2answers
24k views

Allow non-root user to read/write /dev files

In my /dev folder, I would like the following files to be user readable and writable: /dev/ttyUSB0 /dev/gpib0 How do I do this without using chgrp? I can edit /etc/udev/rules.d but I do not know the ...
23
votes
2answers
59k views

set baud speed for tty

How do I set the baud speed for a specific tty (in this case a serial port)? I tried using stty -F /dev/tty.iap ispeed 19200 But get the error Invalid argument for every speed I try (2400, 4800, ...
15
votes
3answers
50k views

PKCS#7 signature not signed with a trusted key

Installed Ubuntu with SIP disabled on MacBook 2017 - 0 issues, booted in seconds. I have been building it out and created a problem while trying to make the WiFi work. At some point (it was very late)...
13
votes
2answers
2k views

Why are < or > required to use /dev/tcp

When trying to call /dev/tcp/www.google.com/80, by typing /dev/tcp/www.google.com/80 Bash says no such file or directory. When looking at other people's code online, they use syntax such as 3<&...
13
votes
2answers
15k views

Using bash's `/dev/udp`, how would I know if the port was open?

I do not have access to netcat or nmap so I'm trying to use bash and the /dev/udp/ special files to test ports. I could do something like: echo "" > /dev/udp/example.com/8000 But $? is always 0 ...
8
votes
4answers
10k views

Prevent claiming of novelty usb device by usbhid so I can control it with libusb?

I have a USB rocket launcher that I wish to experiment with through libusb. However, libusb cannot claim the interface; presumably because the output of usb-devices lists 'usbhid' as the driver for ...
7
votes
3answers
8k views

Udev rule to match multiple node USB device

I have a 3G/GPS device that creates 5 tty nodes, although it's only one physical USB connection. Basically, a multi port usb-serial adapter. I'm trying to create some udev rules to make sure those ...
7
votes
1answer
3k views

Writing raw images safely to USB sticks

Trying lots of different Linux distributions on all kinds of hardware, I find myself typing commands like this quite often: sudo dd if=xubuntu-13.10-desktop-amd64.iso of=/dev/sdc bs=10240 Needless ...
6
votes
2answers
13k views

Prevent usbhid from claiming USB device

Directly related: Prevent claiming of novelty usb device by usbhid so I can control it with libusb? I want to access an RFID reader (works as HID device) from a program that uses libusb-0.1. In the ...
5
votes
1answer
23k views

Kali Linux and RTL8812AU

Currently I am running into an issue where I can't seem to find a way to identify which WiFi adapter I want to use as my primary in Kali (v 2017.1) My laptop has a normal PCI WiFi card inside however ...
15
votes
5answers
23k views

Find out what device /dev/root represents in Linux?

On linux, there is a /dev/root device node. This will be the same block device as another device node, like /dev/sdaX. How can I resolve /dev/root to the 'real' device node in this situation, so ...
10
votes
1answer
3k views

Find out if a specific device is an USB mass storage

Context I'm automating SD card imaging from an existing dd factory image. The SD card is always connected through an external USB card reader and thus appears in the system as a SCSI block device /...
8
votes
2answers
14k views

/dev/input - What exactly is this?

I was curious about how hardware interacted with the OS and came across this post: How do keyboard input and text output work? It seems like a lot of the magic happens in the /dev/input directory. I ...
7
votes
1answer
8k views

look up the device from its tty file?

Here is from my Ubuntu $ ls /dev/*tty* /dev/tty /dev/tty17 /dev/tty26 /dev/tty35 /dev/tty44 /dev/tty53 /dev/tty62 /dev/ttyS12 /dev/ttyS21 /dev/ttyS30 /dev/tty0 /dev/tty18 /dev/tty27 ...
6
votes
1answer
948 views

Why does the UNIX system need so many [0-byte] drives at /dev/* [duplicate]

So I recently asked this question, which lead me to run this command: $ du -sk /dev/* Which outputs about 353 different entries that look like this: 0 /dev/sdt 0 /dev/stderr 0 /dev/stdin 0 /...
6
votes
4answers
8k views

How to know if /dev/hda2 is Primary partition or Extended partition

If all four primary partitions exist on an IDE drive, they are numbered as follows: /dev/hda1 /dev/hda2 /dev/hda3 /dev/hda4 We have also the partitions on a disk with one primary partition and the ...
6
votes
3answers
12k views

Linux : Major and Minor device numbers

What types of devices fall under the major device number category and what types of devices fall under the minor device number category. What is the real difference between the two categories?
5
votes
3answers
6k views

What is a device tree and a device tree blob?

What exactly is a device tree, and a device tree blob? Where can I get its source code for a particular linux version? I found such name while running linux on xilinx chips (having ARM 9), for ...
4
votes
1answer
5k views

Change the number of generated /dev/tty devices

I'm building an embedded Linux system, based on Gentoo. Using udev, all tty devices are probed with a PROGRAM stanza to determine if they are a modem. Right now the system boots up with 64 /dev/tty*. ...
4
votes
1answer
2k views

ssh in chrooted jail doesn't work because of /dev/null operation not supported

I am trying to set up a ssh-chroot jail on one of my NAS servers. The system runs on NAS4Free (which is based on nanobsd). The user should be able to run only one command, which is a bash-script that ...
4
votes
1answer
1k views

How to verify that rsync copied the device correctly when copy-devices is enabled?

This is an extension to Why rsync attempts to copy file that is already up-to-date? I'm attempting to use the --copy-devices patch to rsync to copy an entire disk drive and store it as an image on ...
3
votes
1answer
132 views

give group permissions to specific device

I have a panning web camera I built, (future robot arm). The camera pans via a web interface (cgi scripts and JS interface) which access an arduino. To enable sending of commands via the interface, I ...
2
votes
1answer
184 views

Standard way to expose device file to userland applications running on an unprivileged user account?

I just finished the first version of a Linux kernel module I've written in C. The module creates a device file (/dev/wn0) that controls a USB device with three LED lights. For example, running as root,...
2
votes
1answer
2k views

Reserve ports for modem

I have a modem with 16 ports used for sending SMS. When it's connected to my Linux machine, I get 16 ports from ttyUSB0 to ttyUSB15. Currently if I remove this modem and attach another, I get 16 ...
2
votes
2answers
907 views

A start job is running for eth0

I am using a new installation of Arch Linux and whenever I boot my system I have to wait for 90 seconds as there is a start job running for my network interfaces. I installed Arch yesterday and ...
1
vote
1answer
528 views

Why does tapping a TTY device only capture every other character?

So, I came across the ttyname function (unistd.h) and had to test it out. #include <unistd.h> #include <stdio.h> int main(void) { printf("%s\n", ttyname(0)); return 0; } On my ...
8
votes
1answer
3k views

rsync's relationship with special files

I'm trying to transfer some existing backups from one system to another. The older backup system seems to have managed to back up special files like /dev/hda, /dev/tty0, and /dev/null which look like ...
7
votes
2answers
532 views

Why is the name of the MAKEDEV script spelled in all caps?

While usually all Linux commands are spelled in lowercase, that's not the case of the MAKEDEV script, which is in uppercase. Is there a reason for that?
4
votes
3answers
1k views

/dev/console points to tty0?

I've been trying to understand the /dev/console device, but there are a few things I'm not clear on: What is the purpose of this device? From what I can gather it's just a place for the kernel to ...
4
votes
2answers
345 views

Is there a uniform way to discover information about devices?

UPD: Changed question title from manage devices to discover information about devices One of the frequent thing I do is look up info about devices on my systems. And I am constantly find myself ...
4
votes
1answer
5k views

How can I set device rw permissions permanently on Raspbian?

I'm using the Raspbian (a distribution made for Raspberry Pi, which is based on Debian). I have some scripts that use i2c. Normally only root has read and write permissions for i2c. I'm using this ...
3
votes
1answer
62 views

How to find out when a mounted file system or device was mounted?

Not every file system or device is mounted during boot time. On servers it sometimes happens that a server log might already being rotated. How to find out when a mounted file system or device was ...
3
votes
2answers
6k views

How to prevent /sda /sdb changes between boots?

I am going to install Gentoo Linux onto an old hardware, which motherboard is having both IDE and SATA hard drives. I have two IDE and one SATA hard drives connected, and plan to do RAID on them. ...
3
votes
2answers
3k views

Meaning of “target” in virsh XML VM definitions.

I recently found that the target=hda tag in virsh was actually not translating into guest OS (guest OS's use /dev/sdX as the disk device names, in general, it seems). virt-install and /dev/hda vs. /...
3
votes
3answers
2k views

How to inspect the contents of /dev/sdt

I have what I hope is not a huge problem, but it could end up being a very large problem. For some context, I mistakenly ran this command on my 27" iMac: sudo dd if=ubuntu-rescue.img of=/dev/sdt bs=...
3
votes
1answer
2k views

Webcam Device Driver to support H.264

I have a Creative Live Cam Connect HD (id: 041e:4093) and this webcam has an on-board H.264 encoder. Unfortunately v4l2 only inputs the feed as MJPG. $ v4l2-ctl --list-formats ioctl: VIDIOC_ENUM_FMT ...
3
votes
3answers
1k views

Disk size management

I am using Fedora 16. My /dev/sda2, mounted on / (root) with something like 50G got filled 100%: [foampile@~ 13:13:39]> df Filesystem 1K-blocks Used Available Use% Mounted on rootfs ...
3
votes
1answer
9k views

cat: write error: Invalid argument

Writing to a custom character device using cat 123 > /dev/chardev gives cat: write error: Invalid argument I have changed the permissions to 666 and even tried it with sudo. Still the same ...
2
votes
0answers
469 views

Ethernet to USB adapter is not initialized as ttyUSB or ttyACM device

When I plug a Ethernet-to-USB adapter to my Ubuntu 14.04 on the USB port. I can see the Ubuntu has an extra ethernet device. However, I want to see /dev/ttyACM* type of device. I'm wondering why the ...
2
votes
0answers
129 views

How exactly do the Linux display device files work? [closed]

I don't really understand how the Linux display device files work and interact together. What files in the /dev tree need to go where and where do they need to connect/point to, in order to show a ...
2
votes
1answer
116 views

What happens under the hood when some data is sent/received on an uart (or similar)?

I am trying to understand how computers work and I was thinking about peripherals. Here is what I understand so far but some parts are missing. Using an Arduino, I send some text every second (a then ...
2
votes
1answer
983 views

create several /dev/xconsole files automatically upon boot

I understand from my previous question that the /dev/xconsole file can be created using mkfifo. On my system (Debian Wheezy), /dev/xconsole gets created automatically. I am wondering who creates it (...