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).

learn more… | top users | synonyms (1)

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

Edit audio output before playback

I want to low level edit the output of ALSA sound system. I should sniff the audio output, change it before playback and then play it. I saw /dev/snd/OUTDEVICE but I think it is write only. Which is ...
3
votes
2answers
234 views

sysfs and devtmpfs

Ulrich Dangel explains very well the difference between devtmpfs and udev. What about sysfs? I understand that the kernel uses sysfs to export device nodes to user space to be used by udev. So ...
7
votes
1answer
96 views

Command to generate /dev/disk/-by-path/ name on a system without udev daemon

On most Linux systems udev usually creates symlinks in /dev/disk/by-uuid/ /dev/disk/by-path/ which point to actual device nodes (/dev/sda, /dev/sdb, etc). I don't have udev on my system, and I ...
25
votes
4answers
80k views

How can I find available network interfaces?

This is in regard to linux, but if anyone knows of a general *nix method that would be good. I booted a system yesterday with an ethernet cable plugged in. "NetworkManager" is not installed, so once ...
8
votes
3answers
13k 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 ...
3
votes
1answer
856 views

Can I use a parallel port as a CUPS input device?

I have an old piece of a hardware that does diagnostics on medical equipment. It prints out results over a parallel port. Is there any way to have CUPS accept jobs from a parallel port and redirect ...
2
votes
2answers
45 views

No space left on device on CentOS7

My machine which OS is CentOS7 have to backup 50G data into MySQL. But, there is no space left on the device. But there are many spaces on /home. How can I make user that there are enough space for ...
1
vote
1answer
22 views

How to work out which drive and directory your system booted from if it is not mounted in /etc/fstab?

My /etc/fstab doesn't include the disk the system booted from, basically because I made some changes and forgot to include this. The initial /boot and / directories are on different drives. I noticed ...
3
votes
2answers
2k views

Debian USB automount

Got my USB flash automount broken after reboot. Using Debian 6, GNOME 2 My NTFS hard disk is still mounting correctly. When i connect my Android smartphone (with SD and local drive) my messages log ...
3
votes
1answer
47 views

Ignore unmounted file systems

I've got two devices on my LAN: a Raspbian jessie and an Ubuntu 14.04. The latter has some nfs shared folders, which are available from Raspbian at startup, set up in its /etc/fstab file as: ...
1
vote
0answers
25 views

How can I mount remove /dev/mem to local

This question is relate to this, but more general. Currently I mount remote root by sshfs sshfs -o sshfs_sync,sync_readdir,reconnect,follow_symlinks,direct_io,sync_read root@pi:/ pi /proc is ok, ...
1
vote
1answer
29 views

Programmatically determine the IRQs associated with a network interface

What is the most reliable way to programmatically determine the IRQs associated with a network interface, given the name of the interface (e.g. eth0)? I'm okay with a best-effort approach, but I'd ...
1
vote
1answer
3k views

LVM unknown device: how to recover?

I have a server with two hard drives that I thought I had correctly installed with LVM, until I discovered that the second hard-drive did not actually seem to be used. I investigated the problem and ...
8
votes
1answer
9k views

How to find which serial port is in use?

The Question: I plugged in a device (i.e. GSM modem) through a serial port (a.k.a. RS-232), and I need to see with which file in /dev/ filesystem this device was tied up, to be able to communicate ...
26
votes
5answers
2k views

How does Linux differentiate between real and unexisting (eg: device) files?

This is a rather low-level question, and I understand that it might not be the best place to ask. But, it seemed more appropriate than any other SE site, so here goes. I know that on the Linux ...
1
vote
1answer
25 views

How can I access optical drive status information?

I can obtain the status of a connected display with: cat /sys/class/drm/card0-HDMI-A-1/status Is there something analogous for optical drives? I looked around in /sys/ but couldn't find anything that ...
5
votes
1answer
1k 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 ...
4
votes
3answers
262 views

Do tmpfs and devtmpfs share the same memory region?

