2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2009 Christoph Hellwig.
7 # Test out the xfs_repair -o force_geometry option on single-AG filesystems.
10 _begin_fstest repair auto quick
12 # Import common functions.
16 # real QA test starts here
19 # single AG will cause default xfs_repair to fail. This test is actually
20 # testing the special corner case option needed to repair a single AG fs.
21 _require_scratch_nocheck
24 # The AG size is limited to 1TB (or even less with historic xfsprogs),
25 # so chose a small enough filesystem to make sure we can actually create
26 # a single AG filesystem.
28 echo "== Creating single-AG filesystem =="
29 _scratch_mkfs_xfs -d agcount=1 -d size=$((1024*1024*1024)) >/dev/null 2>&1 \
30 || _fail "!!! failed to make filesystem with single AG"
32 echo "== Trying to repair it (should fail) =="
35 echo "== Trying to repair it with -o force_geometry =="
36 _scratch_xfs_repair -o force_geometry 2>&1 | _filter_repair