Sd Card Identification Windows

 Posted admin

SD Card Requests. SD Card Hardware Identifiers. For information about Secure Digital (SD) device identification strings, see Identifiers for Secure Digital (SD) Devices. Restrictions on SD Card Drivers. Certain restrictions apply to Secure Digital (SD) card device drivers that manage a function on an SD combo or multifunction card. Fixes an issue in which the SD card cannot be detected after the computer is resumed from sleeping states. This issue occurs in Windows 8.1, Windows RT 8.1, or Windows Server 2012 R2. Second Method to Fix ‘SD Card Not Detected On Windows 10 Right-Click on the Window Start menu and Select the “ Control Panel ” option. Now in the Control panel Search for the “ Troubleshooting ” and then after click on the “ Troubleshooting ” option.

An SD Card is a small electronic storage medium used by a plethora of storage devices including smartphones, games devices, camcorders, cameras and even single board computers such as the Raspberry Pi.

  • Normal
  • Mini
  • Micro

Insert the SD Card Into Your Computer

Most modern computers have an SD card slot somewhere on the side of the computer. The slot is generally designed to be the same size as a normal SD card and so micro and mini SD cards need to be inserted into an SD card adapter in order to insert them into the computer.

It is possible to get an SD card adapter that accepts Mini SD cards and in turn, a Mini SD adapter that accepts micro SD cards.

If your computer doesn't have an SD card slot you will need to use an SD card reader. There are hundreds of these available on the market and they come in many different shapes and sizes.

With an SD card reader, you simply need to insert the SD card into the reader and then plug the reader into the USB port on your computer.

The way that you format an SD card has been the same for a number of years and these instructions are for all versions of Windows.

The Easiest Way to Format an SD Card Using Windows

The easiest way to format an SD card is as follows:

  1. Open Windows Explorer.
  2. Find the drive letter for your SD card.
  3. Right-click, and when the menu appears click Format.

The file system defaults to FAT32 which is fine for smaller SD cards but for larger cards (64 gigabytes and up) you should choose exFAT.

You can give the formatted drive a name by entering it into the Volume Label.

A warning will appear notifying you that all of the data on the drive will be erased.

At this point, your drive should be formatted correctly.

How to Format Write Protected SD Cards

Sometimes when attempting to format an SD card you will receive an error saying that it is write protected.

The first thing to check is whether the little tab is set on the SD card itself. Remove the SD card from the computer (or the SD Card reader).

Look at the edge and you will see a little tab which can be moved up and down. Move the tab into the opposite position (i.e. if it is up, move it down and if it is down, move it up).

Reinsert the SD card and try to format the SD card again.

Sd Card Identification Windows 7

If this step fails or there is no tab on the SD card follow these instructions:

  1. If you are using Windows 8 and above you can right click the start button and click Command Prompt (Admin).
  2. If you are using XP, Vista or Windows 7 press the start button and right click on the Command Prompt option and choose Run as administrator. You may need to navigate through the menus to find the Command Prompt icon.
  3. Type diskpart.
  4. Type list disk.
  5. A list of all the available disks on your computer will appear. Make a note of the disk number that resembles the same size as the SD card you are formatting.
  6. Type select disk n (Where n is the number of the disk for the SD card).
  7. Type attributes disk clear readonly.
  8. Type clean.
  9. Type exit to exit diskpart.
  10. Format the SD card again using Windows Explorer as shown in the previous step.

Note that if there is a physical tab on the SD card then this overrides the above instructions and you need to amend the position of the tab to turn read-only on and off.

In step 7 above, 'attributes disk clear readonly' removes the write protection. To set write protection back on, type attributes disk set readonly.

How to Remove Partitions From an SD Card

If you have installed a version of Linux to your SD card because for use on a single board computer such as a Raspberry Pi then there may come a point in time when you want to re-purpose that SD card for other uses.

When you attempt to format the drive you realize that there are only a few megabytes available. The chances are that the SD card has been partitioned so that the SD card could boot correctly into Linux.

If you suspect your SD card has been partitioned you can check by following these steps:

  1. If you are using Windows 8 and above right click on the start button and choose Disk Management from the menu.
  2. If you are using Windows XP, Vista or Windows 7 click on the start button and type diskmgmt.msc into the run box.
  3. Find the disk number for your SD card.

You should be able to see a number of partitions assigned to your SD card. Quite often the first partition will show as unallocated, the second will be a small partition (for example 2 megabytes) and the third will be for the rest of the space on the drive.

To format the SD card so that it is one continuous partition follow these steps:

  1. If you are using Windows 8 and above you can right click the start button and click Command Prompt (Admin).
  2. If you are using XP, Vista or Windows 7 press the start button and right click on the Command Prompt option and choose Run as administrator. You may need to navigate through the menus to find the Command Prompt icon.
  3. Type diskpart.
  4. Type list disk.
  5. Find the disk number that matches your SD card (should be the same size)
  6. Type select disk n (where n is the disk number representing your SD card)
  7. Type list partition.
  8. Type select partition 1.
  9. Type delete partition.
  10. Repeat steps 8 and 9 until there are no more partitions (note that it will always be partition 1 that you delete because as soon as you delete one the next one along will become partition 1).
  11. Type create partition primary.
  12. Open Windows Explorer and click on the drive matching your SD card.
  13. A message will appear as follows: 'You need to format the disk before you can use it'. Click the Format Disk button.
  14. The Format SD Card window will appear. The capacity should now show the size of the whole drive.
  15. Choose either FAT32 or exFAT depending on the size of the SD card.
  16. Enter a volume label.
  17. Click Start.
  18. A warning will appear stating that all data will be deleted. Click OK.

