Description

Some Junos installation images are larger than 4 GB, but FAT32 USB drives only support a maximum file size of "4 GB minus 1 byte".


Solution

To work around this limitation, we can split the large Junos image file into smaller chunks, copy them to the USB drive, and then reassemble the file on the Junos device.

 

 

1a:  MacOS / Linux - Splitting the file

 

We can use the built-in `split` command to divide the file into chunks smaller than 4 GB.

 

**Command**
split -b 3000M <bigfile.img> <prefix>

**Example**
split -b 3000M junos-install-media-usb.img junos_part_

 

This generates files such as:

junos_part_aa

junos_part_ab

junos_part_ac

 

 

1b:  Windows - Splitting the file using PowerShell

 

Windows does not provide a native file-splitting command, but you can use the following PowerShell script to split the image:

 

#powershell

$infile = "C:\path\junos.tgz"
$outprefix = "C:\path\junos_part_"
$chunksize = 2000MB

$stream = [System.IO.File]::OpenRead($infile)
$buffer = New-Object byte[] $chunksize
$i = 0

while (($read = $stream.Read($buffer, 0, $buffer.Length)) -gt 0) {
  $outfile = "{0}{1:D3}" -f $outprefix, $i
  $outstream = [System.IO.File]::OpenWrite($outfile)
  $outstream.Write($buffer, 0, $read)
  $outstream.Close()
  $i++
}

$stream.Close()

 

This produces files such as:

junos_part_000

junos_part_001

junos_part_002

 

 

2:  Copying split parts to the FAT32 USB drive

 

Copy all generated chunk files (`junos_part_aa`, `junos_part_ab`, `junos_part_000`, etc.) to the FAT32-formatted USB drive.

Each chunk will be smaller than 4 GB, so they can be stored without issue.

 

About how to mount the USB drive into the Junos device and copy files from USB to Junos, please refer to the KB12880 [juniper.net], the link is below.

 

https://supportportal.juniper.net/s/article/Junos-How-to-mount-a-USB-drive-on-EX-SRX-MX-QFX-Series-platforms-to-import-export-files

 

 

3:  Reassembling the file on the Junos device**

 

On the Junos device, use `cat` from the Unix shell to merge the file chunks back into a single image.

 

**Example**
(This following assumes all parts are in /mnt/da1/)

cat /mnt/da1/junos_part_* > /var/tmp/junos-install.img

 

 

4:  Verify the file integrity**

Compare the checksum with the original source MD5 to ensure the file was reconstructed correctly.

file checksum md5 /var/tmp/<<junos-install.img>>

 

Modification History

2025-12-02 : Article Created