Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 07 Jul 2020, 10:32
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Puppy changed VFAT file names to lower case (Solved)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
Kestrel

Joined: 31 Dec 2005
Posts: 74

PostPosted: Tue 01 Apr 2008, 08:55    Post subject:  Puppy changed VFAT file names to lower case (Solved)  

Good day, I'm trying for a solution again, after posting yesterday that I had thought that gFTP had renamed files during uploads. That turns out not to be the case, but rather that Rox filer is renaming files:

1. I have thousands of client image files to upload to a server, many of which are named "IMG_001.JPG", etc, all stored in a large USB drive with VFAT, when viewed from WinXP.
2. When viewing these files in Rox, Puppy 3.01, the files now show the name as "img_001.jpg". If I go back to WinXP, the files are still named as "IMG_001.JPG".
3. I had uploaded 31 Gb of images to the server using gFTP from 3.01, rather than from WinXP, so that I could still have use of my PC, but now, of course, due to the renaming by Rox, the renamed uploaded files are useless.

Does anyone know how to stop Rox from renaming the files? Otherwise I guess I have found another task I can't do with Linux.

Thanks, Russ
Back to top
View user's profile Send private message 
HairyWill


Joined: 26 May 2006
Posts: 2946
Location: Southampton, UK

PostPosted: Tue 01 Apr 2008, 09:28    Post subject:  

The problem is probably not rox.

The mount command has a number of different options regarding case sensitivity when mounting VFAT filesystems. See here
http://linux.die.net/man/8/mount
about 90% of the way down the page

Mount options for vfat
First of all, the mount options for fat are recognized. The dotsOK option is explicitly killed by vfat. Furthermore, there are

uni_xlate
Translate unhandled Unicode characters to special escaped sequences. This lets you backup and restore filenames that are created with any Unicode characters. Without this option, a '?' is used when no translation is possible. The escape character is ':' because it is otherwise illegal on the vfat filesystem. The escape sequence that gets used, where u is the unicode character, is: ':', (u & 0x3f), ((u>>6) & 0x3f), (u>>12).
posix
Allow two files with names that only differ in case.
nonumtail
First try to make a short name without sequence number, before trying name~num.ext.
utf8
UTF8 is the filesystem safe 8-bit encoding of Unicode that is used by the console. It can be be enabled for the filesystem with this option. If 'uni_xlate' gets set, UTF8 gets disabled.
shortname=[lower|win95|winnt|mixed]

Defines the behaviour for creation and display of filenames which fit into 8.3 characters. If a long name for a file exists, it will always be preferred display. There are four modes:
lower
Force the short name to lower case upon display; store a long name when the short name is not all upper case.
win95
Force the short name to upper case upon display; store a long name when the short name is not all upper case.
winnt
Display the shortname as is; store a long name when the short name is not all lower case or all upper case.
mixed
Display the short name as is; store a long name when the short name is not all upper case.

The default is "lower".

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send private message 
Kestrel

Joined: 31 Dec 2005
Posts: 74

PostPosted: Tue 01 Apr 2008, 09:48    Post subject:  

Thanks very much for the link. In retrospect this has to be the answer, although I was too upset to do anything but search for Rox answers...

I'll review, and try again with a different mount scheme.

Thanks, Russ
Back to top
View user's profile Send private message 
Kestrel

Joined: 31 Dec 2005
Posts: 74

PostPosted: Tue 01 Apr 2008, 10:50    Post subject:  

HairyWill, your suggestion was the correct answer:

#mount -t vfat -o shortname=mixed /dev/sda1 /mnt/sda1

Unfortunately I have a ton of uploaded files to correct, but at least I can now stick with Puppy to do the work.

Russ
Back to top
View user's profile Send private message 
erikson


Joined: 27 Feb 2008
Posts: 735
Location: Ghent, Belgium

PostPosted: Wed 02 Apr 2008, 16:01    Post subject:  

Quote:
#mount -t vfat -o shortname=mixed /dev/sda1 /mnt/sda1


I wonder if it is also possible to have the *boot* partition mounted in shortname=mixed mode?

I have a frugal Puppy install on a USB pendrive, vfat partition, and I'm also sometimes misled by the case in filenames that I see there.

_________________
If it ain't broke, don't fix it. --- erikson
hp/compaq nx9030 (1.6GHz/480MB/37.2GB), ADSL, Linksys wireless router
http://www.desonville.net/
Puppy page: http://www.desonville.net/en/joere.puppy.htm

Back to top
View user's profile Send private message Visit poster's website 
Pizzasgood


Joined: 04 May 2005
Posts: 6266
Location: Knoxville, TN, USA

PostPosted: Wed 02 Apr 2008, 22:41    Post subject:  

Sure, but only if you extract the initrd.gz file, modify the /init script inside it, and then put it back together.

How you'd do that depends on which Puppy you have. For 3.xx the initrd.gz file is a compressed cpio archive. Make the directory /tmp/workingdir/ and put initrd.gz inside. Open a terminal there and run this to extract it:
Code:
mkdir initrd-tree
cd initrd-tree/
zcat ../initrd.gz | cpio -d -i

Now edit initrd-tree/init. When you're done, save, then run these commands from the /tmp/workingdir/ directory to put it back together again:
Code:
rm initrd.gz
cd initrd-tree
find . | cpio -o -H newc | gzip -9 > ../initrd.gz

Now replace your original initrd.gz with that.

For 2.xx, initrd.gz is a compressed ext2 filesystem image. Back it up, then run these commands to mount it to /mnt/data:
Code:
gunzip initrd.gz
mount initrd /mnt/data -o loop

Now edit /mnt/data/sbin/init. When done, close any directories in /mnt/data and then run these:
Code:
umount /mnt/data
gzip initrd

Note: You cannot move initrd.gz into /tmp/ while you work on it like you could in the other example. Mounting filesystem images that are within Puppy's main filesystem fails. So it needs to be on a mounted filesystem, such as your USB drive or a harddrive.
Also be aware that this method of editing is fine for just modifying the init script. If you wanted to do anything adding significant size you'd have to use a more involved method and create a new initrd file (since initrd has a fixed size).


As for exactly what changes to make, without having tested anything I'd guess you need to track down a line that looks something like this:
Code:
mntfunc -t $PUPSAVEFS -o noatime /dev/$PUPSAVEDEV /mnt/dev_save

It may be different in different Puppies though. And there might be more than one place where it turns up. You should probably also run a generic search for anywhere in the file where it mentions /mnt/dev_save. Anyways, once you know what you're editing you have two options. The simplest is to hardcode the shortname option, something like this:
Code:
mntfunc -t $PUPSAVEFS -o noatime,shortname=mixed /dev/$PUPSAVEDEV /mnt/dev_save

The biggest problem is that doing so will probably make that initrd.gz unable to properly boot when the pup_save.2fs file is on a non-vfat partition. If that doesn't matter for you, go for it. Otherwise, you should set it to only use that option if mounting a vfat partition:
Code:
[ "$PUPSAVEFS" = "vfat" ] && SHORTNAME=',shortname=mixed'
mntfunc -t $PUPSAVEFS -o noatime$SHORTNAME /dev/$PUPSAVEDEV /mnt/dev_save


Maybe it would be a good idea for that to become standard in future Puppies?

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message 
erikson


Joined: 27 Feb 2008
Posts: 735
Location: Ghent, Belgium

PostPosted: Thu 03 Apr 2008, 09:02    Post subject:  

Pizzasgood wrote:
Sure, but only if you extract the initrd.gz file, modify the /init script inside it, and then put it back together.

That is at the very core of Puppy Wink

I use 3.01 in two flavors: vanilla and pcPuppyOS rc6 (booted via grub menu from separate subdirs in same USB vfat partition). I followed your (clear and precise) instructions with good result.

Quote:
As for exactly what changes to make, without having tested anything I'd guess you need to track down a line that looks something like this:
Code:
mntfunc -t $PUPSAVEFS -o noatime /dev/$PUPSAVEDEV /mnt/dev_save

That is exactly line 533 in initrd.gz for 3.01. So that is the (only) line that I edited, with shortname=mixed. Just in case, I left the original initrd.gz as such, saved the new file as initrdmod.gz and adapted the grub menu.lst accordingly.

Quote:
Maybe it would be a good idea for that to become standard in future Puppies?

I think so too.

Insofar I tested, it remains quite tricky to rename files in my USB vfat partition for case changes, but now case always shows correctly as it is, both in rxvt and in ROX.

_________________
If it ain't broke, don't fix it. --- erikson
hp/compaq nx9030 (1.6GHz/480MB/37.2GB), ADSL, Linksys wireless router
http://www.desonville.net/
Puppy page: http://www.desonville.net/en/joere.puppy.htm

Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0603s ][ Queries: 13 (0.0215s) ][ GZIP on ]