How I can make file multiple of `segmentSize`
As far as I can understand (or better say: guess) what you mean, the optimum solution is a file size equal to the least common multiple of the given data size and the segment size: multiply your file N times:

\$ N = {segmentSize} / \operatorname{gcd}({dataSize}, \ {segmentSize}) \$

so you get a file of size

\$S = \operatorname{lcm}({dataSize}, \ {segmentSize})\$

which is \$M\$ full segments:

\$M = {dataSize} / \operatorname{gcd}({dataSize}, \ {segmentSize}) \$

For data size 48 million and segment size 12 Meg the greatest common divisor is 3,072 = 3*1024, so their least common multiple is:
\$196,608,000,000 = 2^{12} \times datasize = 5^6 \times segmentsize.\$