My system disk usage is like this: # df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 50G 39G 12G 77% / devtmpfs 5.8G 0 5.8G 0% /dev ...
0
votes
1answer
14 views

Busy /dev/gpio. I can shared it?

I need shared one device between two C applications. This device is a buzzer. I've try open this with O_NONBLOCK flag, but result is same: device or resource busy. Is there any possibility to use the ...
0
votes
0answers
20 views

How to call a device's power management methods in another way than during suspend to ram?

Let us consider the e1000e driver for an Ethernet card. This driver provide two power management methods .suspend and .resume to respectively turn off and turn on the card. Those methods are naturally ...
1
vote
3answers
63 views

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

I am installing CentOS Linux distribution on a fresh new machine. Just for learning. I am new to Linux. At the partition step, CentOS tells me that it has detected a sda HD in my machine and I should ...
-1
votes
2answers
41 views

What are exactly mknod command parameters?

What are exactly mknod command parameters? I want to create a jail in chroot. So I need to do: mknod /var/chroot/bind/dev/null c 1 3 mknod /var/chroot/bind/dev/random c 1 8 What are c, 1, 3 and 8? ...
1
vote
1answer
45 views

Which special file holds Microphone input?

There is a special file for everything: /dev/tty for the terminal, /dev/sda for a drive, and two random number generators: /dev/random and /dev/urandom. Yet I can't find the special file(s) for raw ...
3
votes
6answers
4k views

GNU/Linux (Debian): detecting hard-disks mappings?

Let's suppose you have two hard-disks: one internal (boots GNU/Linux); one external (USB). "fdisk -l" detects both, but will not tell you which is /dev/sda and which is /dev/sdb. "lsusb" will tell ...
0
votes
1answer
19 views

What happens when writing to a device driver? [duplicate]

What happens when writing to a device driver? For example: echo "some text" > /proc/device_driver I'm guessing that echo has a write-call that somehow invokes the write-function in the driver. ...
1
vote
1answer
30 views

