Community discussions

MikroTik App
 
phoenix202305
just joined
Topic Author
Posts: 2
Joined: Wed May 31, 2023 11:20 am

USB Disk issue after hardware reboot

Tue Jan 09, 2024 4:43 pm

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.
You do not have the required permissions to view the files attached to this post.
 
holvoetn
Forum Guru
Forum Guru
Posts: 6174
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: USB Disk issue after hardware reboot

Tue Jan 09, 2024 4:49 pm

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
 
jaclaz
Forum Guru
Forum Guru
Posts: 1627
Joined: Tue Oct 03, 2023 4:21 pm

Re: USB Disk issue after hardware reboot

Tue Jan 09, 2024 6:07 pm

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.
 
phoenix202305
just joined
Topic Author
Posts: 2
Joined: Wed May 31, 2023 11:20 am

Re: USB Disk issue after hardware reboot

Thu Jan 11, 2024 10:52 am

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
 
ckleea
Frequent Visitor
Frequent Visitor
Posts: 69
Joined: Sun Apr 21, 2013 12:19 pm

Re: USB Disk issue after hardware reboot

Sat Jan 13, 2024 2:05 am

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?
 
jaclaz
Forum Guru
Forum Guru
Posts: 1627
Joined: Tue Oct 03, 2023 4:21 pm

Re: USB Disk issue after hardware reboot

Sat Jan 13, 2024 10:45 am

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)

Who is online

Users browsing this forum: No registered users and 5 guests