]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blob - util/gen-sample-fs
Add utility script which generates a small sample file system
[thirdparty/e2fsprogs.git] / util / gen-sample-fs
1 #!/bin/bash
2
3 MNT=/mnt
4 FS=/tmp/foo.img
5
6 cp /dev/null $FS
7 mke2fs -t ext4 -O inline_data -I 256 -b 4096 $FS 256
8 mount -t ext4 $FS $MNT
9 ln -s symlink_data $MNT/symlink
10 for i in 30 70 500 1023 1024 1500; do
11 ln -s /$(perl -e "print 'x' x $i;") $MNT/l_$i
12 done
13 touch $MNT/acl
14 setfacl -m u:daemon:r $MNT/acl
15 setfacl -m u:bin:rx $MNT/acl
16 setfacl -m g:mail:rw $MNT/acl
17 setfacl -m g:daemon:r $MNT/acl
18 touch $MNT/simple_acl
19 setfacl -m u:daemon:r $MNT/simple_acl
20 touch $MNT/xattr
21 attr -s foo -V bar $MNT/xattr
22 echo -e "one\n\ttwo" | attr -s quux $MNT/xattr
23 echo -e "abc\001\002\003" | attr -s def $MNT/xattr
24 echo file_data > $MNT/small_inline
25 a="I am a very model of a modern major general;"
26 a="$a I've information vegetable, animal and mineral"
27 echo $a > $MNT/big_inline
28 umount $MNT
29
30