Tag Info

Hot answers tagged

13

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


11

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


11

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


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


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


8

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


8

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


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


6

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


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


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

Well, after many hours of googling and asking on forums, I got it working (it seems). Anyone who wants to get nice visual and/or audio notification when some USB device is plugged/unplugged can install my script, see installation details below. First of all, answers on my own questions. 1. How to get actual title of the device attached, the same as I can ...


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


4

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


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

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

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

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

I would set the group of the repetierHost application to uucp and then set the SGID bit (as long as it is a real binary and not script): chgrp uucp repetierHost chmod g+s repetierHost If the repetierHost is a script you could consider moving that to repetierHost.sh and write a small C programming wrapper repetierHost that calls repetierHost.sh E.g.: ...


3

Yes. The camera light will be on while the camera is in use. In this case, Motion is taking the feed and streaming it through the Motion web server. This happens whether or not people are connected to your stream. Assuming you're only using Motion I would edit the motion.conf in order to add authentication for the stream and also enable logging (to see ...


2

I think I would suggest making the rule a little more restrictive than John's. For example create a file such as /etc/udev/rules.d/99-tty-dialout.rules: SUBSYSTEM=="tty", KERNEL=="ttyUSB0", GROUP="dialout", MODE="0660" You can use udevadm to determine a devices SUBSYSTEM== and KERNEL== values. For example: $ udevadm info -a -n /dev/tty0 Udevadm info ...


2

How udev rules are structured For devices falling into subsystem tty, you can set their group as follows: SUBSYSTEM=="tty", GROUP="dialout" Note that, just like in common programming, == is a test for equality while = is an assignment. So, the above statement translates to "if SUBSYSTEM=="tty" then assign GROUP="dialout". A statement may have multiple ...


2

You can modify the properties of input devices with the xinput command. See Make mouse movements scroll when the middle button is held down for a detailed explanation. You'll want something like xinput --set-prop 'Thinkpad Trackpoint' 'Evdev Wheel Emulation' 0 where Thinkpad Trackpoint is the name of the device found in the output of xinput list, and the ...



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