Scrambled label for usb disk

Bug #27897 reported by Andreas Eriksson
22
Affects Status Importance Assigned to Milestone
hal (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

I've been trying out dapper for a few days, and I've been using my usb hdd with
music on it to listen to music while I'm on the dapper computer. But when I
fired it up today and inserted the hdd the icon that apperas on the desktop got
some weird characters in it (I can't type them here, so I'll attach a
screenshot), instead of the normal "37 GB Media" that its usually called. It
also got mounted at /media/<strange name here> instead of /media/usbdisk that it
got mounted at yesterday and the day before that. I really hope this is just a
bug in hal or gnomes media manager or something, and that my filesystem hasn't
been corrupted. I've tried listening to one music file and playing one the first
few minutes of a movie I had on there, so it seems like its working, but I have
lots of things on that disk and it would take too long to check it all.

Here is the relevant output from the mount command:
/dev/sda1 on /media/D"??H?$ type vfat
(rw,nosuid,nodev,quiet,shortname=mixed,uid=1000,gid=1000,umask=077,iocharset=utf8)

And here is the relevant lines from dmesg:
[4295621.292000] usb 4-4: new high speed USB device using ehci_hcd and address 3
[4295621.408000] scsi1 : SCSI emulation for USB Mass Storage devices
[4295621.408000] usb-storage: device found at 3
[4295621.408000] usb-storage: waiting for device to settle before scanning
[4295626.411000] Vendor: FUJITSU Model: MHT2040AT Rev: 0811
[4295626.411000] Type: Direct-Access ANSI SCSI revision: 00
[4295626.413000] SCSI device sda: 78140160 512-byte hdwr sectors (40008 MB)
[4295626.413000] sda: assuming drive cache: write through
[4295626.415000] SCSI device sda: 78140160 512-byte hdwr sectors (40008 MB)
[4295626.415000] sda: assuming drive cache: write through
[4295626.415000] sda: sda1
[4295626.765000] sd 1:0:0:0: Attached scsi disk sda
[4295626.767000] usb-storage: device scan complete
[4295628.197000] FAT: utf8 is not a recommended IO charset for FAT filesystems,
filesystem will be case sensitive!

Could that last line have something to do with it? FAT is not supposed to be
case sensitive, so something is obviously up.

Revision history for this message
Andreas Eriksson (andreas-tpwch) wrote :

Created an attachment (id=5552)
screenshot showing the problem

screenshot showing the problem attached

Revision history for this message
Andreas Eriksson (andreas-tpwch) wrote :

I tried running fsck.vfat on it, here is the output:

root@laptop:andreas# fsck.vfat -y -v /dev/sda1
dosfsck 2.11 (12 Mar 2005)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Checking we can access the last sector of the filesystem
There are differences between boot sector and its backup.
Differences: (offset:original/backup)
  71:20/00, 72:20/00, 73:20/00, 74:20/00, 75:20/00, 76:20/00, 77:20/00
  , 78:20/00, 79:20/00, 80:20/00, 81:20/00
  Not automatically fixing this.
Boot sector contents:
System ID "MSWIN4.1"
Media byte 0xf8 (hard disk)
       512 bytes per logical sector
     32768 bytes per cluster
        36 reserved sectors
First FAT starts at byte 18432 (sector 36)
         2 FATs, 32 bit entries
   4883456 bytes per FAT (= 9538 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 9785344 (sector 19112)
   1220640 data clusters (39997931520 bytes)
63 sectors/track, 255 heads
        63 hidden sectors
  78140097 sectors total
Reclaiming unconnected clusters.
Checking free cluster summary.
/dev/sda1: 16646 files, 713986/1220640 clusters

Since it said 'not automatically fixing this' I ran it in non-auto mode:

root@laptop:andreas# fsck.vfat /dev/sda1
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
There are differences between boot sector and its backup.
Differences: (offset:original/backup)
  71:20/00, 72:20/00, 73:20/00, 74:20/00, 75:20/00, 76:20/00, 77:20/00
  , 78:20/00, 79:20/00, 80:20/00, 81:20/00
1) Copy original to backup
2) Copy backup to original
3) No action
? 2
Leaving file system unchanged.
/dev/sda1: 16646 files, 713986/1220640 clusters

I did 2 since if anything changed on the disk it would be best to restore the
backup since I haven't made any changes to the disk in a long time.

Oh well.. I'll see if I can store the files temporarily somewhere so I can back
it up and format the disk with ext3 instead.

Revision history for this message
Tarik Jabri (tjabri) wrote :

Those weird characters actually pop up in a lot of different places. I will attach two screenshots of their appearance.

I first noticed them in Synaptic. Some of the package descriptions had them. Sometimes if you hovered your mouse over them, they would go away, sometimes not.

I have a FAT volume that's mounted with the icon on the desktop. It used to be named 15 GB Volume or something like that before, but now it's a bunch of garbled characters.

Now, I just saw some more in System Log. I tried closing the program and starting it again and it still showed up.

Some other times, these characters also appear on some websites.

This forum thread also has some more information on this bug. http://ubuntuforums.org/showthread.php?t=153203

Revision history for this message
Tarik Jabri (tjabri) wrote : Weird Characters on Mounted Volume Icon

The way this volume is displayed on the desktop is the same way it's displayed throughout GNOME. Every place where it is listed it looks exactly the same way.

