Tag Info

Hot answers tagged

11

The kernel lists them by name in /sys, both separately in (e.g.) the tree of PCI devices -- although finding them there if you don't know where they are to start with is not simple -- and together via symlinks in /sys/class/net. E.g.: > ls /sys/class/net em1 lo wlp6so Another example: > ls /sys/class/net lo p6s1 wlan0 If you are not sure which is ...


10

Moving a file to the location of an already existing file replaces the existing file. In this case the /dev/null device file is replaced, just as any normal file would be. To avoid this use the -i (interactive, warns before overwriting) or -n (no clober) option for mv. /dev/null only performs its special function as a bit-bucket then the device is opened as ...


10

Looking at the source code for mv, http://www.opensource.apple.com/source/file_cmds/file_cmds-220.7/mv/mv.c : /* * If rename fails because we're trying to cross devices, and * it's a regular file, do the copy internally; otherwise, use * cp and rm. */ if (lstat(from, &sb)) { warn("%s", from); return (1); } return (S_ISREG(sb.st_mode) ? ...


10

There are various alternatives to udev out there. Seemingly Gentoo can use something called mdev. Another option would be to attempt to use udev's predecessor devfsd. Finally, you can always create all the device files you need with mknod. Note that with the latter there is no need to create everything at boot time since the nodes can be created on disk and ...


8

Umm, because you overwrite the special file with normal one? What did you expect to happen? dev/null is not a directory, it is a file pointing to a null device. When you mv something to it, you delete the original and replace it with whatever you moved: $ file /dev/null /dev/null: character special $ sudo mv file /dev/null $ file /dev/null /dev/null: ...


7

