"No such file or directory" trying to write NTFS
I have booted from an LUbuntu 18.04 Live USB. I am trying to access the files on my hard drive (Windows 10, NTFS). By default they are mounted read only, so I remounted it read-write with no errors. (This is with the ntfs-3g driver in user space.) But when I try to write to files on the drive, I always get this error:
"No such file or directory"
For instance, if I chdir to my home directory on the drive and run "echo > tmp.txt" I get the error:
"bash: tmp.txt: No such file or directory"
If I try to make a copy of a file in the File Manager, I get this error:
file1.txt: Error opening file “/media/lubuntu/Windows8_OS/Users/michael/Downloads/file1.txt”: No such file or directory
I tried running ntfs-fix, but it found no issues.
Why can't I write to my drive?
Solution 1:
Instead of trying to remount the read-only partition, unmount the partition and mount it in a separate step. First the unmount (replace the directory as needed with wherever your Windows drive is mounted):
sudo umount /media/lubuntu/Windows8_OS
Next run ntfsfix
(sudo apt install ntfs-3g
if the command is not found) just in case the drive wasn't unmounted properly. This could happen, for instance, if you properly shut down but then aborted a Windows start due to the BIOS running away before you could select your USB media to boot from.
sudo ntfsfix /dev/sda4
The above assumes the NTFS file system is at /dev/sda4
. Replace as needed with your device (lsblk
may be helpful to determine where it is).
Now mount it:
sudo mount -t ntfs-3g /dev/sda4 /mnt
Don't forget to unmount it when you are done:
sudo umount /mnt