[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190706040221.GC11665@mit.edu>
Date: Sat, 6 Jul 2019 00:02:21 -0400
From: "Theodore Ts'o" <tytso@....edu>
To: James Bottomley <James.Bottomley@...senPartnership.com>
Cc: Matthew Wilcox <willy@...radead.org>, linux-ext4@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
Parisc List <linux-parisc@...r.kernel.org>
Subject: Re: Question about ext4 testing: need to produce a high depth extent
tree to verify mapping code
On Fri, Jul 05, 2019 at 11:49:02AM -0700, James Bottomley wrote:
> > Create a series of 4kB files numbered sequentially, each 4kB in size
> > until you fill the partition. Delete the even numbered ones. Create
> > a 20MB file.
>
> Well, I know *how* to do it ... I was just hoping, in the interests of
> creative laziness, that someone else had produced a script for this
> before I had to ... particularly one which leaves more randomized gaps.
You mean something like this? It doesn't do randomized gaps, since
usually I'm trying to stress test block allocations.
#!/bin/bash
DEV=/dev/lambda/scratch
SIZE=10M
mke2fs -Fq -t ext4 -i 4096 -b 4096 $DEV $SIZE
max=$(dumpe2fs -h $DEV 2>/dev/null | awk -F: '/^Free blocks:/{print $2}')
mount $DEV /mnt
cd /mnt
mkdir -p d{0,1,2,3,4,5,6,7,8,9}/{0,1,2,3,4,5,6,7,8,9}
seq 1 $max | sed -E -e 's;^([[:digit:]])([[:digit:]])([[:digit:]]);d\1/\2/\3;' > /tmp/files$$
cat /tmp/files$$ | xargs -n 1 fallocate -l 4096 2>/dev/null
sed -ne 'p;n' < /tmp/files$$ | xargs rm -f
cd /
umount $DEV
rm /tmp/files$$
Powered by blists - more mailing lists