Micro SD: No write access, cannot format. exFAT digital write protect or SD corrupt? - Android Q&A, Help & Troubleshooting

I know using a thread it not necessarily the best way to ask a question but since the cause of this issue is unknown (and might just be SD corruption) and there are a few other threads where it might come up, this thread can be used as a reference.
The issue is: An SD card that rather suddenly became unwritable in every way and can no longer be mounted by Android (although it is detected) but on which all existing data was undamaged, can be viewed and copied via USB card reader to Windows or Linux PC. The drive behaves much as if it was write protected or as if the file system (particularly the FAT) was corrupted in a way that mimics digital SD write protection. Here are the details.
L5.1.1/CM12.1 December 2015, SuperSU 2.65, TWRP3.0.2,
- 64GB Sandisk Ultra SD, initially accepted as formatted or formatted upon first use to Fat32; Working fine for a few months as repository for static data (ROM zips and app apks), work material (frequently edited text, DOCX and XLSX files), as well as apps and app data with a dynamic presence on the drive.
- Drive suddenly stopped appearing on device in CM and in TWRP. When re-inserted in CM, the system detects a card but times out as it is unable to find a mount point. Attempts to mount SD card in ROM result in the following error in CatLog:
"E/Vold (222): /dev/block/vold/179:65 failed to mount via VFAT (No such device or address)
E/Vold (222): Volume sdcard1 found no suitable devices for mounting "
- Attempts to repair, partition or format the drive in TWRP result in mount error and the details of the drive have zeros where there should probably be other values.
/external_sd | | Size: 0MB Used: 0MB Free: 0MB Backup Size: 0MB
Flags: Can_Be_Mounted Can_Be_Wiped Wipe_Available_in_GUI Removable Is_Storage
Primary_Block_Device: /dev/block/mmcblk1p1
Alternate_Block_Device: /dev/block/mmcblk1
Display_Name: MicroSD Card
Storage_Name: MicroSD Card
Backup_Path: /external_sd
Backup_Name: external_sd
Backup_Display_Name: MicroSD Card
Storage_Path: /external_sd
Current_File_System: auto
Fstab_File_System: auto
Backup_Method: files
MTP_Storage_ID: 65537
- With SD in card reader attached to PC, the contents of SD are visible and can be copied to PC but files cannot be copied from PC to SD card. It looks like they are copied but they are gone when card reader is disconnected then reconnected. Same in Linux Ubuntu 14.x.
- Unable to delete or reformat partitions in any utility that I tested including: Dedicated GParted boot USB, EaseUS Partition Master, HP USB Disk Storage Format Tool on PC, GParted in Ubuntu 14 VM, GParted in Ubuntu 10.x live CD/USB.
- Although the SD drive shows as Fat32 in GParted, Windows 7 only offers exFat and NTFS as formatting options. Some research shows exFat can digitally "write protect" drives with a dirty bit or byte which causes very similar symptoms.
- Windows Chkdsk requests to convert lost chains to files but must not be doing so as this occurs on every scan.
Soooo...the questions are: What in the realm of relatively normal android use might cause this? Has anyone heard of a disk or partition management setting or common form of drive corruption that could cause this? Could such a thing be caused by a file manager? A 32GB replacement SD is doing OK but I'm left wondering if the issue with the 64GB SD card was caused by a utility on the device or if it was just SD corruption (that looks conspicuously like digital write protection).
[EDIT] A minor correction I should make: The reason Windows 7 only offers NTFS and exFAT is not because the drive is damaged (although it may be) but rather because Windows 7 cannot format USB drives over 32GB with FAT32 although it can mount and use larger FAT32 SD drives that were formatted elsewhere. In this case I let android do the initial format months ago (Fat32) and never had problems during the times I connected it to card reader (although I usually leave it in the device and use Wifi or MTP through device USB to PC).

[] AL [] said:
Since your running 12.1, I imagine that you don't flash too many nightly build's... So this (not) variable is may be put aside from suspects list.
Click to expand...
Click to collapse
Correctamundo
[] AL [] said:
Recovery: well, I don't know but for that, I'm always following the if it ain't broke, don't fix it rule. You have specific reasons to keep it updated? Like you, I've also read many posts reporting USB related issues with v > 3.0. I still use v2.8.7.0 on my device and don't feel the need to update soon.
Click to expand...
Click to collapse
I'm now on the fence about reverting to the longer standing 2.8.7 version of TWRP, but since the primary maintainer for my Otus CM12.1 and CM13 ROMS (@squid2) also creates the build of TWRP and has included in his 3.0.2 version some forward fixes that might be better for CM13 especially where encryption is used, I have been updating it. A consideration in this regard is; what if it was not the different version of TWRP that caused this but rather a one-time instance of something that went wrong in the act of flashing it - which I would be more at risk of because I do occasionally update TWRP.
Hmmmm...I did recently restore a nandroid of stock Moto L 5.0.2 then flashed stock recovery in an attempt to install a pending L5.1 OTA (Moto finally released it!) which failed AFAIK due to unlocked bootloader, then I flashed TWRP 3.0.2 and restored a CM12.1 nandroid. If that was a factor it merely planted the seed of the problem but did not grow into the problem until some other later action .
[] AL [] said:
As for apps, what I find strange is that even a format didn't fix things up with it.
Click to expand...
Click to collapse
The drive became un-writable in every way including the ability to format or change any properties of the drive in any drive/partition manager even though the data was all there in perfect shape. Ironically the problem with the drive is now protecting the data
[] AL [] said:
...I would hope to believe that a file explorer alone can not mess it up THAT much alone...
Click to expand...
Click to collapse
Likewise but at this point it would not surprise me considering that Android is a bit fast and loose with more basal aspects of the system including drive management.

