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

Testing if audio devices / sound cards are currently playing?

Is there a default program where I can check if my audio devices are in silent? Edit: By silence, I mean that if there is something playing on that (not just activated or opened) Something like this:...
1
vote
0answers
126 views

Is there any standard for naming RS-485 tty devices/device aliases in Linux?

I know, that there are some standards in tty naming. There is ttyUSBx for USB to serial converters, ttySx for RS-232, ttyAMAx on ARM devices, but I can't find anything about conventions in RS-485 ...
0
votes
1answer
566 views

Correct way to fix missing device file in /dev?

I am using a proprietary PCI card from Sensoray in my Ubunut 14.04 machine (I intend to upgrade to 18.04 soon). The card comes with the source code for the driver and a Makefile to build and install ...
2
votes
1answer
337 views

SPI driver for Debian

This is the Linux: PRETTY_NAME="Debian GNU/Linux 8 (jessie)" NAME="Debian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=debian The Kernel version is: 4.1.15-gcfb25fd ...
1
vote
1answer
917 views

Emulating a character device from userspace

We are currently working on building a system for data visualisation for different sensors. To make development of the Linux application possible we would need to emulate the behaviour of the ...
2
votes
2answers
1k views

How do I access a digital camera drive via usb after safely removing it?

In Ubuntu 11.04, I unwisely right clicked and "safely unmounted the drive" of my Sony HDR-XR150 connected via USB. Now, when I plug my digital camera into my computer via USB, Ubuntu either doesn't ...
3
votes
1answer
1k views

How do I get my DVD-RW to mount as a writable device instead of ROM?

I am trying to use my laptop (running Debian Jessie) and an external USB DVD reader/writer to burn an ISO to a DVD-RW. However, upon inserting my disk, it appears to have been detected as read-only: ...
0
votes
1answer
93 views

Rip-off (an ncurses term) single bottom line out of /dev/tty terminal, is it possible?

Ncurses allows to separate a single line from screen, at level of physical screen (curscr), to devote it to e.g. a title bar, thus also creating a logical screen (stdscr), devoted to application's ...
24
votes
2answers
49k views

How does cat know the baud rate of the serial port?

I regularly use cat to view debugging information in the console from my FPGA development board over the serial connection, but I never have had to tell linux what the baud rate is. How does cat know ...
9
votes
2answers
2k views

Can I query which processes (if any) are currently accessing the microphone?

I'm running Debian (technically Raspbian), trying to get a Star-Trek style voice-command system. I've got it mostly up and running, but in the interests of privacy and all that jazz, I don't want my ...
2
votes
1answer
2k views

USB device (keyboard or mouse) shows in `lsusb` but does not work if it is the second USB device to be plugged in

I've been having a strange issue the past couple of months where the second USB device to be plugged into my laptop is unresponsive, despite showing up in lsusb and dmesg seemingly without issue. ...
-1
votes
2answers
449 views

How to find the Absolute device name

I had a homework question which I answered correctly: Use lvdisplay to discover information about the VG Name found in the previous question. What is the first LV Path which is using the volume ...
-2
votes
1answer
40 views

What is the relation between a line in cpu cache and a page in main memory (and block in disk)?

Computer Systems: A Programmer's Perspective (2nd Edition) [Randal E. Bryant, David R. O'Hallaron] says A block is a fixed-sized packet of information that moves back and forth between a cache and ...
0
votes
1answer
46 views

How is a sequentially accessible device made randomly accessible?

If a device offers only sequential access not random access, can a device driver or a file system make the device look like randomly accessible to users? If yes, is this done by providing buffer/...
1
vote
0answers
407 views

Proxmox Guest: Network Device not linked

I've setup a new Ubuntu 18.04 virtual machine using Proxmox. On this new virtual machine I can't get a working Internet connection. The command lshw -C network shows: root@web:~# lshw -C network *-...
-1
votes
1answer
451 views

Can filesystems be created only on block devices, but not on character devices?

Can filesystems be created only on block devices, but not on character devices? Can a filesystem be viewed as a block device itself (for example, when programming to use a file system)? My guess is ...
4
votes
1answer
10k views

