LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-10-2010, 04:33 PM   #1
Potatos
LQ Newbie
 
Registered: Apr 2010
Distribution: Fedora 13
Posts: 20

Rep: Reputation: 1
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
 
Old 05-11-2010, 11:06 AM   #2
Potatos
LQ Newbie
 
Registered: Apr 2010
Distribution: Fedora 13
Posts: 20

Original Poster
Rep: Reputation: 1
Tried loading ide_disk and ide_core as modules (just a random guess) but no still no luck today.
 
Old 05-12-2010, 09:28 AM   #3
Potatos
LQ Newbie
 
Registered: Apr 2010
Distribution: Fedora 13
Posts: 20

Original Poster
Rep: Reputation: 1
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 )

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

Last edited by Potatos; 05-13-2010 at 12:27 PM.
 
Old 05-19-2010, 05:06 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 42.1_64+Tumbleweed-KDE, Mint 17.3
Posts: 3,990

Rep: Reputation: Disabled
Thanks for coming back and explaining .
 
Old 06-01-2010, 11:37 AM   #5
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Rep: Reputation: 32
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
palm device listed in /proc/bus/usb/devices, but not in lsusb output carltm Linux - Hardware 2 09-09-2010 07:33 AM
On (x)Ubuntu 9.04, usb hard drive isn't listed in /dev/sd*, yet seen by lsusb. cfp Linux - Hardware 1 07-28-2009 04:10 PM
Firewire Maxtor drive showing up in /proc but not /dev, can't mount darkbluedrew Linux - Newbie 1 09-17-2005 06:33 PM
Listed partition in cfdisk, but not listed in /dev? Erik_the_Red Linux - Newbie 7 08-05-2005 11:44 PM
USB hard drive rejects dev number mad2physicist Linux - Hardware 16 12-15-2003 12:11 PM


All times are GMT -5. The time now is 07:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration