From 0929f059e23a43bd5a67e5c8b188286dba53e680 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 17 Jan 2023 10:02:51 -0500 Subject: [PATCH] Increase track size in dir2img Larger images still run afoul of track limits in mtools. Make tracks 4 times as big to lower number of required tracks. --- confluent_client/bin/dir2img | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/confluent_client/bin/dir2img b/confluent_client/bin/dir2img index c2e99a21..0100cf20 100644 --- a/confluent_client/bin/dir2img +++ b/confluent_client/bin/dir2img @@ -21,17 +21,17 @@ def create_image(directory, image, label=None): currsz = (currsz // 512 +1) * 512 datasz += currsz datasz += ents * 32768 - datasz = datasz // 4096 + 1 + datasz = datasz // 16384 + 1 with open(image, 'wb') as imgfile: - imgfile.seek(datasz * 4096 - 1) + imgfile.seek(datasz * 16384 - 1) imgfile.write(b'\x00') if label: subprocess.check_call(['mformat', '-i', image, '-v', label, '-r', '16', '-d', '1', '-t', str(datasz), - '-s', '4','-h', '2', '::']) + '-s', '16','-h', '2', '::']) else: subprocess.check_call(['mformat', '-i', image, '-r', '16', '-d', '1', '-t', - str(datasz), '-s', '4','-h', '2', '::']) + str(datasz), '-s', '16','-h', '2', '::']) # Some clustered filesystems will have the lock from mformat # linger after close (mformat doesn't unlock) # do a blocking wait for shared lock and then explicitly