Skip to content

Commit cea9634

Browse files
committed
add mke2fs options to speed up initialization for big disks
1 parent ec3885a commit cea9634

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/splunkconf-cloud-recovery.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,10 @@ exec >> /var/log/splunkconf-cloud-recovery-debug.log 2>&1
262262
# 20240910 add var for arch and warn if arch mismatch
263263
# 20240915 up to 9.3.1
264264
# 20240917 add splunktargetbinary=sc4s logic
265-
# 20242020 add splunkswapmemode tag to control swapme activation and mode
265+
# 20241020 add splunkswapmemode tag to control swapme activation and mode
266+
# 20241029 add mke2fs options to speed up initialization for big disks
266267

267-
VERSION="20242020a"
268+
VERSION="20241029a"
268269

269270
# dont break script on error as we rely on tests for this
270271
set +e
@@ -455,6 +456,9 @@ get_packages () {
455456

456457
setup_disk () {
457458
DEVNUM=1
459+
MKOPTIONS=" -m 0 -T largefile4 -E lazy_itable_init"
460+
# for ephemeral , we can add sparse_super with no drawback"
461+
MKOPTIONSEPHEMERAL="-O sparse_super -m 0 -T largefile4 -E lazy_itable_init"
458462
if [[ "$splunkenableunifiedpartition" == "true" ]]; then
459463
echo "Usimg unified partition mode"
460464
MOUNTPOINT="$SPLUNK_HOME"
@@ -504,7 +508,7 @@ setup_disk () {
504508
vgdisplay >> /var/log/splunkconf-cloud-recovery-info.log
505509
lvdisplay >> /var/log/splunkconf-cloud-recovery-info.log
506510
# note mkfs wont format if the FS is already mounted -> no need to check here
507-
mkfs.ext4 -L storage1 /dev/vgsplunkstorage1/lvsplunkstorage1 >> /var/log/splunkconf-cloud-recovery-info.log
511+
mkfs.ext4 ${MKOPTIONS} -L storage1 /dev/vgsplunkstorage1/lvsplunkstorage1 >> /var/log/splunkconf-cloud-recovery-info.log
508512
mkdir -p $MOUNTPOINT
509513
RES=`grep $MOUNTPOINT /etc/fstab`
510514
#echo " debug F=$RES."
@@ -547,7 +551,7 @@ setup_disk () {
547551
vgdisplay >> /var/log/splunkconf-cloud-recovery-info.log
548552
lvdisplay >> /var/log/splunkconf-cloud-recovery-info.log
549553
# note mkfs wont format if the FS is already mounted -> no need to check here
550-
mkfs.ext4 -L ephemeral1 /dev/vgsplunkephemeral1/lvsplunkephemeral1 >> /var/log/splunkconf-cloud-recovery-info.log
554+
mkfs.ext4 ${MKOPTIONSEPHEMERAL} -L ephemeral1 /dev/vgsplunkephemeral1/lvsplunkephemeral1 >> /var/log/splunkconf-cloud-recovery-info.log
551555
mkdir -p $MOUNTPOINT
552556
RES=`grep $MOUNTPOINT /etc/fstab`
553557
#echo " debug F=$RES."

0 commit comments

Comments
 (0)