LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-29-2008, 06:43 PM   #1
hedpe
Member
 
Registered: Jan 2005
Location: Pittsburgh
Distribution: Ubuntu
Posts: 378

Rep: Reputation: 30
vfat support in linux, files keep getting corrupted


Hi all,

Trust me, I would not be using vfat if I didn't have to, but the PS3 only supports external drives that use FAT32.

So, I have a 16GB flash drive I am trying to use to playback video on my PS3. I have it partitioned as follows:
Code:
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       15488    15859696    c  W95 FAT32 (LBA)
Then I format it as such:
Code:
mkfs.vfat /dev/sdc1
And finally, I attempt to copy files (~2GB each) to the flash drive using a terminal and 'cp' ... once it finishes blocking, I 'umount /dev/sdc1' and when umount returns, I unplug the drive.

Then, *extremely* often, if I unplug the drive and plug it back in, and then do an md5sum on the file on the flash drive, it does not match the file on my hard drive.

Are there known vfat issues? I thought vfat was relatively widely supported, but NTFS was a little eh.

Any suggestions?

Thanks,
George
 
Old 09-29-2008, 07:46 PM   #2
hedpe
Member
 
Registered: Jan 2005
Location: Pittsburgh
Distribution: Ubuntu
Posts: 378

Original Poster
Rep: Reputation: 30
i've checked if there are any bad blocks on the disk with "badblocks" and found nothing:
Code:
$ sudo badblocks /dev/sdc1
$
 
Old 09-29-2008, 07:49 PM   #3
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Can you verify that the filesystem is FAT32? You can use 'mkdosfs -F 32' to guarantee FAT32.

You may have some bad blocks on your USB stick as well; this is not at all uncommon.

NTFS has been very well supported for over a year now with ntfs-3g. The last time I checked there were very few NTFS features not yet implemented, but read/write operations work fine.
 
Old 09-29-2008, 08:07 PM   #4
hedpe
Member
 
Registered: Jan 2005
Location: Pittsburgh
Distribution: Ubuntu
Posts: 378

Original Poster
Rep: Reputation: 30
thanks for the response, I am 100% sure it is FAT32.

is badblocks guaranteed to detect these bad blocks? I got no output from the program. Also, I have a second flash device which is 4GB and I have never experienced these issues with it.
 
Old 09-29-2008, 08:25 PM   #5
hedpe
Member
 
Registered: Jan 2005
Location: Pittsburgh
Distribution: Ubuntu
Posts: 378

Original Poster
Rep: Reputation: 30
it seems to happen when unmounting the disk, then unplugging it, plugging it back in, and remounting...

Before unmount, correct md5sums:
Code:
$ md5sum /media/disk/VIDEO/*
0c9954d8b7e9cc78e09e4b492c1c3b9f  /media/disk/VIDEO/vid1.mp4
787e9af430d404dba1bf667e9a23d5f1  /media/disk/VIDEO/vid2.mp4
After unmounting, unplugging, and re-mount:
Code:
$ md5sum /media/disk/VIDEO/*
0c9954d8b7e9cc78e09e4b492c1c3b9f  /media/disk/VIDEO/vid1.mp4
787e9af430d404dba1bf667e9a23d5f1  /media/disk/VIDEO/vid2.mp4
The second md5sum changed :\
 
Old 09-29-2008, 08:36 PM   #6
hedpe
Member
 
Registered: Jan 2005
Location: Pittsburgh
Distribution: Ubuntu
Posts: 378

Original Poster
Rep: Reputation: 30
checking the binary differences between the two, there is exactly 1 kilobyte of data that was corrupt in the middle of the file, and then roughly 1 kilobyte of corrupt data at the end of the file
 
Old 09-29-2008, 08:39 PM   #7
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
I have no idea how to handle bad blocks on Flash RAM; I always throw it away before it causes more problems.
If the device has it's own "wear-levelling" algorithm like the CF cards do, then identifying bad blocks can be even more difficult (or even impossible).
 
  


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
Corrupted files in my linux? leo1981 Linux - General 1 04-16-2007 01:56 AM
From WindowsXP I cannot access files written onto vfat-partition under Linux Agi Hammerthief Linux - Hardware 10 01-19-2004 02:07 PM
Does RH8 support vfat fs ? nathanv117 Linux - Newbie 4 12-30-2002 02:54 AM
copy files from vfat to vfat from linux? purpleburple Linux - General 2 12-11-2002 04:24 PM
Copying files to vfat partion in linux??? MgF Linux - Newbie 15 11-02-2002 07:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration