Resizing filesystem /root on X86_64

Hi there,
I just installed Openwrt 19.07.8-x86-64-combined-ext4 (on an old notebook, with 128G ssd) and I tried to follow this guide:

until # Resizing filesystem, while my /dev/sda2 is mounted:
root@OpenWrt:~# OFFSET="$(losetup -n -O OFFSET /dev/loop0)"
root@OpenWrt:~# losetup -o ${OFFSET} /dev/loop1 /dev/sda2
losetup: failed to parse offset: '/dev/loop1': Invalid argument

Where I'm wrong with it? Thank you

1 Like

https://openwrt.org/docs/guide-user/installation/openwrt_x86#resizing_ext4_rootfs

Here is the situation:

/dev/root            ext4          258016     55276    197500  22% /
tmpfs                tmpfs        4039192      4452   4034740   0% /tmp
/dev/sda1            ext4           16112      3884     11904  25% /boot
/dev/sda1            ext4           16112      3884     11904  25% /boot

so, when I try:

root@OpenWrt:/mnt# resize.f2fs /dev/sda2 Info: Mounted device! Error: Not available on mounted device!

May I'd try with an usb-live to resize it?

Please, read carefully.
You need to follow the second part of the instruction.
It is not resize.f2fs, but resize2fs.

1 Like
root@OpenWrt:/mnt# resize2fs /dev/sda2 
resize2fs 1.44.5 (15-Dec-2018)
Filesystem at /dev/sda2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 7
resize2fs: Invalid argument While checking for on-line resizing support

Then boot another Linux to resize this filesystem offline. :wink:
I can only wonder what is wrong in your case, as it just works for me:

# resize2fs /dev/sda2
resize2fs 1.44.5 (15-Dec-2018)
Filesystem at /dev/sda2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/sda2 is now 72576 (4k) blocks long.

# resize2fs /dev/sda2
resize2fs 1.44.5 (15-Dec-2018)
The filesystem is already 72576 (4k) blocks long.  Nothing to do!

# ubus call system board
{
	"kernel": "4.14.241",
	"hostname": "OpenWrt",
	"system": "Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz",
	"model": "QEMU Standard PC (i440FX + PIIX, 1996)",
	"board_name": "qemu-standard-pc-i440fx-piix-1996",
	"release": {
		"distribution": "OpenWrt",
		"version": "19.07.8",
		"revision": "r11364-ef56c85848",
		"target": "x86/64",
		"description": "OpenWrt 19.07.8 r11364-ef56c85848"
	}
}
1 Like

Thank you, it worked! I started a linux-live then I resized, now it is

Filesystem           Type       1K-blocks      Used Available Use% Mounted on
/dev/root            ext4       115363328     56516 115290428   0% /
tmpfs                tmpfs        4039192      3168   4036024   0% /tmp
/dev/sda1            ext4           16112      3884     11904  25% /boot
1 Like

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