LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 08-26-2004, 10:53 PM   #1
jasarien
Member
 
Registered: Apr 2004
Location: Wales, UK
Distribution: Fedora Core 3
Posts: 31

Rep: Reputation: 15
USB Memory Stick/MP3 Player (Can't read files)


When I plug in my USB mp3 player/memory stick, linux mounts its perfectly, but I can't read the files on the stick. My dmesg says:
Code:
hub.c: new USB device 00:03.0-3, assigned address 1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 1
SCSI device sda: 251904 512-byte hdwr sectors (129 MB)
sda: Write Protect is off
sda: sda1
cdrom: This disc doesn't have any tracks I recognize!
What does it mean that the disc doesn't have any tracks it can recognise? The filesystem of the stick is FAT16 if my memory serves me well, and Linux can read FAT16 can it not?
 
Old 08-26-2004, 11:32 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
It looks like the cdrom -line is somewhat unrelated, eg. it tries to access your cdrom instead of usb stick.

Try mounting /dev/sda1 to somewhere and see if you can access your stick from there.
 
Old 08-26-2004, 11:46 PM   #3
jasarien
Member
 
Registered: Apr 2004
Location: Wales, UK
Distribution: Fedora Core 3
Posts: 31

Original Poster
Rep: Reputation: 15
Yeah, that works, as root i did

# mount /dev/sda1 /mnt/memstick

and now I can see the files. What do I do to get linux to mount the stick automaticly? A line is entered into fstab when the stick is mounted, but it doesn't stay there.
 
Old 08-26-2004, 11:51 PM   #4
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
One way is to use autofs.
 
Old 08-27-2004, 06:35 AM   #5
jasarien
Member
 
Registered: Apr 2004
Location: Wales, UK
Distribution: Fedora Core 3
Posts: 31

Original Poster
Rep: Reputation: 15
Would you be as kind to educate me on how to use autofs?
 
Old 08-27-2004, 09:38 AM   #6
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
1. Get autofs package.
2. Edit conffiles of autofs.
3. Restart autofs.
4. Make convenient symlinks.



1.
In debian, package containing autofs is called autofs; maybe something similar in FC.
Use your installation / package management tools to figure out.

2.
I have a /etc/auto.master with line
Code:
/var/autofs/misc        /etc/auto.misc
The usage of this is similar to fstab. The /var/autofs/misc is an existing mountpoint where my autofs resides.

Other file /etc/auto.misc contains lines like
Code:
stick           -fstype=vfat                        :/dev/sda1
3.
Now running "/etc/init.d/autofs start"
(and "/etc/init.d/autofs stop" before it, if it was already running)
should do the trick.
if you cd to directory /var/autofs/misc/stick/, the autofs should mount the /dev/sda1.
And if you move away from there and/or stop accessing the stick, it will unmount the device after the timeout.

4.
ln -s /var/autofs/misc/stick /mnt/memstick
 
Old 08-27-2004, 09:39 AM   #7
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Some people might have easier ways to do things, but this is how I have done it.
 
Old 08-27-2004, 09:47 AM   #8
jasarien
Member
 
Registered: Apr 2004
Location: Wales, UK
Distribution: Fedora Core 3
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks ToniT,

I'll try this out and get back to you.
 
Old 08-27-2004, 10:00 AM   #9
jasarien
Member
 
Registered: Apr 2004
Location: Wales, UK
Distribution: Fedora Core 3
Posts: 31

Original Poster
Rep: Reputation: 15
Its not working as I'd hoped.

In my /etc/autofs.master, i have :

Code:
                                                                                
# $Id: auto.master,v 1.2 1997/10/06 21:52:03 hpa Exp $
# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(8).
/misc     /etc/auto.misc        --timeout=60
and then in my /etc/autofs.misc, i have :

Code:
# $Id: auto.misc,v 1.2 1997/10/06 21:52:04 hpa Exp $
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
                                                                                
cd              -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
                                                                                
# the following entries are samples to pique your imagination
#linux          -ro,soft,intr           ftp.example.org:/pub/linux
#boot           -fstype=ext2            :/dev/hda1
#floppy         -fstype=auto            :/dev/fd0
#floppy         -fstype=ext2            :/dev/fd0
#e2floppy       -fstype=ext2            :/dev/fd0
#jaz            -fstype=ext2            :/dev/sdc1
#removable      -fstype=ext2            :/dev/hdd
stick           -fstype=vfat            :/dev/sda1
I restarted autofs, and it says [ OK ]

and i tried to cd to /misc/stick and it says there is no such dir, so I try and create /misc/stick and it says :

Code:
[root@cpc3-cwbn1-3-0-cust242 /]# mkdir /misc/stick
mkdir: cannot create directory `/misc/stick': No such file or directory
I do not understand at all.
 
Old 08-27-2004, 02:37 PM   #10
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
ok, what is written to syslog when you try to
"cd /misc/stick"? If nothing, is there some errors (again in syslog) when you set autofs running?
 
Old 08-27-2004, 03:15 PM   #11
jasarien
Member
 
Registered: Apr 2004
Location: Wales, UK
Distribution: Fedora Core 3
Posts: 31

Original Poster
Rep: Reputation: 15
Nothing was written to the syslog in either case - I used dmesg to view the log, is that correct?
 
Old 08-27-2004, 03:59 PM   #12
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
dmesg shows only kernel log, not userspace events that are logged.

In some distributions (atleast some versions of RH), all logs are collected to /var/log/messages, in some(eg. in debian) to /var/log/syslog. You can try to locate the correct log by running command like
Code:
logger "Hello there, where are you?"
and searching through the /var/log to see what file got a line containing those words.
 
Old 08-27-2004, 04:09 PM   #13
jasarien
Member
 
Registered: Apr 2004
Location: Wales, UK
Distribution: Fedora Core 3
Posts: 31

Original Poster
Rep: Reputation: 15
Well, I'll admit now - I've never felt more stupid. Looking at the syslog (which happened to be in /var/log/messages) I saw the line /dev/sda1 invalid block device - device doesn't exist.

Which twigged me to think - "Hang on a moment.... the drive isn't plugged in" - And that was the root of the problem all along >.< I'd forgotten that the drive needed to be plugged in to be mounted.

Sorry for wasting your time... :S
 
  


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
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 05:39 PM
Read a Sony Memory Stick? jago25_98 Linux - Hardware 2 11-23-2004 05:32 AM
Usb memory stick help MylesCLin Linux - Newbie 1 11-21-2004 10:47 PM
USB Memory Stick freddie_leaf Slackware 15 11-09-2004 01:41 AM
MP3 CD player can't read MP3 CD's burned in linux food188 Linux - Software 2 01-11-2004 04:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:24 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