What should I do if I get an error when changing the label of our external NTFS 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, on a running Windows system, we simply unplug our external drive without properly disconnecting it. In this case, the system does not perform the required shutdown file system operations, and the contents of the media may be damaged. Therefore, especially under Windows, it is always recommended to always disconnect our external storage with the Safely Remove Hardware option and only then unplug it.

 

Related Content, Useful Links: