Community discussions

MikroTik App
 
User avatar
Filo
newbie
Topic Author
Posts: 39
Joined: Thu Jan 13, 2022 2:37 pm
Location: Germany

USB-Stick slot kept getting renamed. So...

Mon Aug 28, 2023 1:01 pm

Hi,

recently I upgraded my setup to RB5009 (coming from a HAP-Device).

I noticed (Version 7.11) that every now and then, mostly with a reboot, my USB-Stick got renamed ("SLOT" got changed).
One boot it's USB1 (and the partition accordingly: USB1-Part1), next boot it is USB2 (and USB2-part2)...
Also I noticed an empty partition showing up which occupied the other slot.

Since this is annoying in having an SMB-Share or containers hosted, and I saw this happening to other users as well in the firmware-discussion threads, I'd like to share a workaround, which is working fine for me.

1. In Winbox open SYSTEM -> DISKS
2. Write down or copy the MODEL - string of the attached device which is always changing (in this example: USB SanDisk 3.2Gen1 )
3. Open SYSTEM -> SCHEDULER
4. Create a new scheduled script (by pressing +)

Script:
Name: Rename USB
Start Time: startup
On event:

:delay 10
/disk set slot=data [find model="USB SanDisk 3.2Gen1"]


What's this doing?

Every time the Routerboard is starting up the attached USB-Stick is renamed to "data".
This is more reliable than hoping the correct order will be preserved after reboot.

You then will be able to create Containers stored in e.g. /data/container/ or you can be sure that your SMB-Services are running correctly if you add shares like /data/share .

For containers you will want to create another script, making them run after the rename-script did the job.
Autorun containers fail if you set them to "start on boot" and the devices name is still false.

Maybe someone knows, WHY the renaming is happening in the first place? Is it a bug? Is it depending on the USB-Hardware?
Hope this helps someone, somewhere :)

Best regards,
Martin!
 
Worko
just joined
Posts: 3
Joined: Thu Dec 14, 2023 6:01 pm

Re: USB-Stick slot kept getting renamed. So...

Fri Feb 16, 2024 7:35 am

It was kinda working for a while. Now it does not again. It sets "data" on a not-being-used slot..
[myname@mikrofw] /disk> print
Flags: E - EMPTY, B - BLOCK-DEVICE; M - MOUNTED
Columns: SLOT, MODEL, SERIAL, INTERFACE, SIZE
#    SLOT  MODEL                SERIAL                                                                                                                    INTERFACE                     SIZE
0 E  data                                                                                                                                                 USB 3.20 5000Mbps                 
1 BM usb2  USB SanDisk 3.2Gen1  04019daf59f1114ca69b7e9c69df61073c08f7938c8cb9cd928ae2fbdd03f1efb1430000000000000000000048ce2b1600858b18915581072aaebe50  USB 2.10 480Mbps   250 148 290 560
That it shifts down the speed from USB3 > USB2 is a different topic. My router params:
[myname@mikrofw] /system/routerboard> print
       routerboard: yes
             model: RB5009UPr+S+
     serial-number: cenzored
     firmware-type: 70x0
  factory-firmware: 7.8
  current-firmware: 7.8
  upgrade-firmware: 7.13.4
Last edited by Worko on Sat Mar 02, 2024 12:02 pm, edited 1 time in total.
 
jaclaz
Long time Member
Long time Member
Posts: 670
Joined: Tue Oct 03, 2023 4:21 pm

Re: USB-Stick slot kept getting renamed. So...

Fri Feb 16, 2024 11:10 am

But it still is a Sandisk USB 3.x device, the possible explanation given is that it is *somehow* slower (or faster) than other sticks in "presenting itself" to the OS, so essentially a timing problem of some kind:
viewtopic.php?t=203217
 
Worko
just joined
Posts: 3
Joined: Thu Dec 14, 2023 6:01 pm

Re: USB-Stick slot kept getting renamed. So...

Thu Feb 29, 2024 9:24 pm

What I did find out is, that this issue comes up after a firmware upgrade or a soft reboot = all reboots initiated via software (e.g. Winbox or ssh). Whenever I unplugg power for a couple of seconds and then plug it back again - it works correctly:
[myname@mikrofw] > /disk/print                                                                                                                                                                                                        
Flags: E - EMPTY, B - BLOCK-DEVICE; M - MOUNTED
Columns: SLOT, MODEL, SERIAL, INTERFACE, SIZE, FREE, FS
#    SLOT  MODEL                SERIAL                                                                                                                    INTERFACE                     SIZE             FREE  FS  
0 BM data  USB SanDisk 3.2Gen1  04019daf59f1114ca69b7e9c69df61073c08f7938c8cb9cd928ae2fbdd03f1efb1430000000000000000000048ce2b1600858b18915581072aaebe50  USB 3.20 5000Mbps  250 148 290 560  238 592 811 008  ext4
1 E  usb2  

[myname@mikrofw] > /system/routerboard print 
       routerboard: yes
             model: RB5009UPr+S+
     serial-number: cenzored
     firmware-type: 70x0
  factory-firmware: 7.8
  current-firmware: 7.8
  upgrade-firmware: 7.14

I am not sure what does it have to do with a soft-reboot, but that are my findings :) Hopefully, it will help someone.

Who is online

Users browsing this forum: rolfschneider, thor29 and 39 guests