Ultramanoid said:
I've used extensively SanDisk 64 GB microsdxc cards with Android. Given all the information you've given, I'd lean towards physical card failure.
It happens. In my experience, very rarely, but it does.
If the same thing happens again to another of your cards anytime soon, that's when you should start a serious investigation about it.
To be honest I've had more smartphones failing on me for a myriad different reasons in the last few years than problems with a card from a reliable manufacturer.
I have washed some of these cards in the washing machine by mistake, and I've used some intensively non-stop every single day for two or three years without an issue. I've run OSes from them often, and always replaced them for another because of speed or space concerns, very rarely because of failure.
They are incredibly resilient. And yet sometimes ( again, rarely ) one will spit input / output errors, or simply die on me, no matter what the format, filesystem, or OS. In fact it happened once with a brand new card that I had just used for a couple of weeks, the irony...
Click to expand...
Click to collapse
Good points. Thanks! I've had similar experiences with Micro SDs surviving through accidental washings as well as heavy use as USB boot drives running various utilities or Linux distributions (one of which had a persistent cache cache right on the card - thats a lot of read/writes) and I can't remember encountering a corrupted SD card that was not physically damaged.
That being said I did once support an outdoor system of over 300 units each of which ran off of a proprietary Linux system on an 8GB SD card where SD card corruption was not uncommon but those "devices" were exposed to thermal extremes, traffic vibrations, and poor quality field work and remote management the likes of which our devices rarely experience.
At first I was leaning toward SD card corruption but now wonder if this was an accidental digital write-protect, perhaps caused by an extremely localized bit of SD card corruption... or something like that... and that is an area where android is faster and looser than many other device/OS combinations.

What is the result of fsck with Linux ?

Ultramanoid said:
What is the result of fsck with Linux ?
Click to expand...
Click to collapse
Similar to Windows chkdsk; In Ubuntu 14.x Live USB boot, fsck (supposedly) reclaims lost clusters, and reports "free cluster summary wrong...". When option to fix is selected the command cannot gain write access to the drive. Re-scan verifies same errors persist.

Here's an idea that worked for me once with a card that refused to be formatted on Linux and OS X; try with a digital camera or DSLR, you may need a micro to SD adapter.
In that case though, mine was a defective card indeed. The camera did format it, and was usable for a little while, before giving errors again, and I discarded it definitely.
Edit : to be precise, the camera did not recognize it and offered to format it ( to FAT being an old DSLR, but a new camera might go for exFAT, and you already suspect foul play because of exFAT ), which worked, and then I could format it again ( ext4 ) in Linux. As mentioned, the card failed again soon afterwards anyway.

Ultramanoid said:
Here's an idea that worked for me once with a card that refused to be formatted on Linux and OS X; try with a digital camera or DSLR, you may need a micro to SD adapter.
In that case though, mine was a defective card indeed. The camera did format it, and was usable for a little while, before giving errors again, and I discarded it definitely.
Edit : to be precise, the camera did not recognize it and offered to format it ( to FAT being an old DSLR, but a new camera might go for exFAT, and you already suspect foul play because of exFAT ), which worked, and then I could format it again ( ext4 ) in Linux. As mentioned, the card failed again soon afterwards anyway.
Click to expand...
Click to collapse
I tried that yesterday in a relatively new camera that is supposedly capable of handling 64GB SDXC but the camera reports that the card could not be used but offered not other information.
As to exFAT - this correction to my initial assessment of the situation: The reason Windows 7 only offers NTFS and exFAT as formatting options is not necessarily because the drive is damaged or had a read only flag applied (although both off those thing now seem likely*) but rather because Windows 7 cannot format USB drives over 32GB as FAT32 even though it can mount and use them if they were formatted elsewhere. This does not really change things other than meaning that the available Windows formatting options are not informative.
* I just called SanDisk support and learned that the card supposedly has some sort of data preservation feature where; when an imminent potential failure is detected the card is indeed digitally write protected. This might mean that there is a way to undo the digital protection although that would put the data risk and the protection is non-standard as the Windows Diskpart command line utility does not show the disk or the volume as write protected.SanDisk even offered to replace the card but I declined (for now) because I want to hack at it some more. At least there now seems to be an understandable mechanism for how this happened.
Thanks for throwing some thought into it

It's interesting, the card I mentioned was a 64GB one, but the camera formatted it to FAT creating a 32GB partition, same limit as Windows. It pretty much ignored the other half of the card that showed up just as free space, but it also undid whatever was blocking the formatting before, which may have been that protection scheme from SanDisk as in your case. Good to learn about that.

Interesting...

I have the same issue with my Samsung 64gb sd. I was moving a zip file from internal sd to external sd with ES File Explorer and all of a sudden my phone froze and I had to hard reset. When I rebooted external was screwed. I have been looking for days for a fix and have come up with nothing. TWRP can see the card but no values. Please any help would be very much appreciated because I have ALL the pictures of my 2 week old son stored in ext sd.

noob4598 said:
I have the same issue with my Samsung 64gb sd. I was moving a zip file from internal sd to external sd with ES File Explorer and all of a sudden my phone froze and I had to hard reset. When I rebooted external was screwed. I have been looking for days for a fix and have come up with nothing. TWRP can see the card but no values. Please any help would be very much appreciated because I have ALL the pictures of my 2 week old son stored in ext sd.
Click to expand...
Click to collapse
See if this helps. Read through it, it has allot of helpful information.
http://forum.xda-developers.com/showthread.php?t=1192508

noob4598 said:
I have the same issue with my Samsung 64gb sd. I was moving a zip file from internal sd to external sd with ES File Explorer and all of a sudden my phone froze and I had to hard reset. When I rebooted external was screwed. I have been looking for days for a fix and have come up with nothing. TWRP can see the card but no values. Please any help would be very much appreciated because I have ALL the pictures of my 2 week old son stored in ext sd.
Click to expand...
Click to collapse
The incident about which I created this thread was sudden as yours was. Try viewing the contents of the SD card in a card-reader on a computer. If you can see the contents and copy to the computer but cannot write to the SD card you may be experiencing the same issue describe in the OP of this thread (irreversible dirty bit write protection due to impending failure detected), in which case you would have to backup the data on the card and get a new one. Also, it is best to keep internal/adoptable storage completely out of this equation as that re-formats and encrypts the SD card.

@MatisyahuSerious
Since this was a bit OT for LOS I've expanded upon this post (https://forum.xda-developers.com/showpost.php?p=71903594&postcount=4155) here where the reply is less off topic.
Off course there are many other bad things that can happen to SD cards, and frequent ROM flashing and TiBU backups put a particular stress on them. Another factor, at least in my case, is that when a high speed SD card (eg Sandisk Ultra red/grey) is used in a USB 3 port (to move data much quicker than MTP) the SD card gets so hot that the painted logo scorches and changes color. Those thermal cycles cant be good for the cards either. I've had 3 go bad in about 6 years, one in the manner described in linked post.
A bit of somewhat related OT: For what this is worth I once supported a system which ran Linux based OS from 8GB SD cards and the most frequent fix was to replace corrupted SD cards. SD cards have gotten better, and some brands may be better than others, but they were not originally designed to handle so much fast R/W and IMO the SD industry is still catching up.

Related

[Q] Benefits of partitioning the SD card

Hey guys ive been lurking around for a while troubleshooting my builds, I have figured out that when I run my android build off of the sd card by itself everything runs well, but once i put in my 10GB of music everything starts to fall appart and i get sod after a minute or two in the lockscreen. I was wondering if creating a separate ext2 partition for android to boot from and keeping my data on the other partition would provide me with any more stability. BTW im using the stock 16 gig class 2 card that came with the phone
Where on the SD card is your music? Root or in the Android folder. I ask because I have a 2 year old 8GB class 4 SD card that came with my preloaded CGO8 navigation (ICO8, but for US) and have never formatted. I've loaded most of the Android builds and most I've had no problems, other than typical for the build.
SD cards are digital. Unlike analog hard disks data is not fragmented. Formatting does not serve a useful purpose for an SD card. Even deleting files (except protected) deleting is just as, if not more, effective.
Do some research, think independently to come up with your own conclusions, but these are mine.
Oh, by the way, this is not the right forum for your question....you should have done some research before posting.
i was not asking about formating i was asking about partitioning and if running android from an ext2 partition on the sd card would create more stability on the build
audscott said:
SD cards are digital. Unlike analog hard disks data is not fragmented.
Do some research, think independently to come up with your own conclusions, but these are mine.
Oh, by the way, this is not the right forum for your question....you should have done some research before posting.
Click to expand...
Click to collapse
Analog hard disks? No fragmentation on flash media? Wow, sounds like you need to do some research...
I also have the same issue where if I put Android along with my music on the 16gb card, it gets stuck at jumping to kernal on reboot.
im copying my music on the new sd now will report back if the problem persists, but i have a feeling that running off of an ext2 partition will provide us with better r/w speeds, similar to ubuntu running on an ntfs partition instead of ext4
Having music (anything else) on your SD card should not really affect Android. Most builds are in an 'Android' folder, so that is where the system looks for its information. This may slow things down a bit (just like an overloaded HDD) but generally there should not be much difference.
Creating and ext2 partition will not help. Of course, now that I have said that, I have an ext2 partition on my SD card that was left from using my rooted G1 with cyanogen mod and Apps2SD. By default, my android build on my HD2 automatically looked in that partition for apps (froyo does this).
So, I do not think it will change anything about freezing or 'jumping to kernal' but it does have its uses.
EDIT: And, since WinMo is actually booting android, I don't think containing your android stuff in an .ext2 partition would even work. Needs to be FAT32 for haret to see it. (this is my assumption, not necessarily a fact)
Isn't the rootfs.img file actually like a simulated ext2 filesystem? Doesn't this file emulate the device memory? I'm not exactly sure, maybe someone else can expand on this. I don't think there is any benefit to partitioning the card in the current state of the hd2's development. Maybe when we are able to flash nand, nand will be formatted to ext2.
polo735 said:
Isn't the rootfs.img file actually like a simulated ext2 filesystem? Doesn't this file emulate the device memory? I'm not exactly sure, maybe someone else can expand on this. I don't think there is any benefit to partitioning the card in the current state of the hd2's development. Maybe when we are able to flash nand, nand will be formatted to ext2.
Click to expand...
Click to collapse
Well, there is that and the system.ext2 and data.img. This is all the files in Android (basically).
But with these files, android knows where to look to find them, placing them in your own ext2 partition will hide them from android.
When we are able to flash to nand (and now) an ext2 partition will allow you to store apps on that partition, given you are able to move apps to SD, which is not currently possible in our builds.
I installed apps to my SD card on my G1 (on an ext2 partition), so when I used Froyo on my HD2, android was able to read from that partition and use my old apps. All that means is that I did not have to reinstall all my old apps, and save space in the data.img created by android.
audscott said:
Where on the SD card is your music? Root or in the Android folder. I ask because I have a 2 year old 8GB class 4 SD card that came with my preloaded CGO8 navigation (ICO8, but for US) and have never formatted. I've loaded most of the Android builds and most I've had no problems, other than typical for the build.
SD cards are digital. Unlike analog hard disks data is not fragmented. Formatting does not serve a useful purpose for an SD card. Even deleting files (except protected) deleting is just as, if not more, effective.
Do some research, think independently to come up with your own conclusions, but these are mine.
Oh, by the way, this is not the right forum for your question....you should have done some research before posting.
Click to expand...
Click to collapse
First of all, before you call someone out you might want to do some research of your own so you don't come across looking like a moron. Fragmentation happens regardless of the actual hardware, and most file systems are vulnerable (whether it be fat, ntfs, ext2, ext4, etc). And while deleting files and reformatting end in the same result, a quick reformat makes far fewer writes to the card by simply wiping the allocation table. Each file name must be modified individually if you delete them, adding unnecessary wear to the card. As for a hard drive being "analog", it stores its data the same way as a memory card - 0's and 1's - which is digital. Just a little refresher there.
Now, as for the question at hand, which is completely appropriate for this forum as it directly concerns the development and installation of android on our HD2's, the use of ext2 for the android files has been done successfully on other winmo devices in order to increase stability and speed in the system. In fact I have done this very thing on my Kaiser in the past. Whether its possible with our current HD2 setup is another matter, so I'll direct you to these links - do a little reading and play around with it, let us know what you find. I'll probably look at it myself this weekend as a stop-gap until a full NAND flash becomes available, which hopefully is sooner rather than later - I'll report back if I find something.
http://www.androidonhtc.com/wiki/Installing_Android
http://android-devs.org/forum/viewtopic.php?f=56&t=194&sid=69cc2d8c93262ff8c70de594d50e5874
In my own experience, I have a 4Gig class 10 and 16Gig class 2 (stock).
I use my 4Gig for Android test runs.
I use my 16Gig for my Android currently in use.
I have my Music in at the root /Music
Android is in the traditional /Android
Any pics I take I just move over /DCIM
I haven't experience any corruption. Before testing, I format the SD card on my computer with 64k or 32K blocks. I copy over my saved /Music and /DCIM and then load the new Android in /Android.
ALWAYS Eject the SD card. Keeping those rules and I haven't had issues.
Well I switched to my other 16gig class 2 and my problems went away, it seems the stock card was going bad but not using a 20yr old file system would be nice regardless
Sent from my HTC HD2 using XDA App
... oh, and about fragmentation, I'm not a software engineer (I'm electronics engineer), but I wouldn't get too worried about SD card fragmentation. It can happen, but not in the same way as a physical HD.
SD cards can do random access reads/writes much better than a physical hard drive. However, if you've formatted your blocks too small, the controller has to piece together two bits of info instead of one.
Example: 64k file written to 8k formatted SD, will have to piece together 8 blocks.
A 64k file written to 64k formatted SD is written all to one block.
The flip-side is if you have a bunch of small files (1k - 5k) and you're formatted at 64k, you've just wasted 63k of a 64k block writing a 1k file. It's inefficient.
willgill said:
Example: 64k file written to 8k formatted SD, will have to piece together 8 blocks.
A 64k file written to 64k formatted SD is written all to one block.
The flip-side is if you have a bunch of small files (1k - 5k) and you're formatted at 64k, you've just wasted 63k of a 64k block writing a 1k file. It's inefficient.
Click to expand...
Click to collapse
Considering the sizes of most music and picture files these days and the fact that all Android little files are inside one large file, I believe going with 64k blocks would be better. Even going with a larger block size than 64k might be a good idea. Too bad 64k is the limit.
Larger block sizes might be inefficient when dealing with system folders like C drive in windows or system folder in linux since they contain a huge number of small files. That is why windows default is 4k.

Need 64GB Driver.

