LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 11-11-2009, 05:56 AM   #1
linux_21
LQ Newbie
 
Registered: Nov 2009
Posts: 8

Rep: Reputation: 0
Smile SD card partition corrupted


Hi all,
I have an transcend sd card in my embedded device.when i am running an application to test the sd card the sd card gets corrupted once in 100 times or less...
My sd card test application shall mount the sd card writes the 1 kb file to sd card and unmount the sd card and again mount the sd card reads the 1 kb file and compare with file written into sd card and unmounts the sd card.The sequence of steps is as follows:-
mount /dev/mmcblk1 /mnt/sd
write the 1 kb file
umount /mnt/sd

mount /dev/mmcblk1 /mnt/sd
read the 1 kb file and compares
umount /mnt/sd

if i perform the above test and power off and power on the embedded device and perform the test again if we do like this for 40-50 time the partition of the sd card is getting corrupted and i am not able access the content of the sd card either in linux or windows pc...I need to format the sdcard to access it again...

I would like to find a solution for why the card is getting corrupted...


Thanks in Advance...
 
Old 11-11-2009, 11:54 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
How much time are you giving it between mounts and writes? Are you sure the device is properly mounted/unmounted before your software preforms the write/read operations? Perhaps you are just moving too fast for the kernel to keep up.

On the other hand, flash media is exceptionally bad for continuous small read/write operations like you are doing. Granted it shouldn't have a problem that quickly, but is there is a reason you are trying to do this? What exactly is this test trying to prove?
 
Old 11-12-2009, 05:03 AM   #3
linux_21
LQ Newbie
 
Registered: Nov 2009
Posts: 8

Original Poster
Rep: Reputation: 0
I want to test sd card through my application its a part of my software....i had give 100 msec of delay between mount and write operation and 2 sec delay for again mouting and also after mounting properly then i am writing the data to the sd card...
i dont its a driver issue or card issue....
 
  


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
Ubuntu 9.x install corrupted NTFS partition; repair corrupted TrueCrypt partition halfer Linux - General 1 06-30-2009 02:59 PM
Ext4 partition corrupted by resized NTFS Vista C:\ partition? graviton-boson Linux - Newbie 2 03-16-2009 01:26 PM
swap partition corrupted varun_saa Mandriva 2 11-02-2008 03:12 AM
Help with XP partition corrupted ufmale Linux - Newbie 8 08-16-2008 06:21 PM
root partition corrupted donguai Linux - Software 2 04-02-2006 12:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

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