Courseiva
JNCIA-JUNOSChapter 6 of 15Objective 2.4

Junos File Management and Software Upgrades

Junos file management is the process of organising, storing, and verifying all the critical files on a Juniper router or switch, ensuring you can keep the device healthy and up-to-date. Software upgrades are the controlled, safe methods to update the Junos operating system to get new features, fix security holes, or improve performance. For your JNCIA-JUNOS exam, mastering these tasks is crucial because you will be tested on the exact commands and steps to manage files and perform a successful upgrade.

12 min read
Intermediate
Updated Jul 23, 2026
Editorial oversight: Johnson Ajibi· Security Systems Architect · MSc IT Security · IEEE Senior Member

A simple way to picture Junos File Management and Software Upgrades

The Moving House Box System Analogy

First, you decide to move house, which leads you to realise you need a system to keep all your belongings safe and organised during the move.

You have a cardboard box (the storage device or directory in Junos). Inside, you place your important documents (configuration files), precious photos (log files), and small electronics (J-Web or software images). You label each box clearly, like 'Kitchen' or 'Bedroom', so you can find things later. Now, imagine you have a favourite vase that is fragile. You decide to pack it carefully in bubble wrap and put it in a sturdy, special box labelled 'Fragile: Living Room'. In Junos, this is like moving a software image file into a specific directory with a clear filename. To make sure it arrives safely, you might even take a picture of the packed box (create a hash or checksum of the file) to verify it wasn't damaged during the move. Finally, you unpack the vase at your new house and place it on the shelf where it belongs. This is the upgrade process: you 'unpack' the new Junos image onto the router's hard drive and then boot from it. If you ever need to go back to the old arrangement, you have the old boxes stored in the garage (the backup software partition). This whole moving-house-box system is a precise analogy for how Junos manages its files and performs software upgrades.

How It Actually Works

At its heart, Junos is just software that runs on a router, and like any computer, it has a file system. This file system is a structured way to store data, organised into directories (like folders) and files. Think of the file system as the router's hard drive. The main directory you will work with is '/var/tmp'. This is a temporary workspace where you typically copy new software files or configuration files during an upgrade or maintenance. Another important directory is '/config', which holds the active configuration file, 'juniper.conf.gz' (a compressed, read-only copy of the running config).

When you manage files in Junos, the primary tool is the command-line interface (CLI). You use commands like 'file list' to see what files are where, 'file copy' to move files between directories or to a remote server, 'file delete' to remove unwanted files, and 'file show' to display the contents of a text file. The file command is used for file operations. For example, 'file list /var/tmp' will show you every file in the temporary directory. If you have a new software image, you would use 'file copy ftp://192.168.1.100/junos-image.tgz /var/tmp/' to download it.

Now, let's talk about the two main storage partitions on a Juniper device. When you install a new Junos version, the device has two logical spaces where the operating system (OS) lives: a 'current' partition and a 'backup' partition. You can think of these like two separate rooms in a house. You live in one room (the current OS), while the other room is empty, waiting for new furniture. When you upgrade, you install the new OS into the backup partition. You do not touch the current room. Then, you tell the router to boot from the backup partition on the next restart. After the router reboots, the backup partition becomes the current partition. The old current partition is now the backup partition. This is called a 'dual-partition' system. It provides a safety net: if the upgrade fails for some reason, the router can still boot from the untouched, old partition. If the upgrade works, you can confirm it and later, if you want, you can delete the old partition to free up space.

The upgrade process itself follows a specific sequence of steps. First, you must obtain the correct version of the Junos software image. This is a single, compressed file (usually with the extension '.tgz' or '.tar.gz') that contains the entire operating system. You must download the correct version for your specific router model and hardware. Second, you copy this file to the router, typically using FTP, HTTP, or SCP (a secure copy protocol). You place it in the '/var/tmp' directory. Third, you install the software using the command: 'request system software add <file path>'. For example: 'request system software add /var/tmp/junos-21.2R2.tgz'. This command does a lot: it verifies the file's digital signature (to ensure it hasn't been tampered with), checks for compatibility, and then unpacks the new OS into the backup partition. The router does not reboot automatically. Fourth, you validate the installation by checking the output of 'show system storage' or 'show system software' to see that the new package is listed. Fifth, you schedule a reboot using 'request system reboot'. The router will then restart and boot from the newly installed partition. After the reboot, you log in and check the version with 'show version' to confirm the upgrade was successful.

