How do I expand the partition in OpenWRT?

To expand partitions in OpenWrt, you can follow these steps:

  1. To check the current partition status, use the command df -h to view the utilization and mounted partitions.
  2. Create a new partition:
    Use an appropriate disk partitioning tool (such as fdisk or parted) to create a new partition. Make sure the new partition is large enough to accommodate the required space for expansion.
  3. Format the new partition:
    Use the mkfs command to format the new partition, for example: mkfs.ext4 /dev/sdXN (where sdXN is the device name of the new partition).
  4. Mounting a new partition involves creating a new mount point directory (e.g. /mnt/new_partition), and then running the mount command to mount the new partition to that directory, for example: mount /dev/sdXN /mnt/new_partition.
  5. Backup old partition data:
    Use the command cp -a to copy the data from the old partition to the new partition, for example: cp -a /overlay/. /mnt/new_partition.
  6. Update the /etc/config/fstab file: Open the /etc/config/fstab file and update the mount path of the old partition to the mount path of the new partition.
  7. Unmount the old partition by running the “umount” command, for example: umount /overlay.
  8. Mount a new partition to the mount point of an old partition:
    Use the mount command to mount the new partition to the mount point of the old partition, for example: mount /dev/sdXN /overlay.
  9. Restart the router:
    To apply the changes, reboot the OpenWrt router.

Please be aware that these steps may vary depending on the OpenWrt version and hardware. Before expanding the partition, make sure to back up important data and proceed carefully.

bannerAds