Skip to main content

Based on the other answers I made this over-bloated one-liner that tracks summary progress as well as device-specific progress:

# Create the command function watch-syncwatchSync() { watch -n1 'egrep'grep -E "(Dirty|Write)" /proc/meminfo; echo; ls /sys/block/ | while read device; do awk "{ print \"$device: \" \$9 }" "/sys/block/$device/stat"; done' } # Run the command watch-syncwatchSync 

The output looks like this:

Dirty: 848956 kB Writeback: 125948 kB WritebackTmp: 0 kB dm-0: 0 dm-1: 0 loop0: 0 loop1: 0 loop2: 0 loop3: 0 loop4: 0 loop5: 0 loop6: 0 loop7: 0 nvme0n1: 0 sda: 0 sdb: 0 sdc: 124 

The above tells me that 1) I have a few 100,000 kBytes that need writing, and 2) the device being written to is sdc. Sync is complete when, in this case, sdc and Writeback hit zero (this will happen at the same time).

Based on the other answers I made this over-bloated one-liner that tracks summary progress as well as device-specific progress:

# Create the command function watch-sync() { watch -n1 'egrep "(Dirty|Write)" /proc/meminfo; echo; ls /sys/block/ | while read device; do awk "{ print \"$device: \" \$9 }" "/sys/block/$device/stat"; done' } # Run the command watch-sync 

The output looks like this:

Dirty: 848956 kB Writeback: 125948 kB WritebackTmp: 0 kB dm-0: 0 dm-1: 0 loop0: 0 loop1: 0 loop2: 0 loop3: 0 loop4: 0 loop5: 0 loop6: 0 loop7: 0 nvme0n1: 0 sda: 0 sdb: 0 sdc: 124 

The above tells me that 1) I have a few 100,000 kBytes that need writing, and 2) the device being written to is sdc. Sync is complete when, in this case, sdc and Writeback hit zero (this will happen at the same time).

Based on the other answers I made this over-bloated one-liner that tracks summary progress as well as device-specific progress:

# Create the command watchSync() { watch -n1 'grep -E "(Dirty|Write)" /proc/meminfo; echo; ls /sys/block/ | while read device; do awk "{ print \"$device: \" \$9 }" "/sys/block/$device/stat"; done' } # Run the command watchSync 

The output looks like this:

Dirty: 848956 kB Writeback: 125948 kB WritebackTmp: 0 kB dm-0: 0 dm-1: 0 loop0: 0 loop1: 0 loop2: 0 loop3: 0 loop4: 0 loop5: 0 loop6: 0 loop7: 0 nvme0n1: 0 sda: 0 sdb: 0 sdc: 124 

The above tells me that 1) I have a few 100,000 kBytes that need writing, and 2) the device being written to is sdc. Sync is complete when, in this case, sdc and Writeback hit zero (this will happen at the same time).

deleted 1 character in body
Source Link
aggregate1166877
  • 899
  • 2
  • 11
  • 21

Based oneon the other answers I made this over-bloated one-liner that tracks summary progress as well as device-specific progress:

# Create the command function watch-sync() { watch -n1 'egrep "(Dirty|Write)" /proc/meminfo; echo; ls /sys/block/ | while read device; do awk "{ print \"$device: \" \$9 }" "/sys/block/$device/stat"; done' } # Run the command watch-sync 

The output looks like this:

Dirty: 848956 kB Writeback: 125948 kB WritebackTmp: 0 kB dm-0: 0 dm-1: 0 loop0: 0 loop1: 0 loop2: 0 loop3: 0 loop4: 0 loop5: 0 loop6: 0 loop7: 0 nvme0n1: 0 sda: 0 sdb: 0 sdc: 124 

The above tells me that 1) I have a few 100,000 kBytes that need writing, and 2) the device being written to is sdc. Sync is complete when, in this case, sdc and Writeback hit zero (this will happen at the same time).

Based one the other answers I made this over-bloated one-liner that tracks summary progress as well as device-specific progress:

# Create the command function watch-sync() { watch -n1 'egrep "(Dirty|Write)" /proc/meminfo; echo; ls /sys/block/ | while read device; do awk "{ print \"$device: \" \$9 }" "/sys/block/$device/stat"; done' } # Run the command watch-sync 

The output looks like this:

Dirty: 848956 kB Writeback: 125948 kB WritebackTmp: 0 kB dm-0: 0 dm-1: 0 loop0: 0 loop1: 0 loop2: 0 loop3: 0 loop4: 0 loop5: 0 loop6: 0 loop7: 0 nvme0n1: 0 sda: 0 sdb: 0 sdc: 124 

The above tells me that 1) I have a few 100,000 kBytes that need writing, and 2) the device being written to is sdc. Sync is complete when, in this case, sdc and Writeback hit zero (this will happen at the same time).

Based on the other answers I made this over-bloated one-liner that tracks summary progress as well as device-specific progress:

# Create the command function watch-sync() { watch -n1 'egrep "(Dirty|Write)" /proc/meminfo; echo; ls /sys/block/ | while read device; do awk "{ print \"$device: \" \$9 }" "/sys/block/$device/stat"; done' } # Run the command watch-sync 

The output looks like this:

Dirty: 848956 kB Writeback: 125948 kB WritebackTmp: 0 kB dm-0: 0 dm-1: 0 loop0: 0 loop1: 0 loop2: 0 loop3: 0 loop4: 0 loop5: 0 loop6: 0 loop7: 0 nvme0n1: 0 sda: 0 sdb: 0 sdc: 124 

The above tells me that 1) I have a few 100,000 kBytes that need writing, and 2) the device being written to is sdc. Sync is complete when, in this case, sdc and Writeback hit zero (this will happen at the same time).

Source Link
aggregate1166877
  • 899
  • 2
  • 11
  • 21

Based one the other answers I made this over-bloated one-liner that tracks summary progress as well as device-specific progress:

# Create the command function watch-sync() { watch -n1 'egrep "(Dirty|Write)" /proc/meminfo; echo; ls /sys/block/ | while read device; do awk "{ print \"$device: \" \$9 }" "/sys/block/$device/stat"; done' } # Run the command watch-sync 

The output looks like this:

Dirty: 848956 kB Writeback: 125948 kB WritebackTmp: 0 kB dm-0: 0 dm-1: 0 loop0: 0 loop1: 0 loop2: 0 loop3: 0 loop4: 0 loop5: 0 loop6: 0 loop7: 0 nvme0n1: 0 sda: 0 sdb: 0 sdc: 124 

The above tells me that 1) I have a few 100,000 kBytes that need writing, and 2) the device being written to is sdc. Sync is complete when, in this case, sdc and Writeback hit zero (this will happen at the same time).