LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 11-11-2006, 05:39 AM   #1
Vitalie Ciubotaru
Member
 
Registered: Dec 2005
Location: Osaka, Japan
Distribution: Ubuntu Trinity
Posts: 153

Rep: Reputation: 30
Question Can't use USB memory stick


Hi everybody and thanks a lot for your replies
There are threads with people asking how to do certain things with their USB devices, which means they managed to create/install them.
As for me, I don't know how to see my USB stick. LFS system definitely recognizes it - "dmesg" says usb_uhci module [or something similar] gets loaded. Shall I mount it somehow? A thread says it's about /dev/sda1 device, but I don't seem to have it. Shall I create it? How does one create files in /dev?

Vitalie CIUBOTARU
 
Old 11-11-2006, 06:03 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

I do believe you use LFS 6.1 (with 2.6 kernel). If that is the case: The sda entries are created when needed (take a look at /etc/udev/rules.d/25-lfs.rules).

When inserting a USB device (memory stick in your case) it should be recognized:

Before inserting usb stick:

$ ls -l /dev/sd*
ls: /dev/sd*: No such file or directory


After inserting USB stick:

$ ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Nov 11 12:59 /dev/sda
brw-rw---- 1 root disk 8, 1 Nov 11 12:59 /dev/sda1


In the logfile (I log everything in /var/log/allmessages, dmesg shows only part of the text below) you should see this:

Nov 11 12:58:55 inferno kernel: usb 1-6: new high speed USB device using ehci_hcd and address 2
Nov 11 12:58:55 inferno kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Nov 11 12:58:55 inferno kernel: usb-storage: device found at 2
Nov 11 12:58:55 inferno kernel: usb-storage: waiting for device to settle before scanning
Nov 11 12:59:00 inferno kernel: Vendor: USB Model: BAR Rev: 2.00
Nov 11 12:59:00 inferno kernel: Type: Direct-Access ANS I SCSI revision: 02
Nov 11 12:59:00 inferno kernel: sda: Unit Not Ready, sense:
Nov 11 12:59:00 inferno kernel: : Current: sense key=0x6
Nov 11 12:59:00 inferno kernel: ASC=0x28 ASCQ=0x0
Nov 11 12:59:00 inferno kernel: sda : READ CAPACITY failed.
Nov 11 12:59:00 inferno kernel: sda : status=1, message=00, host=0, driver=08
Nov 11 12:59:00 inferno kernel: sd: Current: sense key=0x6
Nov 11 12:59:00 inferno kernel: ASC=0x28 ASCQ=0x0
Nov 11 12:59:00 inferno kernel: sda: assuming Write Enabled
Nov 11 12:59:00 inferno kernel: sda: assuming drive cache: write through
Nov 11 12:59:00 inferno kernel: SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
Nov 11 12:59:00 inferno kernel: sda: assuming Write Enabled
Nov 11 12:59:00 inferno kernel: sda: assuming drive cache: write through
Nov 11 12:59:00 inferno kernel: sda: sda1
Nov 11 12:59:00 inferno kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Nov 11 12:59:00 inferno kernel: Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0
Nov 11 12:59:00 inferno kernel: usb-storage: device scan complete
Nov 11 12:59:00 inferno scsi.agent[3307]: disk at /devices/pci0000:00/0000:00:1d.7/usb1/1-6/1-6:1.0/host0/target0:0:0/0:0:0:0
Nov 11 12:59:00 inferno udev[3319]: creating device node '/dev/sg0'
Nov 11 12:59:00 inferno udev[3317]: creating device node '/dev/sda'
Nov 11 12:59:00 inferno udev[3353]: creating device node '/dev/sda1'


For easy mounting you need an entry like this in your /etc/fstab:

/dev/sda1 /mnt/usb_01 auto noauto,rw,user 0 0

/mnt/usb_01 is a mountpoint created by me, you are free to change usb_01 into whatever you want (do change the fstab entry accordingly).

Hope this helps.
 
Old 11-12-2006, 02:28 PM   #3
Vitalie Ciubotaru
Member
 
Registered: Dec 2005
Location: Osaka, Japan
Distribution: Ubuntu Trinity
Posts: 153

Original Poster
Rep: Reputation: 30
Thank you very much, druuna!
Funny enough, but mostly none of your advice applied.
1. /etc/udev/rules.d/25-lfs.rules file is OK. I never edited it, so it contains exactly what it should. sda entries are there.
2. /dev directory does not contain any sd* files - neither before, nor after inserting the USB stick.
3. I don't have /var/log/allmessages, so I still have to limit myself to "dmesg".
But I solved it! And it's definitely your merit.
dmesg says that after I plug my memory stick in the kernel module gets loaded, but no /dev entries get created. That made me think there's something with my kernel configuration. After some google search, I found out what exactly was wrong - I did not enable "SCSI drive support" in the kernel. Recompiling the kernel solved the whole issue.
For some reason udev [udev is taking care of it all, isn't it?] creates /dev/uba1 instead of /dev/sda1, but the name probably doesn't matter so much.
Wait, there's something I used almost "mot-a-mot" - I copied your /etc/fstab entry! It's great to see an shortcut to my memory stick created automatically in Gnome desktop!

Vitalie CIUBOTARU
 
  


Reply



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
USB memory, Compact Flash, Memory Stick energiza Linux - Hardware 2 08-22-2006 09:29 PM
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 05:39 PM
USB memory stick mattmole Linux - Hardware 5 02-05-2006 11:40 AM
USB Memory Stick Link_420 Linux - Hardware 2 11-19-2004 01:09 AM
USB Memory Stick jmdlcar Linux - Hardware 1 01-09-2004 07:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

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

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
Open Source Consulting | Domain Registration