LUKS create_encrypted_fs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

This is my first post to centos-docs.  I've read several months of
archives, but, this may be too trivial.

Re: http://wiki.centos.org/TipsAndTricks/EncryptedFilesystem/Scripts

This line:

FREE_SPACE=$(df -m $SECRET_PATH |grep / | awk '{ print $4 }')

gave me a problem due to line wrapping in df.  For example:

$ df -m /home/ja/verify/
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                        589333    289168    269746  52% /

So, $4 is 52% rather than 269746.

The '/dev/mapper/VolGroup00-LogVol00' term is from a fresh install,
so, perhaps others have this same name.

This change worked for me:
FREE_SPACE=$(${DF} -m ${PATH} | ${GREP} / \
			| ${TR} "\n" ' ' | ${TR} -s ' ' | ${CUT} -d' ' -f4)

Note the reformating onto 1 line with TR.  The remainder could be what
I have, the original awk statement, or whatever.  Thanks for your
consideration.

JIm


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Users]     [CentOS Virtualization]     [Linux Media]     [Asterisk]     [Netdev]     [X.org]     [Xfree86]     [Linux USB]     [Project Hail Cloud Computing]

  Powered by Linux