File system expansion

Hi

I've installed open wrt on an x86 machine
Used a 2tb hdd. I've installed parted and going to expand the root partition using the parted -f -s /dev/sda resizepart 2 100%

Is this all that is needed to expand the drive for full usage from apps etc?

Do I need to do this?...

Install packages

opkg update
opkg install losetup resize2fs

Map loop device to root partition

losetup /dev/loop0 /dev/sda2 2> /dev/null

Expand root filesystem

resize2fs -f /dev/loop0

Apply changes

reboot

Thanks in advance for any helpers :grinning:

losetup is for squashfs.

resize2fs is for resizing the file system, it's ran after you've resized the partition.

if parted resizes the partition, and extends the FS in one go, then it's all you need.

Here is a before and after photo after I did

parted -f -s /dev/sda resizepart 2 100%


Do I need to run any other commands please ?

Thanks

run a df -kh and fsck on the resized partition.

1 Like

I'm really new to command running and formatting them correctly.
Could you please help me with what exactly I'd type into the command line.

Thanks

google "man df" and "man fsck" (although it's probably fsck.ext4), and you'll learn something.

1 Like