In a yocto distribution the ntfs file system of a USB key is mounted read-only?
1
vote
1
answer
81
views
To enable the mount of USB key formatted with file system
ntfs
I have created the following configuration fragment file:
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y
This file sets the parameters CONFIG_NTFS_FS
and CONFIG_NTFS_RW
used by the kernel build. To compile the kernel I have used the command:
bitbake -C compile virtual/kernel
With this modification of the kernel config my distribution is able to execute the mount of an ntfs
USB by the command:
> mount /dev/sda /media/sda
where /dev/sda
is the device associated with the USB key, and /media/sda
is the mount point.
The file system is mounted but read-only. This is showed by the following command:
# mount | grep media
/dev/sda on /media/sda type ntfs (ro,relatime,uid=0,gid=0,fmask=0177,dmask=077,nls=iso8859-1,errors=continue,mft_zone_multiplier=1)
In the fragment file I have set CONFIG_NTFS_RW=y
, so why the ntfs
file system of a USB key is mounted read-only?
___
**EDIT**
If I execute the command dmesg
I obtain the following message:
> dmesg
...
(device sda): load_system_files(): Volume is dirty. Mounting read-only. Run chkdsk and mount in Windows.
I have followed the info written in the previous message:
- I have inserted the USB on a Windows system
- The Windows system has executed a scanfix of the USB
After that I have execute correctly the mount R/W of the USB on my Linux system:
> mount -t ntfs /dev/sda /media/sda
> mount | grep media
/dev/sda on /media/sda type ntfs (rw,relatime,uid=0,gid=0,fmask=0177,dmask=077,nls=iso8859-1,errors=continue,mft_zone_multiplier=1)
At this point if I try to write on the USB I get the following error:
> touch /media/sda/write_ntfs.txt
touch: cannot touch '/media/sda/write_ntfs.txt': Permission denied
The same if I try to change the permission of a file present on the USB:
> chmod 777 /media/sda/filename.csv
chmod: changing permissions of '/media/sda/filename.csv': Operation not supported
So, despite the output of the command mount
, seems that the mount of the USB is yet read-only!
Asked by User051209
(498 rep)
Mar 24, 2025, 05:50 PM
Last activity: Apr 16, 2025, 12:46 PM
Last activity: Apr 16, 2025, 12:46 PM