4 # This file is part of util-linux.
6 # This file is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This file is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
19 # Test alignment for 512/512 disk *with* topology -- aligned to optimal
23 TS_TOPDIR
="${0%/*}/../.."
24 TS_DESC
="align 512/4K +MD"
26 .
$TS_TOPDIR/functions.sh
29 ts_check_test_command
"$TS_CMD_FDISK"
34 # set global variable TS_DEVICE
35 ts_scsi_debug_init dev_size_mb
=50 sector_size
=512 physblk_exp
=3
36 DEVNAME
=$
(basename $TS_DEVICE)
38 ts_log
"Create partitions"
39 $TS_CMD_FDISK ${TS_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF
56 ts_log
"Alignment offsets:"
57 cat /sys
/block
/${DEVNAME}/${DEVNAME}{1,2}/alignment_offset
>> $TS_OUTPUT 2>> $TS_ERRLOG
62 MD_DEVICE
=/dev
/${MD_DEVNAME}
64 mdadm
-q -S ${MD_DEVICE} &> /dev
/null
67 mdadm
-q --create ${MD_DEVICE} --metadata=0.90 --chunk=64 \
68 --level=0 --raid-devices=2 ${TS_DEVICE}1 ${TS_DEVICE}2 >> $TS_OUTPUT 2>> $TS_ERRLOG
71 ts_log
"Create partitions (MD)"
72 $TS_CMD_FDISK ${MD_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF
89 ts_log
"Alignment offsets (MD):"
90 cat /sys
/block
/${MD_DEVNAME}/${MD_DEVNAME}p{1,2}/alignment_offset
>> $TS_OUTPUT 2>> $TS_ERRLOG
92 mdadm
-q -S ${MD_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG
97 ts_fdisk_clean
$TS_DEVICE
98 ts_fdisk_clean
$MD_DEVICE