Mounting /dev/mtdblock5 on /mnt failed: Invalid argument

my router is ac750 running 23.5 new firmware

did everything here :https://openwrt.org/docs/guide-user/additional-software/extroot_configuration and here https://www.youtube.com/watch?v=5UjCT99udm0

on

# 4. Transferring data
We now transfer the content of the current overlay to the external drive and reboot the device to apply changes:*


mount ${DEVICE} /mnt
tar -C ${MOUNT} -cvf - . | tar -C /mnt -xf -
reboot

i get this error:

eval $(block info | grep -o -e 'MOUNT="\S*/overlay"')
admin@router:~# uci -q delete fstab.extroot
admin@router:~# uci set fstab.extroot="mount"
admin@router:~# uci set fstab.extroot.uuid="${UUID}"
admin@router:~# uci set fstab.extroot.target="${MOUNT}"*
admin@router:~# uci commit fstab
admin@router:~# mount ${DEVICE} /mnt
-C ${MOUNT} -cvf - . | tar -C /mnt -xf -
reboot
mount: mounting /dev/mtdblock4 on /mnt failed: Invalid argument

my usb stick is a 32gb usb and i am trying to use it as internal memory

looked in google and found nothing , please help

i have wasted 24hours resetting and configuring the router , i am exhausted and also formatted as fat32 and then ext4 installed this packages too

opkg install block-mount kmod-fs-ext4 kmod-usb-storage kmod-usb-ohci kmod-usb-uhci e2fsprogs fdisk

i therefore summon the tech savy here @frollic @lleachii

The actual text in the preformatted code block looks jumbled up a bit... for example, you've got a bunch of * in there that shouldn't exist.

looks wrong. it should look like this:

mount ${DEVICE} /mnt
tar -C ${MOUNT} -cvf - . | tar -C /mnt -xf -
reboot

Can you verify that this is purely related to the way it got copied into the forum as compared to what was actually entered into your ssh session?

i will format correctly the post sorry i just felt tired because wasted all the day on it and feel exhausted

for example the usb stick gets recognized when i do a hit enter block info

(after installling drivers of course)i have all the steps done good except the #4 which fails to mount i do not know why

there is an story of another person with the same error https://forum.openwrt.org/t/mount-mounting-dev-mtdblock5-on-mnt-failed-invalid-argument/107927however i have not reboot since i have understood the reboot must be after the process, also added the wait 15seconds before mount just in case , but did not worked, my stick is detected in all the places except in

df

i suspect the post have errors because the steps in the video and in the post differ in small steps

https://openwrt.org/docs/guide-user/additional-software/extroot_configuration

https://www.youtube.com/watch?v=5UjCT99udm0

No worries... just the first thing that jumped out was that things looked off, and I want to make sure that the commands didn't get messed up on entry into your system. Beyond that, yes, it's necessary to make sure we see exactly what you entered and what resulted, so yes, making sure it is correct is key.

We'll get you running... don't worry.

1 Like

it looks like this got messed up a bit... note that in the snippet below, the second line starts with tar which is missing from yours. Also, it's not entirely clear to me if the first line was interpreted properly because I would normally expect to see a new prompt.

mount ${DEVICE} /mnt
tar -C ${MOUNT} -cvf - . | tar -C /mnt -xf -
reboot

Something else is unusual here...

^^^ this doesn't look quite right either.

What is the output of

ubus call system board

Thank you very much , in the video also there is person with tplink having the same error, maybe is a vendor problem(tplink) ?

yesterday i updated from 21 to 23.5, did a update using the upgrade image flashing from luci, i did it like 10 times yesterday to make sure it was clean flash and not a dirty flash problem however it does not works, also looks like 23.5 weights more memory so i was not able to fully install

opkg install block-mount kmod-fs-ext4 kmod-usb-storage kmod-usb-ohci kmod-usb-uhci e2fsprogs fdisk

so i did a

remove pppoe, ppp, ppp-mod-pppoe

remove IPv6 ip6tables odhcp6c kmod-ipv6 kmod-ip6tables
odhcpd-ipv6only

Did you do this after the device was flashed, or did you build a custom image with this stuff removed? If the former, this won't save any space... it will actually consume extra space.

