テスト用のあれこれ共用フォルダ
リビジョン | a4ea0132d37963293661e5814c52dc5526469027 (tree) |
---|---|
日時 | 2019-07-31 08:59:44 |
作者 | takemasa <suikan@user...> |
コミッター | takemasa |
Added script to fill up the disk by ff
@@ -0,0 +1,20 @@ | ||
1 | +#!/bin/bash | |
2 | + | |
3 | +# Fill up the 95% of the remained space of / by 0xFF. | |
4 | +# The file name is foo.txt. | |
5 | +# | |
6 | + | |
7 | + | |
8 | +# Install the pv application to display the status. | |
9 | +dpkg -l | awk '{ print $2 }' | grep -w pv > /dev/null | |
10 | +if [ $? = 1 ] ; then | |
11 | + sudo apt-get install -y pv | |
12 | +fi | |
13 | + | |
14 | +# Obtain the file size to create. Extract the available file system under / and times 0.95. | |
15 | +MEM=`df / | awk '!/Available/{print int($4*0.95)}'` | |
16 | +echo "Creating foo.txt ( $MEM kB )" | |
17 | + | |
18 | +# Create a large foo.txt which contains 0xFF. | |
19 | +dd if=/dev/zero count=$MEM bs=1024 |tr '\000' '\377' | pv -s ${MEM}k > foo.txt | |
20 | + |