The files in /dev are actual devices files which UDEV creates at run time. The directory /sys/class is exported by the kernel at run time, exposing the hierarchy of the hardware through sysfs. From the libudev and Sysfs Tutorial excerpt On Unix and Unix-like systems, hardware devices are accessed through special files (also called device files or ...


7

The simplest method I know to list all of your interfaces is ifconfig -a EDIT If you're on a system where that has been made obsolete, you can use ip link show


7

Modern Linux kernels support the devtmpfs file system (do not confuse with ancient devfs), which creates all device nodes dynamically as soon as the kernel discovers them. (In fact, latest udev releases require this; you'll find that udev doesn't create any device nodes anymore, only symlinks.) Similarly, firmware loading has been moved into the kernel as ...


5

You could pipe through SSH. Example using dd: dd bs=1M if=/dev/disk | ssh -C target dd bs=1M of=disk.img If the network connection breaks during transfer, you can resume if you know how much was copied. For example if you're sure at least 1000MiB were transferred already (check the file size of disk.img): dd bs=1M skip=1000 if=/dev/disk | ssh -C target ...


5

If the filesystem takes over the whole disk, OS X currently uses a name like /dev/disk5. If the disk is partitioned, it adds an s# suffix, like /dev/disk5s2 for the second partition. (s is short for "slice," a BSDism functionally equivalent to a partition.) Disks are numbered sequentially in discovery order by the OS, on boot, so you may have to experiment ...


5

When fsck runs, it should first try to locate the superblock of a filesystem to begin traversing the filesystem's structure in order to validate it. Since the /dev/sda device corresponds to whole drive, the first portion of the disk will likely contain the partition table or Master Boot Record and fsck will not be able to locate the superblock for a ...


4

This is scarcely explained in Implementing SELinux as a Linux Security Module This results in a populated selinuxfs filesystem and sets up the special null device node used by SELinux when it closes unauthorized files upon a context-changing execve. Apparently programs cannot use /dev/null directly while in SELinux-context and they needed their own ...


4

An embedded system may have a static /dev, rather than use udev to populate it. If you don't have /lib/udev, then presumably your system isn't running udev. In that case, you need to create /dev/shm on the root filesystem. If the root filesystem is an initramfs, rebuild your initramfs with an extra line in the initramfs description file: dir /dev 755 0 0 ...


4

The files in /dev are device files, they are not real files. They don't, usually, have content on disk (a few representing raw disks do). There is nothing in the file. If you do ls -l /dev, you will see all there is to these "files": A name, some special bits, see first character of mode (is is not d=directory, -=regular file, l=symlink, it is c=character ...


4

POSIX general defines three special files: /dev/tty /dev/console /dev/null In addition, / and /tmp are also defined by POSIX. /dev/zero, /dev/urandom or /dev/random are defined in some UNIX-like operating systems. Some operating systems may not define them, or implement with different names. Note POSIX direcory structure and files /dev/zero ...


4

Not every file under /dev is a device file that has major/minor numbers. Example $ ls -l |grep initctl prw-------. 1 root root 0 Sep 17 13:27 initctl $ stat initctl File: ‘initctl’ Size: 0 Blocks: 0 IO Block: 4096 fifo Device: 5h/5d Inode: 8882 Links: 1 Access: (0600/prw-------) Uid: ( 0/ root) Gid: ...


3

The RTC subsystem went through a major redesign since at least 2006 and since then doesn't have a statically assigned major number, now. This is a rather major trend in the Linux kernel for various device drivers (device-mapper for example also dynamically allocates its device-number region). The reason behind this is that the vast amount of available ...


3

Have you tried consulting the Xilinx wiki? Build Device Tree Blob This howto looks like it has everything you need to get what you want. There's links to a git repository with code as well as directions on how to build it. Here's the command to download the device-tree sources. $ git clone git://github.com/Xilinx/device-tree.git The Xilinx website ...


3

/dev/dsp is part of OSS, which hasn't been part of the Linux kernel in... a very long time. It has long been supplanted by ALSA, which uses different devices, different programs, and a different API. There is an emulation layer module though. If it is available then loading the snd-pcm-oss module will enable you to use the PCM devices for OSS such as ...


3

If I run this with sudo I still get permission denied. By this statement, it sounds like you are trying a command like: sudo cat file.wav > /dev/dsp The reason you continue to get "permission denied" is that your shell first tries to open the /dev/dsp device for output, before running the command (which is sudo). To have the shell open the ...


3

I think you are looking for hwinfo command. This command helps you to query disk, network and other hardware information


3

If I understand you right then there is some file system on /dev/sdb that you have mounted. What matters here are the permissions in the file system that resides on /dev/sdb, the permissions of /dev/sdb are completely irrelevant for your question. Except that with permissions 0666 anyone can bypass the access control mechanisms for that file system and ...


3

A Solution: The problem is that this serial port is non-PlugNPlay, and a system do not know which device was plugged in. Anyway, after reading a HowTo I get the working idea. An *nix-OS already have in /dev/ a files like ttySn where a n ending is a number. Most of this files is dumb i.e. doesn't correspond to an existing devices. But some of those is going ...


3

Weeeeellll..... A kernel module is something very specific: A part of the kernel that's being loaded as a module (i.e. dynamically), after the core kernel starts. That can be anything. In order to use the hardware you need some parts that reside in the mostly kernel for two reasons: In order to be able to perform hardware operations that cannot be done ...


3

I can try to trap the Interrupt at a lower level and inform the gtkmm application. No, that is a kernel space activity. Fortunately, the kernel does report the outcome of certain events via interfaces accessible from userland. It's a little ambiguous in your question whether you want to detect when a block device is attached, or when a filesystem is ...


3

What is a Terminal? A terminal consists of a screen and keyboard that one uses to communicate remotely with a computer (the host). One uses it almost like it was a personal computer but the terminal is remote from its host computer that it communicates with (on the other side of the room or even on the other side of the world). Question 1 /dev/tty ...


3

I'm never quite sure if spelunking in sysfs is the best way to do things (am I supposed to use udevadm?), but at least it's discoverable $ DEV=p8p1 $ readlink /sys/class/net/$DEV/device/driver ../../../../bus/pci/drivers/tg3 It won't work for devices like lo which are "virtual" (/sys/devices/virtual/). They don't have the link to an underlying device ...


3

It won't work, if the filesystem was installed in a partition (e. g. sda1). fsck and its brethren are tools for performing maintenance on filesystems (hence the name: filesystem ccheck), not of block devices. It is, I suppose, theoretically possible to put a filesystem directly onto a block device by way of something like mke2fs -j /dev/sda, but this is ...


2

I don't think there's a single standard or a tool to manage and query hardware devices on Linux systems in general, as each implementation may differ from another in terms of file system structure, tools available and the way devices are managed internally by that particular system or service. Depending on which component you need to query, you'll use a ...


2

It works if you create two files, one wrapper script being called by udev, which in turns calls the actual configuration script in the background. The configuration script needs to sleep for a short while, so that X11 has time to do its job. Here's the setup I use: Wrapper script called by udev (/usr/local/bin/setupwacom.sh): #!/usr/bin/env bash ...



Only top voted, non community-wiki answers of a minimum length are eligible