Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
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?


  Search this Thread
Old 11-18-2009, 08:19 AM   #1
Registered: Oct 2005
Posts: 116

Rep: Reputation: 15
Unable to Format pendrive, Delete contents

My dear friends i got the strange problem,

I purchased new Kingston Datatraveler 32GB Pendrive

after i copied some of the files into that around 2GB.

But whenever iam trying to delete those content it is giving the following error.

Readonly file system

actually it is not.

I tried the same in windows and linux.

Is there any way by which i can delete the content or format the pendrive.

by using the command

mkfs.vfat /dev/sdb i got the error
invalid blocks count


Now I want to forcefully format the pendrive or is there any tool or utility which will help me to format the USB.
Old 11-18-2009, 08:22 AM   #2
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
You might want to check that you have valid partitions set up and the partition table is OK.
sudo fdisk /dev/sdb

then press p to print the partition table. If that gives you errors you might consider deleting existing partitions and creating new ones to see if that fixes the problem.
Old 11-18-2009, 08:05 PM   #3
Registered: Oct 2005
Posts: 116

Original Poster
Rep: Reputation: 15

I tried this. It is saying i/o error and write protected.

i.e fdisk /dev/sdb

after i deleted 4 partitions which are existing there

and created one new partition i.e primary

and trying to write those partition

it is giving i/o error

I dont understand suddenly what happend to my pendrive i.e why it is suddenly become write protected even when i tried to access in windows it is saying write protected. It is working very well like readonly mode. The film it is stored earlier iam able to watch. But the files iam unable to delete or move.

There is no button around that to put as write protected.

I want to forcefully format my pendrive if nothing works.

My Operating System is Mandriva. (for information)

Last edited by teluguswan; 11-18-2009 at 08:09 PM. Reason: fdisk pendrive
Old 11-18-2009, 08:09 PM   #4
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Anyone think this could be one of those weird drives for Windows, with that proprietary r/o junk on it? What was it called.... I can't remember.. U2 or U3 or something like that? That can't be removed?
Old 11-18-2009, 08:13 PM   #5
LQ Guru
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Rep: Reputation: 338Reputation: 338Reputation: 338Reputation: 338
Try using dd to wipe the partition table

dd if=/dev/zero of=/dev/sd? bs=512 count=1
where ? = your usb
/dev/sdf /dev/sdb
not sdb1 or sdf1,etc

note that will destroy the partition table
you then need to take the usb out
wait ten sec
insert usb and open Gparted
find usb under "devices" in gparted menu
then get gparted to make a msdos partition table whatever
and format to fat32 or whatever
Old 11-18-2009, 11:29 PM   #6
LQ Newbie
Registered: Nov 2009
Posts: 3

Rep: Reputation: 0
Originally Posted by Komakino View Post
You might want to check that you have valid partitions set up and the partition table is OK.
sudo fdisk /dev/sdb

then press p to print the partition table. If that gives you errors you might consider deleting existing partitions and creating new ones to see if that fixes the problem.

Hey you're not the only one with this problem. I've been approached by two people in the last 4 months with very similar problems with the kingston. I got one to work by formatting but the other I couldn't figure out. Looking forward to reading peoples suggestions

Old 11-19-2009, 05:56 AM   #7
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
You should try using dd to zero the drive as stated above, if that does not work and there's no locking switch then ...

I think it's a bad drive, take it back to the store for a refund if none of the above work. I've found this is common for Kingston drives (not the best quality, IMO).
Old 11-19-2009, 06:14 AM   #8
Senior Member
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146

Try GParted. You can install it as a program on your existing Linux distribution or you could just download the live CD. Then format it to the FAT32 file system. If it has a pair of keys next to it (the USB stick), then that means it's mounted. Simply right-click, click 'Unmount' and format. This helped me on a similar problem with a HDD.
Old 11-19-2009, 06:28 AM   #9
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If you zero out the partition table, you will probably have to use advanced features (no. of heads, sector per track) in fdisk before you can reformat it. You should post more information on this device. Do two devices show up in /dev/? What kernel messages do you see when you insert it? Is the filesystem corrupt? Is it a U3 device?

Try mounting it rw, and monitor the kernel messages. "sudo tail -f /var/log/messages". The kernel messages may indicate why it is being mounted read-only. One possibility is that the filesystem is corrupt.

If it is a U3 pendrive, I don't know of a Linux solution to remove a U3 iso image. You may have to use the remove tool in windows if there is one on the pendrive.


format, pendrive

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
can't delete content of pendrive form my suse10.2 ashwinidubey Linux - Newbie 5 09-27-2009 07:43 AM
Pendrive format command in Fat16 from Redhat linux OS? vikibd007 Red Hat 1 07-29-2009 02:01 PM
How to format pendrive in FAT32 format chrischristian Linux - Newbie 12 01-20-2009 08:01 AM
How to delete the contents of a file Ericchiu Linux - Newbie 6 04-23-2008 08:16 PM
How to format FAT32 on pendrive satimis Linux - Software 8 03-16-2006 08:23 PM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration