LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-06-2013, 07:29 AM   #1
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Corrupted filesystem FAT16 on USB stick. It mounts read-only.


Hi all. I have a 2Gb USB stick formatted as FAT16. For some unknown reason I cannot mount it r/w anymore. dmesg reports the following error:
Code:
FAT: Filesystem error (dev sdb1)
    fat_get_cluster: invalid cluster chain (i_pos 0)
I can read almost all the files inside it, but I cannot write and I cannot format it again. I tried to run fsck and it reports the following
Code:
# fsck -a /dev/sdb1
fsck from util-linux-ng 2.17.2
dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN
open: Read-only file system
I also tried to write down /dev/zero using dd, but nothing. I tried even from a Windows 7 machine, but I cannot format it from its native disk managment utility (the format option is greyed out). What can stop me from throwing it in the trash?
 
Old 11-06-2013, 07:32 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,790

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
you should umount before fsck. you can also try fdisk.
 
Old 11-06-2013, 07:35 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Original Poster
Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by pan64 View Post
you should umount before fsck. you can also try fdisk.
I assure you I did umount it before trying various commands, fdisk included. It always complains the system is read-only.
 
Old 11-06-2013, 07:36 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,881
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I'm assuming you've tried to wipe the partition table, make it something totally different; like ext2 and then create a new file system for it? What does fdisk get you?
 
Old 11-06-2013, 07:39 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,881
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by colucix View Post
fdisk included. It always complains the system is read-only.
2Gig thumbstick? You're not trying to save any data? I say chuck it! Or slice it up with a power tool just to vent.
 
Old 11-06-2013, 07:44 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Original Poster
Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Code:
# fdisk /dev/sdb
You will not be able to write the partition table.

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): d
Selected partition 1

Command (m for help): w

Unable to write /dev/sdb
fdisk -l reports the following:
Code:
Disk /dev/sdb: 2001 MB, 2001076224 bytes
62 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 3844 * 512 = 1968128 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x79f3dc19

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        1016     1952721    6  FAT16
 
Old 11-06-2013, 07:49 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,790

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
probably: http://www.tomshardware.co.uk/forum/...otection-drive
 
Old 11-06-2013, 07:49 AM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Original Poster
Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by rtmistler View Post
2Gig thumbstick? You're not trying to save any data? I say chuck it! Or slice it up with a power tool just to vent.
I saved what could be saved. I just wanted to avoid buying a new one, if by chance it can be restored. I'm going to throw it in the basket at this point!
 
Old 11-06-2013, 07:53 AM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,881
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
If it's really important to you, there's always grab the source for fdisk and remove the checks which dis-allow writing of the partition table.

I took a look and the version I found did not have that particular error verbiage in it, fdisk.c.

Another option is to boot to single user mode in command line so that when you plug in that thumbstick, it never gets attempted to be mounted, but I'm guessing that you've already done that. My thinking there is that it won't have tried to do anything with it and the system might consider it to be a fresh disk which once you do fdisk and just say re-partition. I think you're already past that though.
 
Old 11-06-2013, 08:00 AM   #10
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Original Poster
Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by pan64 View Post
I've tried this method, but the message is always the same:
Code:
Cannot format. This volume is write protected.
 
Old 11-06-2013, 08:06 AM   #11
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Original Poster
Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by rtmistler View Post
Another option is to boot to single user mode in command line so that when you plug in that thumbstick, it never gets attempted to be mounted, but I'm guessing that you've already done that. My thinking there is that it won't have tried to do anything with it and the system might consider it to be a fresh disk which once you do fdisk and just say re-partition. I think you're already past that though.
Yes, I tried. It doesn't mount but fdisk behaves as in runlevel 5:
Code:
Unable to write /dev/sdb
Now I will try to compile fdisk with that checking removed, just for the sake of curiosity.

Edit: I've just tried to compile fdisk, but I cannot find the part of code containing the error message. I give up now! Thank you for the support.

Last edited by colucix; 11-06-2013 at 08:22 AM.
 
Old 11-06-2013, 09:15 AM   #12
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,790

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
Just because I'm interested how it can happen: http://superuser.com/questions/40268...w-can-i-fix-it (probably you have seen it already).
 
Old 11-06-2013, 09:19 AM   #13
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,881
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by pan64 View Post
Just because I'm interested how it can happen: http://superuser.com/questions/40268...w-can-i-fix-it (probably you have seen it already).
You gotta be kidding me! They put a bleeping SD Micro inside their USB flash drive? I've never torn one apart, but really didn't expect to see THAT. Laughing, but ... it works, eh?
 
Old 11-06-2013, 11:19 AM   #14
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
http://sosfakeflash.wordpress.com/20...-flash-drives/

man that is really disgusting that companies would do such horrid bait and switch tactics and still be able to get away with it.
 
Old 11-08-2013, 11:06 AM   #15
mdlinuxwolf
Member
 
Registered: Dec 2006
Distribution: Mepis and Fedora, also Mandrake and SuSE PC-BSD Mint Solaris 11 express
Posts: 385

Rep: Reputation: 42
Try running as root and mount it then. Click on the drive's properties and change its permissions to read/write using either a terminal or one of the many graphical tools. Be sure to make these changes applicable to all files and subfolders in all directories.

If you can still read what's on there, you should be able to copy and paste all data to another hard drive or file system. Then use it normally. Running as root makes this process easier, one reason to not disable the root's account gui. Just use a really strong password and take it offline whenever possible.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] USB Stick (FAT16) get corrupted files; what new format should I use? floppy_stuttgart Linux - Newbie 6 04-11-2012 04:53 PM
NFS mounts read-only filesystem only Quip11 Linux - Networking 1 10-30-2011 12:45 PM
Unable to erase USB-stick. Mounts as read-only tom4everitt Linux - Hardware 9 12-02-2009 07:00 AM
USB hard drive mounts as "Read Only Filesystem" augu2000 Linux - Hardware 11 07-12-2007 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:34 AM.

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