I am trying to increase root partition on x86_64 system but with no success

I used all methods listed here [OpenWrt Wiki] Expanding root partition and filesystem
Then reboot several times, but still I see same amount of space

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                98.3M     29.0M     67.2M  30% /
tmpfs                   475.7M     68.0K    475.7M   0% /tmp
/dev/sda1                15.7M      5.6M      9.8M  36% /boot
/dev/sda1                15.7M      5.6M      9.8M  36% /boot
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~#

I just can not understand what is the problem, since earlier some of this method worked fine. I must check disk somehow?

P.S. HDD is old SATA 160Gb

UPD: I would not do that, but after installing v2raya I happen to have no free space to install DoH.

root@OpenWrt:~# opkg install https-dns-proxy
Installing https-dns-proxy (2023.12.26-1) to root...
Collected errors:
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg https-dns-proxy needs 21
 * opkg_install_cmd: Cannot install package https-dns-proxy.
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                98.3M     96.3M         0 100% /
tmpfs                   475.7M      1.0M    474.7M   0% /tmp
/dev/sda1                15.7M      5.6M      9.8M  36% /boot
/dev/sda1                15.7M      5.6M      9.8M  36% /boot
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# 

What is your root filesystem type?

mount

I believe it is ext4, at least according to

root@OpenWrt:~# cat /proc/mounts
/dev/root / ext4 rw,noatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
/dev/sda1 /boot ext4 rw,noatime 0 0
/dev/sda1 /boot ext4 rw,noatime 0 0
tmpfs /dev tmpfs rw,nosuid,noexec,noatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,noatime,mode=600,ptmxmode=000 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
bpffs /sys/fs/bpf bpf rw,nosuid,nodev,noexec,noatime,mode=700 0 0

UPD: mount

root@OpenWrt:~# mount
/dev/root on / type ext4 (rw,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/sda1 on /boot type ext4 (rw,noatime)
/dev/sda1 on /boot type ext4 (rw,noatime)
tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
bpffs on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
root@OpenWrt:~#

may be If I delete

fdisk
losetup
parted
kmod-amazon-ena (Since I am not in Anazon network Infrastructure)
kmod-amd-xgbe (I have no AMD network)
kmod-e1000
kmod-e1000e (Intel staff)

and some other packages I will have enought free space

That's good since ext4 expands easily, at least in theory.

Can you show the commands you issued and then the output that came from the system?

(Full disclosure -- I'm not an expert on expanding the filesystem, but even if I can't help, this information will be useful for others to try to understand what is happening on your system)

1 Like

I used

opkg update
opkg install parted losetup resize2fs

then

sh /etc/uci-defaults/70-rootpt-resize

And nothing happen, even after reboot

Then I used

wget -U "" -O expand-root.sh "https://openwrt.org/_export/code/docs/guide-user/advanced/expand_root?codeblock=0"
. ./expand-root.sh

With Enter to execute script, but nothing happen also

If you simply need more space to install additional apps, and are don't specifically need to expand the filesystem fully, you could use owut. It will reinstall OpenWRT and you can use the option to resize the filesystem up to 1 GB. It will not preserve your configuration though, so back up in advance if you decide to proceed.

OMG, It would be most inconvenient, since I have already setup all necessary and also this OWUT staff seems like something which is quite not easy to master.

I've gone through the process. It's not as detailed or time consuming as you perhaps think.

  1. Backup your configuration
  2. run owut, specifying desired new filesystem size in MB ( max 1024 / 1GB)
owut upgrade -S 1024
  1. Restore your configuration.

It only took a few minutes for me.

2 Likes

Ok. Thank you. I must install it first and the problem is that I have only 220Kb free space. I try to figure out something
UPD: Unfortunately I can not install owut, since opkg in 23.05 does not know about it

Unknown package 'owut'.

UPD2: I do not know why, but with different HDD everithing works fine. I took old IDE 40Gb HDD from garbage. And now I have all the free space in the world!!! Mwahahaha!!! (sorry)

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                36.8G     18.3M     36.7G   0% /
tmpfs                   979.0M     80.0K    978.9M   0% /tmp
/dev/sda1                15.7M      5.6M      9.8M  36% /boot
/dev/sda1                15.7M      5.6M      9.8M  36% /boot
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~#

P.S. The algorithm ot my actions was:

opkg update
opkg install parted losetup resize2fs

Then

sh /etc/uci-defaults/70-rootpt-resize

But system responded that can not find directory

So. I used Automatic scenario

wget -U "" -O expand-root.sh "https://openwrt.org/_export/code/docs/guide-user/advanced/expand_root?codeblock=0"
. ./expand-root.sh

But executed expand-root.sh twice (Oh, may be I should not, but I feel like ancient human who just do everything by the book without proper understanding of what he does) and after reboot it worked.

1 Like