I bought 64 gb card and it works on samsung stock galaxy s3 rom BUT when i switched to Cyanogen10 mod it started showing damaged card,
I know it is because the stock has driver for that card,
My question is has someone ported or can someone please port the driver from stock and make it workable on custom roms.
Thanks.
exFAT is not and probably will never be supported by CM9 or 10.
Your card needs to be FAT32-formatted to work.
Alright trying hopefully this works and doesnt screw up my card.
d4fseeker said:
exFAT is not and probably will never be supported by CM9 or 10.
Your card needs to be FAT32-formatted to work.
Click to expand...
Click to collapse
didnt work now the phone doesnt even show damaged card, its acting like card is not even inserted.
How exactly have you formatted the card? Windows onboard utilities won't let you format a 64GB card as FAT32, so my guess is you formatted it as NTFS.
Unfortunately CM cannot read NTFS either, you'll need another kernel for that. (And to date none has been released)
Try the HP Usb Format utility to create a FAT32 partition.
d4fseeker said:
exFAT is not and probably will never be supported by CM9 or 10.
Your card needs to be FAT32-formatted to work.
Click to expand...
Click to collapse
Why is this?! Does AOSP not come with exFAT support, it's something Samsung builds into the kernel afterwards?
Disappointed, as I was tempted to try CM, but no 64GB support renders my card next to useless.
Disappointed, as I was tempted to try CM, but no 64GB support renders my card next to useless.
Click to expand...
Click to collapse
FAT32 doesn't mean the card is restricted to 32GB, it means a file can be 2^32 bytes long which is 4GB.
FAT64 (ExFat) has a limit of 2^64 bytes per file which equals 16 Exabyte (1Exabyte = 1024 Terabyte)
It's possible for FAT32 partitions to be as large as 8 Terabyte, which is roughly 1000 times the size of harddisks when FAT32 was released.
Windows, for some stupid compatibility reason with a 12 year old operating system (Windows 2000) does not allow to format FAT32 partitions to a size larger than 32GB, hence the usual confusion.
As described above, here is the tool you need: http://www.softpedia.com/get/System/Hard-Disk-Utils/HP-USB-Disk-Storage-Format-Tool.shtml
Why is this?! Does AOSP not come with exFAT support, it's something Samsung builds into the kernel afterwards?
Click to expand...
Click to collapse
ExFat is patent-encumbered, meaning every distributed binary copy of Cyanogenmod would theoretically cost the developers the license fee.
(At least for US-based downloads, most other countries see software patents as what they are - ridiculous and unenforceable)
Furthermore -and a very big issue- is the instability of the exFat code for GNU/Linux (and by extension, Android) which causes data loss, corruption and other negative side effects.
It's highly recommended not to use exFAT with Samsung-firmwares either.
d4fseeker said:
How exactly have you formatted the card? Windows onboard utilities won't let you format a 64GB card as FAT32, so my guess is you formatted it as NTFS.
Unfortunately CM cannot read NTFS either, you'll need another kernel for that. (And to date none has been released)
Try the HP Usb Format utility to create a FAT32 partition.
Click to expand...
Click to collapse
i used easeus partition: i deleted partition first and made new one with fat32 file system,
which didnt work, after that i deleted the partition again and formatted using stock galaxy s3 rom and it works again but limited to stock rom only like before.
atleast the card isnt dead.
d4fseeker said:
How exactly have you formatted the card? Windows onboard utilities won't let you format a 64GB card as FAT32, so my guess is you formatted it as NTFS.
Unfortunately CM cannot read NTFS either, you'll need another kernel for that. (And to date none has been released)
Try the HP Usb Format utility to create a FAT32 partition.
Click to expand...
Click to collapse
ill try this software as well.
d4fseeker said:
How exactly have you formatted the card? Windows onboard utilities won't let you format a 64GB card as FAT32, so my guess is you formatted it as NTFS.
Unfortunately CM cannot read NTFS either, you'll need another kernel for that. (And to date none has been released)
Try the HP Usb Format utility to create a FAT32 partition.
Click to expand...
Click to collapse
I didnt get a chance to try Hp software i cant across this other software and it work.
Thank you though
d4fseeker said:
FAT32 doesn't mean the card is restricted to 32GB, it means a file can be 2^32 bytes long which is 4GB.
FAT64 (ExFat) has a limit of 2^64 bytes per file which equals 16 Exabyte (1Exabyte = 1024 Terabyte)
It's possible for FAT32 partitions to be as large as 8 Terabyte, which is roughly 1000 times the size of harddisks when FAT32 was released.
Windows, for some stupid compatibility reason with a 12 year old operating system (Windows 2000) does not allow to format FAT32 partitions to a size larger than 32GB, hence the usual confusion.
As described above, here is the tool you need: http://www.softpedia.com/get/System/Hard-Disk-Utils/HP-USB-Disk-Storage-Format-Tool.shtml
Click to expand...
Click to collapse
Thanks, though I realised this - the whole reason I need a 64GB card is to copy movies onto there, because I travel a lot... many of them are over 4GB, which is the issue I have with using FAT32.
d4fseeker said:
ExFat is patent-encumbered, meaning every distributed binary copy of Cyanogenmod would theoretically cost the developers the license fee.
(At least for US-based downloads, most other countries see software patents as what they are - ridiculous and unenforceable)
Furthermore -and a very big issue- is the instability of the exFat code for GNU/Linux (and by extension, Android) which causes data loss, corruption and other negative side effects.
It's highly recommended not to use exFAT with Samsung-firmwares either.
Click to expand...
Click to collapse
Maybe I should look at ext3 instead, though then I'd have problems putting it straight into my Windows machine. Though, exFAT has been 100% stable for me so far.
many of them are over 4GB
Click to expand...
Click to collapse
Ok that is a problem for FAT32. You didn't mention it so I assumed you mistook the 32 in FAT32 for 32GB as many people do.
Maybe I should look at ext3 instead
Click to expand...
Click to collapse
Since you should never need to remove or directly access the card (MTP mode or File transfer through 'Samba Fileshare' App) that should be a solution. For your own computers, you could use the following driver:
http://www.fs-driver.org/
It allows read-write access to EXT2. EXT2 being EXT3 without journaling support (and thus fully backwards compatile) that could do the trick.
Pententially you'll need to re-enable the journal again through tune2fs on the Smartphone after having used an EXT2-driver. Not sure though since the journal is only relevant until a clean dismount is made.
You should however also be able to load the NTFS-module in the kernel or recompile the CM10 kernel with the required options.
If you need to plug the SDcard into your computer a lot, that may be the only solution until Gokhanmoral is back.

