How to enlarge more space for my openwrt to use?

My openwrt was installed in the old pc , i dd openwrt's image into /dev/sdb1.

sudo fdisk -l  /dev/sdb
Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM002-1SB10
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x5f8979fa

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1            2048 195508223 195506176  93.2G 83 Linux
/dev/sdb2       195510270 197462015   1951746   953M  5 Extended
/dev/sdb3       197462016 301062143 103600128  49.4G  7 HPFS/NTFS/exFAT
/dev/sdb4       301062144 976773119 675710976 322.2G 83 Linux
/dev/sdb5  *    195510272 197462015   1951744   953M ef EFI (FAT-12/16/32)

It is so huge that contain 93.2G space!But i found that space is full when to enter my openwrt.

df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root               252.0M    246.9M         0 100% /
tmpfs                     3.8G      2.8M      3.7G   0% /tmp
/dev/sdb1               252.0M    246.9M         0 100% /boot
/dev/sdb1               252.0M    246.9M         0 100% /boot
tmpfs                   512.0K         0    512.0K   0% /dev

The /dev/sdb1 shown here is different from the /dev/sdb1 above.
How to enlarge more space for my openwrt to use?

When you dd the image to the disk, it places a pre-set partition table which only has 250 MB for root regardless of the actual size of the disk. It will also wipe out any existing partitions on the disk.

Using the ext4 build, you can use standard tools to expand the sdx2 partition (containing the ext4 root filesystem) to the full size of the disk. This is easiest to do by running a separate OS such as gparted live usb to alter the OpenWrt disk while it is not running OpenWrt.

If you're using the disk space mostly for shared files, create a third partition for data instead of putting all the shared files into the same rootfs. This makes upgrading OpenWrt easier. I think that later versions of sysupgrade will not affect the data partition.


Boot into debian.(three os installed in my old pc:debian,win10,openwrt), call gparted,and resize the partition /dev/sdb1.
In menu, partition-check after selecting /dev/sdb1,then execute.

sure if your data is on /boot and taking any EFI etc. size limits into consideration...

otherwise you'd be wanting to;


really is good advice...

it is always better to create additional partitions, so you can safely sysupgrade the system.
if you put them also on GPT then you can ran gdisk and will inform to recover the mbr one to gpt and you will skip manually configuring it.
you can configure opkg to install packages on data partition, etc...

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.