Omega2+ treats files as dirs on USB drive. Why?



  • Hi guys.
    I have a USB flash with files with russian names. This is from windows:

    24.04.2020  14:22        39 576 966 женщина.bmp
    24.10.2020  19:56         6 912 054 winpe.bmp
    22.01.2021  19:30         3 448 960 Vis - Песня_про_нечисть.mp3
    28.01.2021  15:03           165 623 tela_tst.psd
    07.03.2020  19:03           205 406 pacan_mini_layers.psd
    17.11.2020  12:53           231 080 angelsmal.bmp
    13.06.2021  09:16    <DIR>          В_Цой
    13.06.2021  09:16    <DIR>          Dir1
    13.06.2021  09:16    <DIR>          asdf                                                               
    

    Note that женщина.bmp is file.
    Same USB flash in omega2:

    root@Omega-3079:~# ls -l /mnt/sda1
    drwxr-xr-x    2 root     root          4096 Jun 13 09:16 Dir1
    -rwxr-xr-x    1 root     root       3448960 Jan 22 19:30 Vis - Песня_про_нечисть.mp3
    -rwxr-xr-x    1 root     root        231080 Nov 17  2020 angelsmal.bmp
    drwxr-xr-x    2 root     root          4096 Jun 13 09:16 asdf
    -rwxr-xr-x    1 root     root        205406 Mar  7  2020 pacan_mini_layers.psd
    -rwxr-xr-x    1 root     root        165623 Jan 28 15:03 tela_tst.psd
    -rwxr-xr-x    1 root     root       6912054 Oct 24  2020 winpe.bmp
    drwxr-xr-x    2 root     root          4096 Jun 13 09:16 В_Цой
    drwxr-xr-x    0 root     root      39576966 Apr 24  2020 женщина.bmp
    root@Omega-3079:~# cd /mnt/sda1/женщина.bmp
    root@Omega-3079:/mnt/sda1/женщина.bmp#
    root@Omega-3079:/mnt/sda1/женщина.bmp# ls -l
    root@Omega-3079:/mnt/sda1/женщина.bmp#
    root@Omega-3079:~# cat /mnt/sda1/женщина.bmp
    cat: read error: Is a directory
    

    As you can see 'женщина.bmp' - directory, not a file!
    Why? How to avoid this?



  • Some experiments show that this bug present only on FAT32 disks.
    On exFAT and NTFS all good - женщина.bmp -- file, not a directory.



  • Mounting USB drive with shortname=mixed option fixes this bug

    /bin/mount -o codepage=1251,iocharset=utf8,shortname=mixed /dev/sda1 /mnt/sda1
    

    Problem solved.



  • @Pavel-Negrobov If you have the time it might be good to log a defect on openwrt.org, if nothing else it would help others using Russian.



  • @crispyoz I will do this later when I will finish my python soft, I need to check chdir to russian named dirs and read files.



  • I have two external drives and I'm hoping to make finding what I have and where, by topic, much easier than "plug in and hope I'm right". Is there an easy way to do this? I'd love to scrape the file and folder list of a drive and then I suppose tag folders or subfolders by relevant subject and possibly even by importance (obviously that I'd determine) and be able to see what is where on my computer without needing to physically access a drive to be sure. I'm not sure if this is at all possible, though.


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.