Partitions
Partitions
Section titled “Partitions”The RouterOS partitions feature allows you to divide NAND flash storage into multiple separate partitions, each capable of running a complete RouterOS installation. This enables you to maintain fallback installations, perform upgrades safely, and recover from failed updates or configuration issues without requiring physical access to the device.
Partitioning is supported on ARM, ARM64, MIPS, TILE, and PowerPC RouterBOARD devices that use NAND flash. By maintaining multiple partitions, you can perform upgrades on a secondary partition while keeping a known-working installation active. If the upgrade fails or causes issues, the router automatically falls back to the working partition, ensuring network continuity.
Overview
Section titled “Overview”RouterOS partitioning transforms your router’s NAND flash into a multi-boot system where different partitions can contain different RouterOS versions or configurations. This capability serves as an interactive backup mechanism, allowing you to experiment with new configurations or versions while maintaining a reliable fallback option.
The partition system works by dividing the physical NAND flash into multiple logical segments, each containing a complete RouterOS installation. During boot, the router checks the active partition and attempts to load RouterOS from that partition. If boot fails due to corruption, failed upgrade, or configuration error, the router automatically attempts to boot from the next available partition according to your fallback settings.
This architecture proves particularly valuable in remote deployments where physical access is difficult or impossible. Network administrators can confidently perform upgrades and configuration changes knowing that a failed update will not leave the device in an unrecoverable state. The automatic failover ensures that even if an upgrade corrupts the primary partition, the router will revert to a working configuration.
Supported Devices
Section titled “Supported Devices”Partitioning requires devices with NAND flash storage and compatible processors. The feature supports ARM, ARM64, MIPS, TILE, and PowerPC architectures found in RouterBOARD devices. Not all MikroTik devices support partitioning, particularly those with limited flash storage or older bootloader versions.
Before attempting to configure partitions, verify that your device supports this feature by checking the RouterOS documentation for your specific hardware model. Devices with NOR flash or very small NAND storage may not support partitioning or may have limited partition options.
Requirements and Limits
Section titled “Requirements and Limits”RouterOS places specific requirements on partition configuration to ensure system stability and reliable operation:
- Minimum RouterOS version: Starting from RouterOS 7.17, you must update the device-mode to use partitions
- Minimum storage size: Starting from RouterOS 7.20beta2, the minimum storage size for repartitioning is 128 MiB
- Minimum partition size: During repartitioning, the minimum allowed partition size is 60 MiB
- Maximum partitions: The system supports up to 8 partitions total
For devices previously repartitioned that now fall below minimum size requirements, the system provides limited options. In such cases, you may only repartition to a single partition covering the entire storage, which will restore normal operation while disabling further partitioning until storage requirements are met.
Sub-menu
Section titled “Sub-menu”/partitions
Configuration
Section titled “Configuration”Viewing Partitions
Section titled “Viewing Partitions”Display all configured partitions with their status, size, and RouterOS version:
/partitions printOutput:
Flags: A - ACTIVE; R - RUNNINGColumns: NAME, FALLBACK-TO, VERSION, SIZE# NAME FALLBACK-TO VERSION SIZE0 AR part0 next RouterOS v7.18.2 2025-03-11 11:59:04 128MiBThe output shows each partition with its name, fallback behavior, installed RouterOS version, and total size. Flags indicate whether a partition is active (A) or currently running (R).
Setting Fallback Behavior
Section titled “Setting Fallback Behavior”Configure what happens when a partition fails to boot:
/partitions set <number> fallback-to=nextThe fallback-to property accepts three values:
- next - Attempt to boot from the next partition in sequence
- etherboot - Fall back to etherboot mode for manual intervention
- partition-name - Specify a particular partition to use as fallback
For example, configuring a specific fallback partition:
/partitions set 0 fallback-to=part1This configuration ensures that if partition 0 fails to boot, the router will attempt to boot from partition 1 instead of trying partitions in sequence.
Activating a Different Partition
Section titled “Activating a Different Partition”Manually assign another partition as the active one:
/partitions activate <partition-name>This command changes the partition the router will attempt to boot on the next restart. The activate command requires that partitions are enabled in device-mode (since RouterOS 7.17). After activation, reboot the router for the change to take effect:
/system rebootCopying Running OS to Partition
Section titled “Copying Running OS to Partition”Clone the currently running RouterOS installation with its configuration to a specified partition:
/partitions copy-to <partition-name>This command copies the entire running OS image to the target partition, erasing any previously stored data on that partition. Use this to replicate a known-good configuration across multiple partitions or to prepare a fallback installation.
Example copying to part1:
/partitions copy-to part1After copying, you may want to set fallback behavior and activate the new partition:
/partitions set part1 fallback-to=part0/partitions activate part1Saving Configuration Only
Section titled “Saving Configuration Only”Clone only the running configuration to a specified partition without affecting the OS installation:
/partitions save-config-to <partition-name>Unlike copy-to, this command preserves the existing RouterOS installation on the target partition while replacing only the configuration. This proves useful when you want to apply current settings to another partition without reinstalling the entire operating system.
Restoring Configuration from Partition
Section titled “Restoring Configuration from Partition”Copy configuration from a specified partition to the currently running partition:
/partitions restore-config-from <partition-name>This command imports settings from another partition, allowing you to recover a known configuration or apply settings from a different deployment scenario.
Repartitioning
Section titled “Repartitioning”Repartitioning the NAND
Section titled “Repartitioning the NAND”Reformat the NAND flash with a new partition configuration:
/partitions repartition partitions=<number-of-partitions>This command reboots the router immediately and reformats the NAND flash, creating the specified number of partitions. The command erases all data on the NAND and creates new partitions of approximately equal size.
For example, creating two partitions:
/partitions repartition partitions=2After repartitioning, RouterOS installs on the first partition, leaving remaining partitions empty. You must copy the OS to additional partitions as needed using the copy-to command.
Repartitioning Considerations
Section titled “Repartitioning Considerations”Repartitioning permanently destroys all data on the NAND flash, including RouterOS installations, configurations, and any stored files. Ensure you have backups of critical configurations before proceeding.
The minimum partition size during repartitioning is 60 MiB. If your device storage cannot accommodate the requested number of partitions at this minimum size, the command will fail. The maximum number of partitions is 8, regardless of storage size.
After repartitioning to a single partition, the Partitions menu becomes hidden on devices where partitioning is not supported by default. This behavior ensures that unsupported devices do not display confusing partition options.
Partition Properties
Section titled “Partition Properties”Configurable Properties
Section titled “Configurable Properties”| Property | Description |
|---|---|
| name (string; Default: ) | Unique identifier for the partition |
| fallback-to (etherboot | next | | Boot fallback behavior when active partition fails |
| active (yes | no; Default: no) | Whether this partition is marked as the active boot option |
Read-Only Properties
Section titled “Read-Only Properties”| Property | Description |
|---|---|
| running (yes | no) | Whether this partition is currently running the router |
| size (integer [MiB]) | Total storage capacity allocated to this partition |
| version (string) | RouterOS version installed on this partition |
Property Details
Section titled “Property Details”The name property assigns a human-readable identifier to each partition. Default names follow a sequential pattern (part0, part1, part2) but can be customized for easier identification in multi-site deployments.
The fallback-to property determines the boot sequence behavior when a partition fails. Setting fallback-to to a specific partition name provides deterministic failover behavior, while using next allows the router to attempt partitions in their configured order.
The active flag indicates which partition the router will attempt to boot on the next restart. Only one partition can be active at any time. The running flag shows which partition is currently executing RouterOS code.
Device Mode Requirements
Section titled “Device Mode Requirements”Starting from RouterOS version 7.17, partitions require explicit enabling through the device-mode setting. This requirement ensures that administrators intentionally enable partitioning features and understand the implications of multi-boot configurations.
Enabling Device Mode
Section titled “Enabling Device Mode”Configure device-mode to enable partition functionality:
/system device-mode set partitions=enabledAfter enabling device-mode, the /partitions menu becomes available and partition commands can be executed. Disable partitions by setting the device-mode to disabled, which hides partition options from the menu structure.
Device Mode Considerations
Section titled “Device Mode Considerations”Changing device-mode settings requires careful planning, as the partition configuration interacts with boot behavior. Enabling partitions after previously using single-boot mode allows you to configure multi-partition setups. Conversely, disabling partitions removes the ability to manage partitions through RouterOS commands.
Use Cases
Section titled “Use Cases”Safe Upgrades with Rollback
Section titled “Safe Upgrades with Rollback”Maintain a primary partition with a known-stable RouterOS version while performing upgrades on a secondary partition. When testing new versions or configurations, use the secondary partition to verify stability before switching production traffic.
Example workflow:
/partitions copy-to part1/system package update installAfter the upgrade completes, test functionality thoroughly. If issues arise, activate the original partition:
/partitions activate part0/system rebootConfiguration Testing
Section titled “Configuration Testing”Test new configurations on a secondary partition before applying them to production. The save-config-to command allows you to propagate configuration changes without affecting the running system, enabling configuration validation in an isolated environment.
Multi-Site Standardization
Section titled “Multi-Site Standardization”Deploy consistent configurations across multiple devices by maintaining a standardized partition image. Use the copy-to command to replicate configurations between devices or to restore previously tested configurations after troubleshooting.
Best Practices
Section titled “Best Practices”Primary and Fallback Configuration
Section titled “Primary and Fallback Configuration”Always configure fallback behavior for all partitions to ensure automatic recovery. Test failover behavior periodically to verify that the router correctly switches partitions when boot issues occur.
/partitions set part0 fallback-to=part1/partitions set part1 fallback-to=part0This configuration creates a bidirectional failover where each partition serves as the fallback for the other, providing maximum protection against single-partition failures.
Naming Conventions
Section titled “Naming Conventions”Use descriptive partition names that indicate their purpose or contents:
/partitions set part0 name=stable/partitions set part1 name=testingClear naming prevents confusion during troubleshooting and makes it easier to identify which partition contains which configuration or RouterOS version.
Backup Before Changes
Section titled “Backup Before Changes”Before repartitioning or significant changes, export your current configuration:
/export file=pre-partition-config.rscThis backup allows you to restore configuration even if partition operations encounter issues.
Regular Health Checks
Section titled “Regular Health Checks”Monitor partition health as part of routine maintenance:
/partitions print/system resource printVerify that all partitions have adequate free space and that partition versions match expected configurations. Address any discrepancies before they cause operational issues.
Troubleshooting
Section titled “Troubleshooting”Partitions Menu Not Visible
Section titled “Partitions Menu Not Visible”- Verify device-mode partitions are enabled:
/system device-mode print - Confirm device supports partitioning (ARM, ARM64, MIPS, TILE, PowerPC with NAND)
- Check RouterOS version (requires 7.17 or later for device-mode integration)
Boot Failure Loop
Section titled “Boot Failure Loop”If the router cycles between partitions during boot:
- Connect via serial console to observe boot messages
- Verify fallback-to settings:
/partitions print - Check for corrupted RouterOS installation on problematic partition
- Restore from known-good configuration:
/partitions restore-config-from <working-partition>
Insufficient Space for Repartitioning
Section titled “Insufficient Space for Repartitioning”Repartitioning fails due to storage constraints:
- Verify available storage:
/system resource print - Consider reducing partition count to free minimum required space
- For devices with insufficient storage, use single-partition mode
Partition Does Not Boot After Copy
Section titled “Partition Does Not Boot After Copy”Copied partition fails to start:
- Verify copy completed successfully without errors
- Check partition size matches source:
/partitions print - Try activating and manually rebooting:
/partitions activate <name>; /system reboot - Use etherboot fallback for recovery:
/partitions set <number> fallback-to=etherboot
Related Commands
Section titled “Related Commands”/system device-mode- Configure device-mode settings/system reboot- Reboot the router/file- Manage files on the router/system package- RouterOS package management/system reset-configuration- Reset to factory defaults