It’s not possible to see the number of write-buffered bytes for a block device. If you want to confirm that a device is safe to remove, the second-best gauge would be to check if there are any active writes. If you were recently copying something, this should drop to zero as soon as the kernel finishes flushing bytes.
Here is an example of interrupting a copy to /dev/sda1 and then doing a soft eject of the device. The kernel finishes the current write and then the procfs folder disappears:
$ cat /sys/class/block/sda1/inflight 0 1$ cat /sys/class/block/sda1/inflight 0 1$ cat /sys/class/block/sda1/inflight 0 0$ cat /sys/class/block/sda1/inflightcat: /sys/class/block/sda1/inflight: No such file or directory