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
1answer
1k 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 ...
0
votes
1answer
101 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 ...
2
votes
1answer
3k 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
517 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
48 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
votes
1answer
538 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 ...
2
votes
1answer
189 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-...
0
votes
1answer
146 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=="...
2
votes
2answers
672 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 ...
1
vote
0answers
25 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
4k 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 ...
0
votes
2answers
53 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?
1
vote
0answers
87 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
1answer
1k views

Udev Rules Not Running

I'm playing with Udev Rules on OpenSuse Leap, and I'm trying to run a simple and small script once a USB device is plugged into my system. However, my script which I added in my keyword "RUN+=" does ...
2
votes
1answer
72 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 ...
0
votes
1answer
142 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 ...
0
votes
2answers
52 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 ...
2
votes
1answer
368 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 ...
5
votes
3answers
2k 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 ...
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
677 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
46 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 ...
2
votes
0answers
695 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 ...
19
votes
3answers
61k 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)...
-2
votes
1answer
148 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
557 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
0answers
26 views

Ethernet malfunction when booting with extra device on /dev

I have a customized Linux distro (created via buildroot) running on an embedded platform. The system consists in a processing module (Based on Samsung Exynos 4412 microprocessor) with a base board for ...
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 ...
1
vote
1answer
78 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 ...
4
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 ...
0
votes
1answer
478 views

Programmatically identify block device of filesystem [closed]

The following code was tested on RedHat 7 using df verison 8.2 and lsblk version 2.23.2. This is important as the lsblk utility has signficantly more output options than the RedHat 6 version (2.17.2) ...
0
votes
1answer
495 views

Define udev rule for disk by id or uuid?

I want to define a udev rule for a particular block device (or partition). I currently do it by defining a 91-my-custom-rules.rules configuration file as follows: computer:/etc/udev/rules.d # cat 91-...
0
votes
2answers
469 views

What are limitations chrooted system? [closed]

Chroot allows us to change the root directory, or rather root directory of specific process. Now obviously this does restrict the process to the specified tree (unless it doesn't relinquish the ...
2
votes
2answers
439 views

Can I run Linux on specific CPU cores?

I'm making a brainwave detection device. Will be using an Octa-Core ARM processor for the software processing. For the management of CPU cores, can I code Linux to strictly run on a specific set of ...
1
vote
0answers
434 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 *-...
0
votes
0answers
606 views

/dev/sr0 (live DVD) turns into /dev/sr1 when inserting periphials

On a live Linux session, inserting a keyboard or mouse via USB onto the computer causes /dev/sr0 to be remapped as /dev/sr1, which makes the live system unable to access the DVD. sudo rename /dev/sr1 ...
1
vote
1answer
333 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: ...
0
votes
1answer
49 views

U(n)mount sthealthily without notifying applications or clearing cache. (testing purposes)

There is already: $ umount -l . But is there a way to unmount silently? This means, in example: If a photo on the unmounted partition is inside of a device, then Linux should preferrably keep it ...
1
vote
1answer
434 views

Set usb flash drive as non rotational drive

I'm trying to optimize the IO schedulers and to use a proper scheduler for rotational and for non rotational drives (different). When I run: cat /sys/block/sd*/queue/rotational I get: 1 <-- ...
2
votes
0answers
84 views

Debugging in android chrome as a non-root user

I am trying to debug a website displayed in Google Chrome on an Android device connected to my box via USB. To this end, there is the remote debugging protocol as implemented in the desktop versions ...
114
votes
9answers
22k 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 ...
0
votes
2answers
63 views

Are all virtual files in Linux device files?

The following two files are virtual files: /dev/sda1 /proc/cpuinfo I know that /dev/sda1 is a device file (that points to a device driver), so when I access this file, I am actually accessing the ...
0
votes
0answers
278 views

cmake: How to check existence of an unreadable file

Theoretically, cmake can check for the existence of a file if(EXISTS "/dev/spidev0.0") according to the documentation this should be True if the named file or directory exists. Behavior is well-...
0
votes
0answers
66 views

how to redirect from stdin to dev driver

I am writing a device driver and have implemented file_operations write method. I would also like to be able to just redirect to the device driver, e.g.: echo "this text is sent to driver" > /dev/...
1
vote
1answer
881 views

How Virtual Box shared folder are handled in Debian ?

I'm on Windows 7 and I run a Debian VM under Vbox. On my Windows 7 I've the c:\temp folder that I want to share. I added it : I had an hard time to permanently mount that folder with Virtual box (...
0
votes
0answers
347 views

How do I mount USB CDROM Drive

I have an external usb cdrom drive but cannot find it in RHEL 7.4. The attached image is the results of my "ls /dev/". When I execute the "cat /var/log/dmesg | grep usb" I get the below results but ...
0
votes
0answers
401 views

Booting from Puppy Linux USB cannot see sda1

I am booting from a Puppy Linux USB Flash drive so that I can tar the primary partition of the hard drive. I see sda2 through to sda15, sdb1 to 15 (sdb1 is USB boot disk), sdc1 to 15, sdd1 to 15, sde1 ...
0
votes
1answer
180 views

Is it possible to use a pseudoterminal to redirect PPP’s dataflow to an application?

I want to set PPP in order to use a pseudoterminal slave (/dev/pts/N) instead of a physical serial link, handle its data flow in an application (from /dev/ptmx) and redirect that flow … somewhere ...
0
votes
1answer
3k views

Why does my USB device not appear on /dev?

We have a customized Linux distro (created via buildroot) running on an embedded platform. There's this relay module we need to connect to it through an USB port (the module is based on an ATmega32U2 ...

1 2 3 4 5 14