LinuxQuestions.org
Visit Jeremy's Blog.
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 05-26-2003, 01:15 PM   #1
Malakh
LQ Newbie
 
Registered: May 2003
Location: Seattle
Distribution: Mandrake Linux
Posts: 10

Rep: Reputation: 0
Question USB 2.0 Flash Memory Drive


Ok so I bought one of these USB Flash Memory drives the other day and I see that linux has support for these by reading some other posts but I am having a hell of a time with it. I am not able to even get it to work on my Windows side of my machine.

If I try to mount it , it tells me it has no File system which is correct. So can anyone tell me how I can partition and format this thing?
 
Old 05-26-2003, 02:19 PM   #2
lado
Member
 
Registered: Apr 2003
Location: Greece
Distribution: Red Hat 8.0, SuSE 8.2
Posts: 36

Rep: Reputation: 15
When you plug it in what are the contents of your fstab?
 
Old 05-26-2003, 04:39 PM   #3
Malakh
LQ Newbie
 
Registered: May 2003
Location: Seattle
Distribution: Mandrake Linux
Posts: 10

Original Poster
Rep: Reputation: 0
Well here are the contents of the fstab after I plug it it but it did not change.

Code:
[malakh@localhost Documents]$ cat /etc/fstab
/dev/hdd1 / ext2 defaults 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hdd6 /home ext2 defaults 1 2
none /mnt/cdrom supermount dev=/dev/hdc,fs=auto,ro,--,iocharset=iso8859-1,codepage=850,umask=0 0 0
none /mnt/floppy supermount dev=/dev/fd0,fs=auto,--,iocharset=iso8859-1,sync,codepage=850,umask=0 0 0
/dev/hda1 /mnt/win_c vfat iocharset=iso8859-1,codepage=850,umask=0 0 0
/dev/hdb1 /mnt/win_c2 vfat iocharset=iso8859-1,codepage=850,umask=0 0 0
none /proc proc defaults 0 0
/dev/hda6 /tmp ext2 defaults 1 2
/dev/hdd5 /usr ext2 defaults 1 2
/dev/hda5 swap swap defaults 0 0
 
Old 05-26-2003, 05:50 PM   #4
mike9010
LQ Newbie
 
Registered: May 2003
Location: Englewood, CO, US
Distribution: Fedora
Posts: 4

Rep: Reputation: 0
The /etc/fstab contents after plugging it in really doesn't mean much.

What I suggest is getting it to work on the windows side of you machine first, as you said it wouldn't. Usually, things are much easier to set up in windows than they are in Linux. Since Windows seems to be the x86 epitomy of compatibility, I would be surprised if it didn't work in windows, but did in Linux. Try getting it to work in Windows, and make sure you read all of your documentation.

But, if you do want to try formatting it in Linux, the command to create a ext2 fs is the following:
# mke2fs /dev/device

I am not sure how to format for vfat

If you think you need to partition, try
# cfdisk /dev/device
 
Old 05-26-2003, 11:09 PM   #5
Malakh
LQ Newbie
 
Registered: May 2003
Location: Seattle
Distribution: Mandrake Linux
Posts: 10

Original Poster
Rep: Reputation: 0
uhg

well getting closer I think. I have tried to get it to work in windows98 but it does not want to work. Well I should say i got the drivers for windows installed but can't figure out how to access it in win98. It came with no documentation or anything just a diskette with the inf files and the unit. not even a manufacturers name. I had to get that from linux as you will se bellow.

here is my attept at your advice. I show fdisk in this because cfdisk noes not echo to the console.

Code:
[root@localhost malakh]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: Prolific Model: USB Flash Disk   Rev: PROL
  Type:   Direct-Access                    ANSI SCSI revision: 02

[root@localhost malakh]# fdisk /dev/sda
Unable to read /dev/sda

[root@localhost malakh]# cd /sbin
[root@localhost sbin]# mke2fs /dev/sda
mke2fs 1.32 (09-Nov-2002)
/dev/sda is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
64000 inodes, 256000 blocks
12800 blocks (5.00%) reserved for the super user
First data block=1
32 block groups
8192 blocks per group, 8192 fragments per group
2000 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185

Warning: could not read block 0: Attempt to read block from 
filesystem resulted in short read
Writing inode tables: done
ext2fs_mkdir: Attempt to read block from filesystem resulted in 
short read while creating root dir
added /proc/scsi/scsi in there so you can see how linux sees the device.

neither cfdisk or fdisk with read it as a disk. If anyone has any ideas could use them. Otherwise I am taking this thing back.

Last edited by Malakh; 05-26-2003 at 11:11 PM.
 
Old 05-27-2003, 12:29 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,002

