Author Topic: Win7 has truncated directory names on external HDD to 8.3!  (Read 2522 times)

0 Members and 1 Guest are viewing this topic.

Offline Delta

  • Super Contributor
  • ***
  • Posts: 1225
  • Country: gb
Win7 has truncated directory names on external HDD to 8.3!
« on: October 25, 2017, 10:04:01 pm »
So a work colleague has just asked "why have all my folders turned to shit?".

Our work computers use Win7, and often when plugging in USB storage devices we get the "Do you want to scan and fix XXXXXX (X:)?" popup.  We always choose "Continue without scanning", but he let it do its thang this time.  Now some directories have had all subdirectories over 8 chars long truncated to 8.3.

Using dir /x I can see that it looks like the affected folders have had their original long names completely replaced with the truncated versions, so I don't think this is recoverable.  (I created a new directory, and it shows its longname and the shortname) Please see the screenshots attached.

Why has this happened, and can it be reversed?
 

Offline Delta

  • Super Contributor
  • ***
  • Posts: 1225
  • Country: gb
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #1 on: October 25, 2017, 11:18:28 pm »
Thanks for the reply Wilfred.

It was OK yesterday, was plugged in today, scanned and "Fixed"(!), and is now like this.  It hasn't been on any other systems, other than this office computer.

Very weird, and very annoying.  Thank you Mircosoft!
 

Offline Whales

  • Frequent Contributor
  • **
  • Posts: 989
  • Country: au
    • Halestrom
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #2 on: October 26, 2017, 12:15:37 am »
To further what wilfred has said:

Windows/DOS filesystems started with 8.3 for everything.  Long filenames were an added feature later, so to keep backwards compatibility they were probably implemented as 'extra' or 'optional' information.

