udev

通过复制创建虚拟机,无法联网的解决办法

﹥>﹥吖頭↗ 提交于 2019-11-29 05:39:18
vmware 下找不到ifcfg-eth0的问题 http://www.linuxdiyf.com/viewarticle.php?id=90924 在windowXP下安装了suse linux,在vmware下选择了host-only方式与主机通信。 使用host-only方式与主机通信,vmware使用的是VMware Network Adapter VMnet1虚拟网卡,查看该网卡的IP是 192.168.174.1。 在虚拟机下面的linux下遇到了一下几个问题: 1、找不大 eth0网卡,也就连不上网络。症状是ifconfig以后只现实lo,不显示eth0。 解决方法: ifconfig eth0 up。这样ifconfig以后就显示了eth0。 找到eth0以后,再运行ifconfig eth0 192.168.174.2 netmask 255.255.255.0。即可与主机通信。 2、经过上面步骤是找到了eth0,可是重启以后又没有了。 解决方法: cd /etc/sysconfig/network/ cp ifcfg-lo ifcfg-eth0 vim ifcfg-eth0 修改配置如下 IPADDR=192.168.174.2 NETMASK=255.255.255.0 NETWORK=192.168.174.0 BROADCAST=192.168.174

Scripts launched from udev do not have DISPLAY access anymore?

浪子不回头ぞ 提交于 2019-11-29 03:51:21
I have a script that runs from udev when I plug in my external drive. It always worked. But after upgrading from Linux 3.8/Xorg 1.12/Mint 14 ( Ubuntu 12.10 compatible) to Linux 3.11/Xorg 1.14/Mint 16 ( Ubuntu 13.10 compatible), it doesn't work anymore. The script still runs, but none of the commands that require the display work. I figured that out by quitting the udev daemon and manually run udevd --debug for verbose output (more below). This script used to work in Mint 14/12.10 : export DISPLAY=:0 UUID=$1 DEV=$2 notify-send -t 700 "mounting $DEV ($UUID)" gnome-terminal -t "Backing up home...

十八、centos7网络属性配置

末鹿安然 提交于 2019-11-28 10:29:57
一、为什么需要这个 服务器通常有多块网卡,有板载集成的,同时也有插在PCIe插槽的。 Linux系统的命名原来是eth0,eth1这样的形式,但是这个编号往往不一定准确对应网卡接口的物理顺序。 为解决这类问题,dell开发了biosdevname方案(systemd v197版本中将dell的方案作了进一步的一般化拓展)。 目前的Centos既支持dell的biosdevname,也支持systemd的方案。 二、Centos7中的命名规则 传统命名:以太网eth[0,1,2,...] 2.1、可预测功能     udev支持多种不同的命名方案:       基于Firmware , 拓扑结构    udev支持多种不同的命名方案:UDEV是系统在用户空间探测内核空间,通过sys接口所输出的硬件设备,并配置的硬件设备的一种应用程序,在centos7上UDEV支持多种不同的命名方案,无非就是支持基于固件的命名(firmware,基于主板上rom芯片)或者是通过总线拓扑(PCI总线)结构来命名。总线拓扑(PCI总线)结构命名主要是根据对应设备所在的位置来命名,slot设备上的第几个接口方式命名,这样命名的方式就是能够实现自动命名,只要接口不坏,无论是哪一块网卡插上去其名称一定是固定的。     (1)网卡命名机制     systemd对网络设备的命名方式:       (a

python udisks - enumerating device information

邮差的信 提交于 2019-11-28 10:19:22
It's apparently possible to get a lot of info relating to attached disks using the udisks binary: udisks --show-info /dev/sda1 udisks is apparently just enumerating the data which is available udev. Is it possible to get this information using python? say for example if i just wanted to retrieve the device serial, mount point and size. mark You can use Udisks via dbus directly in python. import dbus bus = dbus.SystemBus() ud_manager_obj = bus.get_object("org.freedesktop.UDisks", "/org/freedesktop/UDisks") ud_manager = dbus.Interface(ud_manager_obj, 'org.freedesktop.UDisks') for dev in ud

ISCSI多路径配置(二)

江枫思渺然 提交于 2019-11-28 08:23:51
搭建iscsi存储系统(一) (1).配置ISCSI多路径实现 磁盘 挂载高可用   如果存储服务器到交换机只有一条线路的时候,那么一条线路出现故障,整个就没法使用了,所以多线路可以解决这个问题,避免单点故障。  1)实验环境 youxi1  192.168.5.101,1.1.5.129  服务端 youxi2  192.168.5.102,1.1.5.130  客户端  2)搭建target服务器 [root@youxi1 ~]# yum -y install targetcli [root@youxi1 ~]# targetcli  //进入交互配置 Warning: Could not load preferences file /root/.targetcli/prefs.bin. targetcli shell version 2.1.fb46 Copyright 2011-2013 by Datera, Inc and others. For help on commands, type 'help'. /> /backstores/block create test1 /dev/sdb  //使用/dev/sdb创建自定义存储对象test1 Created block storage object test1 using /dev/sdb. /> /iscsi

ubuntu 12.04 libudev-dev won't install because of dependencies

馋奶兔 提交于 2019-11-28 07:32:38
问题 I have a some sample c++ code that receives hotplug events using the udev library. It worked fine in Ubuntu 10.04. It's only prerequisite was the libudev-dev package: sudo apt-get install libudev-dev But when I tried to install that package in 12.04, I get: sudo apt-get install libudev-dev Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are

Bash script to detect when my USB is plugged in and to then sync it with a Directory

眉间皱痕 提交于 2019-11-28 05:30:00
Is there a Bash script and/or daemon that I can write that will detect a specific USB drive and then sync that drive with a directory? For future reference, here's how to run a bash script upon detection of a USB drive. Connect your device and run lsusb to retrieve the device's info. You should see something similar to this: $ lsusb Bus 002 Device 039: ID 0bc2:2100 Seagate RSS LLC In this case, the vendor ID of the device is 0bc2 and the product ID is 2100. Now you can create your UDEV rule using a text editor of your choice. $sudo vi /etc/udev/rules.d/85-my_usb_device_rule.rules And add this:

uevent sent from kernel to user space (udev)

六眼飞鱼酱① 提交于 2019-11-27 18:51:08
I knew that udev plays on the linux system and it receives uevents sent from the kernel through netlink socket. However, my questions are: How kernel sends out the event ? It must be something triggered by adding/removing device and then sends out events to udev. How does kernel do this? (Is there any code example I can find? ) udev receives these uevents only through netlink socket. This is the only way that udev does it. Is this correct? When uevent is sent out from the kernel, I knew it can do broadcast. However, Can it do unicast? Thanks for any feedback. Alexander Dzyoba It sends netlink

USB devices UDev and D-BUS

强颜欢笑 提交于 2019-11-27 11:23:35
I am trying to get a list of currently plugged in USB devices in Ubuntu 10.10 and monitor changes that happen, like devices being plugged in or out using UDev and D-BUS. I'm fairly new to programming using D-BUS. I saw one example: Linux : How to detect is usb keyboard is plugged and unplugged only that one uses HAL and I know that HAL is deprecated. I found some working code, modified it a bit, only it doesn't work for any device only storage devices such as usb sticks, media players or cd-rom devices. I want the whole thing mice, keyboards, usb cameras chargers anything that is plugged in to

USB devices UDev and D-BUS

↘锁芯ラ 提交于 2019-11-26 22:20:32
问题 I am trying to get a list of currently plugged in USB devices in Ubuntu 10.10 and monitor changes that happen, like devices being plugged in or out using UDev and D-BUS. I'm fairly new to programming using D-BUS. I saw one example: Linux : How to detect is usb keyboard is plugged and unplugged only that one uses HAL and I know that HAL is deprecated. I found some working code, modified it a bit, only it doesn't work for any device only storage devices such as usb sticks, media players or cd