Rep: Reputation: 3872Reputation: 3872Reputation: 3872Reputation: 3872Reputation: 3872Reputation: 3872Reputation: 3872Reputation: 3872Reputation: 3872Reputation: 3872Reputation: 3872
It just might be bad. It doesn't sound good if you get a can't read device message. Does the device say it supports linux? I have MDK 9.0 and it auto detected my pen drive and even added an entry to /etc/fstab.

Mine has a write protect switch but that probably isn't the problem. I would say that unless the memory was bad it should be already formated as vfat. (mine was)

With Win98 you should of gotten a detected new device and load driver etc windows. To manually install driver you can right click on the inf file and select install. You probably need to reboot windows. When you popup an explorer box you should see a new letter for the drive.

Just as a precaution:
Also look in the control panel under system and device manager. Make sure there are not any warning flags for your USB hub and that all of them are detected and windows says that they are working properly.
 
Old 05-27-2003, 01:36 AM   #7
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
To autodectect USB devices. You need to have hotplug. Its a bash script that searches for additional devices during boot up or after boot up and sets up the device. I think you can find hotplug at sourceforge.

You need to mount the device before you use it.

I think to format FAT use mkfs -f vfat device
 
Old 05-27-2003, 10:05 AM   #8
Malakh
LQ Newbie
 
Registered: May 2003
Location: Seattle
Distribution: Mandrake Linux
Posts: 10

Original Poster
Rep: Reputation: 0
I can't mount it as you will see in my console log below. Nor can I mkfs.

In windows it was seen by the system I got the drivers in and I know all about device manager. I had errors with the drivers at first but after finding Prolific's website I was able to get the newest drivers to work and no !'s in device manager but I can't do anything with it cause I have no way of getting to the device in windows. as in there is no icon in My Computer etc, but this is not a place for windows stuff nor do I expect help on the windows side.

I am leaning to the idea that the unit might be bad.

anyway here is the console log

Code:
[root@localhost sbin]# mkfs.vfat /dev/sda
mkfs.vfat 2.8 (28 Feb 2001)
mkfs.vfat: Will not try to make filesystem on '/dev/sda'
[root@localhost sbin]# mkfs -f vfat /dev/sda
mke2fs 1.32 (09-Nov-2002)
mkfs.ext2: bad fragment size - vfat
[root@localhost sbin]# mount /dev/sda
/dev/sda: Input/output error
mount: you must specify the filesystem type
[root@localhost sbin]# mount -t ext2 /dev/sda
Usage: mount -V                 : print version
       mount -h                 : print this help
       mount                    : list mounted filesystems
       mount -l                 : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
       mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
       mount device             : mount device at the known place
       mount directory          : mount known device here
       mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
       mount --bind olddir newdir
or move a subtree:
       mount --move olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p num].
For many more details, say  man 8 mount .
[root@localhost sbin]# mount -t vfat /dev/sda
Usage: mount -V                 : print version
       mount -h                 : print this help
       mount                    : list mounted filesystems
       mount -l                 : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
       mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
       mount device             : mount device at the known place
       mount directory          : mount known device here
       mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
       mount --bind olddir newdir
or move a subtree:
       mount --move olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p num].
For many more details, say  man 8 mount .
[root@localhost sbin]#
 
Old 06-19-2003, 09:42 PM   #9
jim006
LQ Newbie
 
Registered: Jun 2003
Location: Michigan
Posts: 1

Rep: Reputation: 0
Re: USB 2.0 Flash Memory Drive

I'm having a similar problem with a compact flash USB reader... but I don't think it's a problem with the hardware and here's why:

If I mkfs.ext2 with the default parameters I can't mount the block device (/dev/sda1 on my computer). However, the device passes block checks and can be analyzed using dump2efs.

After extensive head-banging, I got the device to work if I created it with 700 INODES or less (mkfs.exts -N700 /dev/sda1).

I was pretty happy until I realized that 1 INODE is used for each file... limiting me to just under 700 files on the CF card.

This is a 16MB CF card that I want to put a small embedded linux image on.

I'm open to suggestions... also if anyone can explain why this INODE problem is occuring, I'm all ears.

Later!

Jim

Quote:
Originally posted by Malakh
Ok so I bought one of these USB Flash Memory drives the other day and I see that linux has support for these by reading some other posts but I am having a hell of a time with it. I am not able to even get it to work on my Windows side of my machine.

If I try to mount it , it tells me it has no File system which is correct. So can anyone tell me how I can partition and format this thing?
 
Old 11-03-2003, 03:04 PM   #10
hbarbosa
LQ Newbie
 
Registered: Nov 2003
Posts: 3

Rep: Reputation: 0
Malakh,

I hope you have solved this problem by now... but if you haven't
maybe you want to try device /dev/sda1 instead of /dev/sda

It seems to me your problem if because you were trying to mount
the disk (sda), instead of the partion (sda1).

cheers,

hbarbosa
 
Old 11-03-2003, 04:51 PM   #11
Malakh
LQ Newbie
 
Registered: May 2003
Location: Seattle
Distribution: Mandrake Linux
Posts: 10

Original Poster
Rep: Reputation: 0
Actually I have not solved yet but I have not tried to in a while. I now know that the hardware is not faulty as it works fine in win2k or higher it just does not work in 98. I'll have to go and experiment with fstab again and try the sda1 thing. Or possibly check out that hotplug deal.
 
Old 11-03-2003, 05:56 PM   #12
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
did you try something like

#mount -t vfat /dev/sda1 /mnt/directoryname

make sure directoryname exists already
 
Old 11-03-2003, 05:57 PM   #13
hbarbosa
LQ Newbie
 
Registered: Nov 2003
Posts: 3

Rep: Reputation: 0
malakh,

dummy question: have you took a look at the manufacture website?

I have a pendrive from SanDisk and it does not work with win98
unless you download a special driver from their webpage. It
works fine in winxp, without any changes to the system, and
probably also on win2000 and NT, as they are basically the
same.

Maybe you have the same problem.

cheers,

hbarbosa
 
Old 11-04-2003, 01:44 AM   #14
Malakh
LQ Newbie
 
Registered: May 2003
Location: Seattle
Distribution: Mandrake Linux
Posts: 10

Original Poster
Rep: Reputation: 0
Yes, anyway I don't use win98 anymore so that part is not important.

I have mdk 9.1 and it seems i needed to run ldmod usb-storage and hotplug usb first.

I now have sda1-4 but I get the same results when i try to mount sda1 2 3 or 4 whch is that it tells me that it is the wrong partition type, superblock, etc.

I know it has a partition and is formated. I never had to format it so i assume it is vfat but I am not sure how to find out for sure. I tried to mount as vfat, ntfs, ext3, ext2 and none work.

I know I am close but still missing something.
 
Old 11-04-2003, 03:31 AM   #15
hoopyfrood
Member
 
Registered: Aug 2003
Distribution: SuSE 9.1
Posts: 113

Rep: Reputation: 15
I'm having the exact same problem with a CF card reader.

cdrecord -scanbus shows the device correctly, dmesg indicates no problems with the reader device having plugged it in, sg_map is the same. And yet attempting to mount it via "mount -t vfat /dev/sda /mnt/flash" yeilds the error: "mount: wrong fs type, bad option, bad superblock on /dev/sda, or too many mounted file systems". Trying to mnt sda1 (or 2,3,4,5,6,7, etc) results in "device does not exist."

Funny thing is that if I take the CF card out of the reader and attempt to mount it, I get "No medium found." When I run fdisk -s I get told "62592" (the CF card is 64mb.) In otherwords, Linux can detect if there's a CF card inserted, and it can proble the size of it. But it wont read it.

I've tried reformatting the card as vfat and ext2 (I have a Linux PDA with a CF card drive and have reformatted it this way -- fdisk will not allow me to format the card through Linux) and this has not worked. It occured to me that the problem might be that you need to create a file system on the CF card to have it work (Ie a MBR and /, etc). I just tried running "mkfs" on the device (as per jim006's suggestion) but was told:

Code:
#mkfs /dev/sda
mke2fs 1.32 (09-Nov-2002)
/dev/sda is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
15680 inodes, 62592 blocks
3129 blocks (5.00%) reserved for the super user
First data block=1
8 block groups
8192 blocks per group, 8192 fragments per group
1960 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345

Warning: could not read block 0: Attempt to read block from filesystem resulted in short read
Writing inode tables: done
ext2fs_mkdir: Attempt to read block from filesystem resulted in short read while creating root dir
Running mkfs -f vfat /dev/sda yeilds: "mkfs.ext2: bad fragment size - vfat"

This is a Belkin CF card reader which I've checked out and understand to be compatible with Linux. It works fine through Win98, and as far as I can tell the CF card is in working order (I use it for extra memory on my Zaurus.) I would really, really love to find a fix since Sharp cheated us Zaurus users out of a sync function with the Linux desktop (unless you use OpenZaurus/Opie) and I need to use the CF card reader to port files to and from my PDA!

I'm running Mandrake Linux 9.1, default kernel for that distro (ie, 2.4.21-0.13mdk).

Cheers,
Tim
 
  


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
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 06:39 PM
USB flash memory drive question luksch Linux - Newbie 2 01-22-2005 12:58 PM
Help - USB flash memory stick and hard drive munkus.agb SUSE / openSUSE 3 12-15-2004 06:51 AM
sony usb flash memory drive ptadonki Linux - Hardware 4 10-01-2003 09:06 PM
usb flash memory drive hyperpimp Linux - Hardware 0 12-26-2002 11:14 PM

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

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