Tag Info

Hot answers tagged

18

Naturally, you need to unmount any filesystems on the disk, and it'd be a good idea to deactivate any LVM groups (vgchange -an), and generally make sure nothing is using the disk for anything. Once you've done that, it should be safe to unplug. If you want to be extra cautious, do echo 1 > /sys/block/(whatever)/device/delete first. That'll unregister ...


5

I think you're looking for pmount. If you want automatic mounting upon insertion, see Automounting USB sticks on Debian. The program that reacts when a new device appears is udev, so automatic mounted is triggered by a udev rule. The usbmount package provides udev rules to automatically mount USB storage devices and a few others. You cannot automatically ...


5

That's just the way that the PS/2 port works. Unlike the USB, the PS/2 was not designed to be hot-plugged. If you need the hot-plugging capability, use a USB mouse. Otherwise, there is no guarantee that any solution will work consistently.


4

This is handed by udev on modern Linux systems. The udev daemon started with the system will search in /etc/udev/rules.d and /lib/udev/rules.d and will run matching rules for kernel events. Inserting a USB drive will trigger an event, udev will search for a matching rule and will execute it. The rules themselves will determine what your system does. In ...


4

You can use udev rules. For this, you'll need to find the device attributes that distinguish your USB headset once it is plugged in. This can be usually done in two steps: Run udevadm monitor --udev befor plugging the device. Then plug it in. There will be a bunch of output lines - just pick one and copy the device path from it - it is something like ...


3

Yes, you can find the information in /sys/block/$DEVICE/slaves. If you only have the canonical name you can use readlink to get the details, e.g: devdm="$(readlink -f /dev/mapper/extern-1-crypt)" dm="${devdm#/dev/}" ls /sys/block/$dm/slaves/ If you want to remove all you can just utilize directly the sys filesystem: echo 1 > ...


3

Those two sections are for different things. The first is for unplugging. The second is for plugging. For unplugging, the OS will sync the data during the unmount operation. Thus, if the disk is unmounted (assuming you in fact do have full hardware support) you can power off the disk then unplug it without risk of data loss or corruption. For plugging, ...


2

I'm not completely confident with this yet, so take it with a grain of salt and more research. It starts with the kernel hotplug subsystem. After a device is setup, it either calls whatever userspace program is setup to handle hotplug events (if one was set by echo hotplug_handler > /proc/sys/kernel/hotplug) or sends a data packet over the kobject_uevent ...


2

There is a lot of possibilities: :> # 1 :> pvscan :> # 2 :> vgscan -v extern-1 :> # 3 :> dmsetup table /dev/mapper/extern-1-crypt :> # 4 :> cd /sys/devices/virtual/block/ :> for dmdev in dm-*; do :> if [ xyz = $(< "${dmdev}/dm/name") ]; then :> ls -l "${dmsev}/slaves/" :> fi :> done Or take the "dm-" ...


1

The answer from Iain Dawson covers the userland part. In the kernel proper the handling of hotplug is integrated all over the place. Some infrastructure is present in the base kernel, but hotplugging has to be handled in each device driver, so there is no set of modules responsible for this.


1

Ok, it's been a long time, but I'll still answer my question with the best option I found as of now. The best way is to create a udev rule, associated with some scripts (that will create / remove directories and mount / unmount removable devices), and attached to partition udev device event type. 1 - Creating add / remove scripts Add this script ...


1

It sounds like your VM has been configured to provide a single virtual cpu. The following documentation might help you in reconfiguring your VM to provide multiple cores: https://www.virtualbox.org/manual/ch03.html#settings-processor This may help, I had a similar issue with an Ubuntu VM. This help me with my original question


1

In general, with modern hardware, a modern kernel, and a modern distribution, hardware recognition should happen automatically. There is, however, a program called "kudzu" which will do what you want — attempt to detect new hardware, and add the appropriate configuration. I think, because of the changes in modern systems, it's not really maintained anymore ...



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