Some questions about mdev

Denys Vlasenko vda.linux at googlemail.com
Mon Aug 16 18:50:17 UTC 2010


On Monday 16 August 2010 15:42, Alexander Griesser wrote:
> On 16.08.2010 14:40, Denys Vlasenko wrote:
> >> Is that by design or am I missing something here? I have added mdev to the
> >> kernel hotplug mechanism by doing that (of course):
> >>
> >> echo /sbin/mdev>/proc/sys/kernel/hotplug
> >
> > You need to debug the problem. Does mdev get called when you create
> > /dev/sda1 via fdisk?
> 
> Yes, when I delete a partition, mdev gets called 4 times with the 
> following parameters:
> 
> block
> block
> block
> block

Just knowing parameters is not enough. What is passed in the environment?
In other words, I am not only interested in output of
	echo "Params: $*"
command, but also I want to know what "env | sort" says.

Here's the complete debugging script again:

#!/bin/sh
echo >>/tmp/mdev.trace
date >>/tmp/mdev.trace
echo "Params: $*" >>/tmp/mdev.trace
env | sort >>/tmp/mdev.trace
exec /sbin/mdev "$@"

> When I create a new partition, output is the same, but still,
> it doesn't add the device file to /dev (i.e. sda2), when I run `mdev -s`
> right after the fdisk command, the device files get created.
> 
> 
> Thanks to your debugging script, I found out something else
> I always wondered about.
> 
> When I plugin a USB memory stick, mdev gets called 8 times
> in a row with the following parameters:
> 
> usb
> usb
> scsi_host
> scsi
> scsi_disk
> scsi_device
> block
> bdi
> 
> But `cat /proc/partitions` doesn't show the new device (should be sdb 
> and sdb1 according to the output of `dmesg`), also, running `mdev -s`
> manually doesn't help in this situation.
> 
> When I unplug the USB memory stick, mdev gets called 8 times in
> a row with the following parameters:
> 
> scsi_device
> scsi_disk
> bdi
> block
> scsi
> scsi_host
> usb
> usb

Please give me more information as explained above; and alsp post
your mdev.conf

-- 
vda


More information about the busybox mailing list