You are not logged in.

#1 2005-07-24 22:24:44

Tyris
Member
From: portland, or
Registered: 2005-07-24
Posts: 12

CF card trouble; not generating "sda1"

Hello,

Im a recent convert from Mandrake linux and have enjoyed running Arch for a few months on both laptop and desktop/server. Everything has worked great until now, Im a bit stumped with this problem:

I have an external USB CF/SD card reader attached which I use to interface to my CF cards, I've had this since I ran Mandrake. With Mandrake I could plugin a CF card and I would be able to mount it like so:

mount -t vfat /dev/sda1 /mnt/cf

With Arch, I dont have a "/dev/sda1", only /dev/sda.

I can overcome the problem by manually running:

mknod /dev/sda1 b 8 1

Honestly, I'd prefer not to do this. Can someone explain why Arch does not auto generate sda1? or how I can get it to auto generate sda1?

One thing I have not tried is to boot the server with the CF card in the reader to see if /dev is populated with sda1 correctly. Also Im running a recompiled kernel, not the default arch one.

I've searched the forums and cannot find a solution to my problem, and unfortunately the docs/wiki seems to be busted right now. Any help would be greatly appreciated.

thanks

-T

Offline

#2 2005-07-24 22:54:05

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: CF card trouble; not generating "sda1"

Do you run hotplug?

My usbstick /dev/sda1 node is usually autogenerated by udev when I plug it into the USB port.

You should be able to write a udvev rule to generate the node. I just don't have a clue what it is.

Dusty

Offline

#3 2005-07-25 00:17:00

Tyris
Member
From: portland, or
Registered: 2005-07-24
Posts: 12

Re: CF card trouble; not generating "sda1"

I am running hotplug. I'll try a few experiments before trying to write a rule:

1. see if /dev/sda1 appears on bootup whith my current kernel
2. repeat with default 2.6 Arch kernel

Wish I still had Mandrake available to do a side by side comparison though.
I wonder if this has do to with udev/devfs?

-T

Offline

#4 2005-07-25 00:20:06

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: CF card trouble; not generating "sda1"

I suspect its udev related, yes.

It's even possible the device is being created, but is not being given the sda* name; maybe its listed under a different naming scheme.

Dusty

Offline

#5 2005-07-25 01:32:34

T-Dawg
Forum Fellow
From: Wilmington, NC
Registered: 2005-01-29
Posts: 2,734

Re: CF card trouble; not generating "sda1"

Are you using udev? Arch uses devfs by default and should be converted over.

The wiki is working for me:
http://wiki2.archlinux.org/index.php/UdevHowTo

I dont know which kernel you're using but add this to your menu.lst to be safe:
devfs=nomount

Offline

#6 2005-07-25 01:37:04

Tyris
Member
From: portland, or
Registered: 2005-07-24
Posts: 12

Re: CF card trouble; not generating "sda1"

OK, got it partially figured out:

I was able to generate /dev/sda1 when I ran udevstart by hand as root. Still need to figure out why it doesnt run on insertion of the CF card.

It seems udevd will NOT generate it by itself yet, nor will "hotplug restart".
Need to figure out why its still not automatic.

-T

Offline

#7 2005-07-25 01:38:43

Tyris
Member
From: portland, or
Registered: 2005-07-24
Posts: 12

Re: CF card trouble; not generating "sda1"

Penguin wrote:

Are you using udev? Arch uses devfs by default and should be converted over.

The wiki is working for me:
http://wiki2.archlinux.org/index.php/UdevHowTo

I dont know which kernel you're using but add this to your menu.lst to be safe:
devfs=nomount

Yes, Im using udev, I've got this in my lilo.conf:

        append="devfs=nomount"

-T

Offline

#8 2005-07-25 12:20:34

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: CF card trouble; not generating "sda1"

Tyris wrote:

OK, got it partially figured out:

I was able to generate /dev/sda1 when I ran udevstart by hand as root. Still need to figure out why it doesnt run on insertion of the CF card.

It seems udevd will NOT generate it by itself yet, nor will "hotplug restart".
Need to figure out why its still not automatic.

-T

It's possible. Some (if not all) CF card readers don't generate events on card insertion hence you only have /dev/sda (the card reader device itself I guess).

I'd recommend reading this tutorial.

Under "Additional notes on writing rules for USB storage" you can find:

Another difficult situation is having a multiple-slot USB-storage card reader. These types of device generally do not inform the host when new cards are plugged in or out, so plugging a card into an unused slot while the reader is plugged in will not create the extra device node needed for mounting!
This problem also applies to other USB disks - e.g. if you create a new partition, the new partition node will not appear until you re-plug the device.

udev provides a solution here - it is able to create nodes for all partitions of a block device. For every rule that you specify, the block device will have all 16 partition nodes created. To achieve this, you can simply modify the NAME key, as shown below:

BUS="usb", SYSFS{product}="USB 2.0 Storage Device", NAME{all_partitions}="usbhd"

To find out if this is your case try creating /etc/udev/rules.d/00.udev.rules and put something like this inside:

KERNEL=="sd*", SYSFS{scsi_level}=="3", SYSFS{type}=="0", NAME{all_partitions}="%k", GROUP="storage", OPTIONS="last_rule"

Restart and check if it works.

Then you can tweak this rule more because the above one can be too general for other sda devices (unless you don't have any).

This requires some more info from /sys (see the tutorial above for details). Run

udevinfo -a -p `udevinfo -q path -n /dev/sda`

and post the results. It should be quite easy to build a better rule only for CF reader device like in the tutorial above (note: tutorial is for older versions of udev so you might need more help).

If you want it to behave exactly like in Mandrake (Mandriva?) first make sure that you were using udev in this distro (not some hotplug script) and just compare udev rules for sd* devices. It's also possible that it wasn't working via udev but some hotplug script (/etc/hotplug or something like this).

This is a very short explanation of possible problem :-) and I can be wrong. Anyway, more info from /sys should help to identify a problem.

Offline

#9 2005-08-15 02:05:10

Tyris
Member
From: portland, or
Registered: 2005-07-24
Posts: 12

Re: CF card trouble; not generating "sda1"

That seems to be the problem: my CF reader is not generating any event when a new CF card is inserted.  I have no issues when using my USB camera or any other mass storage device.

I believe Mandrake was an unfair comparison, the distro was the old 9.1 release using the 2.4.x kernels. If I recall correctly /dev already had populated /dev/sda1 through /dev/sda9 (or some other high number). This would explain why it seemed to work without issue on plug/unplug.

thanks to all for advice

-T

Offline

Board footer

Powered by FluxBB