root@OpenWrt:~# ubus call system board
{
        "kernel": "5.15.134",
        "hostname": "OpenWrt",
        "system": "MediaTek MT7628AN ver:1 eco:2",
        "model": "TP-Link TL-WR902AC v3",
        "board_name": "tplink,tl-wr902ac-v3",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.0",
                "revision": "r23497-6637af95aa",
                "target": "ramips/mt76x8",
                "description": "OpenWrt 23.05.0 r23497-6637af95aa"
        }
}

i did it after flashing, i do not know how to build a custom image, i have read the guide but it is a little bit confusing for me so i do not know what package should remove and i dont have linux, yes i have seen it consumed more space which is very strange should be the oppose

I'm confused... your previous post showed this:

And your most recent one showed this:

Any idea what accounts for this observed difference?

This is not the latest. Let's upgrade to 23.05.2 -- do not keep settings, and then we'll go from there.
https://firmware-selector.openwrt.org/?version=23.05.2&target=ramips%2Fmt76x8&id=tplink_tl-wr902ac-v3

i just redacted my username for security purposes but who care is root heheheheh, sorry, ok will update now should i update from lucy or from tftp? select kernel or sysupgrade?

sysupgrade file since you're already running OpenWrt.

1 Like

done, running now 23.5.2

i do not know what to do, should i make a custom image from scratch? i could but i do not know how it works and the guide is not well explained, i mean i would lack to put in a package that is a must, does i explain myself?

wait

https://firmware-selector.openwrt.org/?version=23.05.2&target=ramips%2Fmt76x8&id=tplink_tl-wr902ac-v3
if i copy paste the same packages without the packages i want in, and i hit request build, this will build a image for me? oh my jesus h christ!!! this is the holy grail of routers!!

or am i wrong? could you kindly explain how this works? i used logic and tought that the first text field is showing the scripts installed, and the second is to create a custom build with the scripts you want, is it right? or am i wrong?

i removed ppoe and ipv6 packages

We'll go step-by-step:
If your usb stick is already formatted with ext4, you only need to do this:

opkg update
opkg install block-mount kmod-fs-ext4
reboot

Then, plug in your usb stick and let's see the output of

block info
1 Like

done, installed succesfully

opkg install block-mount kmod-fs-ext4

it does not detect the usb

block info
/dev/mtdblock3: UUID="97741d6c-e644db67-1c0916d0-cf1fa89f" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock4: MOUNT="/overlay" TYPE="jffs2"

it only was detected when i did a

opkg install block-mount kmod-fs-ext4 kmod-usb-storage kmod-usb-ohci kmod-usb-uhci e2fsprogs fdisk and i do not know what command is what helped

This will obviously be an issue. We need to figure out why the usb stick isn't being recognized.

  • If you plug the stick into your computer, does it work?
  • What is the power source for your TL-WR902ACv3 (specifically, the current rating on the USB power adapter)?

when i installed

opkg install block-mount kmod-fs-ext4 kmod-usb-storage kmod-usb-ohci kmod-usb-uhci e2fsprogs fdisk

it recognized the block info command and shown the usb, i have not run all that command cause lack of memory, but it worked even ran fstab and dmesg, shown usb consumption @300Mah , psu is stock @2.1A -- 5v

yes the usb stick is fine, already come from format to ext4 and the pc recognized it, so is not the usb

Whoops... my bad...

Yes, these are necessary, too. Please install those.

Good!

Once those packages are installed, let's see the result of block info again.

1 Like
Configuring kmod-scsi-core.
Configuring kmod-usb-storage.
Configuring kmod-usb-uhci.
root@router:~# block info
/dev/mtdblock3: UUID="97741d6c-e644db67-1c0916d0-cf1fa89f" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock4: MOUNT="/overlay" TYPE="jffs2"
/dev/sda1: UUID="120bc142-71f0-a04d-b376-a84230983766" VERSION="1.0" TYPE="ext4"

it shows the usb now :face_with_hand_over_mouth: , without needing reboot

there is other case i found of other person with tplink router having the same problem

awesome.

The reboot isn't totally necessary, but I usually do it just to make sure everything has loaded properly.

next... (this is my own recipe which I know works):

mkdir /mnt/usbdrive
mount /dev/sda1 /mnt/usbdrive

mkdir -p /tmp/cproot
mount --bind / /tmp/cproot
tar -C /tmp/cproot -cvf - . | tar -C /mnt/usbdrive -xf -
umount /tmp/cproot