Win7 has truncated directory names on external HDD to 8.3! - Page 1
Forum section: electronics / general

author: Delta
author_rank: Super Contributor
timestamp: October 25, 2017, 10:04:01 pm
content: 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?

author: Delta
author_rank: Super Contributor
timestamp: October 25, 2017, 11:18:28 pm
content: 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!

author: Whales
author_rank: Super Contributor
timestamp: October 26, 2017, 12:15:37 am
content: 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.

author: Tomorokoshi
author_rank: Super Contributor
timestamp: October 26, 2017, 03:08:22 am
content: To clarify, what do you get when you view the directories using the Windows folder viewer?

author: cdev
author_rank: Super Contributor
timestamp: October 26, 2017, 03:16:59 am
content: It likely mounted it as the wrong file type for some reason. It might have mounted "Fat 32" as "DOS"

author: Delta
author_rank: Super Contributor
timestamp: October 26, 2017, 04:38:45 am
content: Tried it on a Ubuntu system, exactly the same. Gparted didn't find any issues with the file system...

author: hamster_nz
author_rank: Super Contributor
timestamp: October 26, 2017, 04:46:43 am
content: Quote from: blueskull on October 26, 2017, 04:31:08 amAs 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-partitionsAlthough 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.

author: Berni
author_rank: Super Contributor
timestamp: October 26, 2017, 05:25:51 am
content: Quote from: hamster_nz on October 26, 2017, 04:46:43 amWow 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.

author: Delta
author_rank: Super Contributor
timestamp: October 26, 2017, 05:49:21 am
content: Quote from: Tomorokoshi on October 26, 2017, 03:08:22 amExactly the same, short truncated names only.

author: Jeroen3
author_rank: Super Contributor
timestamp: October 26, 2017, 06:19:30 am
content: Quote from: Delta on October 25, 2017, 10:04:01 pmFAT, 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".

author: stj
author_rank: Super Contributor
timestamp: October 26, 2017, 09:38:08 pm
content: device name - Elements?you didnt format it from new??

author: cdev
author_rank: Super Contributor
timestamp: October 26, 2017, 10:08:34 pm
content: 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.

author: cdev
author_rank: Super Contributor
timestamp: October 26, 2017, 10:11:41 pm
content: Does this "scanning" program keep any kind of log ofwhatit did? It must.

author: Jeroen3
author_rank: Super Contributor
timestamp: October 27, 2017, 05:36:13 am
content: scandisk does keep a log.https://superuser.com/a/896116/592444

author: Delta
author_rank: Super Contributor
timestamp: October 27, 2017, 06:32:36 am
content: Quote from: Jeroen3 on October 27, 2017, 05:36:13 amThanks for that, I'll have a look when I'm back in work.

author: Delta
author_rank: Super Contributor
timestamp: October 27, 2017, 06:35:07 am
content: Quote from: stj on October 26, 2017, 09:38:08 pmI 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?

author: AndyC_772
author_rank: Super Contributor
timestamp: October 27, 2017, 07:16:14 am
content: 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 thatonce.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.

author: metrologist
author_rank: Super Contributor
timestamp: October 27, 2017, 07:37:38 am
content: 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.

author: rdl
author_rank: Super Contributor
timestamp: October 27, 2017, 07:58:14 am
content: 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"?

author: Jeroen3
author_rank: Super Contributor
timestamp: October 27, 2017, 09:48:55 am
content: Yes. The dirty bit.Quote from:https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#Extended_BIOS_Parameter_Block

author: stj
author_rank: Super Contributor
timestamp: October 27, 2017, 12:23:39 pm
content: Quote from: Delta on October 27, 2017, 06:35:07 amthere 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.