Sophie

Sophie

distrib > Mageia > 8 > x86_64 > by-pkgid > 9f2dc8ff937d1159ab1bd9ba2c84cea7 > files > 6

e2fsprogs-1.45.6-6.mga8.src.rpm

#!/bin/sh

if [ -z "$1" ]
then
  echo Specify a device.
  exit 1
fi

inode=`dumpe2fs $1 2> /dev/null | grep "Journal inode:" | \
 sed -e 's/^.*\([0-9][0-9]*\).*$/\1/' `

if [ -z "$inode" ]
then
  echo $1 does not have a journal inode.
  exit 1
fi

echo "stat <$inode>" | debugfs $1 2> /dev/null | grep "User:.*Size:" | sed 's/^.*Size:[^0-9]*\([0-9][0-9]*\).*$/\1/'