Tuesday, May 7, 2019

Linux mounted NTFS partition as read-only suddenly

Sometimes in dual boot system (Windows / Linux), the NTFS partitions might have some problem causing the Linux mounted the NTFS partitions as read-only. To solve this problem, one might try following to see if it works:


Step 1: Unmount the partition first

This can be done via Disks application OR command line:
  • e.g. umount -v /dev/sda1

Step 2: Run ntfsfix on the target partition
  • e.g. sudo ntfsfix /dev/sda1


If the command is successful, the following output should be shown:
  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/sda1 was processed successfully.

Step 3: Remount the partition

    The partition should be read-write enabled






Sync multiple git repo at once

Use the following command in Linux will do the job:  ls -d RepoNames* | xargs -I{} git -C {} pull