Tag Info

Hot answers tagged

125

/dev/null is a file. A special file. A device file like /dev/sda or /dev/tty that talks to a piece of hardware on your system. The only difference with /dev/null is that no hardware is linked to it. Any data you send to it is silently discarded. Like the following command: $ echo "Hello World" > /dev/null which won't print anything on your terminal ...


28

@Benoit is nearly correct in his answer. You will also need to fix permissions. $ sudo rm /dev/null $ sudo mknod /dev/null c 1 3 $ ls -l /dev/null crw-r--r-- 1 root root 1, 3 Mar 18 08:38 /dev/null $ sudo chmod 666 /dev/null $ ls -l /dev/null crw-rw-rw- 1 root root 1, 3 Mar 18 08:38 /dev/null This restores the permissions. Otherwise, as a non-root user ...


16

Unfortunately there seems to be no easy way. What I will describe is how to create a new Upstart job to set the values on boot through the virtual filesystem under /sys. Find the device path of your trackpoint Run the following in a gnome-terminal (press Alt + F2, type gnome-terminal, and hit Enter): find /sys/devices/platform/i8042 -name name | xargs ...


15

I don't know if this helps in reloading the network configuration, but when I modified /etc/udev/rules.d/70-persistent-cd.rules to correct the DVD device link from /dev/dvd1 to /dev/dvd, I had to run sudo udevadm trigger to get have the new links created.


15

There is a big difference between overwriting a file and writing to a file. When you write something to /dev/null, e.g., $ echo Hello > /dev/null ...it gets silently discarded. For this you need write permissions to /dev/null, which everyone has: $ ls -l /dev/null crw-rw-rw- 1 root root 1, 3 Mar 18 13:17 /dev/null When you overwrite /dev/null, as ...


14

I never did that but I think you need to create a keymap file in /lib/udev/keymaps/ and add a rule for your device to /lib/udev/rules.d/95-keymap.rules Details: An udev keymap maps scan codes to key codes, so you need to find both to create the keymap file. To find the scan codes run the following and press the buttons on the device: sudo ...


11

