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 +alignment_offset"
26 .
$TS_TOPDIR/functions.sh
29 ts_check_test_command
"$TS_CMD_FDISK"
33 # set global variable TS_DEVICE
34 ts_scsi_debug_init dev_size_mb
=50 sector_size
=512 physblk_exp
=3 lowest_aligned
=7
35 DEVNAME
=$
(basename $TS_DEVICE)
37 ts_log
"Create partitions"
38 $TS_CMD_FDISK ${TS_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF
73 ts_log
"Alignment offsets:"
74 cat /sys
/block
/${DEVNAME}/${DEVNAME}{1,2,3,4,5,6,7}/alignment_offset
>> $TS_OUTPUT 2>> $TS_ERRLOG
77 ts_fdisk_clean
$TS_DEVICE