static int physicalBlockSize(String dev) throws IOException {
while (! dev.isEmpty()) {
final File f = new File("/sys/block/" + dev + "/queue/physical_block_size");
if(f.exists()) {
return Integer.valueOf(new AFile(f, Charset.defaultCharset()).lines().get(0));
}
dev = dev.substring(0, dev.length()-1);
}
return 512;
}