Hi Jean-Pierre!
On Tuesday 27 December 2011 09:29:58 Jean-Pierre André wrote:
> Dennis Schridde wrote:
> > I just ran Windows 7 SP1's chkdsk on an NTFS partition that I usually
> > work on from Linux using NTFS-3G 2011.4.12.
> >
> > chkdsk decided to delete a lot of filenames because they were "invalid"
> > (that seems to mean they contain characters like : or ? which Windows
> > does not like). Now I am in a state where I have a few dozen
> > file1234.chk filenames and dir1234.chk directories, have to figure out
> > what they contain and properly rename them. (At least it did not
> > entirely delete the files...)
>
> The chkdsk for Windows 7 creates a log in
> "/System Volume Information/Chkdsk/Chkdsk*.log"
> which contains the old name and the inode number,
> such as :
> "Deleted invalid filename foo:bar (83) in directory 30."
>
> You can query the inode number of "file1234.chk"
> with stat or option -i of ls ("ls -li file1234.chk"), and
> associate the old name according to inode number.
Thanks for this tip! It seems I can recover my files afterall. :)
I attached the script I wrote to recover my files. Hope it is useful to
somebody.
Searching for that file I also found a _restore{UUID} directory. What is that
about?
> > Now my questions/ideas to prevent such mess in the future:
> > * Is it possible to instruct ntfs-3g to create both, a Windows and a
> > POSIX filename?
>
> This is probably possible in general, using hard links,
> but it would be complex :
> - when deleting such a file, a search for a possible
> alternate name would have to be done.
> - when doing a directory list, returning both names
> would have to be avoided.
>
> In such a case, the Posix name is deleted by chkdsk
> and the Windows name is kept (no file1234.chk is
> created), so there is no real improvement.
To me this would be a huge improvement. I would not have to resort to chkdsk
logs and parsing stat to regularly fix my filenames, if the Windows name would
persist.
> > * Can it map "invalid" characters of the POSIX filename to e.g.
> > underscores _ in the Windows filename? Does "windows_names" do this?
>
> Replacing reserved characters by underscores would
> create duplicates.
You mean potential name clashes?
> > * Is it possible to put the whole partition into POSIX mode, so that
> > Windows and tools like chkdsk would let those filenames alone?
>
> Not possible. My opinion is that the deletion of such file
> names has been added intentionally by Microsoft.
To piss off Linux users?
Thanks for your detailed answer,
Dennis
recover_chkdsk_invalid_filenames.sh
Description: application/shellscript
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev
_______________________________________________ ntfs-3g-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel
