Search Results

Search found 318 results on 13 pages for 'udev'.

Page 2/13 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • udev rule not being executed

    - by jyavenard
    I have the following device that udevadm lists as: looking at device '/devices/pci0000:00/0000:00:1c.7/0000:09:00.0/usb6/6-2/6-2:1.0/ttyUSB0/tty/ttyUSB0': KERNEL=="ttyUSB0" SUBSYSTEM=="tty" DRIVER=="" looking at parent device '/devices/pci0000:00/0000:00:1c.7/0000:09:00.0/usb6/6-2/6-2:1.0/ttyUSB0': KERNELS=="ttyUSB0" SUBSYSTEMS=="usb-serial" DRIVERS=="pl2303" ATTRS{port_number}=="0" looking at parent device '/devices/pci0000:00/0000:00:1c.7/0000:09:00.0/usb6/6-2/6-2:1.0': KERNELS=="6-2:1.0" SUBSYSTEMS=="usb" DRIVERS=="pl2303" ATTRS{bInterfaceNumber}=="00" ATTRS{bAlternateSetting}==" 0" ATTRS{bNumEndpoints}=="03" ATTRS{bInterfaceClass}=="ff" ATTRS{bInterfaceSubClass}=="00" ATTRS{bInterfaceProtocol}=="00" ATTRS{supports_autosuspend}=="1" So I created the rule: KERNEL=="ttyUSB0", SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="pl2303", KERNELS=="6-2:1.0", SYMLINK+="cc128serial" this doesn't work. However if I do: KERNEL=="ttyUSB0", SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="pl2303", SYMLINK+="cc128serial" then it works. I tried with KERNELS=="6*" etc.. to no available any ideas ? thanks

    Read the article

  • How to support udev in a kernel module?

    - by Basilevs
    I'm porting a linux kernel module. It used to create a device file for itself (using dirty hacks with syscalls from kernelspace), but now I want to do this in udev. Where can I find documentation on supporting udev in in kernel module? Note that module itself is not a device driver. It serves as a multiplexor for a set of drivers. Therefor default ways of registering devices (i.e. pci ones) are not suitable for my task.

    Read the article

  • Understanding the Linux boot process, subsystem initialization, & udev rules?

    - by quack quixote
    I'm creating UDEV rules for automounting external drives on a headless server, much in the same way as Gnome-VFS does automounting during a user session. I'm concerned with the rule's behavior at boot-time. There's a good chance one of these drives will be connected during a boot, and I'd prefer any connected drives get mounted in the right place. The drives might be either USB or Firewire, and they are mounted from a shell script fired off by UDEV on detecting an "add". Here are my questions: When UDEV runs the mount for these devices at boot, will the system be ready to mount it? Or will the script get triggered too early? If it's too early, what's a good way for a script to tell that the system isn't ready yet (so sleep a while before checking again)? The UDEV rule matches ACTION=="add". Does this event even fire at system boot?

    Read the article

  • Alternative to udev functionality on OSX

    - by S1syphus
    I'm trying to create a custom file/check in check out script for external hardrives, however part of the script is from a Linux machine, which I have tested works fine, but uses udevinfo, OS X doesn't have udev, so is there anything that offers the same functionality? #!/bin/bash declare -a EXTERNAL_DISKS declare -a INTERNAL_DISKS for disk in /dev/[sh]d[a-z]; do eval `udevinfo -q env -n $disk` [ "$ID_BUS" = "usb" ] && EXTERNAL_DISKS=( ${EXTERNAL_DISKS[@]} $disk ) [ "$ID_BUS" = "scsi" ] && INTERNAL_DISKS=( ${INTERNAL_DISKS[@]} $disk ) done echo "Internal disks: ${INTERNAL_DISKS[@]}" echo "External disks: ${EXTERNAL_DISKS[@]}" Anybody know any alternatives? Or a way this could be accomplished on OSX using bash?

    Read the article

  • Auto-run script when iPad plugged in

    - by oldmankit
    The way that Ubuntu handles documents on the iPad is awesome (without any configuration required). It beats windows, even after you install iTunes. I want to have the documents in certain iPad apps automatically synced into my Dropbox directory whenever the iPad is connected by USB. The syncing is easy; getting the script to run is not. I have already read the information in various (very out-of-date) tutorials. The best I could find was here: http://askubuntu.com/a/25091/16157 I used lsusb, with the following results: Bus 002 Device 012: ID 05ac:12a2 Apple, Inc. (Please note that when an iPad is connected, Ubuntu seems to mount it to two different mount points: one for "Documents" and one for the whole iPad filesystem. They are both mounted in ~/.gvfs) I have created the following file /etc/udev/rules.d/96-ipad_sync.rules ACTION=="add", ATTRS{idVendor}=="05ac", ATTRS{idProduct}=="12a2", RUN+="/home/kit/bin/jobdone2" I want it to run a test script (which sleeps for five seconds then plays an mp3 file. The test script works, and I have typed the location correctly). So far, when I plug the iPad in, nothing happens. Yes, I waited five seconds. This is the output I get from typing udevadm monitor –env KERNEL[29348.114010] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4 (usb) KERNEL[29348.114844] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0 (usb) KERNEL[29348.129118] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0 (usb) KERNEL[29348.130699] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:4.0 (usb) KERNEL[29348.130845] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:4.1 (usb) KERNEL[29348.130909] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:4.2 (usb) UDEV [29348.163861] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4 (usb) UDEV [29348.170390] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0 (usb) UDEV [29348.171521] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:4.1 (usb) UDEV [29348.172230] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0 (usb) UDEV [29348.172890] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:4.2 (usb) UDEV [29348.175645] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:4.0 (usb)

    Read the article

  • How to run long time process on Udev event?

    - by neclude
    (sorry for my bad english) I want run ppp connection when my usb modem is connect. so i use next udev rule: ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="16d8",\ RUN+="/usr/local/bin/newPPP.sh $env{DEVNAME}" (my modem appear in /dev as ttyACM0) newPPP.sh: #!/bin/bash /usr/bin/pon prov $1 >/dev/null 2>&1 & Problem: udev event fire, newPPP.sh running, BUT newPPP.sh process will be killed after ~4-5s. ppp not have time to connect. (in it params is timeout 10s for dial up). How can i run long time process, that will not be killed? (I was try nohup. It don't work too.) System: Arch Linux

    Read the article

  • Using udev to create a character device based on a driver being loaded

    - by SteveCB
    I'm in the process of setting up RAID monitoring for a number of Dell servers that use the PERC 6i integrated card. We're using Nagios at present and the check_megasasctl plugin seems to fit the bill. However, the plugin relies upon the existence of: /dev/megaraid_sas_ioctl_node This device node doesn't exist by default, you have to create it by hand using something like: mknod /dev/megaraid_sas_ioctl_node c 253 0 Now, to make the existence of this device node persistent across reboots, I thought I could write a udev rule, but as usual, I'm missing something. I thought I could create a file such as /etc/udev/rules.d/10-local/rules that contained: DRIVER=="megasas" NAME="megaraid_sas_ioctl_node" MODE="0600" But this doesn't work - no device node after a reboot. Dmesg output indicates the megasas driver is loaded and functional: megasas: 00.00.04.01-RH1 Thu July 10 09:41:51 PST 2008 megasas: 0x1000:0x0060:0x1028:0x1f0c: bus 1:slot 0:func 0 megasas: FW now in Ready state Further, I don't see any means to instruct udev on which type of device node to create: character or block. I suspect I'm failing to understand exactly how udev is meant to work. I realise I could just cheat and run MegaCLI in /etc/rc.local, redirecting output to /dev/null; it creates the megaraid_sas_ioctl_node device node as part of its execution. I just thought using udev rules would be a) cleaner and b) a useful learning exercise. Perhaps I should just dump the above mknod command in /etc/rc.local... So how do I get udev to create the /dev/megaraid_sas_ioctl_node device node based on the presence of the megasas driver? Cheers Steve

    Read the article

  • Creating floppy drive special devices under Quantal

    - by JCCyC
    First, I'd like for the various special devices for different floppy capacities (like /dev/fd0u720 etc.) to be available. I tried to adapt some udev rules I found online. I tried this, which I saved as /etc/udev/rules.d/70-persistent-floppy.rules: # change floppy device ownership and permissions # default permissions are 640, which prevents group users from having write access # first fix primary devices (/dev/fd0, /dev/fd1, etc.) # also change group ownership from disk to floppy SUBSYSTEM=="block", KERNEL=="fd[0-9]*", GROUP="floppy", MODE="0660" # next recreate secondary devices (/dev/fd0u720, /dev/fd0u1440, etc.) SUBSYSTEM=="block", KERNEL=="fd[0-9]*", ACTION=="add", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0660 -G floppy $root/%k" But to no avail. It seems the create_floppy_devices script isn't provided with 12.10. How do I obtain it? Second: I'm using MATE, and whenever I log in I get a message box saying it tried to mount the drive but failed. How do I disable this? Third (which is probably related to the second): Whenever there's a disk in the drive, the motor won't stop spinning. If I do a mdir of it, after it returns, the motor stops, and then starts again. I suspect there's some process in MATE doing this. UPDATE: For CentOS 6 (who does have a create_floppy_devices program) the following rules file worked. Saved as /etc/udev/rules.d/98-floppy.rules: # change floppy device ownership and permissions # default permissions are 640, which prevents group users from having write access # first fix primary devices (/dev/fd0, /dev/fd1, etc.) # also change group ownership from disk to floppy KERNEL=="fd[0-9]*", GROUP="floppy", MODE="0660" # next recreate secondary devices (/dev/fd0u720, /dev/fd0u1440, etc.) # drive A: is type 4 (1.44MB) - add other lines for other drives KERNEL=="fd0*", ACTION=="add", RUN+="/lib/udev/create_floppy_devices -c -t 4 -m %M -M 0660 -G floppy $root/%k"

    Read the article

  • How can I set deadline as the I/O scheduler for USB Flash devices by using udev rules?

    - by ????
    I have set CFQ as the default I/O scheduler. I often get bad performance when I write data into a Flash device. This is resolved if I use deadline as the I/O scheduler for USB Flash devices. I can't always change the scheduler manually, right? I think writing udev rules is a good idea. Can someone please write rules for me? I want: When I plug in a USB device, detect the type of the device. If it is a portable USB hard disk, do nothing (I think if a device has more than one partitions, it always a portable hard disk. If it is a USB Flash device, set deadline as it's scheduler.

    Read the article

  • Why would 70-persistent-net.rules have no effect?

    - by Wes Felter
    I've got a saucy server with a lot of NICs and they end up with weird names like "rename19". I know interface names can be changed by modifying the /etc/udev/rules.d/70-persistent-net.rules file. The first clue that something is wrong is that that file did not exist even though it's supposed to be created automatically. So I decided to write my own based on advice from Linux From Scratch: ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:06:00.0", NAME="eth0" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:06:00.1", NAME="eth1" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:06:00.2", NAME="eth2" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:06:00.3", NAME="eth3" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:0c:00.0", NAME="mezz0" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:0c:00.1", NAME="mezz1" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:1b:00.0", NAME="slot1a" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:1b:00.1", NAME="slot1b" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:20:00.0", NAME="slot2a" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:20:00.1", NAME="slot2b" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:11:00.0", NAME="slot3a" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:11:00.1", NAME="slot3b" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:8b:00.0", NAME="slot4a" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:8b:00.1", NAME="slot4b" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:90:00.0", NAME="slot5a" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:90:00.1", NAME="slot5b" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:95:00.0", NAME="slot6a" ACTION=="add", SUBSYSTEM=="net", BUS=="pci", KERNELS=="0000:95:00.1", NAME="slot6b" (I'm matching on PCI IDs instead of MAC addresses because I have multiple identical machines that I want to apply this configuration to.) After rebooting, nothing has changed. It's like these rules aren't even being read. There's not much going on in dmesg either: $ dmesg | grep udev [ 3.196629] systemd-udevd[323]: starting version 204 [ 6.719140] systemd-udevd[550]: starting version 204 [ 38.695050] init: udev-fallback-graphics main process (1658) terminated with status 1

    Read the article

  • How to write rules for persistent net names?

    - by ndemou
    I know that a process generates persistent network card names based on rules found in /lib/udev/rules.d/75-persistent-net-generator.rules. I also know how to completely disable this process with a simple echo '#' > /etc/udev/rules.d/75-persistent-net-generator.rules but I've read that I "could also write my own rules file to give the interface a name — the persistent rules generator ignores the interface if a name has already been set" (/etc/udev/rules.d/README confirms that this is possible). Do you have any pointers to documentation about how to write such rules? (I mostly care about Debian/Ubuntu and a bit less for CentOS) As a specific example of why I want to write custom rules: I have two identical servers with one onboard LAN and one PCI LAN. In case of HW failure I want to be able to move disks from HW#1 to HW#2 and it's important for eth0 to continue pointing to the onboard card and eth1 to the PCI card (no one wants to mess with cabling in the middle of a HW failure panic). My current workaround works but is a lot of work[1] so I wonder if writing custom rules would allow me to express something simple like this: cards with MAC A or B should be named eth0 cards with MAC C or D should be named eth1 follow default naming scheme for anything else [1] install the OS in HW#1 and keep a copy of /etc/udev/rules.d/70-persistent-net.rules. Move the disks to HW#2 and keep a second copy of the same file. Concatenate the two copies and manually edit the NAME="ethX" part. Replace /etc/udev/rules.d/70-persistent-net.rules with my version. Finally disable auto-creation of a new 70-persistent-net.rules using echo '#' > /etc/udev/rules.d/75-persistent-net-generator.rules

    Read the article

  • Can I prevent an IDENTIFY PACKET DEVICE command to a specific device at boot?

    - by Brian Spisak
    This is related to a previous question related to installation that is now resolved. I'm opening a new question, because I still need to get my DVD drive working. Problem: Failed boot when my ASUS DRW-24B1/ST DVD drive is attached to my asmedia ASM1061. Symptom: ata8.00: exception Emask 0x52 Sact 0x0 SErr 0xffffffff action 0xe frozen ata8: SError: { blah blah } ata8.00: failed command: IDENTIFY PACKET DEVICE ata8.00: cmd blah blah res blah blah (ATA bus error) ata8.00: status: { DRDY } ata8: hard resetting link Background: The ASM1061 is a PCIe to SATA bridge providing 2 x 6Gb/s ports and is supposed to be fully compliant to SATA specs. I just discovered in the fine print of my ASUS P8Z77-V pro motherboard that "These SATA ports are for data hard drivers only. ATAPI devices are not supported." However, I have already installed Windows 7 using this drive and I can run the Ubuntu 12.04 installer from it as well. The only time I have a problem is during Ubuntu boot when it tries an IDENTIFY PACKET DEVICE which seems to be an ATAPI command. I can't simply switch this device to another SATA port because they are already allocated to other devices. (My chipset's 2 x 6Gb/s are connected to my boot SSD and a fast HDD while the 4 x 3Gb/s ports are running a RAID 5 array.) If this can't be fixed or worked around, I suppose I'll have to go buy SATA add-in card. Blech. Thoughts: If indeed this is a device specific issue (that it doesn't support ATAPI discovery) then I can't expect - is it udev? - to work with it. But, it seems that Windows and even the Ubuntu installer work just fine. So why does udev have a problem? At the end of the day, it would be nice to have the DVD working under Ubuntu, but I can live without it. But, as this is a dual-boot machine, I can't physically disconnect it because I want it to work with Windows. (And physically disconnecting it every time I want to boot Ubuntu is NOT an option. ;-) Questions: Should this be considered a bug? My feelings are that if it works with other OS that it should probably work with Ubuntu as well. How can I work around this problem? I have a limited knowledge of linux internals, but it seems I should be able to somehow tell udev (or whatever is doing the discovery) to ignore that device. Is there a way?

    Read the article

  • Start script when connecting phone through usb

    - by choel
    Trying to run a script when my phone is plugged in via USB, a made a udev rule looks like this in /etc/udev/rules.d/85-lazydroid.rule ATTRS{idVendor}=="22b8", ATTRS{idProduct}=="428c", RUN+="/home/joel/.lazydroid" And the script .lazydroid looks like this: #!/bin/bash exec adb forward tcp:8080 tcp:8080 & exec chromium-browser 127.0.0.1:8080 --new-window & The script itself runs fine. The trick is I can't get the script to run up on insertion of the phone. And it's the right ID according to: lsusb | grep Motorola Bus 002 Device 042: ID 22b8:428c Motorola PCS Any ideas?

    Read the article

  • Informaton of pendriver with libudv on linux

    - by Catanzaro
    I'm doing a little app in C that read the driver information of my pendrive: Plugged it and typed dmesg: [ 7676.243994] scsi 7:0:0:0: Direct-Access Lexar USB Flash Drive 1100 PQ: 0 ANSI: 0 CCS [ 7676.248359] sd 7:0:0:0: Attached scsi generic sg2 type 0 [ 7676.256733] sd 7:0:0:0: [sdb] 7831552 512-byte logical blocks: (4.00 GB/3.73 GiB) [ 7676.266559] sd 7:0:0:0: [sdb] Write Protect is off [ 7676.266566] sd 7:0:0:0: [sdb] Mode Sense: 43 00 00 00 [ 7676.266569] sd 7:0:0:0: [sdb] Assuming drive cache: write through [ 7676.285373] sd 7:0:0:0: [sdb] Assuming drive cache: write through [ 7676.285383] sdb: sdb1 [ 7676.298661] sd 7:0:0:0: [sdb] Assuming drive cache: write through [ 7676.298667] sd 7:0:0:0: [sdb] Attached SCSI removable disk with "udevadm info -q all -n /dev/sdb" P: /devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/1-1:1.0/host7/target7:0:0/7:0:0:0/block/sdb N: sdb W: 36 S: block/8:16 S: disk/by-id/usb-Lexar_USB_Flash_Drive_AA5OCYQII8PSQXBB-0:0 S: disk/by-path/pci-0000:02:03.0-usb-0:1:1.0-scsi-0:0:0:0 E: UDEV_LOG=3 E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb1/1-1/1-1:1.0/host7/target7:0:0/7:0:0:0/block/sdb E: MAJOR=8 E: MINOR=16 E: DEVNAME=/dev/sdb E: DEVTYPE=disk E: SUBSYSTEM=block E: ID_VENDOR=Lexar E: ID_VENDOR_ENC=Lexar\x20\x20\x20 E: ID_VENDOR_ID=05dc E: ID_MODEL=USB_Flash_Drive E: ID_MODEL_ENC=USB\x20Flash\x20Drive\x20 E: ID_MODEL_ID=a813 E: ID_REVISION=1100 E: ID_SERIAL=Lexar_USB_Flash_Drive_AA5OCYQII8PSQXBB-0:0 E: ID_SERIAL_SHORT=AA5OCYQII8PSQXBB E: ID_TYPE=disk E: ID_INSTANCE=0:0 E: ID_BUS=usb E: ID_USB_INTERFACES=:080650: E: ID_USB_INTERFACE_NUM=00 E: ID_USB_DRIVER=usb-storage E: ID_PATH=pci-0000:02:03.0-usb-0:1:1.0-scsi-0:0:0:0 E: ID_PART_TABLE_TYPE=dos E: UDISKS_PRESENTATION_NOPOLICY=0 E: UDISKS_PARTITION_TABLE=1 E: UDISKS_PARTITION_TABLE_SCHEME=mbr E: UDISKS_PARTITION_TABLE_COUNT=1 E: DEVLINKS=/dev/block/8:16 /dev/disk/by-id/usb-Lexar_USB_Flash_Drive_AA5OCYQII8PSQXBB-0:0 /dev/disk/by-path/pci-0000:02:03.0-usb-0:1:1.0-scsi-0:0:0:0 and my software is: Codice: Seleziona tutto #include <stdio.h> #include <libudev.h> #include <stdlib.h> #include <locale.h> #include <unistd.h> int main(void) { struct udev_enumerate *enumerate; struct udev_list_entry *devices, *dev_list_entry; struct udev_device *dev; /* Create the udev object */ struct udev *udev = udev_new(); if (!udev) { printf("Can't create udev\n"); exit(0); } enumerate = udev_enumerate_new(udev); udev_enumerate_add_match_subsystem(enumerate, "scsi_generic"); udev_enumerate_scan_devices(enumerate); devices = udev_enumerate_get_list_entry(enumerate); udev_list_entry_foreach(dev_list_entry, devices) { const char *path; /* Get the filename of the /sys entry for the device and create a udev_device object (dev) representing it */ path = udev_list_entry_get_name(dev_list_entry); dev = udev_device_new_from_syspath(udev, path); /* usb_device_get_devnode() returns the path to the device node itself in /dev. */ printf("Device Node Path: %s\n", udev_device_get_devnode(dev)); /* The device pointed to by dev contains information about the hidraw device. In order to get information about the USB device, get the parent device with the subsystem/devtype pair of "usb"/"usb_device". This will be several levels up the tree, but the function will find it.*/ dev = udev_device_get_parent_with_subsystem_devtype( dev, "block", "disk"); if (!dev) { printf("Errore\n"); exit(1); } /* From here, we can call get_sysattr_value() for each file in the device's /sys entry. The strings passed into these functions (idProduct, idVendor, serial, etc.) correspond directly to the files in the directory which represents the USB device. Note that USB strings are Unicode, UCS2 encoded, but the strings returned from udev_device_get_sysattr_value() are UTF-8 encoded. */ printf(" VID/PID: %s %s\n", udev_device_get_sysattr_value(dev,"idVendor"), udev_device_get_sysattr_value(dev, "idProduct")); printf(" %s\n %s\n", udev_device_get_sysattr_value(dev,"manufacturer"), udev_device_get_sysattr_value(dev,"product")); printf(" serial: %s\n", udev_device_get_sysattr_value(dev, "serial")); udev_device_unref(dev); } /* Free the enumerator object */ udev_enumerate_unref(enumerate); udev_unref(udev); return 0; } the problem is that i obtain in output: Device Node Path: /dev/sg0 Errore and dont view information. subsystem and the devtype i think that are inserted well : "block" and "disk". thanks for help. Bye

    Read the article

  • How do I use udev to find info about inserted video media (e.g. DVDs)

    - by Daniel
    I'm trying to port an application from using HAL to using pure udev. It is written in python and will use the gudev library, though I would love to see examples in any language. I'm able to get all attached video devices (such as cameras) via: import gudev client = gudev.Client(["video4linux"]) for device in client.get_devices(): print device.get_sysfs_attr("name"), device.get_device_name() This prints out something like: USB2.0 UVC WebCam /dev/video0 I am also able to get a list of block devices, but how can I: Tell if it is a CD/DVD drive? Tell if media is currently inserted if the drive supports removable media? Tell what the name/label of the media is (e.g. FUTURAMAS1 for a DVD)? The original code I am trying to port over is located at http://github.com/danielgtaylor/arista/blob/045a4d48ebfda44bc5d0609618ff795604ee134f/arista/inputs.py Any and all help would be greatly appreciated!

    Read the article

  • How can I properly create /dev/dvd?

    - by chazomaticus
    Certain programs look for /dev/dvd by default to find DVDs. When I first boot my computer without a DVD inserted, /dev/dvd exists and points to the correct place (/dev/sr0). However, when I insert a DVD, /dev/dvd disappears. I'd like it to stick around so I don't have to navigate to /dev/sr0 in programs that are looking for DVDs. How do I ensure that the /dev/dvd symlink exists and points to the right place? It looks like I can add something to /etc/udev/rules.d/70-persistent-cd.rules. This site gives a couple of examples, but the 70-persistent-cd.rules file says "add the ENV{GENERATED}=1 flag to your own rules", which isn't part of the examples. The man 7 udev page is impenetrable to me, and I'm not convinced the linked page gives 100% of the information I need. So, what can I do on a modern, Ubuntu 12.04 (or later) system to make /dev/dvd always exist and point to the right device? EDIT: Is it as simple as adding ENV{GENERATED}=1 to the rules in the linked page, something like this: SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="dvd", GROUP="cdrom", ENV{GENERATED}=1 Is that the right information for modern Ubuntu? What is ENV{GENERATED} doing there, when it wasn't generated, but hand-written?

    Read the article

  • Ubuntu won't save my settings for thinkpad trackpoint

    - by serve.chilled
    I'm using Ubuntu 12.04 on a Thinkpad X200. To configure the trackpoint, I use "configure TrackPoint". Unfortunately I can't make Ubuntu saving my settings (concerning the sensitivity etc.). Whenever I reboot the computer, it's set to generic settings again. I already tried htorque's answer to a similar question and created a new udev-rule for the trackpoint-settings but it didn't helped. So, how can I make theses settings permanent?

    Read the article

  • virutalbox always get back the same ip

    - by user1012451
    I exported a virtual machine from my work station, and I am trying to renew the ip-address at home. I put one copy on my laptop and one copy on my PC. I've done this sudo rm /etc/udev/rules.d/70-persistent-net.rules and changed the MAC address, but they keep coming back as 192.168.1.165. I need them to be different because I need to run two of these exports at the same time, so I cannot afford to have the same IP. What can I do? Thanks.

    Read the article

  • automatically starting crashplan backup when a usb harddisc is connected

    - by Stefan Armbruster
    Using CrashPlan I've configured two backup sets: online backup in crashplan's cloud (this is running perfectly) a local backup on a usb harddisc directly connected to the local laptop. The USB drive is only connected rarly when being at home. When connecting the drive it mounts automatically. Is there a way to start the local backup whenever the usb disc connected. My guess is that using udev it should be possible to "somehow" tell crashplan to reevaluate the presence of backup location. Any ideas to do this?

    Read the article

  • Preventing pop-up dialogs when connecting an MTP device

    - by DrownedSensors
    I'm using Lubuntu 14.04 with a Samsung Galaxy S3 running Android 4.3. Each time I connect my phone via USB, I get the following dialog: Unable to open MTP device '[usb:002,023]' A few moments later, I get the "Removable medium is inserted" dialog, prompting me to open in File Manager. After that, the phone is connected and fully accessible. So MTP works. The problem is that I plug in my phone to charge every time I sit down, and unplug it every time I step away. Dismissing these two dialogs every time is a pain. I would think the "Removable medium" dialog is the easier candidate. How do I tell Ubuntu to take no action and stop prompting me? For the MTP error, all the discussion I can find is for people who can't get MTP working at all. For me, it's working, but only after throwing this initial error. I've verified that my device is present in /lib/udev/rules.d/69-libmtp.rules

    Read the article

  • NTFS partitions mount as root instead of user as set in /etc/fstab

    - by G1bs0n
    I recently upgraded a server to Ubuntu 12.04 with a fresh install and my NTFS partitions won't mount as user at boot but I can mount them as user manually from the console with $ sudo mount -a. Using ntfsfix reports no problems and chkdisk sees nothing wrong under Windows 7. Are the drives not ready to be mounted at boot and default to root instead of user for some reason? Here is my /etc/fstab: UUID=E4E6B30CE6B2DDCC /media/Bowles ntfs-3g defaults,uid=1000,gid=1000,umask=022 0 0 UUID=A040C42340C3FDD2 /media/Burroughs ntfs-3g defaults,uid=1000,gid=1000,umask=022 0 0 UUID=EA022C73022C46C3 /media/DoctorGonzo ntfs-3g defaults,uid=1000,gid=1000,umask=022 0 0 UUID=BA425A384259FA19 /media/Geist ntfs-3g defaults,uid=1000,gid=1000,umask=022 0 0 UUID=E87CFAE57CFAAE06 /media/DouglasAdams ntfs-3g defaults,uid=1000,gid=1000,umask=022 0 0 Here is the output of ls -l after boot: drwxr-xr-x 1 xbmc xbmc 4096 Oct 31 21:46 Bowles drwxrwxr-x 1 root users 8192 Oct 31 21:46 Burroughs drwxrwxr-x 1 root users 4096 Oct 28 21:45 DoctorGonzo drwxrwxr-x 1 root users 12288 Oct 31 19:56 DouglasAdams drwxrwxr-x 1 root users 4096 Nov 3 01:03 Geist If I unmount and mount again with $ sudo mount -a from console, the output of ls -l: drwxr-xr-x 1 xbmc xbmc 4096 Oct 31 21:46 Bowles drwxr-xr-x 1 xbmc xbmc 8192 Oct 31 21:46 Burroughs drwxr-xr-x 1 xbmc xbmc 4096 Oct 28 21:45 DoctorGonzo drwxr-xr-x 1 xbmc xbmc 12288 Oct 31 19:56 DouglasAdams drwxr-xr-x 1 xbmc xbmc 4096 Nov 3 01:03 Geist Update I was fooling myself, I had a custom udev rule set up to auto-mount file systems by label for USB drives, borrowed from here, but didn't update the rule to accommodate for my additional hard drives. Updating the rule to auto-mount only drives after /dev/sde solved my problem. Thank you again for your reply cartoonist.

    Read the article

  • smartctl not returning on HBA that's secure-erasing a different drive

    - by Stu2000
    Whenever I run smartctl -i /dev/sd* where * is a drive that is plugged into the same host bus adapter as another drive that is currently being erased with an hdparm secure erase command, the smart command will just 'hang' and not return (blocked) until the erasure of the other drive is finished. To make matters worse you can't cntrl-c out of it. Has anyone else had this issue? Is there another way to retrieve smart data from a drive, which doesn't block? I noticed that I can still use the udevadm command to retrieve the serial and model of the drive which is useful but doesn't appear to have any smart data. Any information relating to this matter is appreciated, especially if you can tell me another way to retrieve the S.M.A.R.T data that might work. Regards, Stuart

    Read the article

  • How to get Bus and Device relationship for a /dev/ttyUSB

    - by Ernesto Campohermoso
    I need to write an script for restart USB dongles. I have all tools but I can't link my /dev/ttyUSBx to physical BUS and DEVICE. An issue is that I have three dongles with the same id vendor and id product. If I do lsusb the output is: Bus 001 Device 004: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem Bus 001 Device 006: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem Bus 001 Device 007: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem Bus 001 Device 002: ID 80ee:0021 Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub And I have attached it to: /dev/ttyUSB0 /dev/ttyUSB3 /dev/ttyUSB5 But I want to know which device is related with which Bus Device. By example I need to get the following: /dev/ttyUSB0 -> Bus 001 Device 006 /dev/ttyUSB3 -> Bus 001 Device 004 /dev/ttyUSB5 -> Bus 001 Device 007 I'm using Ubuntu Server 10.04 and I tested the tools: lsusb hal lsmod But I can't get the relationship.

    Read the article

  • How USB drives goes after system hard drives

    - by raihanchy
    I am using Ubuntu 12.04 LTS. My hard drives usually comes as: sda, with 'sudo blkid' and if I plug-in any USB drive, they comes as: sdb, sdc etc; after sda. That's fine!!! But problem arises after I restart my laptop with connecting those USB drives. They alter and comes first and hard drive goes to the end, like: 'sudo blkid' shows, sda, sdb for USB drives and sdc for hard drives. It's making problem to mount with /etc/fstab. I couldn't find any solutions for this. I would like to have any USB drives after my system hard drives, as in Windows. Please, help me at this point. Thanking you. Raihan

    Read the article

  • eth0 and eth1 both assigned same IP on boot

    - by Banjer
    I have a physical SLES 11 SP2 server on a Sun Fire x4140 that is giving me problems with networking upon reboot. The NICs are onboard. The networking appears successful during boot, but network services such as nfs fail hard. This is because eth0 and eth1 are both receiving the same configuration and are both ifup-ed. Once everything times out and I'm at the console, ifconfig shows that eth0 and eth1 are UP and running with the same IP. Attempting to ping anything in that subnet fails. Restarting the network service fixes the issue. eth0 is the correct NIC that should be configured as primary, per the MAC address. Question: Whats causing eth1 to be brought up with the same config as eth0?? I do not have a config script set up for eth1: banjer@harp:~> ls -la /etc/sysconfig/network/ total 104 drwxr-xr-x 6 root root 4096 Jun 11 12:21 . drwxr-xr-x 6 root root 4096 Apr 10 09:46 .. -rw-r--r-- 1 root root 13916 Apr 10 09:32 config -rw-r--r-- 1 root root 9952 Apr 10 09:36 dhcp -rw------- 1 root root 180 Jun 11 12:21 ifcfg-eth0 -rw------- 1 root root 180 Jun 11 12:21 ifcfg-eth3 -rw------- 1 root root 172 Feb 1 08:32 ifcfg-lo -rw-r--r-- 1 root root 29333 Feb 1 08:32 ifcfg.template drwxr-xr-x 2 root root 4096 Apr 10 09:32 if-down.d -rw-r--r-- 1 root root 239 Feb 1 08:32 ifroute-lo drwxr-xr-x 2 root root 4096 Apr 10 09:33 if-up.d drwx------ 2 root root 4096 May 5 2010 providers -rw-r--r-- 1 root root 25 Nov 16 2010 routes drwxr-xr-x 2 root root 4096 Apr 10 09:36 scripts On a side note, eth3 is also configured with an IP in a different subnet, but this has not posed any problems. FYI the kernel module being used is forcedeth. banjer@harp:~> sudo cat /etc/sysconfig/network/ifcfg-eth0 BOOTPROTO='static' BROADCAST='' ETHTOOL_OPTIONS='' IPADDR='172.21.64.25/20' MTU='' NAME='MCP55 Ethernet' NETWORK='' REMOTE_IPADDR='' STARTMODE='auto' USERCONTROL='no' ONBOOT="yes" Here's eth3 in case you need to see it: banjer@harp:~> sudo cat /etc/sysconfig/network/ifcfg-eth3 BOOTPROTO='static' BROADCAST='' ETHTOOL_OPTIONS='' IPADDR='172.11.200.4/24' MTU='' NAME='MCP55 Ethernet' NETWORK='' REMOTE_IPADDR='' STARTMODE='auto' USERCONTROL='no' ONBOOT="yes" Perhaps is something related to udev? 70-persistent-net-rules looks OK to me, but I may not understand it completely. banjer@harp:~> cat /etc/udev/rules.d/70-persistent-net.rules # This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key. # PCI device 0x10de:0x0373 (forcedeth) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:18:4f:8d:85:4c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2" # PCI device 0x10de:0x0373 (forcedeth) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:18:4f:8d:85:4a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x10de:0x0373 (forcedeth) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:18:4f:8d:85:4b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" # PCI device 0x10de:0x0373 (forcedeth) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:18:4f:8d:85:4d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3" # PCI device 0x1077:0x3032 (qla3xxx) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:c1:dd:0e:34:6c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4" Any other thoughts on what would cause this?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >