Ubuntu/Linux alternative to Chkdsk

Ubuntu Version:
Ubuntu 24.04.4 LTSetc.

Problem Description:
My Ubuntu is installed alongside a legacy version of Windows (that was originally on the system )
I never use Windows.
EXCEPT!! from time to time my external harddrive (my primary storage device) fails to mount in Ubuntu and becomes unusable. (this usually happens after a power failure, which happens …. once or twice a month here in the country)

When it fails the only way I have found to get it back online and have access to the data is to boot Windows and run that old standby, CHKDSK. which has always brought the drive back to life.

I am installing a light version of Ubuntu (LUbunto) on a second system which currently has:
Ubuntu 24.04
and
another legacy version of WIndows, Vista

If I could find a Ubuntu / Linux alternative to CHKDSK I could just eliminate the Windows install altogether.
Ideally a graphical tool, as I am not very handy with Terminal command driven manipulation of drives.

Is FSCK actually as powerful / effective as CHKDSK?

Peter

1 Like

There’s really no alternative for Windows native (logical) error corrections tools if you’re using NTFS.

If you don’t intend for that drive to be used in Windows and, as you say, you “never use Windows” (other than to correct said drive), then the smart thing to do is backing up everything you need from it and re-format it with a filesystem that can be correctly supported in Linux (e.g. EXT4).

That said, if the drive is systematically showing errors, either you’re using it incorrectly or the drive is about to fail for good. I use many external drives with NTFS in Linux but only in machines with dual-boot with a properly up-to-date Windows 11 and the occasions I have to do the same you’re reporting here are extremely rare.

8 Likes

for instance, it appears that FSCK cannot be run on a Mounted drive.
But when I am running ubuntu normally I don’t actually know which drive it is running from and so I would not want to Unmount that drive
which is why I like using Windows Chkdsk. - it just works.

peter@peter-OptiPlex-990:~$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 782M 6.2M 776M 1% /run
/dev/sda3 52G 41G 8.2G 84% /
tmpfs 3.9G 79M 3.8G 2% /dev/shm
tmpfs 5.0M 8.0K 5.0M 1% /run/lock
/dev/sda4 134G 21G 107G 17% /mnt/427bb13e-0609-4207-9628-10860c5d6586
tmpfs 782M 168K 782M 1% /run/user/1000
/dev/sdc1 1.9T 1.6T 257G 87% /mnt/usb-Seagate_Expansion_Desk_NA4N2NMT-0:0-part1
peter@peter-OptiPlex-990:~$ sudo fsck -y /dev/sda3
fsck from util-linux 2.39.3
e2fsck 1.47.0 (5-Feb-2023)
/dev/sda3 is mounted.
e2fsck: Cannot continue, aborting.

Hmmm, Yes, my big external HD is formatted NTFS
I’ll get another drive set up, back up #1 and reformat it.
Peter

1 Like

Again, there’s no good Linux tools for that purpose. It has nothing to do with whether you can or can’t run it on a mounted partition (and FYI, in Windows it unmounts the drive prior to running chkdsk which also CAN’T run in mounted partitions).

There’s really nothing else to add. You’re asking the wrong question, based on wrong assumptions.

1 Like

I would like to have a clear understanding of the situation. When there is a power cut both Windows and Ubuntu still load but the external drive does not mount. Is that correct?

What file system is being used on that drive? If it is a Windows file system then that would explain why a Windows utility fixes the problem.

For your information /dev/sda3 is your Ubuntu partition. It is 52G in size. with 84% used. I say it is your Ubuntu partition because it is listed as { / } = root.

I am guessing that /dev/sdc1 is the external drive = 1.9T size.

And it is true that running fsck from the ubuntu that we are using will not work.

I understand that during the boot process Ubuntu will automatically run fsck if it detects file system defects.

There is a utility that we can use and it will unmount the partition to do it.

At the Grub boot menu select Advance Options for Ubuntu and the select a Linux kernel with recovery mode.

Linux will load and present you with the friendly Recovery menu. Select fsck to check all file systems. When that is finished you will be put back at the menu. Select Resume to resume normal boot.

