Skip to content

[Bug]: Exfat drives connected via SATA are not properly recognized and initialized. #2374

@MaximPerry

Description

@MaximPerry

Describe the bug

Additional drives formatted as Exfat connected via SATA are not properly recognized and initialized in CasaOS.

To Reproduce

  1. With your OS and CasaOS installed on a main drive, connect a secondary drive (in my case: 8 TB HDD) formatted as Exfat via SATA.
  2. Boot into CasaOS.

Result:

  • The newly added drive is not showing up under "Storage";
Image
  • A new notification appears under the search bar: "Found a new drive: [drive name] - NaN / [total capacity]";
Image
  1. To instead manually initialize the drive, open Storage Manager;
  2. Click on the "Create Storage" button, then fill-in the 'Storage name" field and select the drive under "Choose drive";
  3. Click the "Create" button (without formatting).

Result:

  • An error at the top of the screen appears: "/dev/sdb does not have a filesystem or it might be corrupted. Please consider format it.";
Image
  • CasaOS gets stuck indefinitely on the screen: "Creation in progress...".
Image

Expected behavior

  1. With your OS and CasaOS installed on a main drive, connect a secondary drive (in my case: 8 TB HDD) formatted as Exfat via SATA.
  2. Boot into CasaOS.

Result: The newly added drive is automatically recognized and initialized under "Storage".

Screenshots

(See screenshots above)

Desktop (please complete the following information):

 - OS: Ubuntu Server 24.04.2 LTS (GNU/Linux 6.8.0-85-generic x86_64)
 - Browser: Safari
 - Version: CasaOS v0.4.15

System Time

Local time: Fri 2025-10-17 14:52:57 UTC
Universal time: Fri 2025-10-17 14:52:57 UTC
RTC time: Fri 2025-10-17 14:52:57
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

Logs

Oct 17 14:51:17 user systemd[1]: Starting casaos-gateway.service - CasaOS Gateway...
░░ Subject: A start job for unit casaos-gateway.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit casaos-gateway.service has begun execution.
░░ 
░░ The job identifier is 194.
Oct 17 14:51:17 user casaos-gateway[843]: v0.4.8
Oct 17 14:51:17 user casaos-gateway[955]: git commit: eeb28d78941cf2746e611c02b148e347c47501da
Oct 17 14:51:17 user casaos-gateway[955]: build date: 2024-07-18T08:16:38Z
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] PROVIDE        *service.State <= main.main.func4()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] PROVIDE        *service.Management <= github.com/IceWhaleTech/CasaOS-Gateway/service.NewManagementService()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] PROVIDE        *route.ManagementRoute <= github.com/IceWhaleTech/CasaOS-Gateway/route.NewManagementRoute()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] PROVIDE        *route.GatewayRoute <= github.com/IceWhaleTech/CasaOS-Gateway/route.NewGatewayRoute()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] PROVIDE        *route.StaticRoute <= github.com/IceWhaleTech/CasaOS-Gateway/route.NewStaticRoute()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] PROVIDE        fx.Lifecycle <= go.uber.org/fx.New.func1()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] PROVIDE        fx.Shutdowner <= go.uber.org/fx.(*App).shutdowner-fm()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] PROVIDE        fx.DotGraph <= go.uber.org/fx.(*App).dotGraph-fm()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] INVOKE                main.run()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] RUN        provide: go.uber.org/fx.New.func1()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] RUN        provide: main.main.func4()
Oct 17 14:51:17 user casaos-gateway[955]: 2025-10-17T14:51:17.704Z        error        Failed to load routes        {"error": "open /var/run/casaos/routes.json: no such file or directory", "filepath": "/var/run/casaos/routes.json", "func": "service.NewManagementService", "file": "/home/runner/work/CasaOS-Gateway/CasaOS-Gateway/service/management.go", "line": 32}
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] RUN        provide: github.com/IceWhaleTech/CasaOS-Gateway/service.NewManagementService()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] RUN        provide: github.com/IceWhaleTech/CasaOS-Gateway/route.NewManagementRoute()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] RUN        provide: github.com/IceWhaleTech/CasaOS-Gateway/route.NewGatewayRoute()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] RUN        provide: github.com/IceWhaleTech/CasaOS-Gateway/route.NewStaticRoute()
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] HOOK OnStart                main.run.func1() executing (caller: main.run)
Oct 17 14:51:17 user casaos-gateway[955]: 2025-10-17T14:51:17.724Z        info        Management service is listening...        {"address": "127.0.0.1:46761", "filepath": "/var/run/casaos/management.url", "func": "main.run.func1.1", "file": "/home/runner/work/CasaOS-Gateway/CasaOS-Gateway/main.go", "line": 206}
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] HOOK OnStart                main.run.func1() called by main.run ran successfully in 1.943849ms
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] HOOK OnStart                main.run.func2() executing (caller: main.run)
Oct 17 14:51:17 user casaos-gateway[955]: 2025-10-17T14:51:17.725Z        info        Checking if service at URL is running...        {"url": "http://[::]:90/ping", "retry": 10, "func": "main.checkURLWithRetry", "file": "/home/runner/work/CasaOS-Gateway/CasaOS-Gateway/main.go", "line": 382}
Oct 17 14:51:17 user casaos-gateway[955]: 2025-10-17T14:51:17.727Z        info        New gateway is listening...        {"address": "[::]:90", "func": "main.reloadGateway", "file": "/home/runner/work/CasaOS-Gateway/CasaOS-Gateway/main.go", "line": 358}
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] HOOK OnStart                main.run.func2() called by main.run ran successfully in 1.790775ms
Oct 17 14:51:17 user casaos-gateway[955]: [Fx] HOOK OnStart                main.run.func3() executing (caller: main.run)
Oct 17 14:51:17 user casaos-gateway[955]: 2025-10-17T14:51:17.727Z        info        Static web service is listening...        {"address": "127.0.0.1:43717", "filepath": "/var/run/casaos/static.url", "func": "main.run.func3", "file": "/home/runner/work/CasaOS-Gateway/CasaOS-Gateway/main.go", "line": 311}
Oct 17 14:51:17 user casaos-gateway[955]: 2025-10-17T14:51:17.727Z        info        Notified systemd that gateway is ready        {"func": "main.main.func3", "file": "/home/runner/work/CasaOS-Gateway/CasaOS-Gateway/main.go", "line": 157}
Oct 17 14:51:17 user systemd[1]: Started casaos-gateway.service - CasaOS Gateway.
░░ Subject: A start job for unit casaos-gateway.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit casaos-gateway.service has finished successfully.
░░ 
░░ The job identifier is 194.

** Please note that I have replaced to real username by "user" in the above logs.

Additional context and observations

  • The same issue occurs whether I format the drive (in Exfat) using Windows or MacOS;
  • The drive is perfectly usable on other systems (Windows and MacOS);
  • In Storage Manager, choosing the option to "Format and create" will work and make the drive usable in CasaOS. However, it is not the desired result as it formats it as EXT4. I want to keep the drive formatted as Exfat to easily take it out and use it on other systems.
  • When using an HDD enclosure and connecting the drive via USB 3.0, CasaOS properly recognize and initialise it under "Storage":
Image
  • Not sure if this changes anything, but the drive is specifically connected to a SATA 2 port on my machine;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions