Cisco Meraki MR18 remove stock partitions to get more free space for packages

If you don't have enough space available after flashing the access point and do not plan to return to the stock firmware, then this instruction is for you!
After flashing Cisco Meraki MR18 with OpenWRT, you have only ~50MB size of flash.

You can remove stock partitions and get ~99.3MB using this guide!
WARNING!!! Be careful when following all steps of the instructions, otherwise you may damage your device!!!
Step 1. IMPORTANT! Backup all partitions from AP.

Connect to AP by ssh or console:
Step 2. Check partitions:
ubinfo -a

BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.7, r11306-c4a6851c72
 -----------------------------------------------------
root@Meraki-MR18:~# ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:59
Present UBI devices:            ubi0

ubi0
Volumes count:                           9
Logical eraseblock size:                 129024 bytes, 126.0 KiB
Total amount of logical eraseblocks:     888 (114573312 bytes, 109.2 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  20
Current maximum erase counter value:     1874
Minimum input/output unit size:          2048 bytes
Character device major/minor:            251:0
Present volumes:                         0, 1, 2, 3, 4, 5, 6, 7, 8

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        5 LEBs (645120 bytes, 630.0 KiB)
State:       OK
Name:        board-config
Character device major/minor: 251:1
-----------------------------------
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        163 LEBs (21030912 bytes, 20.0 MiB)
State:       OK
Name:        storage
Character device major/minor: 251:2
-----------------------------------
Volume ID:   2 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        45 LEBs (5806080 bytes, 5.5 MiB)
State:       OK
Name:        rootfs-25-201804051805-G885d6d78-dhow-rel-2
Character device major/minor: 251:3
-----------------------------------
Volume ID:   3 (on ubi0)
Type:        static
Alignment:   1
Size:        45 LEBs (5806080 bytes, 5.5 MiB)
Data bytes:  5730304 bytes (5.4 MiB)
State:       OK
Name:        rootfs-25-201804051805-G885d6d78-dhow-rel-1
Character device major/minor: 251:4
-----------------------------------
Volume ID:   4 (on ubi0)
Type:        static
Alignment:   1
Size:        68 LEBs (8773632 bytes, 8.3 MiB)
Data bytes:  8727997 bytes (8.3 MiB)
State:       OK
Name:        diagnostic1
Character device major/minor: 251:5
-----------------------------------
Volume ID:   5 (on ubi0)
Type:        static
Alignment:   1
Size:        68 LEBs (8773632 bytes, 8.3 MiB)
Data bytes:  8725121 bytes (8.3 MiB)
State:       OK
Name:        diagnostic2
Character device major/minor: 251:6
-----------------------------------
Volume ID:   6 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        2 LEBs (258048 bytes, 252.0 KiB)
State:       OK
Name:        caldata
Character device major/minor: 251:7
-----------------------------------
Volume ID:   7 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        20 LEBs (2580480 bytes, 2.4 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 251:8
-----------------------------------
Volume ID:   8 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        448 LEBs (57802752 bytes, 55.1 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 251:9

Step 3. Remove stock partitions
ubirmvol /dev/ubi0 -N (storage name)

root@Meraki-MR18:~# ubirmvol /dev/ubi0 -N storage
root@Meraki-MR18:~# ubirmvol /dev/ubi0 -N rootfs-25-201804051805-G885d6d78-dhow-rel-2
root@Meraki-MR18:~# ubirmvol /dev/ubi0 -N rootfs-25-201804051805-G885d6d78-dhow-rel-1
root@Meraki-MR18:~# ubirmvol /dev/ubi0 -N diagnostic1
root@Meraki-MR18:~# ubirmvol /dev/ubi0 -N diagnostic2
root@Meraki-MR18:~# ubirmvol /dev/ubi0 -N caldata

WARNING!!! Do not turn off the power or reboot the access point after deleting the "caldata" partition before re-creating it. This section contains data on the factory calibration of the module!!!
WARNING!!! Never delete the "board-config" partition!!!

Step 4. Re-create "caldata" partition.
ubimkvol /dev/ubi0 -N caldata -s 252KiB

root@Meraki-MR18:~# ubimkvol /dev/ubi0 -N caldata -s 252KiB
Volume ID 1, size 2 LEBs (258048 bytes, 252.0 KiB), LEB size 129024 bytes (126.0 KiB), dynamic, name "caldata", alignment 1

Step 5. Upgrade firmware with saving your settings using luci or ssh.
Step 6. Check partitions.
ubinfo -a

root@Meraki-MR18:~# ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:59
Present UBI devices:            ubi0

ubi0
Volumes count:                           4
Logical eraseblock size:                 129024 bytes, 126.0 KiB
Total amount of logical eraseblocks:     888 (114573312 bytes, 109.2 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  20
Current maximum erase counter value:     1874
Minimum input/output unit size:          2048 bytes
Character device major/minor:            251:0
Present volumes:                         0, 1, 2, 3

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        5 LEBs (645120 bytes, 630.0 KiB)
State:       OK
Name:        board-config
Character device major/minor: 251:1
-----------------------------------
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        2 LEBs (258048 bytes, 252.0 KiB)
State:       OK
Name:        caldata
Character device major/minor: 251:2
-----------------------------------
Volume ID:   2 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        20 LEBs (2580480 bytes, 2.4 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 251:3
-----------------------------------
Volume ID:   3 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        837 LEBs (107993088 bytes, 102.9 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 251:4


Profit :slight_smile:

1 Like

Warning: do not delete caldata, you will permanently ruin the wireless performance of this board. caldata contains radio calibration data that are unique to the specific board and cannot be regenerated without factory testing equipment. Always, always back up any volumes that you are going to remove just in case things like this happen. It is okay if you remove the caldata volume, recreate one and write back the original contents.

1 Like

You are right, corrected the instructions, added a warning.

You probably mean MB (MegaByte), not Mb (Megabit), right?

What if the user wants to go back to stock firmware, is this easily possible with your changes?

1 Like

Yes, you are right, I was mistaken in writing.
Regarding the return to my native firmware, I did not even think about it, but it was worth warning in the instructions. It will probably not work with standard means, perhaps only with the help of the same u-Link NAND. Do you have any ideas on this?

@YakovOnline sorry for digging out old topic, but I have two remarks which I think are worth it:

  • You might just leave caldata partition in place, there is no issue for it having the slot 6 as in stock firmware at all. If this partition is missing from UBI though, OpenWrt will pick the contents from /dev/mtd4 instead, which has the same contents. In theory, because my unit reported unrecoverable ECC errors reading from there :wink:

  • Returning to stock firmware is possible if you still have stock kernel in "recovery" MTD partition or dumped it before flashing, in addition to dumps of the UBI volumes, so you can recreate the layout. Or if you can find someone who dumped them, they are not device specific. On my unit, both kernels and rootfs partitions were at the same version.

2 Likes

Thank you for your interest in the topic :slight_smile:

1 Like

Thank you for this, enough space to install adguard home