See if a long process is stuck or is it reading or writing to disk
##############################################

Imagine you have a process runing but it seems stuck, here is how to see waht its doing

 

Follow a running process (That might seem stuck)
Get its pid:

Follow it:

EXAMPLE : i notice reads that are happening with 4096 block size (thats 4k)

on a long you can see if its reading or writing and at what blocksize

# iostat -t 5

NOTE: -t just to show you time, its optional

Take “kB_read/s” divide by “tps” (transactions per second, io per second)

Should be the same, I get 4 (meaning 4k)

Thus in my situation btrfsck --fix-crc <dev>  looks stuck but its not
Do an experiment
——————–

copy a big file that will take some time to copy

You will notice that its copying at 32768 chunk

doing a

shows that its copying copying at 32k

you will notice that its copying at 512 byte block size just as expected

CONCLUTION: copy is like a dd with a blocksize set to 32k

Leave a Reply

Your email address will not be published. Required fields are marked *