[RESOLVED] How to mount USB flash with russian filenames



  • Hi, guys!
    I need to use USB flash contain russian filenames (written in Windows). Default mounts:

    # cat /proc/mounts | grep sda1
    /dev/sda1 /mnt/sda1 exfat rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,namecase=0,errors=remount-ro 0 0
    

    ls command gives errors:

    root@Omega-3079:~# ls -l /mnt/sda1
    [  196.830841] convert_uni_to_ch: fail to use nls
    [  196.835429] convert_uni_to_ch: fail to use nls
    [  196.840048] convert_uni_to_ch: fail to use nls
    [  196.844596] convert_uni_to_ch: fail to use nls
    [  196.849103] convert_uni_to_ch: fail to use nls
    [  196.853686] convert_uni_to_ch: fail to use nls
    [  196.858262] convert_uni_to_ch: fail to use nls
    [  196.862905] ------------[ cut here ]------------
    [  196.867630] WARNING: CPU: 0 PID: 1933 at mm/page_alloc.c:3877 __alloc_pages_nodemask+0x144/0xa6c
    [  196.876643] Modules linked in: pppoe ppp_async option w1_therm w1_gpio uvcvideo usb_wwan snd_usb_audio pppox ppp_generic pl2303 nf_conntrack_ipv6 lzo iptable_nat ipt_REJECT ipt_MASQUERADE ftdi_sio cp210x ch341 xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_FLOWOFFLOAD wire videobuf2_v4l2 usbserial usblp usbhid ums_usbat ums_sddr55 ums_sddr09 ums_karma ums_jumpshot ums_isd200 ums_freecom ums_datafab ums_cypress ums_alauda uinput spidev snd_usbmidi_lib slhc rfcomm pwm_mediatek_ramips nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack lzo_decompress lzo_compress iptable_mangle
    [  196.948432]  iptable_filter ip_tables hwmon hidp hid_generic hci_uart crc_ccitt cdc_acm btusb btintel bnep bluetooth p44_ledchain snd_soc_simple_card snd_soc_simple_card_utils snd_soc_ralink_i2s snd_soc_wm8960 videobuf2_vmalloc videobuf2_memops videobuf2_core hid v4l2_common videodev evdev snd_soc_core mt_wifi ralink_gdma virt_dma ledtrig_oneshot ledtrig_morse ledtrig_heartbeat ledtrig_gpio ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables nfs msdos snd_pcm_dmaengine snd_compress snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_rawmidi snd_seq_device snd_hwdep snd soundcore vfat fat ntfs lockd sunrpc grace configfs autofs4 nls_utf8 nls_iso8859_1 nls_cp437 regmap_spi regmap_i2c dma_shared_buffer ecdh_generic kpp ecb cmac crypto_acompress mmc_block
    [  197.020602]  usb_storage sdhci_pltfm sdhci mtk_sd mmc_core leds_gpio ohci_platform ohci_hcd ledtrig_transient ehci_platform sd_mod scsi_mod ehci_hcd gpio_button_hotplug ext4 jbd2 mbcache exfat usbcore nls_base usb_common crc16 aead crypto_null cryptomgr crc32c_generic crypto_hash
    [  197.045860] CPU: 0 PID: 1933 Comm: ls Not tainted 4.14.81 #0
    [  197.051594] Stack : 804f36a0 803c7314 00000000 00000000 80432564 8677bb0c 85c3a95c 8048da07
    [  197.060111]         8042e24c 0000078d 804f36a0 00000f25 8677bdc8 00000001 8677bac0 96825141
    [  197.068612]         00000000 00000000 804f0000 00000127 00000000 736c203a 746f4e20 69617420
    [  197.077146]         72632072 000000c0 00000000 63323363 80000000 00000000 8008fcf0 80436c4c
    [  197.085687]         00000009 00000f25 8677bdc8 00000000 00000003 80202c18 001b711f 001b70df
    [  197.094199]         ...
    [  197.096682] Call Trace:
    [  197.099190] [<8000e624>] show_stack+0x74/0x104
    [  197.103732] [<80025700>] __warn+0x110/0x118
    [  197.107981] [<8002579c>] warn_slowpath_null+0x1c/0x30
    [  197.113126] [<8008fcf0>] __alloc_pages_nodemask+0x144/0xa6c
    [  197.118795] [<800a7be0>] kmalloc_order+0x20/0x54
    [  197.123621] [<8702aa18>] exfat_time_fat2unix+0x518/0x608 [exfat]
    [  197.129768] ---[ end trace 847ff43f74ec7c41 ]---
    ls: /mnt/sda1/ж[  197.138321] convert_uni_to_ch: fail to use nls
    енщина.bmp[  197.144033] convert_uni_to_ch: fail to use nls
    [  197.149920] convert_uni_to_ch: fail to use nls
    
    [  197.155839] convert_uni_to_ch: fail to use nls
    [  197.161672] convert_uni_to_ch: fail to use nls
    [  197.166272] convert_uni_to_ch: fail to use nls
    [  197.170774] convert_uni_to_ch: fail to use nls
    [  197.175301] convert_uni_to_ch: fail to use nls
    [  197.179841] convert_uni_to_ch: fail to use nls
    [  197.184378] convert_uni_to_ch: fail to use nls
    [  197.188880] convert_uni_to_ch: fail to use nls
    [  197.193441] convert_uni_to_ch: fail to use nls
    [  197.203598] convert_uni_to_ch: fail to use nls
    [  197.208148] convert_uni_to_ch: fail to use nls
    [  197.212700] convert_uni_to_ch: fail to use nls
    [  197.217213] convert_uni_to_ch: fail to use nls
    -rwxr-xr-x    1 root     root         48128 Jan  1  2000 1.BMP
    -rwxr-xr-x    1 root     root       3659904 Jul 26  2003 Boyarskiy-dressirovshik.mp3
    drwxr-xr-x    2 root     root          4096 Jun 13 09:16 Dir1
    drwxr-xr-x    2 root     root          4096 May 15 18:03 System Volume Information
    -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       9699509 Jun  5 07:49 omega2.bin
    -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    2 root     root          4096 Jun 13 09:16 Кричевский
    root@Omega-3079:~#
    

    Filename, which produces error is '/mnt/sda1/женщина.bmp'. If I read USB flash directory in python, this file also "absent". OSError, IOError does not happens.

    Centos7 mounts the same flash with parameters:

    /dev/sdb1 /run/media/pavel/FLASH8 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,
                                           fmask=0022,dmask=0022,codepage=437,iocharset=ascii,
                                           shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0
    

    I tried this:

    ~# mount -o codepage=cp437,nls=ascii /dev/sda1 /mnt/sda1
    [ 3295.091098] ntfs: (device sda1): parse_options(): Unrecognized mount option codepage.
    [ 3295.163115] ntfs: (device sda1): parse_options(): NLS character set ascii not found.
    mount: mounting /dev/sda1 on /mnt/sda1 failed: Invalid argument
    

    But Omega's Linux does not understand this 😞 .

    How I should mount USB flash to avoid these errors?

    Firmware is latest 0.3.3 b251



  • The problem seems to be fixed

    # opkg install kmod-nls-cp1251
    # umount /mnt/sda1
    # mount -o codepage=1251,iocharset=utf-8 /dev/sda1 /mnt/sda1
    
    root@Omega-3079:/# ls -l /mnt/sda1
    -rwxr-xr-x    1 root     root         48128 Jan  1  2000 1.BMP
    -rwxr-xr-x    1 root     root       3659904 Jul 26  2003 Boyarskiy-dressirovshik.mp3
    drwxr-xr-x    2 root     root          4096 Jun 13 09:16 Dir1
    drwxr-xr-x    2 root     root          4096 May 15 18:03 System Volume Information
    -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       9699509 Jun  5 07:49 omega2.bin
    -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    2 root     root          4096 Jun 13 09:16 Кричевский
    drwxr-xr-x    0 root     root      39576966 Apr 24  2020 женщина.bmp
    

    No errors occured.


Log in to reply
 

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