Filesystem Block size

Project:JNode FS
Component:Miscellaneous
Category:support request
Priority:minor
Assigned:Unassigned
Status:active
Description

Actually I don't have many clues about filesystems, however I have/had troubles with the DuCommand.
I've got the Information to get the block size of a filesystem by getting the Device and casting it to a FSBlockDeviceAPI. Currently in the DuCommand the Device is queried through mountpoints and the FileSystemService.

Sounds fine, but actually doesn't work well in practice.
When booting from CD, the / and /devices directories have no mount point at all (should this be ok?) and the mounted directories are either ATAPISCSIDevice or VirtualDevice which both don't implement the FSBlockDeviceAPI.

Ok, "virtual" filesystem on CD or in RAM may don't have sectors or blocks (as I said, I have no clue), but at least a "getSectorSize()" method should return me a 1.

#1

I take a quick look to the code. Actually for CD and ram disk, the corresponding driver (SCSICDRODriver and RamDiskDriver) implements the FSBlockDeviceAPI. In the du command code you can add the following test :

if (device instanceof FSBlockDeviceAPI) {
...
} else if(device.getDriver() instanceof FSBlockDeviceAPI){
retValue = ((FSBlockDeviceAPI) device.getDriver()).getSectorSize();
}
else {
...
}

It's should work but i haven't tested yet.

Update : this fix correct the problem if you made du on /devices/sg0 (no more warnings) but not for the ramdisk.

Fabien L.