Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > 228c9c82b68f5d457c3ba51b71b98d40 > files > 5

e2fsprogs-1.45.5-1.mga7.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/'