Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
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.


  Search this Thread
Old 11-11-2009, 06:56 AM   #1
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, 12:54 PM   #2
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, 06:03 AM   #3
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....


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 03:59 PM
Ext4 partition corrupted by resized NTFS Vista C:\ partition? graviton-boson Linux - Newbie 2 03-16-2009 02:26 PM
swap partition corrupted varun_saa Mandriva 2 11-02-2008 04:12 AM
Help with XP partition corrupted ufmale Linux - Newbie 8 08-16-2008 07:21 PM
root partition corrupted donguai Linux - Software 2 04-02-2006 01:53 PM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 05:35 AM.

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
Open Source Consulting | Domain Registration