Why does this matter? Because file management and upgrades are routine tasks for any network administrator. You need to know how to save and load configuration files, how to back up the current OS, and how to move log files for analysis. Without this knowledge, a simple operation like restoring a backup configuration can become a crisis. The exam tests your ability to apply the correct commands and understand the sequence of operations. The exam also tests your understanding of file operations like 'file copy', 'file delete', 'file list', and 'file rename'. You must know the difference between copying a file to the router and installing it. You must know what happens during a reboot. This foundational knowledge is not just for the exam; it is the daily work of a Juniper engineer.

Flowchart showing the step-by-step process of upgrading Junos OS from download to verification.

Walk-Through

1

1. Check the current version

Run 'show version' to see the currently running Junos OS version. This tells you which software you are upgrading from and ensures you select the correct target version.

2

2. Obtain the new software image

Download the correct Junos image for your specific hardware model and platform from Juniper's support site. The file typically ends in '.tgz' or '.tar.gz'. Store it on a local file server accessible via FTP, HTTP, or SCP.

3

3. Copy the image to the router

Use the 'file copy' command to transfer the image file from your server to '/var/tmp' on the router. For example: 'file copy ftp://server/junos-image.tgz /var/tmp/'. Verify the file arrived with 'file list /var/tmp/'.

4

4. Validate and install the software

First, optionally validate the image with 'request system software validate /var/tmp/junos-image.tgz'. Then install it with 'request system software add /var/tmp/junos-image.tgz'. This command unpacks the new OS into the backup partition.

5

5. Reboot the router

After installation, schedule a reboot using 'request system reboot'. The router will restart and boot from the newly installed backup partition, which becomes the current partition.

6

6. Verify the upgrade

After the router reboots, log in and run 'show version' again. The output should display the new version number. Check that all interfaces and services are working correctly.

7

7. Clean up old files (optional)

If the new version is stable and you want to free disk space, delete the old software package using 'request system software delete <old-version-name>'. You can see old versions with 'show system software'.

What This Looks Like on the Job

Imagine you work as a junior network technician at a medium-sized company called 'NetFlow Inc.' Your company has a Juniper SRX firewall that handles all internet traffic. It has been running for two years on an old version of Junos, and a critical security vulnerability has been announced for that version. Your manager asks you to upgrade the firewall to the latest stable release. This is your first real-world upgrade.

Here is what you do, step by step: First, you log into the firewall via SSH. You check the current version with 'show version'. It shows '21.1R1'. Your manager gives you the new file, 'junos-21.4R3.tgz', hosted on a company file server at IP address 10.10.10.10. You then check available disk space with 'show system storage'. You need enough space to hold the new image, which is about 200 MB. The output shows that '/var/tmp' has 500 MB free, so you are good. Next, you copy the file to the firewall using FTP: 'file copy ftp://10.10.10.10/junos-21.4R3.tgz /var/tmp/'. You enter the username and password when prompted. This step is where 'file management' becomes real: you are moving data from one storage to another.

After the file is copied, you verify it is there: 'file list /var/tmp/ | grep tgz'. You see the file. Now you install the software: 'request system software add /var/tmp/junos-21.4R3.tgz'. The CLI shows messages: 'Validating...', 'Checking compatibility...', 'Adding package...'. It takes a couple of minutes. After it finishes, you check again: 'show system software'. You see the new version listed as a snapshot. At this point, the router has not yet rebooted. It is still running the old OS. You must now plan a maintenance window. You inform your manager that you are ready for the reboot. At 2 AM, you log in and issue: 'request system reboot'. The router shuts down and starts up again. This process takes about 5 minutes. You wait. After it reboots, you SSH back into the firewall. You run 'show version'. The output now shows '21.4R3'. The upgrade was successful. You then test the internet connectivity to confirm everything is working.

To be safe, you keep the old backup partition for a week. If anything goes wrong, you can tell the router to boot from the backup partition. After a week of stability, you can clean up the old partition if you need disk space: 'request system software delete junos-21.1R1'. Finally, you save the new configuration file: 'file copy /config/juniper.conf.gz /var/tmp/backup-config-20241201.gz'. This gives you a timestamped backup of the config at the time of the upgrade. This step-by-step process is the real-world of network management, and it is exactly what the JNCIA exam expects you to understand.

How JNCIA-JUNOS Actually Tests This

The JNCIA-JUNOS exam tests your knowledge of Junos file management and software upgrades in a few specific ways. You will see multiple-choice and scenario-based questions. The exam loves to focus on the exact commands, their syntax, and the order of operations. You must memorise the following:

'file copy': command to copy files from a remote location (FTP, HTTP, SCP, etc.) to the local router.

'file list': command to see the contents of a directory.

'file delete': command to remove files.

'file show': command to view file contents (for text files like config backups).

'request system software add': command to install a new software image.

'request system software delete': command to remove a specific software package.

'request system software validate': command to check if an image is valid and compatible without installing it.

'show system storage': command to check disk usage.

'show system software': command to list installed software packages.

'show version': command to display the currently running Junos version.

'show system reboot': command to see scheduled reboots.

Common traps the exam sets:

- They might ask what happens if you run 'request system software add' but do not specify the full path. The correct answer is that the command will fail because it cannot find the file. - They might ask about the storage partition system. For example, a question might ask: 'After a successful upgrade, which partition holds the old version?' The answer is the backup partition. - They might test your understanding that the 'request system software add' command does NOT reboot the router. A separate reboot is required. - They might give a scenario where you need to copy a file to the router and ask for the correct command syntax. The correct syntax is 'file copy source-url destination-url'. - They might ask about file systems: '/var/tmp' is for temporary files, '/config' is for configuration files. Key definitions to memorise: - 'Software image': a single compressed file containing the entire operating system. - 'Dual-partition system': the two separate boot partitions (current and backup). - 'FTP' (File Transfer Protocol): a network protocol used to copy files. - 'SCP' (Secure Copy Protocol): a secure method to copy files, based on SSH. - '/var/tmp': the primary temporary storage directory for image files and logs.

The exam also tests your understanding of the validation step. You can use 'request system software validate junos-image.tgz' to check the image's integrity and compatibility without installing it. This is a safety check. A common question is: 'What is the purpose of the validate command?' The answer is to verify the image before installation. You must also understand that you cannot simply delete a running partition. You must first install a new version or perform a request to set the boot partition. The exam wants you to know the safe and proper procedures: validate, add, reboot, confirm. Never skip a step.

Key Takeaways

Junos uses a dual-partition system (current and backup) to allow safe software upgrades by keeping the old version available as a fallback.

The 'request system software add' command installs a new image into the backup partition but does not reboot the router.

Always validate a new software image using 'request system software validate' before installation to check compatibility and integrity.

The 'file copy' command copies files to and from the router using protocols like FTP, SCP, or HTTP.

/var/tmp is the primary directory for storing temporary files, including new software images, and it persists across reboots.

After a successful upgrade, you can delete the old partition with 'request system software delete <old-image-name>' to free up space.

Never delete or uninstall the currently running software partition; always install a new version first.

The 'show version' command displays the currently running Junos OS version, not the version stored in the backup partition.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

file copy

Used to transfer files to or from the router.

Requires a source and destination URL.

Command example: 'file copy ftp://remote/file /var/tmp/'.

file list

Used to display files in a directory.

Only shows file names, sizes, and timestamps.

Command example: 'file list /var/tmp/'.

request system software add

Installs a new OS image into the backup partition.

Does not change the currently running software.

Must be executed before a reboot to make the upgrade persistent.

request system reboot

Restarts the router and loads the OS from the backup partition.

Finalises the upgrade after software add.

Can be scheduled with a time delay using 'request system reboot at <time>'.

/var/tmp directory

Used as temporary storage for large files like images.

Persists across reboots.

Can be cleaned up manually to free space.

/config directory

Stores the router's configuration files (juniper.conf.gz).

Critical for booting; should not be modified carelessly.

Configuration is read from here at boot time.

FTP (File Transfer Protocol)

Transmits data unencrypted, including passwords.

Often blocked by firewalls due to security concerns.

Requires an FTP server to be set up.

SCP (Secure Copy Protocol)

Transmits data over an encrypted SSH tunnel.

Is the preferred method for secure file copying.

Requires SSH access to the destination device.

Watch Out for These

Mistake

Upgrading the Junos OS deletes all configuration files and log data.

Correct

Upgrading the OS only replaces the system software files. The configuration files, log files, and user-created files in '/var/tmp' remain untouched.

People are used to upgrading operating systems on computers where data loss can happen. They don't realise Junos treats the OS and user data separately on different storage partitions.

Mistake

The 'request system software add' command automatically restarts the router.

Correct

The command only copies the new software into the backup partition. A separate 'request system reboot' command is needed to actually boot the new version.

The word 'add' sounds like applying an update, and many beginners assume updates trigger a reboot automatically, similar to a Windows update.

Mistake

You can delete the old version immediately after verifying the new version runs fine.

Correct

A sensible best practice is to wait at least a few days to ensure stability. The old version serves as a fallback partition in case of issues with the new version.

Beginners often think 'newer is better' and want to free up disk space quickly, not understanding the safety net provided by the dual-partition system.

Mistake

You can install any Junos image on any Juniper device.

Correct

Each Junos image is built for a specific hardware platform and version. Using the wrong image will cause the installation to fail with an 'incompatible platform' error.

People assume software is universal, like a Windows installer that works on different computer brands. Junos images are tied to the exact router model and processor.

Mistake

FTP and SCP are the same tool, just different names.

Correct

FTP is an older, unencrypted protocol. SCP is encrypted and secure. Junos supports both, but SCP is preferred for security.

Both are used for file copying, and beginners often conflate them. The exam expects you to know they have different security properties.

Mistake

The '/var/tmp' directory is automatically cleared on every reboot.

Correct

/var/tmp is a temporary directory, but it persists across reboots. Files there are only deleted by the user or by a specific command.

The 'tmp' in the name suggests temporary storage that gets wiped. In Junos, it is just a workspace that stays between reboots.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What happens if I reboot the router during an upgrade?

Do not interrupt the 'request system software add' process. If you reboot during the add phase, the router may become unstable or fail to boot. Always let the installation complete fully before rebooting.

Can I upgrade a Juniper router without losing the configuration?

Yes. The configuration is stored on a separate partition (/config) and is preserved across upgrades. However, it is always wise to back up your configuration file before starting the upgrade.

How do I know which Junos image to download for my device?

You must match the image to the exact router model (e.g., MX240, SRX300). The Juniper support site lists compatible versions by platform. Using the wrong image will cause the installation to fail with an incompatibility error.

What is the difference between 'file copy' and 'file save'?

'file copy' copies a file from one location to another (local or remote). 'file save' is used to save the output of a command or a configuration snippet to a file, not to move existing files.

Is there a way to downgrade after an upgrade?

Yes. Since the old version remains in the backup partition, you can set the router to boot from that partition using 'request system software set <old-version>' and then reboot. Alternatively, you can install the old image again.

Do I need to be connected via SSH to perform the upgrade?

Yes, you must have remote access (typically SSH) to the router's CLI. You cannot perform a Junos upgrade from the console port alone unless you also have a terminal session, but SSH is the standard method for remote management.

What should I do if the router does not boot after an upgrade?

You can force the router to boot from the backup partition by breaking into the boot loader (during initial boot) and selecting the previous software snapshot. This is an emergency recovery step detailed in the Juniper documentation.

Terms Worth Knowing

Keep going

You've finished Junos File Management and Software Upgrades. Continue through the JNCIA-JUNOS study guide to build a complete picture of the exam.

Done with this chapter?