You will find yourself at a desktop login screen using an open source video driver. If you normally run on a proprietary video drive then just reboot.

I have no knowledge of a Linux utility that will file system check Windows file systems.

Regards

You can always tell what the / (root) filesystem partition is by running the df -h command which output you show above. It will show under Mounted on as / (the symbol for the root of the filesystem) and if you are booted into it, it will obviously be mounted. In your case as pointed out, that is sda3.

If you know how to use a partition manager such as gparted, your 2TB drive is mostly empty and you could shrink the only partition (sdc1) and create another partition with a Linux filesystem and you would not need to back anything up or reformat.

fsck on LInux doesn’t work on a windows filesystem and chkdsk is useless on a linux filesystem

Helpful.
”When there is a power cut both Windows and Ubuntu still load but the external drive does not mount. Is that correct?”
this is basically correct
I have had Ubuntu fail to restart as well, but that is much much more rare. The HD failing has been quite common. though it always comes back to life.

”What file system is being used on that drive?”
that external drive appears to be formated as NTFS.
it has been suggested that I should hack it up completely and reformat it as EXT4.
I’ll work on that.

I’ll now also read and digest your other suggestions.

Peter

Somewhat off topic but I doubt it will always come back to life. Losing power while the HDD is accessed might also result in unrecoverable physical damage. Did you consider using an UPS to safely shut down in case of power loss?

I am trying this. but I am having trouble
I popped a fresh blank 3TB HDD into my spare docking station, formatted it as EXT4 with the plan of copying the contents of that NTFS drive over (before reformatting the NTFS as EXT4)

However I do not seem to be able to MOUNT or write to that newly formatted EXT4 backup drive.

Is this a permissions problem?
how would I fix this to make this new drive Writable.?

Why does it have an EFI partition if you just formatted?

Anyway, for this tasks better to use the included tool Disks. You can open it now, right-click the partition and select take ownership. This will solve anything permissions related.

for some reason DISKS is not responding or rather is not allowing me to select or RightClick on any of the disks shown.

Select the one you need to change from the left panel. Click the partition to select it, click the cog wheel to open the menu. Then take ownership.

I cannot select anything in the LH panel.
”clicking” on any of the four options does nothing.
Let me reboot

Hmmm, even though I thought “let me reboot” sounded ridiculous, only after the reboot does DISKS allow me access to those options.

However (and I am sorry to seem to dim), clicking on the cog wheel, which drop down option allows me to “take ownership” (I am not seeing that…. yet)

I am seeing (because I cannot get a screenshot):
Format Partition
Edit Partition
Edit FileSystem
Resize
Check Filesystem
Repair Filesystem
Edit Mount Options
<greyed out “Edit encryption Options>
Create Partition Image
Restore Partition Image
Benchmark Partition

You have to click the partition… Then, if it isn’t “take ownership” it’s something like “take control” (translations aren’t always literal, you know…).

reading further, it seems that there should be a “Take Ownership” line in the drop down options,
But I am not getting that. (that screenshot is from someone else’s post about the same situation)

elsewhere I have seen posts reporting that they too do not have the “Take Ownership” option in the dropdowns off the Cog
and suggestions that it might be an older version of Disks? but that doesn’t make a lot of sense (and I cannot seem to see how to install a newer version)

Considering you have nothing in that drive you have nothing to loose…

(In Disks after selecting the drive) Select (unmount if needed) and delete [-] all partitions and create a new one. It’s this simple.

[EDIT] Important note: In spite of what you’re reporting - not being able to copy files to the new partition -, your initial screenshot (GParted) shows two unexpected details:

  1. A 200MB ESP (EFI System partition), already mentioned above. This suggests the drive has been used to boot some OS (The ESP is populated with at least one bootloader, ~3MB used).
  2. ~45GB already written in the EXT4 partition (???)

Knowing this, if you need something already written make sure you backups before reformatting. Take care.

indeed. there is no risk
I’ll try this.

That worked!

thanks for your time and help

1 Like