Disk Partition Structure

Is there a way in Java (1.6+) to restore the structure of a disk array? (For example: NTFS, FAT32, HFS + or EXT3.)

External libraries allowed.

Thanks
Gianni

+3
source share
3 answers

You can use Runtime.getRuntime (). exec () to execute a command like sfdisk, and then to parse the output.

sfdisk -l /dev/hdc

Unfortunately, it is not very platform independent.

+1
source

In OS X, the mount output includes the file system:

ravn:~ ravn$ mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)

It /has typehfs

+1
source

, - . , .

+1
source

Source: https://habr.com/ru/post/1729958/


All Articles