public static long getBlockDeviceCapacity(String path) throws ExecutionException {
        String[] cmd = new String[] {
            "lsblk",
            "--bytes",
            "--nodeps",
            "--output", "SIZE",
            "--noheadings",
            "--raw",
            path
        };
        CommandResult result = CommandUtils.run(cmd);
        if (!result.success()) {
            throw new ExecutionException("get block device capacity fail: " + result, null);
        }
        return Long.parseLong(result.stdout().trim());
    }
Get the capacity of the given block device.
s3stream/src/main/java/com/automq/stream/s3/wal/util/WALUtil.java