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
1
vote
0answers
27 views

Can I refer to current clipboard content as a file?

I'd like to select-and-copy some text to clipboard and then to send it via Bluetooth to my phone. But this requires to open a file to send. Well, I know about programs like xsel or xclip, but here it ...
0
votes
0answers
51 views

How to enable all users to access arduino card?

I am trying to set up Linux (Debian 9) machines in a computer lab to let users plug in their arduino interface and flash their device with their code. I do not really know about arduino and so on, ...
8
votes
3answers
2k views

How to check if stdin is /dev/null from the shell?

On Linux, is there a way for a shell script to check if its standard input is redirected from the null device (1, 3) *, ideally without reading anything? The expected behavior would be: ./...
0
votes
1answer
259 views

UIO device files /dev/uioX are not created on Linux Debian

I'm having a problem on Linux Debian 9.6. Although I have UIO support compiled into the kernel, the /dev/uioX device files are not beeing created. root@machine:~# zcat /proc/config.gz | grep UIO ...
4
votes
2answers
489 views

Two interrupt handlers for the same driver

I have a scenario where my driver needs to listen to two different interrupts from two different IRQ lines. Is it possible to register two different IRQs and install two different handlers for the ...
1
vote
3answers
726 views

How could Linux use 'sda' device file when it hasn't been installed?

I am installing CentOS Linux distribution. At the partition step, CentOS tells me that it has detected a sda HD in my machine and I should create partitions and assign mount points for this disk. ...
1
vote
0answers
215 views

Mount two same usb device Always in the same port UBUNTU

need to mount two device (identical/equal) at the same port...not difficult but look this: /dev/input/event6 - Sycreader_RFID_Technology_Co.__Ltd_SYC_ID_IC_USB_Reader_08FF20140315 /dev/input/event2 - ...
2
votes
0answers
44 views

Webcam and Desktop composite with v4l2loopback?

Is there anyway to do a composite video setup where the webcam is overlain onto the desktop and output as a video device (simulated webcam)?
8
votes
4answers
4k 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
103 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
0answers
62 views

Disable consistent device naming on Centos 7.5

I'm using kickstart's booloader options to suppress the consistent device naming feature for network interfaces on Centos 7.5. A minimal example of my kickstart file is as below: auth --enableshadow -...
1
vote
0answers
555 views

Disk device paths Changes from xvd to sda, how do I change to xvd?, [closed]

OS Ubuntu '16.04.5 LTS' Hypervisor Xen This output is when sda df -h Filesystem Size Used Avail Use% Mounted on udev 16G 4.0K 16G 1% /dev tmpfs 3.2G 1.3M 3.2G ...
0
votes
1answer
287 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
275 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 ...
0
votes
1answer
559 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
816 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
55 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
46k 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
280 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
34 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
43 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
239 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
316 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 ...
1
vote
1answer
114 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
2k 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
359 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
147 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
114 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=="...
15
votes
5answers
22k 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
460 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
376 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
23 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.
0
votes
0answers
81 views

Should I let my user access /dev/mapper/control?

I'm building LiveCDs using some script I worked on as an exercise. Now I want to create VDIs to directly use in VirtualBox. I need kpartx among others to create a loop device, mount it and copy files, ...
3
votes
1answer
2k 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
239 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
48 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
51 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
62 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
34 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
66 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
845 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
3k 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
751 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
375 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
37 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 ...