Page 1 of 1

USB Disk issue after hardware reboot

Posted: Tue Jan 09, 2024 4:43 pm
by phoenix202305
Hello,

At the moment we are working on the L009UiGS-2HaxD-IN with an USB attached, we managed to get a container work directly from the usb without any issue while powered on,
but noticed that most of the times after a reboot of the hardware, we find duplicated disk under the "files" menu.

Duplicated_Usb.png
This prevent the container automatic restart and we need to manually delete the duplicated disk named "Usb1" and rename the original Disk from "Usb2" to "Usb1",
then we can start the container correctly. Has anyone got the same "problem" or found any automatic solution to it?

Thank you in advance.

Re: USB Disk issue after hardware reboot

Posted: Tue Jan 09, 2024 4:49 pm
by holvoetn
Is that disk by any chance a Sandisk USB-3 device ?

Known issue on RB5009. They are working on it.
We are looking forward to fix it and currently can suggest to configure a startup scheduler script which does USB power-reset or consider using other brand USB Flash drive

Re: USB Disk issue after hardware reboot

Posted: Tue Jan 09, 2024 6:07 pm
by jaclaz
Some context/previous reports:
viewtopic.php?p=1006351

viewtopic.php?t=193556

It is connected with USB 3 sticks that are sometimes detected as USB 2, Sandisk sticks appear to be more prone to the issue, but it is possible that other brands are also affected.

Re: USB Disk issue after hardware reboot

Posted: Thu Jan 11, 2024 10:52 am
by phoenix202305
Thanks both for the informations and replies, we found a workaround to prevent the issue, if anyone find it useful.
We put the following script inside a netwatch with a ping to one of our public ip.

[interval=5s / startup-delay=5s / timeout=3s / type=simple]
up-script:
:local uptime [/system resource get uptime];
:local date [/system clock get date];
:local time [/system clock get time];
:local identity [/system identity get name];
:local uptimelimit "24:00:00";

:if ($uptime<$uptimelimit) do={
:delay 2000ms

/file
:if ([:len [find where name="usb1" and type="disk"]] = 1) do={/disk remove usb1}
:log warning "AUTOMATIC CONTAINER START"
:delay 2000ms

/disk set usb2 slot=usb1
:delay 2000ms

/container
start 0

Re: USB Disk issue after hardware reboot

Posted: Sat Jan 13, 2024 2:05 am
by ckleea
Can the script resolve the issue of mounting to a wrong position after a sudden reboot?

I have several issues of this when the USB drive was mounted to a different name that containers won't start. As a result, I have to reformat the USB and reinstall the containers. The later takes a much loner time as I need to configure again some settings in the containers' applications.

BTW, is there way to save the container as a tarball?

Re: USB Disk issue after hardware reboot

Posted: Sat Jan 13, 2024 10:45 am
by jaclaz
As a result, I have to reformat the USB and reinstall the containers. The later takes a much loner time as I need to configure again some settings in the containers' applications.
It sounds like a different issue if you actually need to re-format the USB and reinstall the containers.
The script only checks if - by any chance - the USB disk/stick has been mounted on the "wrong" slot and if it is, corrects the slot name.

In any case, if you are experiencing USB corruption or in any case for "proper" backup/restore, if it is a "normal" USB stick (normal in the sense of "sized a few GB's", or "not a zillion GB's USB disk/SSD") it would make IMHO a lot of sense to make a dd-like (sector by sector) image, it is the easiest way to restore the stick to a pristine/initial state, and the image is likely well compressible with zip or gzip. (of course if you have local/physical access to the router and stick)