Swap /dev/mapper/* devices

I have been given a box that has /dev/mapper/root mounted as / and mapped to /dev/dm-0. It has /dev/mapper/home mounted as /home and mapped to /dev/dm-2. The dm-0 device is 5G and the dm-2 device is ...
40
votes
2answers
12k views

How to create /dev/null?

I successfully deleted my /dev/null. How can I restore it? The OS is Ubuntu.
0
votes
1answer
26 views

Size of a character/block file

Why is the size of a character or block file given as comma separated? crw-rw-rw-. 1 root root 1, 3 Mar 8 10:15 /dev/null brw-rw----. 1 root disk 8, 1 Mar 8 10:15 /dev/sda1 Size of a file is ...
1
vote
1answer
35 views

Correspondence between SCSI device entries in /sys and the disks in /dev

Under the /sys/class/scsi_device folder I have the following: root@linux01:/sys/class/scsi_device # ls 1:0:0:0 2:0:0:0 2:0:1:0 3:0:0:0 How can I know how each of these devices is related to ...
0
votes
3answers
53 views

Why does reading a device require admin permissions?

I'm trying to create a backup script that saves my thumbdrive as an image. I'm planning on having it automatic. I've always seen the thumbdrive listed as /dev/sdb, and created a script that will save ...
1
vote
1answer
25 views

Get paths to all sd cards in a computer using GNU bash 4.3.11 running Ubuntu 14.04

how can I get the paths to all sd cards in a computer using GNU bash 4.3.11 running Ubuntu 14.04 and just those? Background: I have an .iso-file and want to create a bash script that asks the user ...
1
vote
1answer
268 views

how to get bus id of an usb device

I would like to bind/unbind my usb device - a wireless adapter. echo -n "1-1:1.0" > /sys/bus/usb/drivers/ub/unbind So to able to do that, I need the bus ID. lsusb prints out the following: Bus ...
1
vote
1answer
80 views

What are some common use cases for creating block/character device files from the shell with mknod?

I understand that block/character device files are created programmatically (by the drivers themselves?) to facilitate communications with device drivers using standard I/O calls. But why one would ...
1
vote
1answer
457 views

Editing a device tree to disable driver loading

Below is a section of device tree. ps7_ethernet_0: ps7-ethernet@e000b000 { #address-cells = <1>; #size-cells = <0>; clock-names = "ref_clk", "aper_clk"; clocks = ...
5
votes
3answers
6k views

Creating eth0 with consistent network device naming

From my understanding, Arch Linux uses Consistent Network Device Naming where the network devices are no longer named eth0, eth1, etc. I use the proprietary MATLAB software which requires a device ...
21
votes
3answers
3k views

mv a file to /dev/null breaks dev/null

If I do: touch file; mv file /dev/null as root, /dev/null disappears. ls -lad /dev/null results in no such file or directory. This breaks applications which depend on /dev/null like SSH and can be ...
19
votes
8answers
3k views

How can I put a bit mask on /dev/zero so that I can get bytes other than zero?

How can I put a bit mask on /dev/zero so that I can have a source not only for 0x00 but also for any byte between 0x01 and 0xFF?
1
vote
0answers
27 views

iostat ( column svctm is not trusted any more ) what to use instead?

I'm running a Linux Server with "Oracle Linux Server release 6.5" which is pretty much the same as RedHat Version. I need to determine the latency on my disk devices. The man page of the iostat ...
1
vote
1answer
24 views

uuid, device number, and device file for a device

In Linux, I would like to know about the differences in purposes and usages of uuid, device (major and minor) number, and device file for a device. They all seem to me to identify a device (and may ...
1
vote
2answers
37 views

Send a message to a “screen” to be received by a device on /dev

My question may looks trivial... But it's because despite of my long experience of linux/unix/osx systems, I found myself lacking some basic notions. I created a little bluetooth/arduino switch to ...
0
votes
1answer
40 views

Major and minor numbers of a partition

$ stat new File: ‘new’ Size: 928 Blocks: 8 IO Block: 4096 regular file Device: 804h/2052d Inode: 28188755 Links: 1 Access: (0622/-rw--w--w-) Uid: ( 1000/ t) Gid: ( ...
0
votes
1answer
12 views

Is it possible read every serial device's data?

Reading serial data is something ordinary when comes from devices connected by direct serial 9-pin cables. But happens with usb devices ? Considering that actually USB is a Universal Serial Bus, is it ...
2
votes
2answers
48 views

How does bash print to the screen if not with a framebuffer? [duplicate]

I noticed that a framebuffer doesn't always exist on some systems. In these cases, how does bash print to the screen (assuming it ever uses fb devices at all)? Since there's no framebuffer device, ...
3
votes
4answers
166 views

Why does mknod require root privileges?

I noticed that the mknod command required root privileges when a creating a node other than a regular file, FIFO or a Unix socket. Why is that? How can a regular user harm a system or compromise ...
2
votes
1answer
3k views

“PS/2 Generic Mouse” gets lost. How to reload without reboot?

I am running Ubuntu 12.04LTS on a ThinkPad E420s. My Trackpoint is recognized as "PS/2 Generic Mouse". My problem is that it doesn't load/disappears after booting or after suspension. I can't move ...
6
votes
1answer
823 views

Difference between /dev/null and /dev/zero

When trying to redirect to /dev/null and /dev/zero, the output it is discarded. It seems both /dev/null and /dev/zero accept and discard all input. So, what is the difference between /dev/null and ...
0
votes
0answers
15 views

How is Xserver able to tell which device is a mouse or a keyboard?

In these days we don't have to create a custom configuration that sets our devices up, at least when it comes to Xserver. But sometimes you want to change some default parameters. When you do it, you ...
0
votes
2answers
18 views

How can I see the dismounted devices

How can I see if the usb device has been dismounted? Because when I did fdisk -l the information is the same, before and after the ran command umount /dev/usb.
6
votes
2answers
3k views

Using bash's `/dev/udp`, how would I know if the port was open?

I do not have access to netcat or nmap so I'm trying to use bash and the /dev/udp/ special files to test ports. I could do something like: echo "" > /dev/udp/example.com/8000 But $? is always 0 ...