3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenWrt ルーターにおける /overlay 領域の拡張

Last updated at Posted at 2025-03-29

この記事の目的

2025 年 2 月に、5ch の【無線 LAN】OpenWrt【強化ファーム】の #25#26 で、公式イメージでは利用できない Flash メモリパーティションの活用方法について、有志による深掘りが行われていました。✨

非常に有効な内容だと思うのですが、このままでは web の海に埋もれてしまう ⚰️ と思うので、自分用の参照情報としてまとめていきます。

この一連の探索は、839 さんのこの ポスト から始まっています。 🙏 感謝 🙏

ディスクの設定状況・使用状況を確認するためのコマンド

# ディスクの割当や使用状況を表示
df -h

# MTD (Memory Technology Device)情報を表示
cat /proc/mtd

# パーティション情報を表示
cat /proc/partitions

# UBI (Unsorted Block Images)ファイルシステムの詳細情報を表示
ubinfo -a

対象機器

⚙️ BUFFALO WSR-3200AX4S (MT7622B)

🪛 コマンドで拡張 🪛

wget -O /etc/init.d/mount_vacant_space https://pastebin.com/raw/XDja96GT
sed -i 's/\r//' /etc/init.d/mount_vacant_space
chmod 755 /etc/init.d/mount_vacant_space
/etc/init.d/mount_vacant_space enable
# この後 mount_vacant_space を有効にするために reboot が必要

🛠️ ビルドで拡張 🛠️

おまけ:メーカー純正ファームウェアへの戻し方

⚙️ ELECOM WRC-X3200GST3 (MT7622B)

普通に OpenWrt をインストールした時のディスク領域: 約 8MB

mtd6 ~ mtd10 の領域を全て mtd6 としてまとめた場合: 約 88MB

🪛 コマンドで拡張 🪛

wget -O /etc/init.d/mount_vacant_space https://pastebin.com/raw/XDja96GT
sed -i 's/\r//' /etc/init.d/mount_vacant_space
chmod 755 /etc/init.d/mount_vacant_space
/etc/init.d/mount_vacant_space enable
# この後 mount_vacant_space を有効にするために reboot が必要

🛠️ ビルドで拡張 🛠️

⚙️ BUFFALO WSR-2533DHP2 (MT7622B)

🛠️ ビルドで拡張 🛠️

⚙️ I-O DATA WN-DX1200GR (MT7621A)

🪛 コマンドで拡張 🪛

wget -O /etc/init.d/mount_vacant_space https://pastebin.com/raw/XDja96GT
sed -i 's/\r//' /etc/init.d/mount_vacant_space
chmod 755 /etc/init.d/mount_vacant_space
/etc/init.d/mount_vacant_space enable
# この後 mount_vacant_space を有効にするために reboot が必要

mount_vacant_space の対象機種として I-O DATA WN-DX1200GR を含むようになった経緯

⚙️ I-O DATA WN-DX2033GR (MT7621A)

🛠️ ビルドで拡張 🛠️

⚙️ Fortinet FortiGate 50E (Marvell Armada 385 88F6820)

🛠️ ビルドで拡張 🛠️

@yossh1 さんによる詳しい解説 🎉

補足情報

OpenWrt イメージのビルド手順

以下は OpenWrt 公式ページInstructions に記載されている手順ですが、この手順でビルドを行うのが楽だと思います。

  1. Set up a build machine in VirtualBox
  2. Install building dependencies
  3. Build OpenWrt images

WSL や macOS を使う場合は以下のページを参考にしてください。

musashino205 氏が OpenWrt 化でパーティションの初期構成を維持しようとする理由

mount_vacant_space 作者による使い方の説明

MTD (Memory Technology Device) の使用方法に関する詳細な解説

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?