[HOWTO] Use external SD card as internal storage in KitKat

Beware, this guide is more or less untested, it will interfere with stuff like memory encryption and OTA or other firmware updates. You have been warned, I assume no warranties for bricked phones, SD cards or lost data.
Many cheap-ass Mediatek phones ship with Android 4.4.2 or later and only ridiculous amounts of internal storage (2GB in my case, CAT B15Q). That may be enough for basic apps, but as soon as you install Navigon or other data-heavy apps (or WhatsApp with a load of videos) you're going to run out of space in no time - and because Google is a bunch of fools, they disallowed app installations to SD cards entirely in 4.4!
So, we're going to move /data in its entirety to our nice huge SD card and be able to use even bigger apps on small phones. It might be possible that this guide works on other phones, but that depends on how they boot and where the fstab and init.rc reside!
Prerequisites:
Mediatek-based 4.4.2 or later phone with root access in recovery (boot it in recovery, run adb shell, therein run id. If it says root, all fine. If not, install CWM)
A large enough SD card (I chose a 32GB card with a 50:50 split between /data and the "external sd card")
Solid Linux knowledge, one Linux PC and one Windows PCs. I urge you to NOT use any kind of VM unless you have experience with USB passthrough.
spFlashTool and the Mediatek drivers from http://forum.xda-developers.com/general/general/stock-rom-cat-b15q-rom-development-t2988774, for a flashing guide see http://forum.xda-developers.com/android/help/howto-firmware-flashing-cat-b15q-t2989627
mtkdroidtools from https://www.androidfilehost.com/?fid=23501681358558543 on the Windows PC
mtk-tools from https://github.com/bgcngm/mtk-tools on the Linux PC (no, Cygwin does not work, it messes up the permission bits), cloned on an ext4 partition (not sure if ext2/3 can handle the extended permission bits...)
a network connection between the PCs or a USB stick to transfer files
Take the sd card out of the phone and insert it into your computer. Many laptop SD slots don't like SDXC (>4GB), you might need e.g. a Huawei 3G stick or a SDXC-compatible USB dongle.
Repartition the SD card using Acronis Disk Director, gparted or whatever you're familiar with. The first partition must only be resized (this is the FAT partition), the second partition is a ext4 (!) partition. Both MUST be primary partitions. Acronis and other tools on Windows might require a reboot to repartition SD cards. I recommend a 50:50% split, but if you're heavy on apps or their data, you might go for a 25% FAT: 75% EXT4 split.
Boot your phone into recovery, connect to it with adb in a root shell.
Assuming your data partition is at /dev/mmcblk0p8 (look in /fstab to find it out, followed by mount /data and ls /data to verify), execute the command "dd if=/dev/mmcblk0p8 of=/dev/mmcblk1p2", wait until it is finished. This can take up to ten minutes or more, depending how much data there is.
Shut down the phone, take out battery and SD card.
Insert the SD card into your Linux machine, run resize2fs /dev/sdb2 (or wherever the ext4 sd card partition ended up, check it in dmesg) as root so that the filesystem grows; then eject the SD card and put it back into your phone
Readback your BOOTIMG partition, transfer it to the linux PC (or, if you already have a boot.img for your current firmware, use this one)
On the Linux PC, open a rootshell (to avoid permission issues when building the ramdisk).
Run "./unpack-MTK.pl /path/to/bootimg"
"cd boot.img-ramdisk" (directory might be named different, depending on how you named the bootimg dump file)
Using a text editor, edit the "fstab" file(s) (there might be multiple, with suffixes): From (adjust if needed)
Code:
/[email protected] /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check,encryptable=footer
to:
Code:
/dev/block/mmcblk1p2 /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check,encryptable=footer
Now, edit the init.rc file (beware, other .rc files in the ramdisk root might also contain mount commands!).
Search for "on fs_property:ro.mount.fs=EXT4" and again replace /[email protected] (or whatever the node for /data had been) with /dev/block/mmcblk1p2 in the commands in this block (should be fsck, tune2fs,ext4_resize and mount).
Repack the boot image: ./repack-MTK.pl -boot boot.img-kernel.img boot.img-ramdisk/ /path/to/newboot.img
Transfer newboot.img to the Windows PC and flash it using spFlashTool
boot your phone, look in Settings->Memory to see if it went OK!
If the memory view didn't change, also modify the other blocks of on fs_property, in case your device does not use an ext4 rootfs (but yaffs or ubifs instead).
Functionality
It is a good idea, but
Are I still have part of it as external storage?
If yes, it means I can not remove it because there are some apps used it.
If no, it means I will not have external storage anymore!
e.ahmedmahfouz said:
It is a good idea, but
Are I still have part of it as external storage?
If yes, it means I can not remove it because there are some apps used it.
If no, it means I will not have external storage anymore!
Click to expand...
Click to collapse
The SD card is now both internal and external storage! You are not able to remove it because else your system will not boot anymore.
harddisk_wp said:
The SD card is now both internal and external storage! You are not able to remove it because else your system will not boot anymore.
Click to expand...
Click to collapse
what if the sd card is damaged ?
Can my phone boot again..or will booltloop
madthinker said:
what if the sd card is damaged ?
Can my phone boot again..or will booltloop
Click to expand...
Click to collapse
If you manage to kill your sdcard while you have my sdcard hack installed, then the phone will bootloop until you insert a new sd card partitioned just like the old one. Then it will act like you had factory-resetted it.
Alternatively you can always reflash original boot.img/recovery.img and use the phone with limited internal memory.
harddisk_wp said:
If you manage to kill your sdcard while you have my sdcard hack installed, then the phone will bootloop until you insert a new sd card partitioned just like the old one. Then it will act like you had factory-resetted it.
Alternatively you can always reflash original boot.img/recovery.img and use the phone with limited internal memory.
Click to expand...
Click to collapse
i see, thanks to explain me :good:
There is another way to get more space: Link2SD (2.- euros) with a second partition on your external SD-card exactly like shown above (ext4 partition, primary).
The advantage is, that if the sdcard is faulty the system still runs, just the apps which are symlinked to the ext4 partition won't run.
So I use this for all these not absolutely important apps which needs lots of internal memory, e.g. kindle bookreader, Amazon, WhatsApp etc. I dont use it for all apps, most importantly not for any app, where there is no alternative. Last week my two years old 64 GB MicroSD card (SanDisk, with warranty 10 years) in my SGS4 stopped working and this could happen all the time. They are not that reliable I think, that I would put my system on it.
I did this now with the Cat B15Q of my friend.
EDIT: and she has now more than 1 GB free internal space
I think this is the best solution, 2 GB for the pure ROM and the system apps is more than enough and all user apps go to the external sd-card (2nd partition).
good day!
hope you can help me.
what if i want vice versa? because my phone's default storage (0) is sd card.and i want my default storage will be its internal since it is 32gb rom. tried all ways but i think the answer is its boot.img. thank you..hoping for a help

