mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
Fix zconfig.sh non-optimal alignment
The recent zvol improvements have changed default suggested alignment for zvols from 512b (default) to 8k (zvol blocksize). Because of this the zconfig.sh tests which create paritions are now generating a warning about non-optimal alignments. This change updates the need zconfig.sh tests such that a partition will be properly aligned. In the process, it shifts from using the sfdisk utility to the parted utility to create partitions. It also moves the creation of labels, partitions, and filesystems in to generic functions in common.sh.in. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
@@ -307,6 +307,46 @@ destroy_loop_devices() {
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Create a device label.
|
||||
#
|
||||
label() {
|
||||
local DEVICE=$1
|
||||
local LABEL=$2
|
||||
|
||||
${PARTED} ${DEVICE} --script -- mklabel ${LABEL} || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Create a primary partition on a block device.
|
||||
#
|
||||
partition() {
|
||||
local DEVICE=$1
|
||||
local TYPE=$2
|
||||
local START=$3
|
||||
local END=$4
|
||||
|
||||
${PARTED} --align optimal ${DEVICE} --script -- \
|
||||
mkpart ${TYPE} ${START} ${END} || return 1
|
||||
udev_trigger
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Create a filesystem on the block device
|
||||
#
|
||||
format() {
|
||||
local DEVICE=$1
|
||||
local FSTYPE=$2
|
||||
|
||||
/sbin/mkfs.${FSTYPE} -q ${DEVICE} || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Check that the mdadm utilities are installed.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user