I have a bash script which copies data across to a USB stick. It works. The data is copied across fine, but the filenames are always changed. They are the same as they were before, but any longer names are cut to only 8 chars long, and have an extension that is only 3 chars long (11 char max total).
So an original file called "willGetCutShorter.html" becomes "willGetS.htm" on the drive, whereas "small.txt" stays the same. Copied directory names are cut in the same way, all appearing 8 chars long (they have no extension, of course).
I don't want this to happen. I want the file and directory names to not be modified at all. I don't know why this is happening either.
In my bash script, I copy everything in my computer directory to the drive using an asterisk to represent all the computer directory contents. I'm wondering if this is why? Perhaps cp is only grabbing part of the filename?
Also, while in Linux the files appear all in lowercase, even stuff that was originally part uppercase. In Windows however, all files and folders are uppercase.
I formatted the USB drive on a Windows 7 machine before I started using it in this way. In my
/etc/fstab file I have added an entry for the drive that mounts it as msdos. This was because I read a manual page (probably 'man mount') and it said that the drive format, which is FAT32, is covered by msdos.
I wanted to mount it with FAT32 as the filesystem type, but I couldn't see that option in the mount manual page. The fstab entry means the mount command consists of only this:
sudo mount /mnt/
The copy commands in the bash script are all like this:
cp -f -r /path/to/dir/* /mnt/to/dir/
It sounds like I just need to reformat the drive to something else, or mount it slightly differently?