Loading ...
Sorry, an error occurred while loading the content.

Preserving ALLCAPS directory names on FAT partitions

Expand Messages
  • dnquark
    I am mounting some FAT32 partitions via a USB hub on port 1 of an Unslung slug. I also have Samba 3 installed. Here is a problem: if I create a directory
    Message 1 of 9 , Jan 2, 2008
    • 0 Attachment
      I am mounting some FAT32 partitions via a USB hub on port 1 of an
      Unslung slug. I also have Samba 3 installed. Here is a problem: if I
      create a directory FOO, either in Windows or by doing mkdir on the
      slug, it ignores the case and directory foo is created.

      This only happens for short (<= 8 chars) directory names in all caps.
      When I mkdir FoO or FOOFOOFOO, they are created just so.

      This creates potential issues when using rsync due to case-sensitive
      comparisons.

      I've read that one can use a shortname=winnt option when mounting FAT
      file systems: "this will stop files and folders that are all
      uppercase from appearing as all lowercase and is only needed for FAT32
      partition." That pertained to Ubuntu, and the advice was to add the
      ollowing line to fstab:
      /dev/hdb2 /mnt/windows_fat vfat umask=000,shortname=winnt 0 0

      Sadly, I don't know enough about Linux to make use of this
      information. Is there some config file that I can edit to tell the
      slug to use the "shortname=winnt" option? I looked at /etc/fstab on
      the slug, but there are no lines that pertain to mounting the port 1
      disks...

      PS: I know there is an --ignore-case patch to cygwin rsync that I
      would use as a last resort. I'm hoping that this case sensitivity
      issue can be resolved..
    • dnquark
      Allow me to clarify: I need to mount the FAT32 partitions using the shortname=winnt option. How do I accomplish that automatically? The uppercase- lowercase
      Message 2 of 9 , Jan 2, 2008
      • 0 Attachment
        Allow me to clarify:

        I need to mount the FAT32 partitions using the shortname=winnt option.
        How do I accomplish that automatically?

        The uppercase->lowercase problem was fixed by doing the following:
        umount /dev/sdc5
        mount /dev/sdc5 /share/hdd/data/HDD_1_2_1 -o async,shortname=winnt

        But how do I tell the slug to use shortname=winnt option whenever it
        mounts the vfat disks on bootup or on disk reconnect?



        --- In nslu2-general@yahoogroups.com, "dnquark"
        <leo.alekseyev+nabble@...> wrote:
        >
        > I am mounting some FAT32 partitions via a USB hub on port 1 of an
        > Unslung slug. I also have Samba 3 installed. Here is a problem: if I
        > create a directory FOO, either in Windows or by doing mkdir on the
        > slug, it ignores the case and directory foo is created.
        >
        > This only happens for short (<= 8 chars) directory names in all caps.
        > When I mkdir FoO or FOOFOOFOO, they are created just so.
        >
        > This creates potential issues when using rsync due to case-sensitive
        > comparisons.
        >
      • John
        ... To do that automatically on bootup, Create a file /unslung/rc.local with the contents: #!/bin/sh umount /dev/sdc5 mount /dev/sdc5 /share/hdd/data/HDD_1_2_1
        Message 3 of 9 , Jan 2, 2008
        • 0 Attachment
          On Wed, Jan 02, 2008 at 08:49:29PM -0000, dnquark wrote:
          > The uppercase->lowercase problem was fixed by doing the following:
          > umount /dev/sdc5
          > mount /dev/sdc5 /share/hdd/data/HDD_1_2_1 -o async,shortname=winnt
          >
          > But how do I tell the slug to use shortname=winnt option whenever it
          > mounts the vfat disks on bootup or on disk reconnect?

          To do that automatically on bootup, Create a file /unslung/rc.local
          with the contents:

          #!/bin/sh
          umount /dev/sdc5
          mount /dev/sdc5 /share/hdd/data/HDD_1_2_1 -o async,shortname=winnt
          return 1

          (In normal linux, there is a simpler method involving /etc/fstab but
          that doesn't work under Linksys/unslung.)
        • dnquark
          That didn t work for me. Perhaps I need to make sure that rc.local runs before Samba (smbd) loads? I have another issue: the mount command that I use screws
          Message 4 of 9 , Jan 2, 2008
          • 0 Attachment
            That didn't work for me. Perhaps I need to make sure that rc.local
            runs before Samba (smbd) loads?

            I have another issue: the mount command that I use screws up unicode
            in Samba. I assume that since when the system mounts the volumes
            automatically unicode works fine, there is a mount option that I am
            missing. I tried -o iocharset=iso8859-1 or iocharset=utf8 options,
            but then mount fails. When I try to use -o utf8, it mounts, but
            Windows still doesn't display unicode correctly.

            I assume the system issues the mount command internally somehow. Is
            there a way to find out how it's formatted?

            However,

            >
            > To do that automatically on bootup, Create a file /unslung/rc.local
            > with the contents:
            >
            > #!/bin/sh
            > umount /dev/sdc5
            > mount /dev/sdc5 /share/hdd/data/HDD_1_2_1 -o async,shortname=winnt
            > return 1
            >
            > (In normal linux, there is a simpler method involving /etc/fstab but
            > that doesn't work under Linksys/unslung.)
            >
          • dnquark
            Never mind, the rc.local works, *however* I still am having trouble with unicode. How can I find out how and with what options the mount command is issued
            Message 5 of 9 , Jan 3, 2008
            • 0 Attachment
              Never mind, the rc.local works, *however* I still am having trouble
              with unicode. How can I find out how and with what options the mount
              command is issued internally? The -o utf8 or codpage=unicode options
              don't help.


              > I have another issue: the mount command that I use screws up unicode
              > in Samba. I assume that since when the system mounts the volumes
              > automatically unicode works fine, there is a mount option that I am
              > missing. I tried -o iocharset=iso8859-1 or iocharset=utf8 options,
              > but then mount fails. When I try to use -o utf8, it mounts, but
              > Windows still doesn't display unicode correctly.
              >
              > I assume the system issues the mount command internally somehow. Is
              > there a way to find out how it's formatted?
              >
              > However,
              >
            • Carl Lowenstein
              ... Unix and Unix-like systems for the past 30 or more years have had the file /etc/mtab which contains the operating system s list of mounted file systems
              Message 6 of 9 , Jan 3, 2008
              • 0 Attachment
                On 1/3/08, dnquark <leo.alekseyev+nabble@...> wrote:
                >
                > Never mind, the rc.local works, *however* I still am having trouble
                > with unicode. How can I find out how and with what options the mount
                > command is issued internally? The -o utf8 or codpage=unicode
                > options don't help.

                Unix and Unix-like systems for the past 30 or more years have had the
                file /etc/mtab which contains the operating system's list of mounted
                file systems with their options.

                You can learn a lot from "cat /etc/mtab".

                carl
                --
                carl lowenstein
                marine physical lab, u.c. san diego
                clowenstein@...
              • dnquark
                Both /etc/mtab and/etc/fstab have references only to the unslung drive (/dev/sdaX) and have no information regarding mounting the FAT32 drives on port 1
                Message 7 of 9 , Jan 4, 2008
                • 0 Attachment
                  Both /etc/mtab and/etc/fstab have references only to the unslung drive
                  (/dev/sdaX) and have no information regarding mounting the FAT32
                  drives on port 1 (/dev/sdbX and /dev/sdcX).

                  So I'm still stuck on how to mount the drives so that Samba displays
                  unicode properly. It works when the drives mount automagically, so it
                  seems there is a way to do it when manually remounting!

                  > Unix and Unix-like systems for the past 30 or more years have had the
                  > file /etc/mtab which contains the operating system's list of mounted
                  > file systems with their options.
                  >
                  > You can learn a lot from "cat /etc/mtab".
                  >
                  > carl
                  > --
                  > carl lowenstein
                  > marine physical lab, u.c. san diego
                  > clowenstein@...
                  >
                • Mike (mwester)
                  ... cat /proc/mounts will show you what/how the device was mounted. But also keep in mind that perhaps the issue may involve how Samba is configured as well;
                  Message 8 of 9 , Jan 4, 2008
                  • 0 Attachment
                    "dnquark" <leo.alekseyev+nabble@...> writes:
                    > Both /etc/mtab and/etc/fstab have references only to the unslung drive
                    > (/dev/sdaX) and have no information regarding mounting the FAT32
                    > drives on port 1 (/dev/sdbX and /dev/sdcX).
                    >
                    > So I'm still stuck on how to mount the drives so that Samba displays
                    > unicode properly. It works when the drives mount automagically, so it
                    > seems there is a way to do it when manually remounting!

                    cat /proc/mounts
                    will show you what/how the device was mounted. But also keep in mind that
                    perhaps the issue may involve how Samba is configured as well; the Linksys
                    logic also ensures that a custom Samba configuration is created when it
                    automounts the drive.

                    Mike (mwester)
                  • dnquark
                    cat /proc/mounts only gives /dev/sdb5 /share/hdd/data/HDD_1_1_1 vfat rw 0 0 and similarly for other vfat drives/partitions This doesn t say anything about
                    Message 9 of 9 , Jan 5, 2008
                    • 0 Attachment
                      cat /proc/mounts only gives
                      /dev/sdb5 /share/hdd/data/HDD_1_1_1 vfat rw 0 0
                      and similarly for other vfat drives/partitions

                      This doesn't say anything about codepage options. From logs of poking
                      around and googling, it looks like the partitions are mounted by
                      binaries (/etc/rc.d/rc.bootbin on bootup or something called by
                      /usr/sbin/USB_detect). Can anyone confirm that?.. And if so, is
                      there a way to figure out exactly what those binaries are doing with
                      codepages when they mount the drives?

                      Alternatively, there has to be a way, I'm sure, to use the mount
                      command to achieve the same configuration that the system has after
                      automounting. I suspect it's a matter of selecting the codepage
                      properly.

                      When I mount without specifying the codepage, all Cyrillic filenames
                      turn into (seemingly) random strings formatted in 8.3 uppercase. When
                      I mount with utf8 option, the existing cyrillic unicode filenames
                      don't get parsed right; each cyrillic character (encoded using 2 bytes
                      in UTF8) apparently gets parsed as two 1-byte latin characters and is
                      thus displayed as garbage.

                      Any help would be great :)


                      >
                      > cat /proc/mounts
                      > will show you what/how the device was mounted. But also keep in
                      mind that
                      > perhaps the issue may involve how Samba is configured as well; the
                      Linksys
                      > logic also ensures that a custom Samba configuration is created when it
                      > automounts the drive.
                      >
                      > Mike (mwester)
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.