If this extra info is corrupt or questionable then the checkdsk algos may have chosen to delete it (or atleast get rid of the flags to say it's there).

Try plugging the USB into a *nix computer, see what it thinks of the filesystem.  They have a different code stack for fat32 and ntfs (two ntfs drivers, for that matter); so you might get lucky.

Online Tomorokoshi

  • Frequent Contributor
  • **
  • Posts: 870
  • Country: us
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #3 on: October 26, 2017, 03:08:22 am »
To clarify, what do you get when you view the directories using the Windows folder viewer?
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5450
  • Country: 00
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #4 on: October 26, 2017, 03:16:59 am »
It likely mounted it as the wrong file type for some reason. It might have mounted "Fat 32" as "DOS"
"What the large print giveth, the small print taketh away."
 

Online blueskull

  • Supporter
  • ****
  • Posts: 13652
  • Country: cn
  • Power Electronics Guy
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #5 on: October 26, 2017, 04:31:08 am »
It likely mounted it as the wrong file type for some reason. It might have mounted "Fat 32" as "DOS"

Good reason to stick with NTFS or exFAT -- they have LFS built in from the first release and there's simply not a program that can mount them without LFS.
 

Offline Delta

  • Super Contributor
  • ***
  • Posts: 1225
  • Country: gb
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #6 on: October 26, 2017, 04:38:45 am »
Tried it on a Ubuntu system, exactly the same.  Gparted didn't find any issues with the file system...
 

Online hamster_nz

  • Super Contributor
  • ***
  • Posts: 2282
  • Country: nz
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #7 on: October 26, 2017, 04:46:43 am »
It likely mounted it as the wrong file type for some reason. It might have mounted "Fat 32" as "DOS"

Good reason to stick with NTFS or exFAT -- they have LFS built in from the first release and there's simply not a program that can mount them without LFS.

As luck would have it, NTFS does have some 8.3 filename features for legacy applications - it defaults to creating a second 8.3 file name for every file that needs one.

https://support.microsoft.com/en-nz/help/121007/how-to-disable-8-3-file-name-creation-on-ntfs-partitions

Although disabling 8.3 file name creation increases file performance under Windows, some applications (16-bit, 32-bit, or 64-bit) may not be able to find files and directories that have long file names.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: blueskull

Online blueskull

  • Supporter
  • ****
  • Posts: 13652
  • Country: cn
  • Power Electronics Guy
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #8 on: October 26, 2017, 04:50:18 am »
It likely mounted it as the wrong file type for some reason. It might have mounted "Fat 32" as "DOS"

Good reason to stick with NTFS or exFAT -- they have LFS built in from the first release and there's simply not a program that can mount them without LFS.

As luck would have it, NTFS does have some 8.3 filename features for legacy applications - it defaults to creating a second 8.3 file name for every file that needs one.

https://support.microsoft.com/en-nz/help/121007/how-to-disable-8-3-file-name-creation-on-ntfs-partitions

Although disabling 8.3 file name creation increases file performance under Windows, some applications (16-bit, 32-bit, or 64-bit) may not be able to find files and directories that have long file names.

Wow. Never heard of this feature in the long 17 years of use of NTFS from Win2k...
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 2801
  • Country: si
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #9 on: October 26, 2017, 05:25:51 am »

As luck would have it, NTFS does have some 8.3 filename features for legacy applications - it defaults to creating a second 8.3 file name for every file that needs one.

https://support.microsoft.com/en-nz/help/121007/how-to-disable-8-3-file-name-creation-on-ntfs-partitions

Although disabling 8.3 file name creation increases file performance under Windows, some applications (16-bit, 32-bit, or 64-bit) may not be able to find files and directories that have long file names.

Wow i had no idea they did the same ridiculous legacy mess with NTFS too.

For the original poster. Im pretty sure the part that stores the long file name lookup tables got corrupt in some way and scandisk decided its too messed up to fix so it just deleted it. While windows will happily still work with short filenames.

Its quite possible that scandisk did the right thing. If you tried to change random bytes of the long file name entries you can probably find some combinations that cause quite funky behavior in windows that makes some files invisible or unusable.
 

Offline Delta

  • Super Contributor
  • ***
  • Posts: 1225
  • Country: gb
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #10 on: October 26, 2017, 05:49:21 am »
To clarify, what do you get when you view the directories using the Windows folder viewer?

Exactly the same, short truncated names only.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 3494
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #11 on: October 26, 2017, 06:19:30 am »
Our work computers use Win7, and often when plugging in USB storage devices we get the "Do you want to scan and fix XXXXXX (X:)?" popup.

FAT, as commonly used on USB drives, is not redundant or robust at all. If you damage the file table or LFN extension, this is one of the many things that could happen.
Most of the time the it's easier to spot though, since people just see "it lost files", "can't open directory" or "RAW filesystem".
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 2156
  • Country: gb
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #12 on: October 26, 2017, 09:38:08 pm »
device name - Elements????

you didnt format it from new??
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5450
  • Country: 00
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #13 on: October 26, 2017, 10:08:34 pm »
If i were you I would image the drive, make a copy of the image, and direct all your attempts to fix it on the copy.

Also remember that many drive repairs cannot be undertaken when a drive is mounted. My guess is the drive may not be damaged, its possible the drive is just not being recognized properly. You may want to make a bootable rescue disk using a LiveDVD based on Linux (see Distrowatch.com for some options)  and boot into that and first image your disk onto a disk image (if its failing use a program like ddrescue) Then make a copy of the image.. only then attempt to get its various parameters (especially its partition table info) With an image of the raw disk safe, you can work on a copy of that data.. Perhaps see what happens when you try to mount your copy of your disk. 

Never work on the actual disk.
"What the large print giveth, the small print taketh away."
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5450
  • Country: 00
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #14 on: October 26, 2017, 10:11:41 pm »
Does this "scanning" program keep any kind of log of what it did? It must.
"What the large print giveth, the small print taketh away."
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 3494
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #15 on: October 27, 2017, 05:36:13 am »
scandisk does keep a log.
https://superuser.com/a/896116/592444
 

Offline Delta

  • Super Contributor
  • ***
  • Posts: 1225
  • Country: gb
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #16 on: October 27, 2017, 06:32:36 am »
scandisk does keep a log.
https://superuser.com/a/896116/592444

Thanks for that, I'll have a look when I'm back in work.
 

Offline Delta

  • Super Contributor
  • ***
  • Posts: 1225
  • Country: gb
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #17 on: October 27, 2017, 06:35:07 am »
device name - Elements????

you didnt format it from new??

I would assume he did not, just plugged it in and started copying music and movies onto it, like most people would. What is your point? Is this not the nerd way?
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 3610
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #18 on: October 27, 2017, 07:16:14 am »
Looks like the simplest fix is to restore from a recent backup.

If there isn't one, then your colleague has just received about the gentlest, least costly lesson possible as to why backups are not optional. I sympathise, to about the tiniest extent physically measurable, because we've all done that once.

If the content of the drive is music files, then they're probably tagged with artist, album and song title. A tool like MP3tag can traverse a directory tree renaming files according to those tags, and might be a workable way to recover meaningful file names from the mess.

Offline metrologist

  • Super Contributor
  • ***
  • Posts: 1834
  • Country: 00
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #19 on: October 27, 2017, 07:37:38 am »
I'm getting this pop-up on my video camera with microSD card. I formatted the card in the camera from new and I've had this message straight away, and have just dismissed it each time. Maybe next time I copy the files, I will try again and let MS "fix" the drive to see what happens. I'm expecting something bad to happen.

Note the camera adds some necessary configuration files and directory structure when formatting.
 

Offline rdl

  • Super Contributor
  • ***
  • Posts: 2968
  • Country: us
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #20 on: October 27, 2017, 07:58:14 am »
I'm pretty sure Windows does something to mark a removable drive so that if it's not "safely removed" or ejected, that error message pops up the next time it's inserted/plugged in. It may only happen with NTFS, but I'm not sure. I never use NTFS with removable drives or memory cards, it's far too annoying.


Edit: With removable drives/memory cards, etc. I wonder if this will fix getting that pop up to "scan and fix"?

« Last Edit: October 27, 2017, 10:48:51 am by rdl »
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 3494
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #21 on: October 27, 2017, 09:48:55 am »
Yes. The dirty bit.
Sector 0x025 offset 0x1A:
In Windows NT used for CHKDSK flags (bits 7-2 always cleared, bit 1: disk I/O errors encountered, possible bad sectors, run surface scan on next boot, bit 0: volume is "dirty" and was not properly unmounted before shutdown, run CHKDSK on next boot).[32] Should be set to 0 by formatting tools.[5][6][7] See also: Bitflags in the second cluster entry in the FAT.
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 2156
  • Country: gb
Re: Win7 has truncated directory names on external HDD to 8.3!
« Reply #22 on: October 27, 2017, 12:23:39 pm »
device name - Elements????

you didnt format it from new??

I would assume he did not, just plugged it in and started copying music and movies onto it, like most people would. What is your point? Is this not the nerd way?

there are a number of reasons why you should ALWAYS format a new drive.
1: to check it for errors - a lot of bad drives fail within the first hour out of the box.
2: a lot of drives come bundled with crap and when you combine it with an o.s. that likes to "auto-run" stuff on discovery your asking for trouble.
3: there have been a number of instances where a virus has somehow been inserted into the master image at a harddrive / usb-flash production line.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf