Skip to content

Disks

The RouterOS Disks menu (/disk) lists all attached storage devices that are supported and in working condition. This feature is particularly useful for RouterBOARD devices with SD/CF/USB/SATA/NVMe slots and x86 systems with additional dedicated storage drives. External storage enables advanced features like User Manager databases, proxy caching, SMB shares, container storage, and logging.

You can attach multiple external or secondary drives and select any number of them for various feature usages. For example, User Manager could use 3 disks—one active database and two backups. You can migrate data by copying to a fourth disk, unmounting it, and moving it to another server.

Always use /disk eject before physically removing any disks from your RouterOS device to prevent data loss!

The ROSE-storage package adds additional enterprise data center functionality to RouterOS.

RouterOS supports various storage interfaces and types:

InterfaceDescriptionUse Cases
USBUSB flash drives and USB hard drivesGeneral storage, backups
SD CardSD and microSD cardsLow-cost storage, logs
SATAInternal SATA drives (x86)High-capacity storage
NVMeNVMe SSDs via PCIeHigh-performance storage
SASSAS drives via expandersEnterprise storage
[admin@MikroTik] > /disk print
Flags: B - BLOCK-DEVICE; M - MOUNTED; F - FORMATTING
Columns: SLOT, MODEL, SERIAL, INTERFACE, SIZE, FREE, FS
# SLOT MODEL SERIAL INTERFACE SIZE FREE FS
0 BM usb1 USB Flash Disk FBA0911260071572 USB 2.00 480Mbps 2.0GB 1.9GB ext4
PropertyDescription
ejectSafely unmounts (ejects) the selected drive by slot name
formatFormats the disk with specified file system
trimDiscards unused data blocks (NVMe)
reset-countersResets disk statistics
monitor-trafficShows real-time disk performance and health
testPerforms disk performance tests (RouterOS 7.16+)
mount-read-onlySets mounted disk to read-only mode
mount-point-templateSets the mounting point using variables

You can customize mount points using variables:

/disk set nvme1 mount-point-template="[model]"
/disk set usb1 mount-point-template="[model]-[fs]"

Available variables:

  • [slot] - slot name (default)
  • [model] - device model name
  • [serial] - device serial number
  • [fw-version] - firmware version
  • [fs-label] - file system label
  • [fs-uuid] - file system UUID
  • [fs] - file system type
FlagDescription
BBLOCK-DEVICE - can be formatted or used for storage
MMounted partition
FCurrently formatting
pHas partition
rRAID member
fRAID member failed
cEncrypted
gGUID partition table
tNVMe TCP export
iiSCSI export
sSMB export
nNFS export

The B flag is particularly important as it indicates whether a device can be formatted or used for storage/RAID purposes.

Global disk settings under /disk settings:

SettingDescriptionDefault
auto-smb-sharingEnables dynamic SMB shares when disk is addeddisabled
auto-smb-userDefault SMB user for auto-shares-
auto-media-shareEnables DLNA when disk is addeddisabled
auto-media-interfaceInterface for dynamic DLNA-
default-mount-point-templateDefault mount point template-

Note: With auto-smb-sharing=yes and /ip smb share enabled=auto, SMB server automatically enables when storage is plugged in.

[admin@MikroTik] > /disk format usb1 file-system=ext4
formatted: 100%
[admin@MikroTik] > /disk format usb1 file-system=ext4 label=usb-flash mbr-partition-table=yes
formatted: 100%
File SystemDescriptionUse Case
ext4Linux ext4General use, best compatibility
fat32FAT32Cross-platform compatibility
exfatexFATLarge files, cross-platform
xfsXFSHigh-performance Linux
btrfsBtrfsAdvanced features, snapshots
discardDiscard blocksTrim unused blocks
wipeSecure wipeSecurely erase all data
/disk format usb1 file-system=ext4 label=usb-flash mbr-partition-table=no
/disk add type=partition parent=usb1 partition-size=200M
/disk add type=partition parent=usb1 partition-size=500M
/disk add type=partition parent=usb1 slot=usb1-last-partition

Notes:

  • If partition size is not specified, all available space is used
  • Use partition-offset to offset partition start

Create RAM-backed folders for temporary storage:

[admin@MikroTik] > /disk add type=tmpfs tmpfs-max-size=100M
[admin@MikroTik] > file print
Columns: NAME, TYPE, SIZE, CREATION-TIME
# NAME TYPE SIZE CREATION-TIME
0 tmp1 disk 100 003 840 dec/12/2022 11:01:48

Warning: RAM disks are emptied on reboot or power loss. Data is stored in RAM and is volatile.

Available from RouterOS 7.16:

/disk disable usb1
/disk test disk=usb2 pattern=sequential type=device thread-count=4 block-size=4K direction=write

Warnings:

  • Disk performance tests may slowly degrade disk health
  • On write tests, all files and file systems on disks will be destroyed
  • Disks must be disabled or unformatted before testing

Example output:

Columns: SEQ, RATE, IOPS, DISK, TYPE, PATTERN, DIR, BSIZE, THREADS
SEQ RATE IOPS DISK TYPE PATTERN DIR BSIZE THREADS
0 1622.5Mbps 49 516 usb2 device sequential write 4096 4
TOT 255.7Mbps 7 806 usb2 device sequential write 4096 4

Configure swap for containers requiring more RAM than available:

/disk set disk1 swap=yes

Note: The entire disk or partition will be used as swap and cannot be used for other purposes. Use a high-speed disk for better performance.

/disk add type=file file-path=disk1/swapfile file-size=1G swap=yes

Note: The disk must be formatted with a file system (e.g., Btrfs). Swap file has lower performance than swap partition.

Always eject before physical removal:

/disk eject usb1

This safely unmounts the drive to prevent data loss.

/ip proxy set cache-path=usb1/cache-n-db/proxy/

The web proxy store is automatically created in the files menu.

/system logging action set disk disk-file-name=/disk1/log

Create log directories manually—unlike proxy, they are not auto-created.

/disk add type=file file-path=disk1/mycopy.iso

RouterOS can mount .iso and .squashfs images directly.

  1. Check physical connection
  2. Verify the device is supported
  3. Try a different USB port or cable
  4. Check /disk print output
  1. Ensure disk is not mounted or disable it first
  2. Try different file system
  3. Check for hardware issues
  1. Use /disk monitor-traffic to check real-time stats
  2. Run disk tests to verify health
  3. Consider faster storage (NVMe over USB 2.0)
  4. Check for filesystem corruption
  • Always run /disk eject before removing
  • Use UPS to prevent corruption from power loss
  • Regular backups of important data
  • Consider RAID for critical storage