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
0
votes
2answers
31 views

How do i read this raid information output?

Im currently working on a remote ubuntu 18.04 server where i need to set up a new raid array (raid1) and then mount it as an available partition to the active filesystem. The first step for me is to ...
0
votes
2answers
59 views

What does mounting do in Linux and why do files appear in both /dev and /media after mounting?

I'm pretty new to Linux and I've been trying to understand how the file system works but I just can't seem to get what mounting is. I've seen several other questions on this site explaining but they ...
118
votes
7answers
54k views

How are “/dev” Linux files created?

There are special files in Linux that are not really files. The most notable and clear examples of these are in the dev folder, "files" like: /dev/null - Ignores anything you write to the file /dev/...
0
votes
1answer
55 views

Can you create a device file by yourself

I'm learning about Linux and Unix and I'm curious if you can create a block or tty device file without having to plug a real one in, using a command, and in a custom place other than /dev. Something ...
31
votes
2answers
11k views

What are nvme namespaces? How do they work?

I've recently begun supporting Linux installed on devices with built-in nvme ssds. I noticed the device files had an extra number, beyond a number identifying the drive number and the partition number....
1
vote
0answers
15 views

Prevent Kernel from device binding until a response

I want to write somethings like udev in Linux. I know that udev uses Netlink socket to receive uevets from the kernel. so I can do this by defining a socket with AF_NETLINK type and listen to kernel ...
1
vote
1answer
36 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 ...
20
votes
5answers
45k views

How can I tell whether a network interface is physical (device) or virtual (alias)?

I have a small home router running OpenWrt (Kind of embedded Linux for routers). It has five Ethernet ports, one labeled WAN and four labeld LAN 1 to 4. It has the following Network Interfaces defined ...
1
vote
1answer
33 views

How to solve failure in plugging external DVD driver in Ubuntu 20.04?

I have bought an external DVD driver but, after plugging (or booting with the unit already plugged) I see the unit listed in the resources of the computer but I cannot access it: If I try to access ...
7
votes
3answers
17k 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?
22
votes
2answers
13k views

Difference between /dev and /sys

Exactly what is the difference between devfs and sysfs? Both seem to maintain a list of hardwares attached to the system. Then why the need for 2 separate fs even arose? As far as I can get /sys ...
1
vote
1answer
42 views

How to open and read a character device as binary file?

I'm working with USB and I want to read the content of usb device descriptor in /dev/bus/usb/00x/00y - it is a character device. I used fopen to open it as a binary file with "rb" parameter. ...
0
votes
0answers
13 views

What is the correct way to match a udev rule on a specific partition UUID?

There is a somewhat related question here that has a successful answer, but they ended up matching on ENV{ID_PART_ENTRY_TYPE}. I want to match on ENV{ID_FS_UUID} and it does not work for me. My ...
1
vote
1answer
33 views

Where is the udev documentation for describing what “P”, “N”, “L”, “S”, “E” prefixes mean in `udevadm info` output and how they relate to rules?

Note: There is a related question here which describes output for this person's specific situation and for their block device "/dev/sdb", but i am trying to set something up for a specific ...
0
votes
1answer
3k 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 ...
14
votes
6answers
53k 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: ...
1
vote
2answers
630 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 <-- ...
5
votes
3answers
10k 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. ...
0
votes
0answers
28 views

What is the utility and risk of the option -D in rsync --archive?

I use sudo rsync --archive --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*",/lost+found} a lot for ...
7
votes
1answer
2k views

How to rename devices for graphical output such as VGA0

On my Laptop the names of my graphical outputs change depending on what chip is activated in the BIOS. This leads to problems in some scripts where outputs such as VGA-0 or LVDS-0 are specified. So I ...
1
vote
1answer
2k views

How to interpret SCSI device (sd) timeout logs

In /var/log/messages, I find the following log: Oct 23 21:48:53 localhost kernel: sd 3:0:0:0: timing out command, waited 180s Please explain the values that are separated by colons. Also where ...
0
votes
0answers
18 views

Is It Possible/Advisable to Change Device USB Device Status from Terminal?

Running Pop_OS 20.10, I'm occasionally having problems with my headset not working after waking from sleep. The device is plugged in, and the issue persists even after switching from one USB to ...
1
vote
1answer
2k views

Disable Ethernet Hardware Devices at start-up

To startup vm called "sys-net" in Qubes on my laptop need to write "1" in file echo -n "1" > /sys/bus/pci/devices/0000\:04\:00.0/remove also 0000:04:00.0 and 0000:04:00.1 are conflicts and need ...
0
votes
0answers
19 views

Using Udev Sound Device with ALSA

Inside of a C program, using libudev and libasound, I have determined a struct udev_device *device is part of the sound subsystem with udev_device_get_subsystem(device) == "sound". Now I ...
0
votes
0answers
21 views

Linux driver use, device and device file clarification

Need help filling in some knowledge gaps on driver use in user applications. I have a digital IO driver. I compile the driver and install it on boot with modprobe and when i check in /dev I can see /...
1
vote
1answer
2k views

How to associate physical usb port with usb device number

I'm using Ubuntu 12.04. I need to send a command to a device that I have connected on a port of my PC. I can send the command by finding out what the Bus and Device number are. For example, lsusb ...
3
votes
1answer
40 views

How does Linux decide when to reuse USB minor device numbers?

When USB devices are connected in Linux the kernel assigns them a minor device number (i.e. the 0 in /dev/ttyUSB0). It seems that if I have a device at /dev/ttyUSB0, when I remove it and plug in a new ...
0
votes
1answer
69 views

How does Debian or Linux in general assign device-names like /dev/sdX on ZFS?