Revision history for this message
Tarik Jabri (tjabri) wrote : Screenshot of Weird Characters in System Log

This shows the same type of characters in System Log.

Revision history for this message
Asraniel (asraniel) wrote : Re: Weird name when using usb disk with dapper

i have also strange symbols with french an german letters like é ä è ü etc in filenames coming from windows.

Revision history for this message
funkensteinberg (funkensteinberg) wrote : USB_Madness

same as the other posts, different contents...

Revision history for this message
funkensteinberg (funkensteinberg) wrote : Re: Weird name when using usb disk with dapper

forgot to say - in the shell it appears as x__^W^____ . Also, it won't let any other user access/change the files that are on it.... :(

Revision history for this message
Alexander Kirillov (shurik179) wrote :

I am not an expert, but the issue is likely that Dapper tries to mount the drive using utf8 encoding. If the finames or volume label were in a different encoding (such as iso8859-1, aka Latin-1), this would explain the mess.

Can you try to unmount the usb volume, then remount with option iocharset=iso8859-1 ? Does it help?

Revision history for this message
Tarik Jabri (tjabri) wrote :

Alexander,

Thank you for your suggestion. I just tried it and it still shows the weird characters.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote : Re: [Bug 27897] Re: Weird name when using usb disk with dapper

No idea who is making a boo boo here, udev, pmount or hal... subcribing
a few relevant people.

 subscribe <email address hidden>
 subscribe <email address hidden>

Revision history for this message
Martin Pitt (pitti) wrote : Re: Weird name when using usb disk with dapper

I guess the label is just screwed up, or in a totally different encoding. Tarik, when remounting with iocharset=iso8859-1, did the characters look 'differently' weird? Can you please do

  lshal > hal.txt

and attach hal.txt here? Maybe I can figure out the encoding; I'll think about it, maybe there's an obvious way to ignore the label if it contains strange characters.

Thanks,

Martin

Revision history for this message
Tarik Jabri (tjabri) wrote : lshal output

Martin, this is the output of lshal > hal.txt as you had requested. I decided to look through the file and I picked out the section you may be interested in. Please note that this is with mounting the partition with the iocharset option. I didn't see a difference with or without it.

Here is the snippet:

(string list)
  info.interfaces = {'org.freedesktop.Hal.Device.Volume'} (string list)
  volume.ignore = false (bool)
  volume.policy.desired_mount_point = '
___h' (string)
  volume.policy.mount_filesystem = 'vfat' (string)
  volume.policy.should_mount = true (bool)
  volume.policy.mount_option.quiet = true (bool)
  volume.policy.mount_option.iocharset=utf8 = true (bool)
  info.udi = '/org/freedesktop/Hal/devices/volume_uuid_3037_AAEC' (string)
  volume.partition.msdos_part_table_type = 12 (0xc) (int)
  info.product = '
___h' (string)
  volume.size = 15726735360 (0x3a962f000) (uint64)
  volume.num_blocks = 30716280 (0x1d4b178) (int)
  volume.block_size = 512 (0x200) (int)
  volume.partition.number = 2 (0x2) (int)
  info.capabilities = {'volume', 'block'} (string list)
  info.category = 'volume' (string)
  volume.is_partition = true (bool)
  volume.is_disc = false (bool)
  volume.is_mounted = true (bool)
  volume.mount_point = '/media/hda2' (string)
  volume.label = '
___h' (string)
  volume.uuid = '3037-AAEC' (string)
  volume.fsversion = 'FAT32' (string)
  volume.fsusage = 'filesystem' (string)
  volume.fstype = 'vfat' (string)
  storage.model = '' (string)
  block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_MRG30DK3KD55TK' (string)
  block.is_volume = true (bool)
  block.minor = 2 (0x2) (int)
  block.major = 3 (0x3) (int)
  block.device = '/dev/hda2' (string)
  linux.hotplug_type = 3 (0x3) (int)
  info.parent = '/org/freedesktop/Hal/devices/storage_serial_MRG30DK3KD55TK' (string)
  linux.sysfs_path_device = '/sys/block/hda/hda2' (string)
  linux.sysfs_path = '/sys/block/hda/hda2' (string)

Revision history for this message
Martin Pitt (pitti) wrote : Re: Weird name when using usb disk with dapper

Thanks for the log. It really seems that the label is severely screwed up (it doesn't look like ISO-8859 either). From your log I was able to set the label of my USB stick's partition to the same value you have.

hal should be fixed to ignore these invalid strings. In the meantime, if you can afford to reformat the drive you can set a good label with

  mkfs.vfat -n 'your label' /dev/hda2

or change the label under windows (sorry, there's currently no easy way to change the label of a VFAT partition under Linux).

Changed in hal:
status: Needs Info → Confirmed
Martin Pitt (pitti)
Changed in hal:
assignee: nobody → pitti
status: Confirmed → In Progress
Revision history for this message
Martin Pitt (pitti) wrote : Re: Scambled label for usb disk

 hal (0.5.7-1ubuntu14) dapper; urgency=low
 .
   * Add debian/patches/14_prove_volume_invalidlabel.patch:
     - Do not try to fix device labels with invalid UTF-8 characters if more
       than 20% of the characters are invalid. This avoids totally
       unintelligible labels while still preserving only mildly damaged ones.
     - Closes: LP#27897

This should be a reasonable heuristics. Can you please confirm that it works for you?

Changed in hal:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.