try {
long numberOfSectors;
long offset;
FSBlockDeviceAPI api = (FSBlockDeviceAPI) device.getAPI(BlockDeviceAPI.class);
int sectorSize = api.getSectorSize();
if (sectorSize != IDEConstants.SECTOR_SIZE) {
log.error("This mkjfat1.0 support only the Hard Disk.Sector Size must " +
IDEConstants.SECTOR_SIZE + " bytes.\n");
}
PartitionTableEntry entry = api.getPartitionTableEntry();
// if we can deduce partitiontable/fat dependencies do it otherwise
// guess it.
if (entry != null && entry instanceof IBMPartitionTableEntry) {
numberOfSectors = ((IBMPartitionTableEntry) entry).getNrSectors();
offset = ((IBMPartitionTableEntry) entry).getStartLba();
} else {
numberOfSectors = api.getLength() / sectorSize;
offset = 0;
}
/*
* Check the Disks Availability. low end limit - 65536 sectors I