The USB disk, connected during an Ubuntu crash, did not mount after the system rebooted.
What triggered the issue
My Ubuntu 22.04 desktop unexpectedly froze while I was editing a text file located on a USB-mounted removable disk. With no other option, I had to shut down the system using the power switch. To my relief, the system rebooted safely and without issues. However, when I reconnected the USB disk, it refused to mount. After investigating the problem, I discovered the following remedy.
The Solution
If an Ubuntu 22.04 system crashed and cannot mount a USB disk after a reboot, the issue could be:
- The filesystem got dirty or corrupted.
- The USB was not cleanly unmounted before the crash.
- The system services responsible for mounting (like
udisks2) are unstable.
Letās go through this step-by-step recovery.
š§ 1. Check if the USB is detected at all.
Plug the USB in and run:
$ lsblk -f
$ sudo dmesg | tail -n 30
Password Upon inspection, dmesg reported:
[ 777.748071] sda: sda1
[ 777.748454] sd 4:0:0:0: [sda] Attached SCSI disk
[ 781.521521] ntfs3: sda1: It is recommened to use chkdsk.
[ 781.628866] ntfs3: sda1: volume is dirty and "force" flag is not set!This indicates that the USB drive (/dev/sda1) uses the NTFS filesystem, and Ubuntuās NTFS3 driver is refusing to mount it automatically due to the following reason:
āvolume is dirty and āforceā flag is not setāIn other words, the filesystem wasnāt cleanly closed, likely because of the crash or because the drive was disconnected without being safely unmounted.
š§© Whatās happening
NTFS keeps a ādirty bitā to mark that Windows (or Linux) didnāt close the filesystem cleanly. Ubuntuās driver (ntfs3) sees that bit and refuses to mount to avoid data loss.
ā Safe Fix ā Quick Linux Fix (with ntfsfix)
$ sudo ntfsfix /dev/sda1This will:
- Clear the dirty bit.
- Fix some basic NTFS inconsistencies.
- Schedule a deeper check for next Windows mount (if applicable).
Once I executed sudo ntfsfix /dev/sda1, the USB disk mounted without issue through the GUI, and a Dolphin window opened displaying its root directory.
š”Inspect and safely remove the USB disk:
1 Open a terminal in the USB diskās root directory:
- Right-click on an empty area within the Dolphin window displaying the root of the USB disk.
- Select āOpen Terminalā from the context menu.
- A terminal window will open, already set to the USB diskās root directory.
2 Check the disk contents:
- Use commands like
lsandcdto browse and verify the files as needed.
3 Close the terminal when done.
4 Safely remove the USB disk:
- In Dolphinās left sidebar, under Removable Devices, locate the USB disk label.
- Right-click it and select āSafely Removeā.
- Once unmounted, you can physically unplug the USB disk.
Conclusion
So the issue was indeed a ādirtyā NTFS filesystem caused by the system crash. Running sudo ntfsfix /dev/sda1 cleared the dirty bit and repaired the basic filesystem metadata, allowing Ubuntu to mount the disk again.
If it happens again ntfsfix is safe to re-run.