Question : Has anyone done studies on the Best SDCARD ?

I dont know if there is already info on this subject, but i recently got a sandisk 64G mSD and it didnt even seem to last a year - kept getting into 'read-only' mode for some reason..... i though it was my KKDS_1.4 (4.4.4) rom, link2sd and all the other stuff there, but dont know if that's the case kept having to do the following to get it out of read only mode :
Plug SD into windows and :
Start > Run > cmd
type "diskpart" -> runs diskpart.exe from system folder
type "list volume" -> now you see all your connected drives, see which one is the drive
type "select volume #" -> # being the letter of your drive
type "attributes disk clear readonly" -> removing the protection
Then open your SD, you can now edit, delete, move files.
However this didn't seem to last long... and think the SDcard on its last leg - even though i didn't use it much.... i did have a ton of pictures, videos, programs and music on it but still had about 12G free but was really slow - even though its one of the SanDisk Ultra 64G XC I (UHS Class 1).... Granted I do use Link2SD and have partitioned the card as follows [59G Fat, 4G ext4, 1G Swap], but cant account for things taking so long, and then sometimes finding the card in read-only mode.
Anyhow... from my reading i dont think android will even use the 'swap' space i made, so on future SD I plan on a 4G ext4 (for second partition) with the remaining 60G as a FAT32, ExFat, or NTFS - for my KitKat (4.4.4) Device - will one filesystem be better an any other for the first partition (windows / linux compatible) - im thinking NTFS (reliable & windows compatible) but not sure if KK supports write mode to NTFS filesystem? There is also ExFat - but not sure about android support for that either... Know many people suggest raw FAT but just not possible with todays bigger cards so kinda seem stuck with FAT32.
Regressing and getting to the heart of my post here, I was wondering if there has been any long term studies of Which mSD Cards last longer and transfer data pretty fast? Perhaps there are ones more reliable... thought Sandisk was pretty good (my USB 3.0 SanDisk Extreme 64 GB Flash Drive kicks butt) I know the technology is different but the 64G Ultra SDXC was UHS Class 1. (so at least class 10)... but its only a year old and already giving me trouble... what are the better cards out there -- and what filesystem should the first partition be set to to make it last (and usable in a windows [or linux] environment) ?
I did read over a few good posts :
http://forum.xda-developers.com/showthread.php?t=1544156
and http://forum.xda-developers.com/showthread.php?t=1150369
as well as a few other places here , here , here , and here
Im starting to think that since im using Link2SD perhaps class 10 card not optimal for the ext4 r/w , but i do use the primary partition quite a bit (like a flash drive ans dont want to wait eons while transferring all my tunes and videos etc to phone.....
Has anyone done any research into these issues? Are there any cards the use SLC nand? or just last longer?
Can anyone comment on any of this.
steve_77 said:
Anyhow... from my reading i dont think android will even use the 'swap' space i made, so on future SD I plan on a 4G ext4 (for second partition) with the remaining 60G as a FAT32, ExFat, or NTFS - for my KitKat (4.4.4) Device - will one filesystem be better an any other for the first partition (windows / linux compatible) - im thinking NTFS (reliable & windows compatible) but not sure if KK supports write mode to NTFS filesystem? There is also ExFat - but not sure about android support for that either... Know many people suggest raw FAT but just not possible with todays bigger cards so kinda seem stuck with FAT32.
Click to expand...
Click to collapse
I just answered on the other thread, but I wanted to add that AFAIK Android doesn't support NTFS (at least not without serious jigging) and I think exFAT is close to the same situation. Why? These are proprietary Microsoft formats (arguably FAT32 is as well, but it is based on the standard FAT16 and has been opened up considerably) that even for a Linux system have to go through hoops to get the drive to properly write (well, not too bad, install the ntfs-3g package).

Samsung Encrypted Memory card help to Decrypt

Hi all
I have a Samsung S20 Ultra with a memory card that all of my photos are saved to, unfortunately I had to take my phone into Samsung experience store for a screen / back cover repair, the staff removed my Memory card and told me to factory reset due to GDPR as the device had to be sent away, when my device returned in the post 5 days later I went to put the memory card back in and a notice appeared stating the memory card is encrypted to a different device! I am totally devastated as there are pictures of my father who has passed away and other images that they are the only copies I have, I know now I should have unencrypted the memory card before the factory reset. I have spoken to Samsung directly so say there is nothing that can be done.
does anyone know of a way I can get round this I would be so very grateful!
Thanks in advanced
Stu
The best thing I could suggest is a third party solution that may be able to decrypt the information on the card, such as FeExplorer. Check to see if you have a "Decrypt SD card" option in the Lock Screen and Security settings, although I suspect it won't be able to do it.
The problem is, the encryption key is unique and stored in user data. When data is wiped during a factory reset, the key is wiped as well, so even if the user configures the same lock settings (password, pattern, etc) they key would be different.
I am not aware of an absolute solution, but here is what I would strongly suggest you do:
If able, make sure the contents of the card are backed up. Use cloud storage such as Google Drive.
Keep the card in a safe place; maybe put it in a small envelope or something, and mark it in such a way as to discourage accidental discarding or wiping.
Buy a new SD card to use in the meantime while you look for a way to recover the information on the encrypted card.
I am sorry for your loss, and I wish I had a better answer for you.
Edit: Found this on another site, maybe it's worth a try. MAKE SURE YOU BACK UP THE DATA ON THE CARD IN CASE THIS GOES WRONG.
On a PC: Copy (the encrypted and unreadable) contents of the sd card from the phone to your harddrive
On the phone: Settings -> Storage -> Sd Card -> Format sd card (this erases all the data on the sd card but don't worry you have a copy on the PC)
On the phone: Settings -> Security -> Encrypt sd Card (should be real fast since it's an empty sd card)
On the PC: Copy the contents of the sd card onto the phone
On the phone: Settings -> Security -> Decrypt sd card (edit: this may take a while depending on how much data was on the card)
sorry but none of the above "solutions" makes any sense. it is not possible to recover data. encryption key was located /data/misc/vold and /data itself was encrypted, too. Furthermore one can't access /data aka userdata partition.
BUT... and here comes the but.. adoptable-storage usually is DISABLED in One UI
So how is it possible your MicroSD Card is encrypted at all? It's not, except you have installed custom ROM or installed any 3rd party encryption tool (you would remember)
There is a good chance your MicroSD Card is plain exFAT or Fat32 unencrypted file system. I recommend to use a card reader for PC and make a 1:1 dump with gddrescue and analyze the dump with photorec or other file carver solutions.
There exist tools for windows too, for example
https://www.klennet.com/carver
https://www.z-a-recovery.com
https://www.runtime.org
Don't buy any software if your MicroSD Card is encrypted, it will definitely not work.
You can easily check if your MicroSD Card is encrypted by opening raw disk image with HxD hex editor and search for any plain text or series of zeros. gparted or testdisk will tell you if partition table exist
aIecxs said:
sorry but none of the above "solutions" makes any sense. it is not possible to recover data. encryption key was located /data/misc/vold and /data itself was encrypted, too. Furthermore one can't access /data aka userdata partition.
BUT... and here comes the but.. adoptable-storage usually is DISABLED in One UI
So how is it possible your MicroSD Card is encrypted at all? It's not, except you have installed custom ROM or installed any 3rd party encryption tool (you would remember)
There is a good chance your MicroSD Card is plain exFAT or Fat32 unencrypted file system. I recommend to use a card reader for PC and make a 1:1 dump with gddrescue and analyze the dump with photorec or other file carver solutions.
There exist tools for windows too, for example
https://www.klennet.com/carver
https://www.z-a-recovery.com
https://www.runtime.org
Don't buy any software if your MicroSD Card is encrypted, it will definitely not work.
You can easily check if your MicroSD Card is encrypted by opening raw disk image with HxD hex editor and search for any plain text or series of zeros. gparted or testdisk will tell you if partition table exist
Click to expand...
Click to collapse
when you put an SD card into a Samsung ultra it asks if you want to encrypt it through their own software, no third party apps were used
True, I realized after posting. Samsung is always bit special, they tried to think differently... In that case your data was lost in the moment of factory reset.
https://www.samsung.com/au/support/mobile-devices/how-to-encrypt-decrypt-sd-card
Stu_C said:
Hi all
I have a Samsung S20 Ultra with a memory card that all of my photos are saved to, unfortunately I had to take my phone into Samsung experience store for a screen / back cover repair, the staff removed my Memory card and told me to factory reset due to GDPR as the device had to be sent away, when my device returned in the post 5 days later I went to put the memory card back in and a notice appeared stating the memory card is encrypted to a different device! I am totally devastated as there are pictures of my father who has passed away and other images that they are the only copies I have, I know now I should have unencrypted the memory card before the factory reset. I have spoken to Samsung directly so say there is nothing that can be done.
does anyone know of a way I can get round this I would be so very grateful!
Thanks in advanced
Stu
Click to expand...
Click to collapse
Hello, have an experience that my samsung device were dead and my sd card still encrypted.
Firstly, you have to backup entire data on your sd card just in case.
And then, format your sd card using another device (maybe your another android).
Last, put your sd card to windows device and recover all data with DiskDigger software.
It's work on my sd card, give it a try.. Dont forget to backup all data

Categories

Resources