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
4
votes
2answers
2k views

How to get the actual keyboard device given the output of /proc/bus/input/devices?

When I run: cat /proc/bus/input/devices ...I receive the following output: ... I: Bus=0003 Vendor=040b Product=2000 Version=0110 N: Name="Generic USB Keyboard" P: Phys=usb-0000:00:1d.0-1/input0 S: ...
0
votes
2answers
116 views

cloning a linux image using dd

If I wish to clone my Linux image using the dd utility, I can do for example dd if=/dev/SDX of=/dev/SDY, where SDX is the internal memory device where the Linux image is stored, and SDY is the ...
0
votes
0answers
37 views

1 NFC Device found but won't list it

I am running a VM of Kali Linux. I have an ACR122U NFC Card Reader. One problem I have been having is that when I attach the NFC reader to my PC and run nfc-scan-device -v, it returns "1 NFC device ...
3
votes
1answer
499 views

EDID is not loading from /lib/firmware

I wanted to load customized edid so I have added it's name as "drm_kms_helper.edid_firmware=edid/edid.bin" and I kept the edid under /lib/firmware/edid/. But after booting the system, I cross ...
0
votes
1answer
231 views

DRBD comes up after reboot with Connected Diskless/Diskless

After an unattented power loss, facing a major issue, every reboot the DBRB comes up with Connected Diskless/Diskless status. main problems: dump-md response: Found meta data is "unclean" ...
0
votes
1answer
1k views

hostapd: Failed to set channel (freq=2417): -16 (Device or resource busy)

I'm trying to set up a WiFi Access Point on my Raspberry Pi. I set up the network interface to a static IP and installed hostapd. I'm using this config: # Interface and Driver interface=wlan0 #...
23
votes
1answer
3k views

Why don't reads from /dev/zero count as IO_RBYTES?

I am emptying out a hard drive on some Linux 4.x OS using this command: sudo sh -c 'pv -pterb /dev/zero > /dev/sda' And I opened another tty and started sudo htop and noticed this: PID USER ...
0
votes
1answer
131 views

Creating Persistant Symbolic Link -Linux

I have a cloud server, where a block device (/dev/xvdb1 with filesystem ext3) is attached . I want to create a persistent symlink (/dev/test_link) which should always target to (/dev/xvdb1) using ...
0
votes
0answers
38 views

Device Major number changed in /proc/devices after restart

I installed my device driver using mknod and operating system assigned a major number for it. (Saw 236 in /proc/devices) But when i restart the machine and check the /proc/devices again i saw that ...
0
votes
0answers
15 views

Disconnected onewire devices still exist after echo 1 > w1_master_search

I'm working on embedded device where user connects and disconnects onewire sensors sometimes. Sensors are connected to DS2482 device, which is I2C to 1Wire converter. DS2482 is supported by Linux ...
2
votes
1answer
212 views

Get video device on embedded Linux SoC

I'm trying to find the camera module device of an IP camera (running Linux), without much success. My main objective is to find the camera stream, so I can attach an RTSP server. Update 26/02/2019 ...
0
votes
1answer
51 views

What is a meta device?

man pvcreate says pvcreate initializes a PV so that it is recognized as belonging to LVM, and allows the PV to be used in a VG. A PV can be a disk partition, whole disk,meta device, or loopback ...
0
votes
1answer
193 views

Possible to force udev to create specific device event number, or change device event numbers

I have a kernel module that reads usb keyboard input specifically from /dev/input/event2 and /dev/input/event3. On some devices the keyboard doesn't get assigned event2 and event3, it gets assigned /...
0
votes
0answers
305 views

flush tty device buffer from terminal

I have a serial device on /dev/ttyAMA0. I have program written in C that communicates with this device. But apart from the C program I sometimes need to input some configuration data from terminal, ...
2
votes
1answer
41 views

Why can't I open these device nodes?

[root@archlinux xtricman]# ls -l /dev/pts total 0 crw--w---- 1 xtricman tty 136, 0 Feb 24 19:24 0 c--------- 1 root root 5, 2 Feb 24 19:10 ptmx [root@archlinux xtricman]# ls -l /mnt total 12 ...
7
votes
3answers
6k views

Can I share a device from under /dev across hosts?

Here's the situation. I have a video device /dev/video0 on a VMware Server and I want to access this device from within a virtual machine. However for whatever reason I can't connect the device ...
2
votes
0answers
116 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 ...
8
votes
1answer
506 views

Why was /dev/null called that?

I'm looking for some historic info about the null device. Why was it called /dev/null instead of (for example) /dev/empty? FreeBSD's manual page states that "A null device appeared in Version 7 AT&...
0
votes
2answers
76 views

What is the default behaviour when we mount filesystem with `nodev` option?

I read this in "RH413 Red Hat Server Hardening" course that we mount the filesystems with nodev which then does not allow the special files/devices to be mounted from it. However, it did not show an ...
2
votes
1answer
76 views

Why does terminal takes input line by line?

If I use: strace echo 'a b c' > file The bottom lines are: write(1, "a\nb\nc\nd\n", 8) = 8 but in strace echo 'a b c d' > /dev/pts/0 These lines are: write(1, "a\n", 2) ...
13
votes
3answers
4k views

How do I let an SDL app (not running as root) use the console

I want to use an SDL-based program to display graphics on the console, without having to log on from the console, and without running the program as root. For example, I want to be able to run it via ...
0
votes
0answers
21 views

What is the difference between a Device File and a Device Node?

I was reading an article that mentioned device nodes, and didn't define what they were. Wikipedia also mentioned device node in the device file article but didn't specify what the difference is. Are ...
0
votes
0answers
41 views

How does linux uses device files stored in /dev? [duplicate]

I really got confused how kernel/device drivers use device files? What does happen when we read some file from a device using cat file1.txt? Do device driver copy the content to these files? If yes ...
1
vote
2answers
336 views

chown /dev by mistake

This is a RedHat system running a postgres database. Nothing seems to have broken. Do I need to request a restore? That would destroy a day's worth of work, so I'm not eager to do that. A couple ...
2
votes
2answers
3k views

Must /dev/random and /dev/urandom be created each boot, or are they static files that can be put in a tar?

Must /dev/random and /dev/urandom be created each boot, or are they static files that can be put in a tar? I am trying to understand if I need to recreate these each time the operating system starts, ...
2
votes
2answers
272 views

What do device type numbers mean?

file /dev/* prints the description of a bunch of files as "block special (M/N)" and "character special (M/N)", where M and N are numbers. For example: $ file /dev/null /dev/null: character special (1/...
15
votes
4answers
9k views

Are there alternatives to using `udev`?

While I understand the greatness of udev and appreciate the developers' effort, I was simply wondering if there is an alternative to it. For instance, I might imagine there should be a way to make ...
0
votes
0answers
268 views

Flash drive detected by lsusb but not by fdisk

I try to format SanDisk Ultra microSDHC UHS-I Card with adapter but it does not appear on fdisk -l. However, it does appear on lsusb as Bus 001 Device 006: ID 1908:0222 GEMBIRD
1
vote
1answer
42 views

How create a second midi device?

I need create two or more MIDI devices. Using the command "modprobe snd-virmidi", I create one midi device: "/dev/midi1". This device is connect in port 20. I can see in "aconnect -l" and put with ...
0
votes
1answer
232 views

How can I make a device driver communicate with hardware?

I have got user-space app ready, device file mknoded, device driver insmoded into kernel, and there is the device with UART protocol. I am trying to find out what happens between Device Driver (it has ...
1
vote
2answers
4k views

MTP File Transfer not working on Linux Cinnamon 18

Have two Android phones Motorola and HTC both not working on Cinnamon 18. They were both working on Cinnamon 17.2. I have installed MTP tools. The commands mtp-detect and lsusb both return Vids and ...
3
votes
5answers
5k views

Find when new hardware is connected on FreeBSD

How can I find out when a device is connected to my FreeBSD machine? Lets say I plug in a USB device, HDMI device, Bluetooth or something like that. Can I have a console output to say [device] and ...
17
votes
1answer
9k views

Why is “nodev” in /etc/fstab so important? How can character devices be used for hacking?

I am learning about linux security and struggling to understand why a USB stick with a character device on it is potentially dangerous. If I have a USB stick with a bash executable that has setuid ...
5
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?
12
votes
5answers
10k views

Special File that causes I/O error

I want to automatically test if a piece of software reacts as expected if an essential SQLite DB file fails to be read (causing an I/O error). Exactly that happened some days ago at a client. We ...
1
vote
1answer
184 views

Removing LV cache after lvreduce fails

Seeing some odd behavior with lvms. If I resize a cached logical volume and then attempt to remove the cache I get a failure with exit code 5. Does anyone know why this would happen? Recreate steps: ...
3
votes
2answers
3k views

In udev, what kind of device events match ACTION==“change”?

The udev rules I've created so far only deal with devices being added or removed, i.e.: ACTION=="add"... or ACTION=="remove"... I've come across an example of a rule that seems to deal with device ...
2
votes
3answers
1k views

Check if a drive has been Zeroed with xxd and uniq?

I'm looking for a way to check if the entire binary contents of a USB device are purely 0s. I'm trying this command: sudo xxd /dev/sdb | uniq but it has no output and just runs forever. I've ...
9
votes
1answer
360 views

Which Unix-like system really provides the /dev/tcp special file?

I know /dev/tcp/<host>/<port> is a magic path handled specifically by some shells in redirections. But according to man bash: If the operating system on which bash is running provides ...
1
vote
2answers
741 views

Raspian: Statically map /dev/ttyUSB*

I'm using a Raspberry Pi running Raspian to control some home automation hardware. One piece of hardware speaks over RS232, so it connects to my RPi using a USB-to-RS232 adapter. Another connects over ...
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 ...
0
votes
0answers
34 views

How about the work mechanism of kudzu in older RHEL version while the system is running ?

It seems that the kudzu can only take effect for new devices while the system starts up ! For example, although we can run the kudzu to find the new devices online, such as disks, but in fact no any ...
2
votes
1answer
127 views

Access grab state of evdev device

I need to retrieved the grab state of an evdev device in a program. More specifically, I need to retrieve the state of the grab pointer in the evdev struct seen here: https://elixir.bootlin.com/linux/...
114
votes
9answers
20k views

Why is /dev/null a file? Why isn't its function implemented as a simple program?

I am trying to understanding the concept of special files on Linux. However, having a special file in /dev seems plain silly when its function could be implemented by a handful of lines in C to my ...
2
votes
0answers
173 views

systemd-nspawn: how to allow access to all devices?

I'm trying to create a rough equivalent of Docker's --privileged in a systemd container, but I've got no idea how to allow the container to access all of the devices available on the host (without ...
1
vote
0answers
238 views

How to script AT command to modem?

Every time my USB modem (/dev/dlinkModem) gets unplugged it defaults to "radio disabled mode" (AT+CFUN:4). I can easily enough call AT+CFUN:1 through the minicom application console to enable radio ...
1
vote
0answers
380 views

When i plug in usb camera i get 2 devices

When I plug in the camera to Linux then I get 2 devices /dev/video0 and /dev/video1 Why is that happens and is that normal? Odd numbered devices do not work. /dev/v4l/by-path looks like that: ...
6
votes
3answers
7k 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 ...
10
votes
1answer
2k views

Usage difference between device files, ioctl, sysfs, netlink

I'm trying to clarify which is the most useful (in terms of functionality) method of interacting with devices in Linux. As I understand, device files expose only part of functionality (address blocks ...
2
votes
0answers
37 views

how to fix the devices name ordering in guest vm (devices name ordering changed after reboot vm by virsh)

my devices xml define: first vm only has a root volume, <disk type='file' device='disk' snapshot='external'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/dev/...