How can I programatically read the SD Card's CID register, which contains a Serial Number and other information? Can I do it through Android Java, or Native code?

Thanks in advance,Eric

Eric HamiltonEric Hamilton

11 Answers

Dinesh PrajapatiDinesh Prajapati

I managed to find my SD card CID by plugging my phone to my computer via usb and using the adb tool (Android SDK)

My phone is rooted so I'm not sure if this is accessible on non-rooted phones.

Also try

Sd Card Identification Windows Cannot Access The Disk

These are explained in the kernel documentation http://www.mjmwired.net/kernel/Documentation/mmc/mmc-dev-attrs.txt

delcypherdelcypher

I made this one.. it worked for me.. hope it makes u clear!

Aditya NikhadeAditya Nikhade

The only code I've found thus far to provide the id is C++ or C#http://jo0ls-dotnet-stuff.blogspot.com/2008/12/read-secure-digital-sd-card-serial.html
http://jo0ls-dotnet-stuff.blogspot.com/2008/12/read-cid-and-csd-c-implementation.html
If you are a C++ developer you may be able to take this and make it work on Android.

Paul GregoirePaul Gregoire

As BMB wrote, you cannot know the real path of the SD card in the /sys filesystem. However, /sys implements aliases as well, and you may be able to retrieve the CID through /sys/block/mmcblk0/device/cid.

For example, on a Tattoo running 2.2, /sys/block/mmcblk0 is a soft link (established automatically by the system) to /sys/devices/platform/msm_sdcc.2/mmc_host/mmc1/mmc1:aaaa/block/mmcblk0.

Samuel TardieuSamuel Tardieu

There is api in android for getting sd card serial id. The method is called getFatVolumeId(String mountPoint), where 'mountPoint' is sd card name (you can get this name by calling Environment.getExternalStorageDirectory()). But getFatVolumeId is kindof hidden function (or forgotten), so you want to create package in your project named android.os and the class in it to reference the native method, to be able to call it:

And the code is:

Also see the links

http://groups.google.com/group/android-framework/browse_thread/thread/1abd18435ba20a67?pli=1http://markmail.org/message/rdl4bhwywywhhiau#query:+page:1+mid:rdl4bhwywywhhiau+state:results

southertonsoutherton

There is no Android API that can do this that I am aware of and for a general solution that is needed. To provide some background the SD card is connected to a hw-controller that is specific to the device platform. It is possible to read out the cid value from the linux /sys file system if you know your platform. The following snippet works on my droid (TI omap based platform) but not on Qualcomm MSM based platforms.

On a another platform the sys file we are looking for is different. It may even differ between different cards on the same platform since I was not able to test that. On MSM based devices the path would be something like /sys/devices/platform/msm_sdcc.1/mmc_host/..

Since we have this hardware dependence on reading out the SD-card CID there would have to be an update to the Android API:s that provides general access. This API would then have to be implemented by each device manufacturer to map to the correct sd card controller driver.

BMBBMB

I was looking for this function too but could never get a home brewed solution. I ended up finding a company that makes an SID reader. Go to nexcopy.com and look in their SD or microSD duplicator section. It can read up to 20 cards at a time.

JesusJesus

for mmcblk0, just write in shell as:

you can implement it in java easily.

ref:
https://www.kernel.org/doc/Documentation/mmc/mmc-dev-attrs.txt
https://www.kernel.org/doc/Documentation/sysfs-rules.txt
http://www.cameramemoryspeed.com/sd-memory-card-faq/reading-sd-card-cid-serial-psn-internal-numbers/

yurenchenyurenchen

Even though the relatively ancient Palm OS and Windows Mobile OS devices are able to read the SD card ID, AFAIK Android devices aren't capable of doing that yet. This is particularly troubling given the problems with the Settings.Secure.ANDROID_ID discussed here.

gregSgregS

Building on Dinesh's answer..

Format

Dinesh suggested looking in the directory/sys/class/mmc_host/mmc1/mmc1:*/ (where * is a number) for the file named cid, which gives us the contents of the card's CID register. This is does work in many cases, and is a very helpful start.

But mmc1 is not always the removable SD card. Sometimes, e.g. on a Motorola Droid Pro with Android API level 10, mmc0 is the removable SD card, and mmc1 is something else. I'm guessing that mmc1, when present, points to internal storage of some sort (possibly a non-removable microSD card). On a cheap Android tablet we tested, mmc0 is the SD card and there is no mmc1.

So you can't just assume that mmc1 is the SD card.

How can the answer be improved? Bcs drug classification.

A glimmer of hope: It seems (so far) that by looking at the type file in the same directory as the cid file (e.g. /sys/class/mmc_host/mmc1/mmc1:0007/type), we can determine which is which: a type value of SD indicates a removable SD card, while MMC is not.

Card

However, that's just from testing on a few Android devices. I can't find any specifications about the contents of the type file, so if somebody else knows of relevant documentation, please let me know.

Of course, MMC and SD are just two different storage technology standards, and SD is backward-compatible with MMC. So it's not necessarily the case that type SD always corresponds to an external microSD card. It doesn't seem likely that MMC could indicate a microSD card at all (if the type field is populated accurately); but on the other hand, it's conceivable that a non-removable SD card could have type SD.

For further research: Does this approach work when an microSD card is connected via a USB adapter? My one test on this, with a tablet, had the USB-connected microSD card show up as mmc1, with type SD.

LarsHLarsH

Not the answer you're looking for? Browse other questions tagged androidc++windowsmfc or ask your own question.