On Thu, Jun 28, 2012 at 8:21 AM, Bernhard Voelker <mail@xxxxxxxxxxxxxxxxxxx> wrote: > On 06/28/2012 07:45 AM, Bernhard Voelker wrote: >> On 06/27/2012 11:33 PM, Sami Kerola wrote: >>> + " --inhuman display swap size in bytes in --show output\n" >> >> Isn't "--inhuman" a bit harsh? And wouldn't it be better to >> say what it does instead of what it does not? E.g. "--bytes"? Hi Berny, You are right. --inhuman does not sound at morning as good as near midnight. I s/inhuman/bytes/ change is done. > Ooh, my swap shrinked! ;-) > > $ ./lsblk /dev/sdb1 > NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT > sdb1 8:17 0 2G 0 disk [SWAP] > > $ ./swapon --show > NAME TYPE SIZE USED PRIO > /dev/sdb1 partition 2M 11836 0 > > $ ./swapon --show --inhuman > NAME TYPE SIZE USED PRIO > /dev/sdb1 partition 2104476 11836 0 > > I think that's in 1k-blocks, isn't it? Good catch. I made simple multiplier assignment but something is still wrong. sake@sake /home/src/util-linux ./swapon --show --bytes NAME TYPE SIZE USED PRIO /dev/dm-0 partition 7999582208 0 -1 sake@sake /home/src/util-linux ./lsblk -I 252 --bytes # why I did not get output? sake@sake /home/src/util-linux ./lsblk --bytes | grep 252 | `-cryptswap1 (dm-0) 252:0 0 7999586304 0 crypt [SWAP] Still differs? But which one is right? sake@sake /home/src/util-linux grep SwapTotal /proc/meminfo SwapTotal: 7812092 kB sake@sake /home/src/util-linux echo $((7812092 * 1024)) 7999582208 Did we came across lsblk --include but && size determination bug. > $ ./swapon --help | grep USED > USED bytes in use > > Isn't USED not also in blocks? This one I realized about ten minutes after I sent the pull request, and went to bed. Yes, used column should be human readable as well, which it is now. p.s. Please notice that the updates to my branch are pushed with force. -- Sami Kerola http://www.iki.fi/kerolasa/ -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html