Mount problems - BSD

This is a discussion on Mount problems - BSD ; Hello folks, After mounting a fat32 partition, the directory listing shows everything in capital letters. This is very annoying. Does anyone know how to solve this? Thanks, Mark...

+ Reply to Thread
Results 1 to 16 of 16

Thread: Mount problems

  1. Mount problems

    Hello folks,

    After mounting a fat32 partition, the directory listing shows
    everything in capital letters. This is very annoying. Does anyone know
    how to solve this?

    Thanks,
    Mark


  2. Re: Mount problems

    > I believe there is more than one way to mount an FAT-32 partition. Could
    > you please give us some sample output with which to work? Have you tried
    > using both the msdos FS and the vfat one?


    I tried mount /dev/wd0i /mnt/data, mount -t msdos /dev/wd0i /mnt/data,
    and mount_msdos /dev/wd0i /mnt/data. I think they all boil down to the
    same thing.


  3. Re: Mount problems

    > I believe there is more than one way to mount an FAT-32 partition. Could
    > you please give us some sample output with which to work? Have you tried
    > using both the msdos FS and the vfat one?


    I tried mount /dev/wd0i /mnt/data, mount -t msdos /dev/wd0i /mnt/data,
    and mount_msdos /dev/wd0i /mnt/data. I think they all boil down to the
    same thing.


  4. Re: Mount problems

    According to mark :
    > Hello folks,
    >
    > After mounting a fat32 partition, the directory listing shows
    > everything in capital letters. This is very annoying. Does anyone know
    > how to solve this?


    Look in the man page for "mount"

    There is an option "-o" for passing options to the actual
    filesystem-specific mount program.

    Then look at the man page for "mount_pcfs", and you will find
    the following:

    ================================================== ====================
    foldcase|nofoldcase

    Force uppercase characters in filenames to lowercase
    when reading them from the filesystem. This is for
    compatibility with the previous behavior of pcfs.
    The default is nofoldcase.
    ================================================== ====================

    Note that this means that *all* characters will be lower case.
    The FAT format directories don't handle mixed case filenames, or
    anything other than the 8.3 format. (And all filenames are all upper
    case, which is why you are seeing what you are.)

    There are other tricks which will read some metadata saved
    invisibly on the filesystem to display in mixed case and with more than
    one '.' among other things. I'm not sure that FAT-32 supports this,
    however, the best you can be sure of doing is using the "foldcase"
    option to render it in lower case.

    However, I don't know how to specify this for a FAT filesystem
    mounted on a Sun. (I think that the same trick is used in some other
    things, like the hsfs (the standard filesystem on a CD-ROM), but I don't
    know how to get this to apply to a FAT filesystem.

    Good Luck,
    DoN.
    --
    Email: | Voice (all times): (703) 938-4564
    (too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
    --- Black Holes are where God is dividing by zero ---

  5. Re: Mount problems

    > Note that this means that *all* characters will be lower case.
    > The FAT format directories don't handle mixed case filenames, or
    > anything other than the 8.3 format. (And all filenames are all upper
    > case, which is why you are seeing what you are.)


    Thanks for your elaborate reply. The problem is that I don't want all
    characters to be lowercase, but just the ones that really are
    lowercase. Windows is showing me the directory listings correctly, and
    that means OpenBSD should be capable of doing the same thing (at least
    in theory). I noticed something else. If a filename contains a
    combination of uppercase and lowercase characters or the extension is
    not 3 characters long, it does show the filename correctly. Anyone?


  6. Re: Mount problems

    mark wrote:
    >> Note that this means that *all* characters will be lower case.
    >> The FAT format directories don't handle mixed case filenames, or
    >> anything other than the 8.3 format. (And all filenames are all upper
    >> case, which is why you are seeing what you are.)

    >
    > Thanks for your elaborate reply. The problem is that I don't want all
    > characters to be lowercase, but just the ones that really are
    > lowercase. Windows is showing me the directory listings correctly, and
    > that means OpenBSD should be capable of doing the same thing (at least
    > in theory). I noticed something else. If a filename contains a
    > combination of uppercase and lowercase characters or the extension is
    > not 3 characters long, it does show the filename correctly. Anyone?
    >

    FAT32 actually has two places it stores filenames. This was to
    facilitate going beyond the 8.3 limitation. It sounds like in this case
    it is deferring to the extended name under some circumstances.
    --
    clvrmnky

    Direct replies will be blacklisted. Replace "spamtrap" with my name to
    contact me directly.

  7. Re: Mount problems

    mark wrote:
    >> Note that this means that *all* characters will be lower case.
    >> The FAT format directories don't handle mixed case filenames, or
    >> anything other than the 8.3 format. (And all filenames are all upper
    >> case, which is why you are seeing what you are.)

    >
    > Thanks for your elaborate reply. The problem is that I don't want all
    > characters to be lowercase, but just the ones that really are
    > lowercase. Windows is showing me the directory listings correctly, and
    > that means OpenBSD should be capable of doing the same thing (at least
    > in theory). I noticed something else. If a filename contains a
    > combination of uppercase and lowercase characters or the extension is
    > not 3 characters long, it does show the filename correctly. Anyone?


    This shouldn't matter, but did you try mount_msdos -l?

    Joachim

  8. Re: Mount problems

    > This shouldn't matter, but did you try mount_msdos -l?

    I tried, but it doesn't help.


  9. Re: Mount problems

    mark wrote:
    >> This shouldn't matter, but did you try mount_msdos -l?

    >
    > I tried, but it doesn't help.


    Well, it shouldn't, but that was about my last idea. You might want to
    retry on misc@openbsd.org. (If you already did, I'm sorry; I'm a bit
    behind, and did not see any subject that looks like it would relate to
    this query.)

    Joachim

  10. Re: Mount problems

    > Well, it shouldn't, but that was about my last idea. You might want to
    > retry on m...@openbsd.org. (If you already did, I'm sorry; I'm a bit
    > behind, and did not see any subject that looks like it would relate to
    > this query.)


    Thanks, I'll try the mailing list.


  11. Re: Mount problems

    mark wrote:
    >> Note that this means that *all* characters will be lower case.
    >> The FAT format directories don't handle mixed case filenames, or
    >> anything other than the 8.3 format. (And all filenames are all upper
    >> case, which is why you are seeing what you are.)

    >
    > Thanks for your elaborate reply. The problem is that I don't want all
    > characters to be lowercase, but just the ones that really are
    > lowercase. Windows is showing me the directory listings correctly, and
    > that means OpenBSD should be capable of doing the same thing (at least
    > in theory). I noticed something else. If a filename contains a
    > combination of uppercase and lowercase characters or the extension is
    > not 3 characters long, it does show the filename correctly. Anyone?
    >


    Allthough Windows can preserve cases sometimes, FAT filesystems are case
    insensitive. It wouldn't make sense to display the filenames as they
    appear in Windows, because they are not real. An attempt to write two
    files with the same name and different cases would more likely end up in
    a filesystem error under Windows. So why should OpenBSD display faked
    filenames ? This is perfectly right to display them either in uppercase
    or in lowercase ( depending on mount options ). Using mixed lower and
    uppercases for filenames on a FAT partition is not necessary and rather
    a bad idea.







  12. Re: Mount problems

    In article ,
    agnelo wrote:
    >mark wrote:
    >>> Note that this means that *all* characters will be lower case.
    >>> The FAT format directories don't handle mixed case filenames, or
    >>> anything other than the 8.3 format. (And all filenames are all upper
    >>> case, which is why you are seeing what you are.)

    >>
    >> Thanks for your elaborate reply. The problem is that I don't want all
    >> characters to be lowercase, but just the ones that really are
    >> lowercase. Windows is showing me the directory listings correctly, and
    >> that means OpenBSD should be capable of doing the same thing (at least
    >> in theory). I noticed something else. If a filename contains a
    >> combination of uppercase and lowercase characters or the extension is
    >> not 3 characters long, it does show the filename correctly. Anyone?
    >>

    >
    >Allthough Windows can preserve cases sometimes, FAT filesystems are case
    >insensitive. It wouldn't make sense to display the filenames as they
    >appear in Windows, because they are not real. An attempt to write two
    >files with the same name and different cases would more likely end up in
    >a filesystem error under Windows. So why should OpenBSD display faked
    >filenames ? This is perfectly right to display them either in uppercase
    >or in lowercase ( depending on mount options ). Using mixed lower and
    >uppercases for filenames on a FAT partition is not necessary and rather
    >a bad idea.


    Note that, for CD, for instance, it is perfectly possible to set up
    Joliet and ISO names that are completely distinct. The default tools do
    not, but still it is feasible. I have used that feature in the past,
    as I own a DVD/DivX player which only shows DOS names. The resulting
    CDs had nice, short names on the DVD player, and full names under other
    OSes, including Windows and OpenBSD.

  13. Re: Mount problems

    Marc Espie wrote:
    > In article ,
    > agnelo wrote:
    >> mark wrote:
    >>>> Note that this means that *all* characters will be lower case.
    >>>> The FAT format directories don't handle mixed case filenames, or
    >>>> anything other than the 8.3 format. (And all filenames are all upper
    >>>> case, which is why you are seeing what you are.)
    >>> Thanks for your elaborate reply. The problem is that I don't want all
    >>> characters to be lowercase, but just the ones that really are
    >>> lowercase. Windows is showing me the directory listings correctly, and
    >>> that means OpenBSD should be capable of doing the same thing (at least
    >>> in theory). I noticed something else. If a filename contains a
    >>> combination of uppercase and lowercase characters or the extension is
    >>> not 3 characters long, it does show the filename correctly. Anyone?
    >>>

    >> Allthough Windows can preserve cases sometimes, FAT filesystems are case
    >> insensitive. It wouldn't make sense to display the filenames as they
    >> appear in Windows, because they are not real. An attempt to write two
    >> files with the same name and different cases would more likely end up in
    >> a filesystem error under Windows. So why should OpenBSD display faked
    >> filenames ? This is perfectly right to display them either in uppercase
    >> or in lowercase ( depending on mount options ). Using mixed lower and
    >> uppercases for filenames on a FAT partition is not necessary and rather
    >> a bad idea.

    >
    > Note that, for CD, for instance, it is perfectly possible to set up
    > Joliet and ISO names that are completely distinct. The default tools do
    > not, but still it is feasible. I have used that feature in the past,
    > as I own a DVD/DivX player which only shows DOS names. The resulting
    > CDs had nice, short names on the DVD player, and full names under other
    > OSes, including Windows and OpenBSD.


    But it has nothing to do with FAT (or whatever else) filesystem used on
    hardrive partitions.



  14. Re: Mount problems

    agnelo wrote:
    > Marc Espie wrote:
    >> In article ,
    >> agnelo wrote:
    >>> mark wrote:
    >>>>> Note that this means that *all* characters will be lower case.
    >>>>> The FAT format directories don't handle mixed case filenames, or
    >>>>> anything other than the 8.3 format. (And all filenames are all upper
    >>>>> case, which is why you are seeing what you are.)


    This is not quite correct. I ran the MKS toolkit on DOS and Windows for years.
    That toolkit had a ksh which displayed filenames in directories exactly as the
    filenames were created (i.e. both lower and upper case characters were
    displayed when the ls command was used). If the same directory was displayed
    using the DOS dir command, the filenames were displayed in all upper case.


  15. Re: Mount problems

    In article ,
    agnelo wrote:

    >The long file names (LFN) are "real" and are written in the FAT on top
    >of the directory. But what matters is still the 8.3 names. Maybe because
    >FAT32 is juste a FAT16 with long file names 'capabilities' and bigger
    >cluster size. If you delete the LFN entry on a low level with a disk
    >editor, you haven't in fact deleted the file ( i.e you haven't removed
    >the first letter of the 8.3 file name, which on FAT would declare the
    >file as 'deleted').


    If you go into any file system, on any OS, with a low-level tool (such
    editing the disk with a binary editor), you can get any result you
    want. No conclusions can be drawn from this. Admittedly, the
    implementation of file names in FAT has layers that have historical
    reasons, and it is particularly easy to use low-level tools to "saw
    off" the long file names.

    But this is taking the wrong attitude. Look as FAT as a file system,
    not through its internal structures, but through its interfaces
    (preferably the Win32 API for it), and you will find that it has
    perfectly working capabilities for long file names; just with some
    un-Unix-ish restrictions on the choice of file names.

    >So calling the long file names 'not real' or 'faked' was an
    >oversimplification. But is it not FAT32 which overcomplicates things ?
    >As you mentionned above you cannot have bIll and Bill. And, because of
    >this limitation, I find it reasonnable to display filenames on FAT
    >partitions either all in uppercase or alle in lowercase, rather than as
    >they would appear in Windows, precisely because you cannot rename bIll
    >in Bill or create BiLl in the same directory.


    You are trying to force a Windows file system into Unix-ish
    preconceptions. There is no logical reason that any file name can be
    allowed. Many other OSes have had restrictions on file names. For
    example, VMS didn't allow characters such as "[", ":" or ";" in file
    names, because they were part of the file disambiguation syntax (":"
    to separate node name from file name, "[" to separate directory from
    file name, and ";" for version numbers). Similarly, Unix-style
    systems don't allow "/" in file names. For fun, you should try
    sometime to create a file name with a "/" in it (requires a cluster
    file system that can run on heterogeneous OSes), and see how your
    favorite Unix reacts (it will be very very ugly).

    My point is: a FAT file system can never do everything perfectly like
    a Unix-style file system, while allowing for data interchangeability
    with Windows. Once you accept that, the remaining question is: How
    should a FAT file system mounted on Unix best simulate semantics? In
    my opinion, it is less confusing to faithfully render the file names
    in mixed case, and accept the restriction that certain file names are
    disallowed on it (for example those that only differ in case from
    existing files). Your opinion is to render all file names in one
    case, which has no restrictions on file name collisions, but has
    restrictions on characters that are allowed in file names.

    >This is a recursive nightmare. Keep trying to convince Windows users not
    >to use umlaut or accents in filenames ! But I'm afraid they won't
    >listen.


    This is now a Windows problem. Actually, on Windows this problem does
    not exist (because there all strings passed into the file system
    through the Win32 API are in the Windows string encoding):

    It is a problem in the Unix-style Posix API. There are a few system
    calls that pass strings between user-mode and kernel mode, and nearly
    all of them are file names being passed. The problem is that the
    kernel doesn't know what string encoding the user process is using,
    because the kernel doesn't see the user processes environment
    variables (such as LOCALE or LANG). This means: If a user process
    creates a file whose name is the single byte 0xC0, the kernel doesn't
    know whether the file name should be A with accent (if the user is
    running iso-8859-1 in western Europe), or a an R with accent (if the
    user is running iso-8859-2 in eastern Europe), or something totally
    different (in utf-8 worldwide, which wouldn't work for a 1-byte
    example, or something else in China or Korea). Now what happens if
    another user, using a different locale and encoding, does an "ls" ? He
    will get the wrong file name. And as I explained, most attempts by
    the kernel to fix this will make it worse in certain cases.

    This is one of the (few?) places where the Win32 API does things
    right, because it learned from the mistakes of the other systems that
    came before it. Remember, the Unix file system API was designed when
    computers used 7-bit ASCII exclusively (and the eighth bit was used
    for parity on the serial line!).

    Note: I'm not a Windows proponent, absolutely on the contrary. There
    is no single Windows machine running in my house. This post is typed
    on a Linux laptop, transported by a OpenBSD router/firewall, and
    posted from a FreeBSD machine.

    --
    Ralph Becker-Szendy _firstname_@lr_dot_los-gatos_dot_ca_dot_us

  16. Re: Mount problems

    According to <_firstname_@lr_dot_los-gatos_dot_ca_dot_us>:

    [ ... ]

    > You are trying to force a Windows file system into Unix-ish
    > preconceptions. There is no logical reason that any file name can be
    > allowed. Many other OSes have had restrictions on file names. For
    > example, VMS didn't allow characters such as "[", ":" or ";" in file
    > names, because they were part of the file disambiguation syntax (":"
    > to separate node name from file name, "[" to separate directory from
    > file name, and ";" for version numbers). Similarly, Unix-style
    > systems don't allow "/" in file names. For fun, you should try
    > sometime to create a file name with a "/" in it (requires a cluster
    > file system that can run on heterogeneous OSes), and see how your
    > favorite Unix reacts (it will be very very ugly).


    I've encountered this. A NFS exported filesystem mounted by a
    Mac (pre OS-X) had several of these, and the only way that I could find
    to delete them (from the unix side as an admin) was to unmount the
    filesystem, go in with the "diredit" feature of emacs working on the raw
    device, and change the character to something easy to type, then save
    it, re-mount the filesystem, and delete the files from the unix command
    line.

    And *then* go talk to the user to explain how using '/' in
    filenames made it impossible to back up his directory, so if he
    persisted in using them, and the disk crashed, *he* would take the blame
    for the losses.

    Enjoy,
    DoN.
    --
    Email: | Voice (all times): (703) 938-4564
    (too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
    --- Black Holes are where God is dividing by zero ---

+ Reply to Thread