How to get a list of major number -> driver associations

The Linux Programming Interface states: Each device driver registers its association with a specific major device ID, and this association provides the connection between the device special file ...
2
votes
1answer
167 views

Is devtmpfs special with respect to namespaces? a permissions problem

I'm wondering if devtmpfs is special with respect to namespaces. Here's my system info (using Vagrant for testing) vagrant@ubuntu-xenial:~/test$ uname -a Linux ubuntu-xenial 4.4.0-135-generic #161-...
1
vote
3answers
3k views

How can I run a shell script on input device event

I have a USB remote presenter that appears as a keyboard. Using evtest I can see the input events from the device. How can I capture those events in a shell script? I had see some solutions using C ...
1
vote
3answers
365 views

Is it possible to make the device filesystem name , /dev/sd?1 , stay constant every time we reconnect the SanDisk USB Cruzer drive?

Is it possible to make the device filesystem name , /dev/sdi1 , shown by lsblk -f stay constant every time we disconnect and reconnect the SanDisk USB Cruzer drive? I am running Ubuntu Linux 16.04 on ...
1
vote
0answers
150 views

Can I use lirc using the i/r on my rtl2832U dongle as regular or separate i/r port?

Although this might have an rtlsdr tone to it, I am on a hunt for info, tip, tricks & mods related to lirc while trying to get it (or some kind of version) to work on my Linux machine. ...
0
votes
1answer
137 views

udev ACTION add isn't working

I'm trying to use udev for some basic actions, in this case the idea is to launch a simple script. The problem is that when I use this rule: ACTION=="remove", ENV{ID_FS_LABEL}=="NAMEHERE", KERNEL=="...
17
votes
5answers
24k 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 ...
4
votes
2answers
1k views

How to programmatically detect when a device raises an interrupt?

How to programmatically detect when a device raises an interrupt? This can be when a device is connected or disconnected. And also this case: for example: when a finger is held over a fingerprint ...
2
votes
2answers
571 views

Why can I (or cannot) mount a mounted device again? What is happening?

Why can I (or cannot) mount a mounted device again? What is happening? For example: /tmp/test$ sudo mount /dev/sda5 ./1;echo ${?} 0 /tmp/test$ sudo mount /dev/sda5 ./2;echo ${?} 0 /tmp/test$ sudo ...
4
votes
3answers
451 views

Do all disks devices in my HW machines start with - sd?

in my bash script I use the syntax lsblk | grep sd in order to capture all disk in my HW machines ( not include flash card or rom ) I just worry that some disk device name will be diff from sd , and ...
1
vote
0answers
24 views

Scenario to use the sg driver

Is there any device commonly controlled by SCSI generic driver (sg) in Linux today? I am curious about that. Currently I just know the mtx tool which controls robots in tape libraries via sg driver.
3
votes
1answer
3k views

How to use dd if=/dev/mem in place of devmem ?

It seems like root@testbox:~# dd if=/dev/mem bs=1 count=4 skip=2149646336 | hd should be nearly equivalent to root@testbox:~# devmem 2149646336 32 But, while devmem works great, that dd invocation ...
1
vote
0answers
258 views

Speakers and headphone paths (name of PCM device)

I am really confused trying to get my speakers and headphone device PCM names like a "hw:x,x" or something like that; cat /proc/asound/devices 2: [ 0] : control 3: [ 0- 0]: digital audio ...
0
votes
2answers
52 views

How to determine if an unmounted CD/DVD is in the drive?

Under Linux, is there any way to get a yes/no answer to whether or a CD/DVD drive contains a disc which isn't mounted but which can be mounted or written to?
2
votes
1answer
68 views

How to link a tunX interface to a specific OpenVPN instance?

I known that I can give a specific name to the TUN interface using --dev option, but I didn't and I have now on a router machine something like a hundred client configs. with less clients I was able ...
1
vote
0answers
78 views

How can I xor two block devices together?

I'm looking for a way to create a virtual block device that when accessed returns the XOR of two block devices. I feel like dmsetup would be used here somewhere but I can't find anything related to ...
0
votes
2answers
44 views

Skipping the middle mapping with cryptsetup luksOpen

I'm mounting a bunch of encrypted disks like so cryptsetup luksOpen some_source some_mapping && mount /dev/mapper/some_mapping /some_mountpoint How can I abstract away the middle mapping? I ...
0
votes
1answer
102 views

Given a block device file, how can I list all relevant partions?

Given a device file (ex: /dev/sda) how can I get a list of all relevant partitions? Expected input: /dev/sda Expected output: /dev/sda1 /dev/sda2 /dev/sda3 ... I know there are many ways to get ...
5
votes
3answers
1k views

Make tar from /dev/stdin file

What I'm looking for is a way to pass in arbitrary data through STDIN, and have it get tar'd up as if its a normal file. I tried this $ echo test | tar -cf test.tar /dev/stdin and that gives me a ...
4
votes
4answers
4k views

According to which algorithm does Linux assign the hard drive letters?

I have observed that between repeated boots of the same system, the mapping between the device names /dev/sda, /dev/sdb/... and the physical hard drives stays the same. However I am not sure if it ...
3
votes
2answers
1k views

How to completely inhibit lid switch events?

Context: Due to missing drivers for my 2-in-1 convertible, folding the screen back only triggers a lid switch event. This causes the laptop to suspend or, when "Suspend when laptop lid is closed" is ...
0
votes
1answer
535 views

How to create multiple devices in a /dev/ subdirectory (kernel driver)

I'm writing a kernel module. I can easily create a character device in /dev/ but I want to have 3 devices available to my user and it would be nice to put them all under a /dev/ subdirectory. ...
1
vote
1answer
43 views

Why raspbian lite powers off when doing `sudo cat /dev/char/10:130`?

I did on a terminal sudo cat /dev/char/10:130, which in the uevent has name of watchdog, and it outputs a message from the kernel saying that watchdog did not stop !, and after a couple of second it ...
6
votes
5answers
20k 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
9
votes
2answers
15k 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 ...
2
votes
0answers
649 views

What is the difference between `/dev/input/event*` and `/dev/input/mouse*` according to mouses?

Suppose my mouse is associated to /dev/.../event1 and /dev/.../mouse1. I was reading the byte streams of those files, and I noticed that event1 gives much more information than mouse1, which ...
1
vote
0answers
38 views

Drive emulation at driver level

I would like to emulate a virtual SED at driver level. The goal is to develop/simulate the "firmware" of a drive, and map driver interface commands to an app which would handle interface specific ...
4
votes
2answers
3k views

How to map /sys/bus/usb/devices to /dev/video*?

I am using a library (librealsense) that only outputs the bus and port number as such (9.1). It uses libusb internally. The issue is from this identifier in libusb I want to know what physical device ...
-2
votes
1answer
122 views

How to deny all access to /dev/sda? [closed]

I would like even applications not to be able to access /dev/sda . If possible, I would even like to disallow root applications from accessing it, but that is not as important.
1
vote
1answer
507 views

what is DEVLINKS in the output of udevadm info --query=property --name=/dev/mmcblk0

I was looking at the udev information but couldn't find out anywhere. What does DEVLINKS signify also what are these values dev/disk/by-id/mmc-008G30_0xf281d20d & /dev/disk/by-path/platform-...
1
vote
1answer
68 views

How do you use SSHFS to work on drives in /dev/

My laptop for some reason will not power an external 2.5" HDD, so I am using a Raspberry PI to connect to the drive. The problem is, I am struggling to perform tasks such as formatting disks and ...
3
votes
1answer
5k views

persistent device naming for NVMe storage devices

The Linux kernel's simple naming for a storage device (e.g. /dev/sda, /dev/sdb) can change randomly across boots. Is that true for NVMe storage devices too? These have names such as /dev/nvme0n1p1 and ...
232
votes
14answers
890k views

How do I find out what hard disks are in the system?

I need to know what hard disks are available, including ones that aren't mounted and possibly aren't formatted. I can't find them in dmesg or /var/log/messages (too much to scroll through). I'm hoping ...
3
votes
1answer
63 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 ...