LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 11-16-2004, 06:00 PM   #1
mrsolo
Member
 
Registered: Jun 2002
Location: Where ever the Navy sends me
Distribution: Gentoo
Posts: 320

Rep: Reputation: 30
Making usb stick with device names


I am really agitated about something, is there anyway to make certain usb devices stick with a certain /dev/sd* name? I have a lot of devices that use either the usb mass storage module or use certain flash cards. For the flash cards, I have a rather cheap ($12) 12in1 reader. In windows, when you plug the flash reader into the computer, windows has 5 drives listed (usually dives f-j) for each of the flash reader's 5 slots. When this device is plugged into linux without any flash cards in it, the dmesg says:

usb 5-3: new high speed USB device using address 6
scsi3 : SCSI emulation for USB Mass Storage devices
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi3, channel 0, id 0, lun 0
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdb at scsi3, channel 0, id 0, lun 1
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdc at scsi3, channel 0, id 0, lun 2
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdd at scsi3, channel 0, id 0, lun 3
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sde at scsi3, channel 0, id 0, lun 4
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdf at scsi3, channel 0, id 0, lun 5
USB Mass Storage device found at 6

Now I understand this, the slots are being reported as scsi devices. What I don't understand is that when I do put a card into on of the slots and try and mount it, it gives me errors, below is an example:

mount -t vfat /dev/sdc1 /media/usb/
mount: special device /dev/sdc1 does not exist

mount -t vfat /dev/sdc /media/usb/
mount: block device /dev/sdc is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/sdc,
or too many mounted file systems

Why isn't this working? There's a card in the slot and as the second command reports, it sees the card but is unable to mount it. Now when I plug the flash reader into linux when there's already a card in the reader, there is no problem. The kernel sees the card and is able to automount it:

usb 5-3: new high speed USB device using address 9
scsi6 : SCSI emulation for USB Mass Storage devices
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 121856 512-byte hdwr sectors (62 MB)
sda: Write Protect is on
sda: Mode Sense: 02 00 80 00
sda: assuming drive cache: write through
/dev/scsi/host6/bus0/target0/lun0: p1
Attached scsi removable disk sda at scsi6, channel 0, id 0, lun 0
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdb at scsi6, channel 0, id 0, lun 1
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sdc: 121856 512-byte hdwr sectors (62 MB)
sdc: Write Protect is on
sdc: Mode Sense: 02 00 80 00
sdc: assuming drive cache: write through
/dev/scsi/host6/bus0/target0/lun2: p1
Attached scsi removable disk sdc at scsi6, channel 0, id 0, lun 2
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdd at scsi6, channel 0, id 0, lun 3
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sde at scsi6, channel 0, id 0, lun 4
Vendor: Generic Model: STORAGE DEVICE Rev: 9134
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdf at scsi6, channel 0, id 0, lun 5
USB Mass Storage device found at 9

Now here's the automatically generated fstab entry:

/dev/sdc1 /mnt/hd auto umask=0022,user,iocharset=iso8859-1,sync,kudzu,codepage=850,noauto,exec,users 0 0

Now users can access this mount point and read just fine from but nobody can write to it. Now I noticed that the dmesg showed that /dev/sdc1 (which is an SD type flash card) was write protected and mounted in read-only but I don't see why. The flash card itself is not write protected. However, when I use an XD card, there is no write protection and if a regular user mounts it, she/he can write to it as needed.

Another problem is that when the computer automounts it, only the root user has write access to it while other users can only read from it (however, if an fstab entry is made about a certain device then users have write access to it). I would like to change that. Is there anyway to change the automount to allow regular users the priviledge of writting? Also, is there a way to make the computer always mount a certain device as say /dev/sda all the time? I know that this isn't ideal but I would like to be able to set up some mount points in fstab and just have to type mount /media/usb without having to determine which device in the /dev folder it's under.
 
  


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
[SOLVED] Making multiple partitions on USB memory stick ctkroeker Linux - Hardware 1 06-16-2005 12:20 AM
Making device permissions stick mugwump84 Linux - Newbie 3 04-05-2005 04:35 PM
Making Linux boot from USB Stick a4r0 Linux - Newbie 2 09-13-2004 07:08 PM
usb device names geomatt Linux - Hardware 2 09-05-2004 01:30 PM
USB Song Memory Stick Device KePSuX Linux - Hardware 3 07-09-2003 04:38 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration