2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-21 17:11:58 +00:00

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.
This commit is contained in:
Jarrod Johnson 2023-01-17 10:02:51 -05:00
parent 40c3f2da53
commit 0929f059e2

View File

@ -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