LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   weird looking files that can only be seen through SAMBA, but not through linux itself (https://www.linuxquestions.org/questions/linux-software-2/weird-looking-files-that-can-only-be-seen-through-samba-but-not-through-linux-itself-592720/)

xushi 10-18-2007 07:12 AM

weird looking files that can only be seen through SAMBA, but not through linux itself
 
Hi All,

I have a Linux server with several RAID1 disks using ext3. In each RAID set I have several folders that contain several files.

I noticed recently that when I view some of these folders through SAMBA through Windows, I see weird looking but working files such as COKZP1~6.AVI, LT128W~0.AVI, etc..

The problem is that I cannot see them from the Linux machine itself through the use of bash (ls -lah, find *.avi), mc, konqueror, rox, etc.. It's as if they don't exist. I think they were caused by power cuts where some of my files disappeared. Nevertheless, I managed to recover my missing files from previous backups. I just would like to know how on earth to find these ... `lost` or `hidden` files and remove them from my system.

I tried running fsck but it didn't find anything wrong (well.. nothing bad was outputted from fsck..).

Thanks.

rjlee 10-18-2007 07:42 AM

Since the files work, my first thought is the perhaps the files do exist, but Samba is presenting the wrong filenames to the Windows machine.

In particular, those filenames look a lot like vfat 8.3 filenames.

As far as Windows is concerned, all files have a name consisting of up to eight characters, followed by a dot, followed by up to three characters. They also have a second name, called a "long filename" which is what the user actually sees. Normally the "8.3" name can be worked out by taking the first six letters or numbers of the long filename, then adding a tilde (~), then adding a unique number (usually 1), then a dot, then the first three characters after the first dot in the long filename. So if you had a file called "Hello World.text" then SAMBA would also give it the name "HELLOW~1.TEX". 8.3 filenames are always lowercase.

Unlike vfat or iso8859-1, Ext3 does not use 8.3 filenames, so they must be being introduced by Samba in some way. Which leads me to suspect that the files exist on the disk with some other filename.

I would try running these command from BASH:
Code:

find . -iname 'COKZ*.avi'
Code:

find . -iname 'LZ*128*.avi'
and seeing if that can find your files.

Another option would be to try and find MD5 checksums for the files in Windows, then run
Code:

md5sum *
to produce MD5 checksums for the files in Linux. If you can find two files with the same checksum then (in all probability) these are the same files.

If that doesn't help, perhaps you could post a list of what you see with ls -1a, compared with what you see from Windows?

Yours,

Robert J Lee.

xushi 10-18-2007 08:09 AM

Quote:

Originally Posted by rjlee (Post 2928382)
Another option would be to try and find MD5 checksums for the files in Windows, then run
Code:

md5sum *
to produce MD5 checksums for the files in Linux. If you can find two files with the same checksum then (in all probability) these are the same files.

Thank you Robert. This was really confusing me and the above section solved my problem. It turns out that some of my files had question marks in their file names, such as,

London Vacation [2007x04] - ?.avi

They appeared normally on Linux hence why I never pinpointed the problem. However, It wasn't recognised properly under Windows+Samba. I just renamed them and got rid of the question mark, and the problem is gone.


All times are GMT -5. The time now is 05:28 AM.