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)
|