Sungju's Slow Life

Personal journal


How to check LVM usage history

If your lvm storage has some problem, you can dump it with the following command.

$ dd if= of=lvm_head.out bs=100M count=1

$ strings lvm_head.out > dump.txt

And make the following awk script (lvm_history.awk) to check the history.

BEGIN { 
    new = 1 
    pecount = 0
} 

{
    if ($1 == "pe_count")
        pecount = $3

    if ($1 == "seqno") {
        printf "seqno = %s : total extent_count = ", $3
        sum = 0
    } else {
        if ($1 == "extent_count")
            sum += $3
    }

    if ($2 == "Generated") {
        print sum,", free=",pecount-sum,"at:",$8,$9,$10,$11,$12
    }
}

http://pagead2.googlesyndication.com/pagead/show_ads.js

If you run this as below, it will show you how filesystem usages changed.

$ awk -f lvm_history.awk dump.txt


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: