Let's say I have a windows host, holding 10 disks: Half of them are in RAW format and the other half are in some FileSystem format. I'm looking for a way to determine, from within java code, which drive is in RAW format and which is in FileSystem format. Till now, I was able to gain information (such as capacity, block size, index and more) about the disks using WMI queries, but I couldn't find a way to determine what is the disk format.
Asked
Active
Viewed 152 times
3
-
http://stackoverflow.com/questions/9441258/identify-file-system-format-of-a-disk-type-in-java-like-ntfs-fat16-32-or-ext – Sean Glover Jan 11 '16 at 16:00
-
This is not exactly what I'm looking for... I don't need to know what kind of FS but if it is FS or not (= RAW). I need something which accepts as input the disk name (PHYSICAL_DRIVE_1 for example) and returns if it is formatted with FS or if it is RAW – Petraro Jan 13 '16 at 17:47
1 Answers
0
I found a way to determine the disk format via diskpart utility.
I'm running detail disk on all of the disks and then parsing the output to know whether it is RAW/FS (the output is different for RAW/FS disks).
My script basically looks like:
select disk 1
detail disk
...
select disk n
detail disk

Petraro
- 33
- 5