Go Down

Topic: How to remove log files on sd card ? (Read 335 times) previous topic - next topic

cooker

When I insert the SD card to RPi, it is auto mounted, and I can read all files.  However, I cannot remove any.
I tried to remount it as read/write, it said it is write-protected!?
I tried both fdisk & parted to recreate the partition, it all stopped by a "read-only" message.
I tried e2fsck and saw something like bad magic number, bad superblock, etc

However
the SD example sketches "Files" in arduino do a magic
a line  SD.remove("filename.ext")  in a sketch can remove file filename.ext !! @@

To me, it means that my SD card is not broken.
But still, it is not practical to edit and execute a sketch in order to delete a file.

Sorry I cannot recall what I had done to get such a resulting situation.  Only thing I am sure is I formated the SD card on a linux machine (just because I have no windows).
I get my first UNO last year.  I encounter this issue quite some months ago, only try to solve the problem now.
I hope I can
1.  get the problem fix
2.  know the cause(s) so that at least I won't make the same mistake again

Any helps are welcome
Thanks

cooker

So, it is not a common issue, is it ?
Please share me your experience so that I can confirm.


The card is a SanDisk Ultra II 4G
SD card module is an unbrand one from TaoBao (same source as ebay), could it be the casue?


christop

Is the SD card's write-protect switch on?

cooker

Is the SD card's write-protect switch on?
Thanks for your reply.  That was not on the "Lock" position.  BTW, I tried both position to get rid of the possibility that this is the cause.

christop

This seems like a question for the RPi forums, since the SD card works fine with your Arduino and Linux system. They might be able to help you better.

cooker

This seems like a question for the RPi forums, since the SD card works fine with your Arduino and Linux system. They might be able to help you better.
Well, RPi is innocent here.
My main PC runs CentOS (with vm's of other distro's), and it is where the sd card was formatted.
As centOS is relatively "conservative", when it fails me, usually I will try other distro (on vm) instead of find/do "fix" on centos directly (a policy to keep my vm host simple and clean).  RPi is sometime a better choice because I can run it on metal, even though it is ARM base.
So, for what I tried on RPi, I had tried on Centos first.

As I have very limited experience with Arduino, I suspect if
1.  there are several sd card Lib out there, and I had installed a not-for-me one.  Can/should I try to find another Lib?
2.  the SD card module (hardware, sd card reader with pins instead of a plug) is "partially" broken(?) which made my sd card can now be rw ONLY thru it.  Does it make any sense?

I'm also lack of knowledge on sd card.
For harddisk, we have low level format.  Is there anything similar for sd card?  Apply it thru Arduino or Linux?
I don't know, I guess Arduino community may have more hands on experience on sd card than Linux ones.


Stacy753

Open the phone dialer, dial *#9900# and select the 2nd option "Delete dumpstate/logcat" in the prompted menu. Select ok to 'Delete Dump' and hit exit. This will restore heaps of storage space by deleting all the log files in the device memory.

cooker

#7
Jul 13, 2018, 07:59 am Last Edit: Jul 13, 2018, 08:05 am by cooker
Open the phone dialer, dial *#9900# and select the 2nd option "Delete dumpstate/logcat" in the prompted menu. Select ok to 'Delete Dump' and hit exit. This will restore heaps of storage space by deleting all the log files in the device memory.
What a new dimension of thinking!  I would say awesome.

As my sd card is a standard size one (can't insert into any phone).  To try that, the only way I can think about is to install Android onto a SBC which I have no experience at all.  (Including the dialing programs on Android & wiring between Android and the sd card.)

Is there any other easier way?

Any related tutorial you guys have come across before?  Kindly pls share the url.

As I treat it as a hobby, I have no reason to give up.  Just want to be reasonable smart and reasonable dump.

Go Up