4

Long story short - how do I check what filesystem is used on the SD card?

I'd like to be able to differentiate between FAT and NTFS.

Sebastian Nowak
  • 5,607
  • 8
  • 67
  • 107
  • Are there actually Android devices that use NTFS? Android is a Linux-based operating system; I'd be astonished if they chose to use NTFS for anything. Is NTFS support even compiled into the kernel? – Edward Falk Aug 07 '12 at 18:43
  • There are people who format their SD cards to NTFS in order to be able to use files larger than 4gb. I'm not really sure if NTFS support is available by default, but there are custom ROMs that supports it for sure. – Sebastian Nowak Aug 07 '12 at 19:33

1 Answers1

5

One way is to parse output of mount command

Edit: here is the code

proc = Runtime.getRuntime().exec("mount");
BufferedReader in = new BufferedReader(new InputStreamReader(proc .getInputStream()));
String line = null;

while ((line = in.readLine()) != null) {  
//parse here
}

you will have to parse string line to check the filesystem for sdcard. I think it should work for non rooted devices also

nandeesh
  • 24,740
  • 6
  • 69
  • 79