# Create a new filesystem using 4k blocks and mount it webber:/# mke2fs -b 4096 /dev/sdc1 30000 webber:/# mount /dev/sdc1 webber:/# cd /mnt/tmp # Make some temp directories, and small and large files to play with webber:/mnt/tmp# mkdir dir1 dir2 dir3 dir4 dir5 dir6 dir7 dir8 webber:/mnt/tmp/dir1# for file in rr ss uu vv ww xx yy ; > for i in 0 1 2 3 4 5 6 7 8 9 ; do dd if=/dev/urandom of=dir1/$file$i bs=1k count=10 > done webber:/mnt/tmp/dir1# for i in 0 1 2 3 4 5 6 7 8 9 ; do dd if=/dev/zero of=dir1/zz$i bs=1k count=4k; done webber:/mnt/tmp# df -k . Filesystem 1024-blocks Used Available Capacity Mounted on /dev/sdc1 119856 41884 71972 37% /mnt/tmp webber:/mnt/tmp# ls -l dir1 total 41840 -rw-r--r-- 1 root root 10240 Sep 2 23:27 ss0 -rw-r--r-- 1 root root 10240 Sep 2 23:27 ss1 -rw-r--r-- 1 root root 10240 Sep 2 23:27 ss2 -rw-r--r-- 1 root root 10240 Sep 2 23:27 ss3 -rw-r--r-- 1 root root 10240 Sep 2 23:27 ss4 -rw-r--r-- 1 root root 10240 Sep 2 23:27 ss5 -rw-r--r-- 1 root root 10240 Sep 2 23:27 ss6 -rw-r--r-- 1 root root 10240 Sep 2 23:27 ss7 -rw-r--r-- 1 root root 10240 Sep 2 23:27 ss8 -rw-r--r-- 1 root root 10240 Sep 2 23:27 ss9 -rw-r--r-- 1 root root 10240 Sep 2 23:27 tt0 -rw-r--r-- 1 root root 10240 Sep 2 23:27 tt1 -rw-r--r-- 1 root root 10240 Sep 2 23:27 tt2 -rw-r--r-- 1 root root 10240 Sep 2 23:27 tt3 -rw-r--r-- 1 root root 10240 Sep 2 23:27 tt4 -rw-r--r-- 1 root root 10240 Sep 2 23:27 tt5 -rw-r--r-- 1 root root 10240 Sep 2 23:27 tt6 -rw-r--r-- 1 root root 10240 Sep 2 23:27 tt7 -rw-r--r-- 1 root root 10240 Sep 2 23:27 tt8 -rw-r--r-- 1 root root 10240 Sep 2 23:27 tt9 -rw-r--r-- 1 root root 10240 Sep 2 23:28 uu0 -rw-r--r-- 1 root root 10240 Sep 2 23:28 uu1 -rw-r--r-- 1 root root 10240 Sep 2 23:28 uu2 -rw-r--r-- 1 root root 10240 Sep 2 23:28 uu3 -rw-r--r-- 1 root root 10240 Sep 2 23:28 uu4 -rw-r--r-- 1 root root 10240 Sep 2 23:28 uu5 -rw-r--r-- 1 root root 10240 Sep 2 23:28 uu6 -rw-r--r-- 1 root root 10240 Sep 2 23:28 uu7 -rw-r--r-- 1 root root 10240 Sep 2 23:28 uu8 -rw-r--r-- 1 root root 10240 Sep 2 23:28 uu9 -rw-r--r-- 1 root root 10240 Sep 2 23:28 vv0 -rw-r--r-- 1 root root 10240 Sep 2 23:28 vv1 -rw-r--r-- 1 root root 10240 Sep 2 23:28 vv2 -rw-r--r-- 1 root root 10240 Sep 2 23:28 vv3 -rw-r--r-- 1 root root 10240 Sep 2 23:28 vv4 -rw-r--r-- 1 root root 10240 Sep 2 23:28 vv5 -rw-r--r-- 1 root root 10240 Sep 2 23:28 vv6 -rw-r--r-- 1 root root 10240 Sep 2 23:28 vv7 -rw-r--r-- 1 root root 10240 Sep 2 23:28 vv8 -rw-r--r-- 1 root root 10240 Sep 2 23:28 vv9 -rw-r--r-- 1 root root 10240 Sep 2 23:28 ww0 -rw-r--r-- 1 root root 10240 Sep 2 23:28 ww1 -rw-r--r-- 1 root root 10240 Sep 2 23:28 ww2 -rw-r--r-- 1 root root 10240 Sep 2 23:28 ww3 -rw-r--r-- 1 root root 10240 Sep 2 23:28 ww4 -rw-r--r-- 1 root root 10240 Sep 2 23:28 ww5 -rw-r--r-- 1 root root 10240 Sep 2 23:28 ww6 -rw-r--r-- 1 root root 10240 Sep 2 23:28 ww7 -rw-r--r-- 1 root root 10240 Sep 2 23:28 ww8 -rw-r--r-- 1 root root 10240 Sep 2 23:28 ww9 -rw-r--r-- 1 root root 10240 Sep 2 23:28 xx0 -rw-r--r-- 1 root root 10240 Sep 2 23:28 xx1 -rw-r--r-- 1 root root 10240 Sep 2 23:28 xx2 -rw-r--r-- 1 root root 10240 Sep 2 23:28 xx3 -rw-r--r-- 1 root root 10240 Sep 2 23:28 xx4 -rw-r--r-- 1 root root 10240 Sep 2 23:28 xx5 -rw-r--r-- 1 root root 10240 Sep 2 23:28 xx6 -rw-r--r-- 1 root root 10240 Sep 2 23:28 xx7 -rw-r--r-- 1 root root 10240 Sep 2 23:28 xx8 -rw-r--r-- 1 root root 10240 Sep 2 23:28 xx9 -rw-r--r-- 1 root root 10240 Sep 2 23:28 yy0 -rw-r--r-- 1 root root 10240 Sep 2 23:28 yy1 -rw-r--r-- 1 root root 10240 Sep 2 23:28 yy2 -rw-r--r-- 1 root root 10240 Sep 2 23:28 yy3 -rw-r--r-- 1 root root 10240 Sep 2 23:28 yy4 -rw-r--r-- 1 root root 10240 Sep 2 23:28 yy5 -rw-r--r-- 1 root root 10240 Sep 2 23:28 yy6 -rw-r--r-- 1 root root 10240 Sep 2 23:28 yy7 -rw-r--r-- 1 root root 10240 Sep 2 23:28 yy8 -rw-r--r-- 1 root root 10240 Sep 2 23:28 yy9 -rw-r--r-- 1 root root 4194304 Sep 2 23:29 zz0 -rw-r--r-- 1 root root 4194304 Sep 2 23:29 zz1 -rw-r--r-- 1 root root 4194304 Sep 2 23:29 zz2 -rw-r--r-- 1 root root 4194304 Sep 2 23:29 zz3 -rw-r--r-- 1 root root 4194304 Sep 2 23:29 zz4 -rw-r--r-- 1 root root 4194304 Sep 2 23:29 zz5 -rw-r--r-- 1 root root 4194304 Sep 2 23:29 zz6 -rw-r--r-- 1 root root 4194304 Sep 2 23:29 zz7 -rw-r--r-- 1 root root 4194304 Sep 2 23:29 zz8 -rw-r--r-- 1 root root 4194304 Sep 2 23:29 zz9 # Check filesystem info for posterity webber:/# dumpe2fs /dev/sdc1 dumpe2fs 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09 Filesystem volume name: Last mounted on: Filesystem UUID: 023f5697-a525-48cd-a643-0a39defecb65 Filesystem magic number: 0xEF53 Filesystem revision #: 0 (original) Filesystem features: (none) Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 1024 Block count: 30000 Maximum blocks: 4194304 Reserved block count: 1500 Free blocks: 19493 Free inodes: 927 First block: 0 Block size: 4096 Fragment size: 4096 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 1024 Inode blocks per group: 32 Last mount time: Thu Sep 2 23:30:20 1999 Last write time: Thu Sep 2 23:29:25 1999 Mount count: 1 Maximum mount count: 20 Last checked: Thu Sep 2 23:29:25 1999 Check interval: 15552000 (6 months) Next check after: Tue Feb 29 22:29:25 2000 Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) Group 0: (Blocks 0 -- 29999) Block bitmap at 2 (+2), Inode bitmap at 3 (+3) Inode table at 4 (+4) 19493 free blocks, 927 free inodes, 8 directories Free blocks: 10503-16442, 16447-29999 Free inodes: 22-29, 34-47, 49-50, 122-1024 # Start a bunch of heavy filesystem activity in the background webber:/mnt/tmp# cp dir1/* dir2 & cp dir1/* dir3 & cp dir1/* dir4 & [1] 12959 [2] 12960 [3] 12961 # Resize the filesystem while it's being used, as we will have 4x 40MB = 160MB # of files when copy is done, but the filesystem was only 120MB in size webber:/mnt/tmp# /usr/src/ext2resize-1.1.4a/src/ext2online /dev/sdc1 384M ext2online v0.21 - 1999/08/28 for EXT2FS 0.5b /usr/src/ext2resize-1.1.4a/src/ext2online: resize to 98304 blocks webber:/mnt/tmp# df -k . Filesystem 1024-blocks Used Available Capacity Mounted on /dev/sdc1 392784 133028 240100 36% /mnt/tmp webber:/mnt/tmp# jobs [1] Running cp dir1/* dir2 & [2]- Running cp dir1/* dir3 & [3]+ Running cp dir1/* dir4 & webber:/mnt/tmp# /usr/src/ext2resize-1.1.4a/src/ext2online /dev/sdc1 512M ext2online v0.21 - 1999/08/28 for EXT2FS 0.5b /usr/src/ext2resize-1.1.4a/src/ext2online: resize to 131072 blocks webber:/mnt/tmp# df -k . Filesystem 1024-blocks Used Available Capacity Mounted on /dev/sdc1 523712 167404 330100 34% /mnt/tmp [1] Done cp dir1/* dir2 [2]- Done cp dir1/* dir3 [3]+ Done cp dir1/* dir4 webber:/mnt/tmp# diff dir1 dir2 & diff dir1 dir3 & diff dir1 dir4 & [1] 13113 [2] 13114 [3] 13115 webber:/mnt/tmp# [1] Done diff dir1 dir2 [2]- Done diff dir1 dir3 [3]+ Done diff dir1 dir4 # That means that the 40MB was copied in parallel (2 CPU SMP Linux) # without any errors 3 times. Being a sucker for punishment, we can copy # some more using 4 different sources and again resize the file system # to the full 1G disk size, just to make sure it is all working. webber:/mnt/tmp# cp dir1/* dir5 & cp dir2/* dir6 & cp dir3/* dir7 & cp dir4/* di r8 & [1] 12978 [2] 12979 [3] 12980 [4] 12981 webber:/mnt/tmp# /usr/src/ext2resize-1.1.4a/src/ext2online /dev/sdc1 ext2online v0.21 - 1999/08/28 for EXT2FS 0.5b /usr/src/ext2resize-1.1.4a/src/ext2online: resize to 256764 blocks webber:/mnt/tmp# df -k . Filesystem 1024-blocks Used Available Capacity Mounted on /dev/sdc1 1025904 334772 639796 34% /mnt/tmp [1] Done cp dir1/* dir5 [2] Done cp dir2/* dir6 [3]- Done cp dir3/* dir7 [4]+ Done cp dir4/* dir8 webber:/mnt/tmp# diff dir1 dir5 & diff dir2 dir6 & diff dir3 dir7 & diff dir4 dir8 & [1] 13121 [2] 13122 [3] 13123 [4] 13124 webber:/mnt/tmp# cd / [1] Done diff dir1 dir5 [2] Done diff dir2 dir6 [3]- Done diff dir3 dir7 [4]+ Done diff dir4 dir8 webber:/# umount /mnt/tmp webber:/# e2fsck -f /dev/sdc1 e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09 Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/sdc1: 659/8192 files (7.1% non-contiguous), 83981/256764 blocks # Again, the files copied 4 times in parallel from 4 different source # directories and no errors while the filesystem was resized. No problemo! # # Cheers, Andreas