LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack Search this Thread
Old 10-17-2011, 12:07 PM   #1
rock.hopper
LQ Newbie
 
Registered: Oct 2011
Posts: 5

Rep: Reputation: 0
USB drive filesystem corrupted


Hi! I have a USB drive which I use for backing up files with the help of grsync. Today, when I went to back up some files, rsync partially completed the operation before complaining that the file system was read only. I then attempted to delete the problem directory from the USB drive. Most of the files in the directory could be deleted OK but some could not due to a "read only file system" error. This led me to think the file system may be partially corrupted.

Would it be quicker to repair the file system or to reformat the drive and re-backup my files? If repairing is the way to go how do I go about doing this?

Thanks in advance!
 
Old 10-17-2011, 12:34 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,519
Blog Entries: 51

Rep: Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598
Quote:
Originally Posted by rock.hopper View Post
Would it be quicker to repair the file system or to reformat the drive and re-backup my files? If repairing is the way to go how do I go about doing this?
IMO that depends on the size of the drive, the file system (journal?), the size and type of files (recoverable or not), if files all still reside on the main system and what read / writes the file system saw since being set read-only. Because as far as recovery goes if a drive is exhibiting anomalous behaviour what you don't want to do is muck with it like delete entries. So please fill in the blanks and be as verbose as possible. Technical details preferred and if you happen to have 'testdisk' (photorec's companion app) then by running 'testdisk /debug /log' on the drive you get a log and the opportunity to explore the drive, determine which files have been deleted and possibly (partially) recover them to another physical medium if needed.
 
Old 10-17-2011, 03:36 PM   #3
rock.hopper
LQ Newbie
 
Registered: Oct 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the quick reply!

The drive is an 8GB pen drive (FAT). I'm using it to back up lots of small files (mostly text files) all of which still reside on my main hard drive.

After being confronted with the "read only file system" error I removed the pen drive then replaced it. Doing this made the drive writable again, allowing me to add and remove some more files. However, when I again tried to update or remove files from one particular directory I got the same "read only file system" error.

Thanks for the heads up about PhotoRec/TestDisk - they look like very handy utilities to have at hand.
 
Old 10-17-2011, 04:16 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,519
Blog Entries: 51

Rep: Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598
Since the files still reside on your system I'd go for a thorough reformat. Please check your syslog and fsck the file system before doing so as it's always good to learn what and where the problem resides exactly.
 
Old 10-17-2011, 04:43 PM   #5
rock.hopper
LQ Newbie
 
Registered: Oct 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks unSpawn, will do!
 
Old 10-18-2011, 05:59 PM   #6
rock.hopper
LQ Newbie
 
Registered: Oct 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Back again, sorry to be a nuisance! I formatted the flash drive with ext2 but now the owner of the drive has changed to root. Should I issue a chown command on the directory the drive gets mounted to or is there something else I need to do in order to mount the flash drive as a normal user?
 
Old 10-18-2011, 08:09 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,519
Blog Entries: 51

Rep: Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598Reputation: 2598
Not a nuisance, really. Probably something with PAM or user groups as ext2 doesn't have any specific ownership mount flags AFAIK?
 
Old 10-19-2011, 02:41 PM   #8
rock.hopper
LQ Newbie
 
Registered: Oct 2011
Posts: 5

Original Poster
Rep: Reputation: 0
"chown username: /media/mountpoint" seemed to do the trick. Glad it wasn't any more complicated than that!
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB drive Reiserfs partitions suddenly corrupted?! AusBob Linux - Hardware 8 01-02-2012 04:52 PM
Corrupted font after reading the 1st sector from an USB drive using dd Geriao Linux - Software 4 03-19-2010 06:38 PM
Corrupted USB flash drive needs fixing (Fedora/Linpus) redmittens Linux - Hardware 7 02-14-2010 12:06 PM
File directory corrupted on external EXT3 USB drive mocambo Linux - General 3 06-17-2009 09:37 PM
USB hard drive looks corrupted wirawan0 Linux - Hardware 0 04-20-2004 11:47 AM


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