Skip to content

Instantly share code, notes, and snippets.

@utgupta27
Last active July 16, 2021 14:44
Show Gist options
  • Save utgupta27/b9ab8cabf9c1023ff75448b426f27f49 to your computer and use it in GitHub Desktop.
Save utgupta27/b9ab8cabf9c1023ff75448b426f27f49 to your computer and use it in GitHub Desktop.
Fix a Read-Only NTFS Partition on Ubuntu 20.04 LTS
Open the terminal or Press Alt+Ctrl+t
Paste the Command Below.
$sudo mount | grep <disk_name>
Replace the disk Name with the disk you want to fix i.e, Data
Example:
$sudo mount | grep Data
Output:
/dev/sdb2 on /media/utgupta27/Data type fuseblk (ro,nosuid,nodev,relatime,
user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
Type this on the terminal. Here <sdnx> means your drive address i.e, sdb1,sdb3,sdc1,etc.
<user_name> is your Linux system username
$sudo mount -o rw /dev/<sdxn> /media/<user_name>/<disk_name>
Example:
$sudo mount -o rw /dev/sdb1 /media/utgupta27/Data
Output:
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.
$sudo mount -o rw /dev/sdb1 /media/utgupta27/Data
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
Could not mount read-write, trying read-only
ntfs-3g-mount: failed to access mountpoint /media/utgupta27/Data: No such file or directory
$sudo ntfsfix /dev/sdb2
Mounting volume... The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
FAILED
Attempting to correct errors...
Processing $MFT and $MFTMirr...
Reading $MFT... OK
Reading $MFTMirr... OK
Comparing $MFTMirr to $MFT... OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sdb2 was processed successfully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment