LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   USB and Hard Drive listed in /proc but not /dev (https://www.linuxquestions.org/questions/linux-newbie-8/usb-and-hard-drive-listed-in-proc-but-not-dev-807042/)

Potatos 05-10-2010 04:33 PM

USB and Hard Drive listed in /proc but not /dev
 
First off I'm working in CentOS 5.4 with the default 2.6.18-164 kernel (which I will be editing but have reverted back to in order to solve this problem.)

Near the end of the init script I have thrown a /bin/sh to get into a busybox bash shell in order to test some scripts. Ive attached the init below.

While in this shell I can see my usb drive in /proc/bus/usb/devices and my hard drive in /proc/scsi/device_info however I cannot mount them as they are not in /dev.

I have scsi emulation set in the kernel. When I plug in a USB stick it finds the address but still no sign of it in /dev. There are other modules listed in /sys/module such as usbcore that dont show up in lsmod, is that possibly the problem?

Is there any obvious reason this could happen?

Thanks in advance,

Init Script
Quote:

#!/bin/nash

mount -t proc /proc /proc
setquiet
echo Mounting proc filesystem
echo Mounting sysfs filesystem
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
mkdir /dev/shm
mkdir /dev/mapper
echo Creating initial device nodes
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/urandom c 1 9
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/rtc c 10 135
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8
mknod /dev/tty9 c 4 9
mknod /dev/tty10 c 4 10
mknod /dev/tty11 c 4 11
mknod /dev/tty12 c 4 12
mknod /dev/ttyS0 c 4 64
mknod /dev/ttyS1 c 4 65
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67
echo Setting up hotplug.
hotplug
echo Creating block device nodes.
mkblkdevs
echo "Loading ehci-hcd.ko module"
insmod /lib/ehci-hcd.ko
echo "Loading ohci-hcd.ko module"
insmod /lib/ohci-hcd.ko
echo "Loading uhci-hcd.ko module"
insmod /lib/uhci-hcd.ko
mount -t usbfs /proc/bus/usb /proc/bus/usb
echo "Loading jbd.ko module"
insmod /lib/jbd.ko
echo "Loading ext3.ko module"
insmod /lib/ext3.ko
echo "Loading scsi_mod.ko module"
insmod /lib/scsi_mod.ko
echo "Loading sd_mod.ko module"
insmod /lib/sd_mod.ko
echo "Loading libata.ko module"
insmod /lib/libata.ko
echo "Loading sata_nv.ko module"
insmod /lib/sata_nv.ko
echo "Loading dm-mod.ko module"
insmod /lib/dm-mod.ko
echo "Loading dm-log.ko module"
insmod /lib/dm-log.ko
echo "Loading dm-mirror.ko module"
insmod /lib/dm-mirror.ko
echo "Loading dm-zero.ko module"
insmod /lib/dm-zero.ko
echo "Loading dm-snapshot.ko module"
insmod /lib/dm-snapshot.ko
echo "Loading dm-mem-cache.ko module"
insmod /lib/dm-mem-cache.ko
echo "Loading dm-region_hash.ko module"
insmod /lib/dm-region_hash.ko
echo "Loading dm-message.ko module"
insmod /lib/dm-message.ko
echo "Loading dm-raid45.ko module"
insmod /lib/dm-raid45.ko
echo Waiting for driver initialization.
stabilized --hash --interval 1000 /proc/scsi/scsi
mkblkdevs
echo Scanning and configuring dmraid supported devices
/bin/sh
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure VolGroup01
resume /dev/VolGroup01/LogVol01
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/VolGroup01/LogVol00
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot
lsmod
Quote:

dm_raid45
dm_message
dm_region_hash
dm_mem_cache
dm_snapshot
dm_zero
dm_mirror
dm_log
dm_mod
sata_nv
libata
sd_mod
scsi_mod
ext3
jbd
uhci_hcd
ohci_hcd
ehci_hcd

Potatos 05-11-2010 11:06 AM

Tried loading ide_disk and ide_core as modules (just a random guess) but no still no luck today.

Potatos 05-12-2010 09:28 AM

Still working on this problem but feel like ive made a little progress.

I noticed usb-storage isnt in the kernel (even though its selected in the config) so I added it and insmod'ed the .ko. This automatically brings up information about the usb when its plugged in and the SCSI emulation announcement. However still no sign of it in /dev

Quote:

usb 1-10: new high speed USB device using ehci_hcd and address 9
usb 1-10: configuration #1 chosen from 1 choice
scsi8 : SCSI emulation for USB Mass Storage devices
Vendor: JetFlash Model: Transcend 1GB Rev: 8.07
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sdb: 1972224 512-byte hdwr sectors (1010 MB)
sdb: Write Protect is off
sdb: assuming drive cache: write through
SCSI device sdb: 1972224 512-byte hdwr sectors (1010 MB)
sdb: Write Protect is off
sdb: assuming drive cache: write through
sdb: sdb1
sd 8:0:0:0: Attached scsi removable disk sdb
I then created a node for it with:
Quote:

mknod /dev/sdb b 8 16
mknod /dev/sdb1 b 8 17
When I run:
Quote:

mount /dev/sdb1/ /cdrom
It returns
Quote:

mount: mounting /dev/sdb1 on /cdrom/ failed: Invalid argument
::EDIT:: I should mention /cdrom is a empty directory I made, I realize the cd name is a little misleading but its used in the script later.

If I cat /dev/sdb1 to make sure somethings there I get a stream of data until I unplug the usb, so its pointing in the right place (this is a pretty crude way of checking but its the best I could figure out :D)

What am I missing?

Thanks,



::SOLVED:: In case someone stumbles on this thread in the future here is what I was missing

For CDROM

insmod cdrom.ko
insmod sr_mod.ko
insmod ide-cd.ko

mknod hda b 3 0

and then mount it


For USB
insmod fat.ko
insmod vfat.ko

mknod sdb b 8 16
mknod sdb1 b 8 17

JZL240I-U 05-19-2010 05:06 AM

Thanks for coming back and explaining :).

stabu 06-01-2010 11:37 AM

Good on you Potatos for writing your solution afterwards.

I have a similar problem with a 32G Kingston Drive, and I'm trying to find something in this thread that will help me.

What I find puzzling here is that you do get output identifying sdb1 as your device, though no file seems to exist (before you created it) in udev.

My general conclusion here is that everything was working correctly and it was just a case of creating the device nodes and then some associated filesystem modules.


All times are GMT -5. The time now is 02:21 PM.