It seems to work for me in Ubuntu 14.04 with 2 flash keys & android phone as storage and usb network adapter & webcam as other type. (I couldn't test placing a usb hub) Check USB port (which is a parent device for the plugged device) $ udevadm info --name=/dev/sdc --attribute-walk looking at parent device ...


10

In Ubuntu 12.04 (Unity, and presumably Gnome Shell/Classic) automounting is handled by GNOME Desktop/Nautilus, which monitors DBus events for insertion, etc. The gvfs* backend is used, in co-operation with udisks for the low-level mounting, etc. gvfs-mount is used internally, and running it in monitor mode with the -o switch will show, for example: $ ...


8

I guess your usb drive is formatted with VFAT/FAT32. This file format does not support execute permissions which is why chmod +x fails. [Edit] Ok, had a bit of a play and search on the net. Lots of 'solutions' suggest that you should change /etc/fstab. This just seems clunky to me, what do you do? change fstab every time you encounter a new usb flash ...


8

Maybe you should specify which part of the process is interesting to you but let's say a USB stick is added then... kernel detects and initializes the device (see dmesg), then exports all the information it has found via a directory in /sys (see /sys/devices) kernel sends a uevent signal which is picked up by udev daemon udev daemon gathers available info ...


8

When you run the command $ sudo mv test_file /dev/null you have replaced the special file /dev/null with your text file. Subsequent attempts to read from /dev/null return the contents of your text file, and programs that attempt to use /dev/null in the normal way will probably break. Replacing or deleting device files in /dev/ requires superuser ...


7

is there any way I can write a udev rule that fixes the name of each adapter based on which physical port on the hub the adapter is plugged into? Yes there is, as it turns out. Consider the last portion of the device hierarchy shown in the second example above: looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1/1-4/1-4.5': ...


7

You have to combine all the advice given here in the right order: Bring down the network service networking stop Unload the driver module from the kernel Find the name of the module lspci -v and look for "Kernel driver in use:" modprobe -r <driver module> Reload the udev rules udevadm control --reload-rules Trigger the new rules udevadm trigger ...


7

I bought the exact same model (900X4C) a couple of days ago and I've successfully seen the F9/F10 keys work, and I didn't even had to install the Voria / samsung-tools package either - I just fiddled around with the /lib/udev/keymaps/samsung-other file and the corresponding force-release file. Unfortunately, I messed up the install process (I wasn't running ...


7

This tutorial explain very nice how to do what you want: Creating Custom Symlinks to Devices According to it, there are two approaches to creating symlinks. The first one is to use the model name and the serial number: SUBSYSTEM=="block", ENV{ID_MODEL}=="...", ENV{ID_SERIAL}=="...", ENV{GENERATED}="1", SYMLINK+="dvd" This way, the symlink will stay ...


6

The usual way to create a Unix domain or TCP socket is programatically, via the mknod or socket system calls. The mknod command will not allow you to create a socket. From the command line, use the socket package If you wish to create a Unix/TCP socket from the command-line, try the socket command from the socket package (install it first). Summarizing ...


6

It looks like you have two problems. The first is an ordering problem. Reading the kernel.org manpage on udev, it mentions: All rules files are ... processed in lexical order Meaning rules are processed in alphabetical order. The first rule that triggers for a device creates the device file. It looks like you've named your rule file ...


6

If you look at /lib/udev/rules.d/60-keyboard.rules you'll see that everything has been messed around with. This is just part of the udev merger into systemd that has gone on. All hardware rules are compiled into a binary hardware database. These follow a really strange format. The existing rules for keyboards that ship with udev live in ...


6

To answer your question of what you should have done, to remove a file, you do: rm test_file As others have stated, /dev/null is a destination for the output of programs.


6

In RUN you must to put a path to a script. See man udev: Add a program to the list of programs to be executed for a specific device. This can only be used for very short running tasks. Running an event process for a long period of time may block all further events for this or a dependent device. Long running tasks ...


5

If you run the script below in the background, it checks for mounted volumes. If one of your defined drives is mounted, it automatically opens the set folder in nautilus. A minor problem was that nautilus does not support opening a directory in a new tab from command line, only in a new window. That means that the initial window, that appears if you insert ...


5

Since I don't have your hardware I can't give you an exact answer. I'd suggest that you go to the device in question, for example: ls -l /dev/ttyUSB0 and obtain the major and minor node numbers. Let's say they are 116, 7 Then go to: ls -l /sys/dev/char/116:7 (char, because a tty is a character device, if you were tracing down a disk device you would ...


5

I finally found a working solution: 1. Find the device path of your trackpoint Run the following in a gnome-terminal (can be opened with Ctrl+Alt+t): find /sys/devices/platform/i8042 -name name | xargs grep -Fl TrackPoint | sed 's/\/input\/input[0-9]*\/name$//' It will return something like /sys/devices/platform/i8042/serio1/serio2 change to whatever ...


5

Normally, this is done by adding to /etc/udev/rules.d a file maybe named 50-usb-scale.conf with contents like this: SUBSYSTEM=="usb", ATTR{idVendor}=="HEX1", ATTR{idProduct}=="HEX2", MODE="0666" Where HEX1 and HEX2 are replaced with the vendor and product id respectively. To match on the Interface type instead, you could try replacing ...


5

I believe the contents of /dev are automatically rebuilt when you reboot. To quote someone else: When you start the system, the "udev" facility examines the hardware configuration (according to established rules) and dynamically creates the entries in /dev.


4

You can write udev-rules to assign different names to the printer, depending on their serial numbers. See http://www.reactivated.net/writing_udev_rules.html#example-printer for an example of a udev printer rule.


4

The bug seems to be fixed now. Without me reporting it. In 12.04 and 12.10 the settings can be found with dconf-editor or dconf in /org/gnome/settings-daemon/peripherals/mouse/middle-button-enabled and persist over standby and reboot.


4

So I haven't actually been able to set up the fitbit using libfitbit, I had to use my roomates Mac to do the initial setup. As for the "sticking in the stick and get the upload going", I included some udev rules in that package (I believe the original author wrote them), and it should just work when the fitbit is plugged in (once the initial setup has ...


4

Ok, found this at https://help.ubuntu.com/community/MultimediaKeys When you hit a key on your keyboard, the linux kernel generates a raw scancode for it (if it is assigned). Each scancode can be mapped to a keycode. This is at kernel level. X has a (quasi) total independent way of mapping keys: X reads the kernel keycode table at startup, then ...


3

cd /etc/udev/rules.d rm -f 70-persistent-net.rules rm -f 75-persistent-net-generator.rules echo "# " > 75-persistent-net-generator.rules See https://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html chapter "Rules files"



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