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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-07-2007, 08:49 AM
|
#1
|
|
LQ Newbie
Registered: Jan 2006
Distribution: Mandriva 2006.0
Posts: 9
Rep:
|
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
|
|
|
|
02-07-2007, 09:43 AM
|
#2
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,703
|
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.
|
|
|
|
02-07-2007, 09:54 AM
|
#3
|
|
LQ Newbie
Registered: Jan 2006
Distribution: Mandriva 2006.0
Posts: 9
Original Poster
Rep:
|
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 10:50 AM.
|
|
|
|
02-07-2007, 11:01 AM
|
#4
|
|
Guru
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,002
|
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
|
|
|
|
02-07-2007, 01:58 PM
|
#5
|
|
LQ Newbie
Registered: Jan 2006
Distribution: Mandriva 2006.0
Posts: 9
Original Poster
Rep:
|
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
|
|
|
|
02-07-2007, 03:18 PM
|
#6
|
|
Moderator
Registered: Aug 2002
Posts: 10,695
|
Flash memory has a fixed number of write/erase cycles. IMO the drive just failed or was written over too many times.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:22 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|