From 94955dd0919e659c6607a86cea314f0e334a3cc9 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 6 Jun 2022 11:57:19 -0400 Subject: [PATCH] Bring down track number Use 2 heads with 4 sectors per track to get the track number down for reasonable images. Newer mtools forbids large track numbers. --- confluent_client/bin/dir2img | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/confluent_client/bin/dir2img b/confluent_client/bin/dir2img index abfc4b25..c2e99a21 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 // 512 + 1 + datasz = datasz // 4096 + 1 with open(image, 'wb') as imgfile: - imgfile.seek(datasz * 512 - 1) + imgfile.seek(datasz * 4096 - 1) imgfile.write(b'\x00') if label: subprocess.check_call(['mformat', '-i', image, '-v', label, '-r', '16', '-d', '1', '-t', str(datasz), - '-s', '1','-h', '1', '::']) + '-s', '4','-h', '2', '::']) else: subprocess.check_call(['mformat', '-i', image, '-r', '16', '-d', '1', '-t', - str(datasz), '-s', '1','-h', '1', '::']) + str(datasz), '-s', '4','-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 @@ -58,4 +58,4 @@ if __name__ == '__main__': label = None if len(sys.argv) > 3: label = sys.argv[3] - create_image(sys.argv[1], sys.argv[2], label) \ No newline at end of file + create_image(sys.argv[1], sys.argv[2], label)