I have three identical servers, all three same cabeling and correctly placed hard-disk. Allthough one of the server got /dev/sdg /dev/sdh for the sata-ssds while the other two servers got them on /dev/...
1
vote
2answers
49 views

How can I mount /dev from C?

How can I mount /dev from C? I'm writing a simple init, and I know this sounds stupid but I would like to have /dev mounted to another folder. The manpages for mount() don't show dev as a supported ...
2
votes
1answer
29 views

From the Linux kernel's point of view, how does a user program communicate with a CUDA GPU?

I am curious about how data is copied back and forth between CPU and GPU memories when I run a CUDA program. Specifically, I want to know how the Linux kernel is involved in this process. I had a few ...
5
votes
1answer
1k views

Remote Mouse netcat (/dev/input/mice)

I was playing around with nc and I'm discovering how powerful and versatile this tool is. I was wondering how the file /dev/input/mice works because when I do cat /dev/input/mice you see the output, ...
5
votes
1answer
1k views

Why are there two entries per device on /dev/input/by-path

If I go to /dev/input/by-path I can see my input peripherals. I've got one keyboard and one mouse, and on my platform the output is: pci-0000:05:00.0-usb-0:1.2:1.0-event-kbd pci-0000:05:00.0-usb-0:1....
0
votes
1answer
42 views

Does device drivers use Kernel logical address space or Kernel virtual address space?

If possible, can you point to documentation or describe the kernel space memory layout? When a device driver instantiates a variable does that variable live in the kernel space or does it live in user ...
0
votes
1answer
14 views

Is there a reliable path to specific device events?

I'm running ubuntu linux and I have a bluetooth mouse that I would like to capture evdev events from. The problem is that the event device can potentially be different any time I connect the mouse: ...
1
vote
0answers
23 views

How can I backup a mount without a corresponding /dev special file?

Typically, I would just e.g. dd if=/dev/sda | gzip > backup.gz or something similar, but in this embedded device, I have a filesystem /dev/root on /rom type squashfs (ro,relatime) without a ...
0
votes
1answer
25 views

Dmesg ring buffer overload problem

I am writing a device driver. I need to seek in system logs; for that I use dmesg. In my case dmesg is overloaded with these warnings: [ 5578.052140] pcieport 0000:00:1c.5: AER: Corrected error ...
14
votes
4answers
3k views

Trouble with understanding the concept of mounting

Having read both What is meant by mounting a device in Linux? and understanding "mount" as a concept in the OS, I have a problem where it is stated that All accessible storage must have ...
1
vote
1answer
143 views

Is there a kind of '/dev/null' to fake output file path?

Lets say that I have a CLI which transforms a file_a into a file_b like so: transform --input /path/to/file_a --ouptut /path/to/file_b I have developed a program that use this CLI and need to unit ...
0
votes
1answer
38 views

How to convert stream data which come over udp to video device?

I'm trying to share my computer's camera with the remote computer. In order to do this, I wanted to share my own computer's camera with the udp port(stream), take the stream on the remote computer and ...
2
votes
1answer
132 views

Trying to run linux kernel using QEMU, having trouble with boot process

For a project, I need to be able to run an uncompressed linux kernel. It was recommended to me to try emulating this using QEMU, since that's less involved than booting it straight on the machine. ...
124
votes
3answers
102k views

When to use /dev/random vs /dev/urandom

Should I use /dev/random or /dev/urandom? In which situations would I prefer one over the other?
2
votes
1answer
105 views

Hide devices in chrooted environment

On Linux, I'm looking for a way to run grub-install <device> and update-grub in a chrooted environment without some devices being taken into account by GRUB (I don't want them to appear at boot)....
13
votes
3answers
19k views

How to get device filename from lsusb output or by device path

Related question: USB connect/disconnect notification When the device is plugged/unplugged, I get instant notification, that's great. But to make it (almost) perfect, I also want to get device ...
1
vote
0answers
38 views

How to mount device that appears in /proc/devices but not /dev?

I'm using a bare bones Linux distribution running on a Phytec i.MX6 ULL SoM on the Phytec demo board for this SoM. I need to be able to copy a file from an SD card. I flashed the SoM NAND from an SD ...
1
vote
0answers
14 views

USB device detection unreliable

I am running an Arch Linux and I have some issue with USB audio device detection on the running system. The detection works fine most of the time and is totally reliable on reboot, but especially when ...
0
votes
0answers
9 views

second bluetooth device on debian

I have debian xfce plus nomfree drivers installed, have a bluetooth keyboard installed and its working, where I use bluetoothctl to connect it, if I try to connect a second device like a bluetooth ...
0
votes
0answers
23 views

Why can't I read /dev/disk0 in macOS as root?

I am trying to read the partition table of my startup disk manually. I open sudo python and issue f=open('/dev/disk0', 'r'). What happens is that I get PermissionError: [Errno 1] Operation not ...
-1
votes
1answer
34 views

copy files from the folder on one disk to the folder on another disk

how to copy files from the folder on one disk to the folder on another disk use cp command? (from the current directory on sda2 to folder on /dev/sdb3?)
1
vote
1answer
1k views

Jetson TX2 device tree, i2c nodes and camera driver loading

I am a bit confused with behavior of Jetson TX2 when loading drivers for camera. Here is definition of IMX274 in device tree: i2c@3180000 { reg = <0x0 0x3180000 0x0 0x100>; ...
1
vote
1answer
71 views

Mounting encrypted SD card: where does /dev/dm-3 come from?

I was trying to mount an encrypted SD card on Kubuntu 20.04. lsblk gives me this: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 ...

1
2 3 4 5
15