Thursday, 18 April 2013

Quickly estimating mksysb size on AIX

I'm not a fan of large mksysb's. They cause slow backups, slow restores, and if you ever need to make a NIM SPOT from a mksysb I've found that it takes exponentially longer for larger size mksysbs.

And a lot of times mksysbs are unnecessarily large just due to junk being left in the rootvg that isn't needed any more like old versions of AIX upgrades. The size of the mksysb is basically the size of the used space of the mounted filesystems in AIX. To quickly estimate how large the mksysb will be you can use this one-liner:
df -tk `lsvgfs rootvg` | awk '{total+=$3}\
 END {printf "Estimated mksysb size: %d bytes, %.2f GB\n", total*1024, total/1024/1024}'
The output looks something like this:
Estimated mksysb size: 8540651520 bytes, 7.95 GB
This is just a quick estimate. It doesn't take in to account if you have an mksysb exclude list file or if you are using mksysb compression (which I have found generally causes problems anyway, just specify the "-p" option on the mksysb command to disable it)

0 blogger-disqus:

Post a Comment