What to do if you get an error changing the label on your external NTFS file system HDD

botond published 2020. 02. 04., K - 09: 42 time

Content

The symptom

We have attached an NTFS external hard drive to our Linux machine. The volume has been mounted, but if you want to overwrite its label it is ntfslabel command:

sudo ntfslabel /dev/<eszköznév> <kötet címke>

or just want to read it:

sudo ntfslabel /dev/<eszköznév>
It is important to note here that commands handling various volume information should only be executed on unmounted devices!

We get the following error:

Volume is scheduled for check.
Please boot into Windows TWICE, or use the 'force' option.
NOTE: If you had not scheduled check and last time accessed this volume
using ntfsmount and shutdown system properly, then init scripts in your
distribution are broken. Please report to your distribution developers
(NOT to us!) that init scripts kill ntfsmount or mount.ntfs-fuse during
shutdown instead of proper umount.

The file system is likely damaged. So here it tells you to boot the device twice on Windows (which will do the repair) or use the 'force' option.

The aforementioned force option can read / write the volume label, but the problem persists and throws an error after the operation:

WARNING: Dirty volume mount was forced by the 'force' mount option.
[parancs esetleges további kimenete]

So what do we do with this problem?

The solution

The problem is ntfsfix command to resolve. Let's run it with a -d option, which will remove the "dirty" flag after checking the file system:

sudo ntfsfix -d /dev/<sérült_eszköz_azonosítója>

If all goes well, the output will:

Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sdb1 was processed successfully.

You can then use the ntfslabel command to query or modify the NTFS file system label without errors.

Conclusion

This type of problem occurs when, for example, with a working Windows system, we simply unplug our external drive without properly disconnecting it. Doing so may cause the system to fail to perform the required shutdown file system operations and possibly corrupt the contents of the media. Therefore, especially in Windows, it is recommended that you always disconnect your external storage with the option to safely remove the device and then disconnect it.

Related Content, Useful Links: