Ubuntu

blkid does not read non-ASCII characters from NTFS labels

Reported by Jonas Ådahl on 2009-11-01
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Medium
Unassigned
Nominated for Karmic by Zen Shaolin
Nominated for Lucid by Zen Shaolin

Bug Description

Binary package hint: hal

When plugging in an external harddrive with an NTFS filesystem with a label set to contain UTF-8 characters, the mounted path as well as the label displayed in nautilus are incorrect. The label reported by ntfs-3g are always correct. The labels are set with the command ntfslabel.

Some different examples follows:

NTFS label # HAL label discovered # Label used in Nautilus / Filesystem path (/media/...)
=========================
dong # dong # dong
東西 # 55 # ??
Å # % # 4A12287F1228725D
dong西 # dong% # dong?
dongÅ # dong% # dong
dong西xi # dong%xi # dong?xi
dongÅxi # dong%xi # dong

Examining the above table shows that depending on what Unicode character the file system path and label shown in nautilus differ. The behaviour of hal is also a bit odd. When a chinese character is used together with a ASCII character, hal with read it as '%', while nautilus and the path as '?'. When the swedish character 'Å' is used together with ASCII characters, hal with do the same as with chinese characters, but nautilus and the path will simply truncate everything including and after the swedish character.

If only chinese characters are used, hal with read them as the number '5'. '東西' is translated into '55'. ‘東西南北’ translates to '5555'. When only swedish characters are used, hal will read them in as '%', while the path as well as the label presented in nautilus will be something looking like a large random identifier number.

In Ubuntu 9.04, these issues did not exist. A NTFS partition with label 東西 would automatically mount into /media/東西/, and would be presented correctly in nautilus. The issue occurred immediately after upgrading to Ubuntu 9.10.

Setting the label is done with the command ntfslabel. Reading hal values is done with the command hal-devices.

Jonas Ådahl (jadahl) on 2009-11-01
affects: hal (Ubuntu) → autofs (Ubuntu)
summary: - Automounted NTFS disks with Unicode in label results in invalid path
+ Automounted NTFS disks with Unicode in label results in incorrect path
after upgrading to 9.10
Chuck Short (zulcss) on 2009-11-03
affects: autofs (Ubuntu) → nautilus (Ubuntu)
affects: nautilus (Ubuntu) → devicekit-disks (Ubuntu)

Can you please attach the hard drive and do

  udevadm info --export-db > /tmp/udev.txt

and attach /tmp/udev.txt here? Afterwards, please copy&paste the output of

  sudo blkid

Thanks!

Changed in devicekit-disks (Ubuntu):
status: New → Incomplete
Jonas Ådahl (jadahl) wrote :

Output shows that /dev/sdb1 (the NTFS partition which has the label '東西') has the label '??' (enc: \x3f\x3f), on line 1462 and 1463.

Jonas Ådahl (jadahl) wrote :

Relevant output of blkid is:
/dev/sdb1: UUID="4A12287F1228725D" LABEL="??" TYPE="ntfs"

Martin Pitt (pitti) wrote :

Ah, so it seems that blkid is not able to read the label that ntfslabel set. I can reproduce this:

$ sudo mkfs.ntfs /dev/ram0

works fine for ascii:

$ sudo ntfslabel /dev/ram0 ascii
$ sudo blkid -p /dev/ram0
/dev/ram0: UUID="340F594C06D212D8" LABEL="ascii" TYPE="ntfs" USAGE="filesystem"

when mixing ASCII and some German umlaut/Euro sign, output becomes scrambled:
$ sudo ntfslabel /dev/ram0 'aäo€xx'

$ sudo blkid -p /dev/ram0
/dev/ram0: UUID="340F594C06D212D8" LABEL="aM-do?xx" TYPE="ntfs" USAGE="filesystem"

Chinese characters aren't detected at all:

$ sudo ntfslabel /dev/ram0 'dong西xi'
$ sudo blkid -p /dev/ram0
/dev/ram0: UUID="340F594C06D212D8" LABEL="dong?xi" TYPE="ntfs" USAGE="filesystem"

affects: devicekit-disks (Ubuntu) → util-linux (Ubuntu)
Changed in util-linux (Ubuntu):
status: Incomplete → Triaged
summary: - Automounted NTFS disks with Unicode in label results in incorrect path
- after upgrading to 9.10
+ blkid does not read non-ASCII characters from NTFS labels
Changed in util-linux (Ubuntu):
importance: Undecided → Medium
Zen Shaolin (zen-shaolin) wrote :

Hello,

Since upgrading to 9.10, hard disk label is truncated after special chars.

For example, under Nautilus and on my desktop, my disk named "Données" display "Donn" since 9.10.

Zen Shaolin (zen-shaolin) wrote :

Here is my udev.txt

Output shows that /dev/sdb1 (the NTFS partition which has the label 'Données') has the label 'Donn_es' (enc: Donn\xe9es).
Relevant output of blkid is:
/dev/sdb1: UUID="061B05DE4DD6F84A" LABEL="DonnM-ies" TYPE="ntfs"

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers