GNOME Bugzilla – Bug 629592
Unable to find Mount Point if it contains a Space Character
Last modified: 2010-12-13 17:31:19 UTC
Created attachment 170204 [details] Screenshot of error message "Unable to find Mount Point" Error: "Unable to find Mount Point" if a space character is contained within the Label of the Partition, i.e. in the Mount Point (external USB drives for example). OS: Ubuntu 10.04 Tried with NTFS and EXT4 partition. In the Attached screenshot the partition label was "ab cd" and "ef gh". Both partitions aren't found as mounted by gparted.
Created attachment 174893 [details] GParted 0.7.0 with mounted file system with a space in the volume label Thank you Andrea for reporting this problem. At first glance I thought that this would be an easy bug to recreate. Either the problem is fixed in GParted version 0.7.0, or else I am missing a step to reproduce the problem. I created a label with a space in it "Single Drive" on a file system. Then I created a directory to mount it "/mnt/mnt2". I used the following command to mount the file system: sudo mount -L "Single Drive" /mnt/mnt2 Then I started GParted and double clicked on the file system and there did not appear to be any problems finding the mount point as can be seen in the attached screen shot. I suspect that I am missing a step that you used. Would you be able to provide the list of steps you used to invoke this problem? Also would you provide the content of the /etc/fstab file, and also the output from the following command? ls -l /dev/disk/by-label
By default the (auto)mount point of USB drives will contain the label, i.e. the spaces. You mounted it manually. Try this: sudo mkdir /mnt/mnt\ with\ spaces sudo mount -L "Single Drive" /mnt/mnt\ with\ spaces
Thanks Andrea. Now I can reproduce this problem. :-) From doing some more reading it would appear that this problem could occur with other characters, such as a tab: Quote from http://www.gnu.org/s/libc/manual/html_node/mtab.html ----- begin quote ----- The file format used prescribes the use of spaces or tab characters to separate the fields. This makes it harder to use name containing one of these characters (e.g., mount points using spaces). Therefore these characters are encoded in the files and the getmntent function takes care of the decoding while reading the entries back in. '\040' is used to encode a space character, '\011' to encode a tab character, '\012' to encode a newline character, and '\\' to encode a backslash. ----- end quote ----- Hence I need to address these characters too when developing a solution.
mmmm.... I'm sure you are going to hate me.... Since we have the wonderful world of Unicode I tried to mount my USB stick on a folder with some exotic characters (including Braille symbols), but not spaces nor tabs. All consecutive characters. Also in that case gparted gave the same error: sudo mkdir "/mnt/CrazyĘωЦ╠@üআ⠟⠯Folder" sudo mount -L "Single Drive" "/mnt/CrazyĘωЦ╠@üআ⠟⠯Folder" I'm not sure if it will be shown correctly in the browser (I know Unicode can be a nightmare, one of the reasons why I use always UTF8 when saving files).
Wow, that sure is a lot more characters to account for in a possible mount point name. :) I'm guessing that there must be some C or C++ function that would encode and decode these characters. Are you aware of one and what it might be called?
It turns out that the mntent C library exists to work with mount point files such as /etc/fstab. This library handles all of the encoding and decoding required for characters such as spaces. An enhancement to handle characters like spaces in mount points has been committed to the git repository for inclusion in the next release of GParted (either 0.7.1 or 0.8.0). The relevant git commit can be viewed at the following link: http://git.gnome.org/browse/gparted/commit/?id=3973b6961de37beab359d72236feadbd1b912bb1 Andrea, are you comfortable compiling code to test this bug fix? How to Build GParted from git Source Code Repository http://gparted-forum.surf4.info/viewtopic.php?id=14136
Compiled and Tested on a fresh install of Ubuntu 10.10 64bit. - gparted 0.6.2 has the bug. - gparted 0.7.0-git compiled has the bug fixed I tried with two folders: sudo mkdir "/mnt/CrazyĘωЦ╠@üআ⠟⠯Folder" sudo mkdir "/mnt/Space Folder" Works in both cases. Thank You :)
And thank you for confirming that this bug is now fixed. :-)
This enhancement has been included in GParted 0.7.1 released on December 13, 2010. Closing this bug.