After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 649509 - Problems with space in device name and mkfs
Problems with space in device name and mkfs
Status: RESOLVED DUPLICATE of bug 787203
Product: gparted
Classification: Other
Component: application
0.7.0
Other Linux
: Normal major
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2011-05-05 20:34 UTC by Yann Leretaille
Modified: 2017-09-21 21:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Problem with space in name (2.15 KB, text/html)
2011-05-28 19:32 UTC, Mogol
Details

Description Yann Leretaille 2011-05-05 20:34:03 UTC
I am using fakeRaid and gave the array a name with an space in it.
This results in a device adress like "/dev/mapper/blahblahmy raid"
GParted was unable to create a partition with mkfs(ext4) because the device adress was not quoted.

Example of executed command (by gparted):
mkfs.ext4 -j -O extent -L "" /dev/mapper/blahblahmy raid
==>
mkfs.ext4: invalid blocks count 'raid' on device '/dev/mapper/blahblahmy'
Comment 1 Mogol 2011-05-28 19:32:10 UTC
Created attachment 188814 [details]
Problem with space in name

Problem in space. I manually copied command line and added quote's mark. Partition created successfully.
Comment 2 Curtis Gedak 2011-07-01 20:51:17 UTC
Thank you for reporting this problem and testing a potential solution.

Obviously you have been able to place a space in a device name and use the device.
My question is whether it is valid to have a space in a device name?
Comment 3 Mogol 2011-11-27 07:41:31 UTC
I think yes, it's valid name. Because a BIOS permits creating such name, Windows and Jmicrons software worked with such name without problem. 

In any case, if it isn't a valid name, a GParted must give warning/error messages about wrong name and recommendation to remove a space, not silently goes down.

Sorry for delay with answer.
Comment 4 Phillip Susi 2014-02-26 03:25:50 UTC
Actually it looks like this is a bug in (lib)parted rather than gparted.
Comment 5 Phillip Susi 2014-02-26 17:56:50 UTC
Actually the bug turns out to be in libdevmapper.  If you run dmsetup create 'foo bar' it ends up creating /dev/mapper/foo\x20bar instead.  IMHO, this is a mistake right there, but then when you run parted on that, dm_task_get_name() unescapes it and tells libparted the name of the device is "foo bar".  This causes libparted to fail to add/remove/set the type of partitions, which prevents gparted from even trying to run mkfs, so perhaps I am seeing a second bug in addition to gparted failing to quote or escape the name when passing it to mkfs.  I have emailed the lvm devel mailing list about it.
Comment 6 Yann Leretaille 2014-02-26 22:45:28 UTC
My report is a few years old, so I'm having a hard time to remember under which circumstances the error occurred. I'm pretty sure that I configured the name in the BIOS/jmicron(?) settings, very similar to Mogols example and that the fix in this case was to add the quotes to the mkfs command and run it manually.
Thumbs up for looking after such an old bug and potentially finding a new one in libdevmapper!
Comment 7 Mike Fleetwood 2017-09-21 21:38:19 UTC
Just pushed the patchset to fix bug 787203 "Correctly quote and escape
arguments of external programs passed to execute_command()".  It has the
effect of enclosing all device names in single quotes, thus allowing
device names containing spaces to be used with GParted.

Therefore closing this report as a duplicate of 787203.

*** This bug has been marked as a duplicate of bug 787203 ***