allow to change dm snapshot chunksize

Copying big amount of data results in bad performance as data is
written in chunks of 4kiB (8 * 512 bytes).

The default is not changed but can be overwritten.

Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
Christian Hesse 2015-01-02 11:23:44 +01:00 committed by Gerardo Exequiel Pozzi
parent 0b7a77cfc3
commit 156b9a6093

View File

@ -31,7 +31,7 @@ _mnt_fs() {
rw_dev=$(losetup --find --show "/run/archiso/cowspace/${cow_directory}/${img_name}.cow") rw_dev=$(losetup --find --show "/run/archiso/cowspace/${cow_directory}/${img_name}.cow")
echo ${rw_dev} >> /run/archiso/used_block_devices echo ${rw_dev} >> /run/archiso/used_block_devices
dmsetup create ${dm_snap_name} --table "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" dmsetup create ${dm_snap_name} --table "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} ${cow_chunksize}"
_mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w" _mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w"
echo $(readlink -f /dev/mapper/${dm_snap_name}) >> /run/archiso/used_block_devices echo $(readlink -f /dev/mapper/${dm_snap_name}) >> /run/archiso/used_block_devices
@ -112,6 +112,7 @@ run_hook() {
fi fi
[[ -z "${cow_directory}" ]] && cow_directory="persistent_${archisolabel}/${arch}" [[ -z "${cow_directory}" ]] && cow_directory="persistent_${archisolabel}/${arch}"
[[ -z "${cow_chunksize}" ]] && cow_chunksize="8"
# set mount handler for archiso # set mount handler for archiso
mount_handler="archiso_mount_handler" mount_handler="archiso_mount_handler"