Hello guys! I am begging for you advice
. I am not highly experienced in OpenWRT
All my attempts to expand rootfs has failed. I have no idea where to move next. Can someone help?
I made sysupgrade ontop of FriendlyWRT using squashfs 23.05.0 image at here https://downloads.openwrt.org/releases/23.05.0/targets/rockchip/armv8/
Initially I had this:
root@FriendlyWrt:~# lsblk -o +FSTYPE,UUID; losetup -l
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
FSTYPE UUID
loop0 7:0 0 100.8M 0 loop /overlay f2fs 460d5ffe-7d86-11ee-9410-dd1eda0fa7b4
mmcblk1 179:0 0 15G 0 disk
├─mmcblk1p1 179:1 0 16M 0 part ext4 84173db5-fa99-e35a-95c6-28613cc79ea9
└─mmcblk1p2 179:2 0 104M 0 part /rom squashfs
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO LOG-SEC
/dev/loop0 0 3342336 1 0 /mmcblk1p2 0 512
I followed Anael's @anaelorlinski instruction here https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/blob/main/docs/resize-f2fs.md.
Resized mmcblk1p2
partition, rebooted and went to the next step
first concern I had when I saw 100MB total instead of full SD card free space at check operation with fsck.f2fs
root@FriendlyWrt:~# echo ${OFFS} ${LOOP} ${ROOT}
3342336 /dev/loop1 /dev/mmcblk1p2
root@FriendlyWrt:~# losetup -o ${OFFS} ${LOOP} ${ROOT}
root@FriendlyWrt:~# fsck.f2fs -f ${LOOP}
.....
Info: total FS sectors = 206464 (100 MB)
Info: CKPT version = 2d07486d
Info: checkpoint state = 44 : crc compacted_summary sudden-power-off
[FSCK] Max image size: 30 MB, Free space: 70 MB
.....
anyway I ran the resize with root@FriendlyWrt:~# resize.f2fs ${LOOP}
after reboot R4S did not start.
I tried all over again. The same result.
Then I decided to try to implement the idea of placing overlay
on the separate partition. I created a new partition with fdisk
and formatted it with ext4
file system.
root@FriendlyWrt:~# fdisk -l /dev/mmcblk1
Disk /dev/mmcblk1: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f
Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 * 65536 98303 32768 16M 83 Linux
/dev/mmcblk1p2 131072 344063 212992 104M 83 Linux
/dev/mmcblk1p3 344064 31457279 31113216 14.8G 83 Linux
root@FriendlyWrt:~# blkid
/dev/loop0: LABEL="rootfs_data" UUID="d012ff86-614c-11e2-a6cc-67864aa44e8c" BLOCK_SIZE="4096" TYPE="f2fs"
/dev/mmcblk1p3: UUID="9f64749b-f521-4e42-a797-81f4da618b00" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="5452574f-03"
/dev/mmcblk1p1: LABEL="kernel" UUID="84173db5-fa99-e35a-95c6-28613cc79ea9" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="5452574f-01"
/dev/mmcblk1p2: BLOCK_SIZE="262144" TYPE="squashfs" PARTUUID="5452574f-02"
mounted and copied overlay
content
root@FriendlyWrt:~# mount /dev/mmcblk1p3 /mnt
root@FriendlyWrt:~# cp -a -f /overlay/. /mnt
root@FriendlyWrt:~# ls -la /mnt
drwxr-xr-x 5 root root 4096 Oct 10 05:45 .
drwxr-xr-x 1 root root 3488 Nov 8 01:19 ..
lrwxrwxrwx 1 root root 1 Nov 8 13:28 .fs_state -> 2
drwx------ 2 root root 16384 Nov 8 01:54 lost+found
drwxr-xr-x 10 root root 4096 Nov 8 01:19 upper
drwxr-xr-x 3 root root 4096 Nov 8 05:24 work
added mount overlay section in /etc/config/fstab and also changed delay_root
to 15
config global
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '15'
option check_fs '0'
config 'mount'
option target '/overlay'
option uuid '9f64749b-f521-4e42-a797-81f4da618b00'
option enabled '1'
rebooted... and no effect
root@FriendlyWrt:~# df -hT
Filesystem Type Size Used Available Use% Mounted on
/dev/root squashfs 3.3M 3.3M 0 100% /rom
tmpfs tmpfs 1.9G 84.0K 1.9G 0% /tmp
/dev/loop0 f2fs 98.8M 51.7M 47.1M 52% /overlay
overlayfs:/overlay overlay 98.8M 51.7M 47.1M 52% /
tmpfs tmpfs 512.0K 0 512.0K 0% /dev
mount output
root@FriendlyWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime,errors=continue)
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/loop0 on /overlay type f2fs (rw,lazytime,noatime,background_gc=on,nodiscard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,checkpoint_merge,fsync_mode=posix,discard_unit=block)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
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)
logread output
root@FriendlyWrt:~# logread | sed -n -e "/ preinit /,/ init /p"
Wed Nov 8 14:04:06 2023 user.info kernel: [ 1.282114] init: - preinit -
Wed Nov 8 14:04:06 2023 kern.notice kernel: [ 1.607171] random: jshn: uninitialized urandom read (4 bytes read)
Wed Nov 8 14:04:06 2023 kern.notice kernel: [ 1.646052] random: jshn: uninitialized urandom read (4 bytes read)
Wed Nov 8 14:04:06 2023 kern.notice kernel: [ 1.686436] random: jshn: uninitialized urandom read (4 bytes read)
Wed Nov 8 14:04:06 2023 kern.warn kernel: [ 1.766271] dw-apb-uart ff1a0000.serial: forbid DMA for kernel console
Wed Nov 8 14:04:06 2023 kern.info kernel: [ 3.824685] loop0: detected capacity change from 0 to 212992
Wed Nov 8 14:04:06 2023 kern.info kernel: [ 3.907702] loop0: detected capacity change from 212992 to 206464
Wed Nov 8 14:04:06 2023 kern.notice kernel: [ 4.211595] F2FS-fs (loop0): Mounted with checkpoint version = 69fe4bfb
Wed Nov 8 14:04:06 2023 user.info kernel: [ 4.213196] mount_root: switching to f2fs overlay
Wed Nov 8 14:04:06 2023 kern.info kernel: [ 4.278851] EXT4-fs (mmcblk1p1): mounted filesystem without journal. Opts: (null). Quota mode: none.
Wed Nov 8 14:04:06 2023 user.warn kernel: [ 4.292818] urandom-seed: Seeding with /etc/urandom.seed
Wed Nov 8 14:04:06 2023 user.info kernel: [ 4.332863] procd: - early -
Wed Nov 8 14:04:06 2023 user.info kernel: [ 4.333208] procd: - watchdog -
Wed Nov 8 14:04:06 2023 user.info kernel: [ 4.885980] procd: - watchdog -
Wed Nov 8 14:04:06 2023 user.info kernel: [ 4.887093] procd: - ubus -
Wed Nov 8 14:04:06 2023 kern.notice kernel: [ 4.915903] random: ubusd: uninitialized urandom read (4 bytes read)
Wed Nov 8 14:04:06 2023 kern.notice kernel: [ 4.939692] random: ubusd: uninitialized urandom read (4 bytes read)
Wed Nov 8 14:04:06 2023 kern.notice kernel: [ 4.940632] random: ubusd: uninitialized urandom read (4 bytes read)
Wed Nov 8 14:04:06 2023 user.info kernel: [ 4.942572] procd: - init -
also PREINIT is not present in /etc/rc.local
root@FriendlyWrt:~# cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
exit 0