• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: NTFS mount using nls=utf8  (Read 5358 times)
TitanFan
Newbie
*

Karma: 0
Posts: 27


View Profile
« on: July 28, 2010, 04:30:05 PM »

I have the following version of ntfs-3g installed on my debian system:

ntfs-3g 1.2531 integrated FUSE 27 - Third Generation NTFS Driver

I have the following fstab entry for an external usb disk:

/dev/sdc1               /mnt/usbdisk    ntfs-3g         rw,nls=utf8 0 0

During boot, a "mount -a" command is executed in rc.local, which mounts my usb disk, but I can't see the filenames with foreign characters. The mount command isn't taking the nls=utf8 option during boot. So, I login as root and do a "umount /dev/sdc1" and "mount -a", and now I can see my filenames with foreign characters!!

Why doesn't the "mount -a" command in rc.local recognize the nls=utf8 option?
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #1 on: July 28, 2010, 05:07:10 PM »

ntfs-3g 1.2531 integrated FUSE 27 - Third Generation NTFS Driver
I have 2010.3.6-1 from squeeze, and the man page makes no mention of an nls option, but if it works at non-boot time it must be there...
Quote
Why doesn't the "mount -a" command in rc.local recognize the nls=utf8 option?
What does the file /var/log/dmesg (== boot time messages) say about it?
One possibility(?) is that it's relying on something that isn't mounted when this ntfs partition is being mounted, but that seems unlikely.
Logged

TitanFan
Newbie
*

Karma: 0
Posts: 27


View Profile
« Reply #2 on: July 28, 2010, 05:29:05 PM »

I don't see anything in the log indicating an issue.  Very strange problem.  I created a shell script that I can run after login to umount and mount my disk, and that works - I can see the filenames with foreign characters. I added a line to call the same shell script at the end of rc.local, and just like before, I can't see the filenames with foreign characters after the boot is finished (my disk mounts fine). For some reason, I have to login as root and run the script for it to fully work.

#!/bin/sh

# Due to nls=utf8 option not being recognized during boot
# We need to umount and remount the usb external disk

/bin/umount /dev/sdc1
/bin/mount -a
Logged

sfzhi
Jr. Member
**

Karma: 1
Posts: 83


View Profile
« Reply #3 on: July 29, 2010, 07:47:13 AM »

What about your locale? Is it also UTF-8?

When you start your script manually the ntfs-3g process probably inherits the locale from your interactive shell, but with rc.local that is not the case.
Logged

Lack of knowledge is not such a big problem, unwillingness to learn is.

TitanFan
Newbie
*

Karma: 0
Posts: 27


View Profile
« Reply #4 on: July 29, 2010, 07:33:20 PM »

Yes, that was it brilliant!  I needed to set the LANG environment variable to en_US.UTF-8 (without the quotes) in rc.local.  Without setting LANG, the locale variables were set to POSIX. Now that Ive set LANG, all the locale variables are automatically set to en_US.UTF-8 (quotes included) and the mount -a in rc.local correctly mounts my disk and I can see all the filenames with foreign characters.

Thank-you!
Logged

TitanFan
Newbie
*

Karma: 0
Posts: 27


View Profile
« Reply #5 on: July 29, 2010, 07:36:21 PM »

Oh, I found out that utf8 is the default for the ntfs-3g driver, so my fstab line looks like this now:

/dev/sdc1               /mnt/usbdisk    ntfs-3g         defaults 0 0

Of course, you have to have the locale variables set to en_US.UTF-8 so you can see your filenames with foreign characters.
Logged

Pages: [1]
Print
Jump to: