Ralf Ertzinger wrote:
Hi,

On Wed, May 08, 2019 at 03:15:49PM +0200, Jean-Pierre André wrote:

I'm working on a project where a media with some data has to be prepared
on a Linux system to be read by a windows system. The media must not be
written to by the windows system, so I'm using SD cards (which have a
physical write protect switch).

It appears that a file system created by ntfs-3g on Linux (using
2017.3.23) cannot be read by windows from a read only medium. I'm using
the below test case:

On the linux system:

- Create MBR label on SD card
- Create partition (with parted), using fstype ntfs
- Create file system on partition with mkntfs
- Remove SD card from machine, and write protect using the physical
    write switch
Looks good to me. AFAIK, the ntfs layout does not have
any provision for marking read-only.
Even if it did, I'm not too inclined to trust that, physical write
protect switches are nice.

And ntfs-3g will enforce read-only mode upon mounting
such a device.

On insertion into a Windows 10 system the following occurs:

- There are errors about errors on the NTFS file system in the event log
    (unfortunately I do not have the exact details, can deliver later)
- The partition is shown as "RAW" in Disk Management, but is assigned a
    drive letter
- chkdsk.exe recognizes the file system as NTFS, and reports no errors
So the ntfs layout is valid. I suppose you started chkdsk.exe
with writing enabled.
No, chkdsk.exe was run on the SD card marked as read only, on the
partition windows marked as "RAW".

Did you try to plug the sd to Windows with writing enabled,
then make a safe unplug, disable writing, and plug again ?
I have not tried that, but will.

The tar file at https://tara.camperquake.de/ntfs-3g-1.tar contains three
files.

- A compressed disk image of the partition, as created by ntfs-3g
- A compressed disk image of the partition after Windows 10 did mount
   it once in write mode
- A screenshot of chkdsk.exe run on the partition while the media was
   still in read only mode (i.e. before Windows could modify it)

By comparing the images, I see that Windows added a
bunch of files, mainly for transaction management and
indexing. They these are not part of the ntfs structure,
they are files created by Windows applications which
most likely depend on your Windows version and configuration.

They are outside ntfs-3g scope and belong to a Windows
emulator.

Maybe there is a possibility you create a partition image
with everything your Windows configuration needs,
which you could use for formatting your SD cards. You
will however have to generate a new label for each SD card
to prevent conflicts when two such cards are mounted on
the same computer at the same time (see man ntfslabel).

Jean-Pierre




_______________________________________________
ntfs-3g-devel mailing list
ntfs-3g-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to