LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 02-07-2007, 09:49 AM   #1
krisbitner
LQ Newbie
 
Registered: Jan 2006
Distribution: Mandriva 2006.0
Posts: 9

Rep: Reputation: 0
Can't format USB flash drive, write protection


Hi all. I have a 256 MB Kingston Data Traveller. I had partitioned it into FAT32 and Linux partitions and it was working fine for quite a while. Then I lent it to someone and when I got it back it would not mount. I have tried to format using fdsik with no success, it says it cannot write to disk. It doesn't mount automatically when I plug it in and apparently the write protection is on. Formatting in XP also fails. When I use the utility in Mandriva Control Center it identifies the drive as read only and says it is empty.
This is what I get from dmesg regarding the device:

SCSI subsystem initialized
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
Vendor: Model: USB DISK 20X Rev: 1.03
Type: Direct-Access ANSI SCSI revision: 00
usb-storage: device scan complete
SCSI device sda: 501760 512-byte hdwr sectors (257 MB)
sda: Write Protect is on
sda: Mode Sense: 23 00 80 00
sda: assuming drive cache: write through
SCSI device sda: 501760 512-byte hdwr sectors (257 MB)
sda: Write Protect is on
sda: Mode Sense: 23 00 80 00
sda: assuming drive cache: write through
/dev/scsi/host0/bus0/target0/lun0: unable to read partition table
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Floppy drive(s): fd0 is 1.44M
floppy0: no floppy controllers found
Floppy drive(s): fd0 is 1.44M
floppy0: no floppy controllers found
Floppy drive(s): fd0 is 1.44M
floppy0: no floppy controllers found
Floppy drive(s): fd0 is 1.44M
floppy0: no floppy controllers found
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0
FAT: bogus logical sector size 65535
VFS: Can't find a valid FAT filesystem on dev sda.
FAT: bogus logical sector size 65535
VFS: Can't find a valid FAT filesystem on dev sda.
Floppy drive(s): fd0 is 1.44M
floppy0: no floppy controllers found
 
Old 02-07-2007, 10:43 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

This is probably stating the obvious, but you never know and you don't mention it: Does your USB stick have a write protect switch? 2 of my sticks have a very tiny switch (hardly noticeable) that can be used to write protect the stick.

Hope this helps.
 
Old 02-07-2007, 10:54 AM   #3
krisbitner
LQ Newbie
 
Registered: Jan 2006
Distribution: Mandriva 2006.0
Posts: 9

Original Poster
Rep: Reputation: 0
Nope there is no mechanical write protection switch on this drive, but thanks for the suggestion.
When I try to use mkdosfs this is what I get:

/sbin/mkdosfs -F32 -v /dev/sda
mkdosfs 2.10 (22 Sep 2003)
mkdosfs: unable to open /dev/sda

Last edited by krisbitner; 02-07-2007 at 11:50 AM.
 
Old 02-07-2007, 12:01 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,033

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
/sbin/mkdosfs -F32 -v /dev/sda
mkdosfs 2.10 (22 Sep 2003)
mkdosfs: unable to open /dev/sda
You can't make a filesystem on a whole disk like that, you have to partition it first, with fdisk
Then try: /sbin/mkdosfs -F32 -v /dev/sda1
 
Old 02-07-2007, 02:58 PM   #5
krisbitner
LQ Newbie
 
Registered: Jan 2006
Distribution: Mandriva 2006.0
Posts: 9

Original Poster
Rep: Reputation: 0
I have tried using fdisk, that is how I partitioned it originally and it worked fine. I think the main problem is that the drive is not writable so none of the changes I try to make work and I can't figure out how to fix that issue.
Here is the fdisk output when I try to create a new partition:

fdisk /dev/sda
You will not be able to write the partition table.
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sda: 256 MB, 256901120 bytes
8 heads, 62 sectors/track, 1011 cylinders
Units = cylinders of 496 * 512 = 253952 bytes

Device Boot Start End Blocks Id System

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1011, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1011, default 1011):
Using default value 1011

Command (m for help): type
Selected partition 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): w

Unable to write /dev/sda
 
Old 02-07-2007, 04:18 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,059

Rep: Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759
Flash memory has a fixed number of write/erase cycles. IMO the drive just failed or was written over too many times.
 
  


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
How to format a usb flash drive eypros Linux - Software 4 04-19-2006 02:06 PM
Format a jump drive or flash card on linux richardo Linux - Software 1 03-26-2006 05:57 AM
Format a Compact Flash Drive While Mounted sadarax Linux - General 2 12-15-2005 04:26 AM
How to format a USB flash drive? Erik_the_Red Linux - Hardware 4 08-29-2005 01:47 PM
USB Flash drive will not let me write. sniperhf Linux - Hardware 1 12-05-2003 03:39 AM


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