This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15314|Reply: 8

【Practical Action】OpenWrt hard disk storage space expansion

[Copy link]
Posted on 6/3/2022 2:02:15 PM | | | |
Requirements: After the default installation of openwrt, I can only use 500M of storage space, but my hard drive capacity is 128G, and there is a lot of space that cannot be used, so I need to expand the storage space of opwnwrt. As shown below:

The actual capacity used by OpenWrt depends entirely on the firmware size set at the time of OpenWrt compilation. If we want to fully toss soft routing, we need to scale OpenWrt.


Installation tools

Log in to OpenWrt through SSH terminal tools such as Xshell and Putty, install the disk partitioning tool, and use the following commands:



In the command line, cfdisk and fdisk are disk partitioning tools, and e2fsprogs contains the mkfs command to format partitions.

Expand the remaining space

Run the cfdisk command in the SSH terminal to enter the disk partition interface, switch to Free space (remaining space) with the keyboard up and down keys, switch to NEW (new partition) with the left and right keys, and then press Enter.



The partition size is the remaining space by default, just keep the default, just press it, as shown in the figure below:



The name of the newly created partition is: /dev/sda3, and after switching to this partition, press the left and right buttons to toggle Write and press Enter to write to the new partition. As shown below:



Enter yes to confirm the write to the new partition. As shown below:



Toggle Quit and press enter to exit. Run the fdisk -l command to see if the new partition is successfully created.




Mount the new partition, go to the OpenWrt management backend, click System - Mount Point to find and click Generate Configuration in the global settings.



Find the new partition created in the Mount Point and click Modify to readjust the settings of the mounted project.



Check Enable this mount point, and the mount point is selected to be used as the root file system, completeCopy all the command lines in the root preparationAfter that, clickSave and apply。 As shown below:



Copy the command line aboveDon't run it directly!! Don't run it directly!!! Otherwise, an error will be reported.

You need to manually modify the new partition drive letter created by mount /dev/sda1 /tmp/extroot for cfdisk in the command line, for example, it should be changed to mount /dev/sda3/tmp/extroot,然后进入 SSH 终端,运行修改后的完整命令行,如下:

Enter all the command lines in order, and then run reboot to restart OpenWrt.

After waiting for the restart to complete, enter df -h to view the mount point and space usage, as shown in the following figure:




(End)




Previous:VS compiles Mixed Platform x64
Next:fdisk_dos_fix_chs: symbol not found
 Landlord| Posted on 6/3/2022 2:03:27 PM |
The version of the openwrt system I am using

Firmware version OpenWrt R22.1.1 GDQ Winter[2022] Compiled by eSir / LuCI Master (git-21.335.48743-5f363d9)
Kernel version 5.10.88
Posted on 8/27/2022 11:04:55 PM |
Thank you to the owner for sharing his experience
Posted on 10/28/2022 6:17:10 PM |
Take a look at the reply below
Posted on 11/9/2022 2:46:36 PM |
ThanksShare
Posted on 11/27/2022 2:45:16 PM |
Thank you for your analysis, thank you
Posted on 12/17/2022 12:51:49 PM |
Thank you for your analysis, thank you
 Landlord| Posted on 12/17/2022 2:51:43 PM |
fdisk_dos_fix_chs: symbol not found
https://www.itsvse.com/thread-10324-1-1.html
Posted on 1/13/2024 11:19:54 PM |
Thanks for sharing
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com