Bug 256964

Summary: Partition Manager fails to see /dev/mmcblk0
Product: [Applications] partitionmanager Reporter: Andrew M <quantumphazor>
Component: generalAssignee: Volker Lanz <vl>
Status: RESOLVED FIXED    
Severity: normal CC: alpeterson, andrius, byczech, fabo, illumilore, nowardev, rootkit85
Priority: NOR    
Version: 1.0.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: add mmcblk devices to the devices list
add mmcblk devices to the devices list

Description Andrew M 2010-11-15 11:21:04 UTC
Version:           1.0.3 (using KDE 4.5.3) 
OS:                Linux

Partition Manager fails to add SD cards /dev/mmcblk0 to the list of available devices

Reproducible: Always

Steps to Reproduce:
Insert SD card into a card reader.
Confirm that it's mapped to /dev/mmcblk0
Open Partition Manager and try to find it

Actual Results:  
/dev/mmcblk0 is not presented in the list. Only /dev/sda and any other disks or USB drives connected at the time are visible.

Expected Results:  
An entry for the /dev/mmcblk0 device allowing the user to modify the card's partitions

OS: Linux 2.6.35-ARCH x86_64

Lenovo ThinkPad SL500 using the built in card reader (not a USB one that presents cards as /dev/sdc, ect.)

lspci:
SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)

/dev/mmcblk0 and /dev/mmcblk0p1 are still editable in command line tools
Comment 1 Aaron Peterson 2011-05-07 02:35:15 UTC
Also in Kubuntu 11.04,  very tough for me to create a dos boot disk to flash my firmware.
Comment 2 Fathi Boudra 2011-10-03 07:03:24 UTC
bug is confirmed.
Comment 3 Matteo Croce 2012-06-17 13:38:49 UTC
Confirmed

seems that the bug  lies in scanDevices() in src/core/libparted.cpp:

	QFile partitions("/proc/partitions");
	if (partitions.open(QIODevice::ReadOnly))
	{
		QRegExp rxLine("\\s*(\\d+)\\s+(\\d+)\\s+(\\d+)\\s([^0-9]+)\\s+");


that regular expression gets the list of the partitions and remove the trailing numbers, so /dev/mmcblk0 becames /dev/mmcblk which isn't a valid device name
Comment 4 Jekyll Wu 2012-06-17 21:36:43 UTC
*** Bug 291008 has been marked as a duplicate of this bug. ***
Comment 5 Matteo Croce 2012-09-07 00:30:19 UTC
Created attachment 73712 [details]
add mmcblk devices to the devices list
Comment 6 Volker Lanz 2012-09-07 09:44:51 UTC
I just got up and maybe I'm not yet at the top of my code-reading-abilities, but would this regex cover devices with two-digit-numbers, e.g. mmcblk23?
Comment 7 Matteo Croce 2012-09-07 09:51:14 UTC
Sure, do you have more than 10 MMC card reader?
(In reply to comment #6)
> I just got up and maybe I'm not yet at the top of my code-reading-abilities,
> but would this regex cover devices with two-digit-numbers, e.g. mmcblk23?
Comment 8 Volker Lanz 2012-09-07 14:41:44 UTC
Is that some kind of "640kb ought to be enough" trick question? ;-)

What's wrong with fixing the regex?
Comment 9 Matteo Croce 2012-09-07 15:01:28 UTC
Created attachment 73722 [details]
add mmcblk devices to the devices list
Comment 10 Andrius Štikonas 2012-12-08 17:37:06 UTC
*** Bug 311194 has been marked as a duplicate of this bug. ***
Comment 11 Andrius Štikonas 2012-12-08 20:15:14 UTC
SVN commit 1327786 by stikonas:

Fix detection of memory cards.


 M  +4 -2      plugins/libparted/libpartedbackend.cpp  
 M  +1 -1      util/helpers.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1327786
Comment 12 Andrius Štikonas 2013-01-14 18:31:38 UTC
Partition Manager does not number partitions on memory card correctly.
Devices are numbered /dev/mmcblk0 but partitions are numbered /dev/mmcblk0p1.
Partitionmanager fails to add 'p' before partition number.
Comment 13 Andrius Štikonas 2013-02-05 00:09:50 UTC
SVN commit 1337488 by stikonas:

Fix detection of partitions' paths.

Previously, partition number was added to device path.
However, there are devices with more complicated numbering scheme,
e.g. memory cards may have /dev/mmcblk0p1.
It seems that the easiest way to handle this is to use partition
path instead of device path + partition number .

 M  +1 -1      backend/corebackendpartitiontable.h  
 M  +23 -10    core/partition.cpp  
 M  +6 -2      core/partition.h  
 M  +1 -1      core/partitiontable.cpp  
 M  +1 -1      gui/infopane.cpp  
 M  +1 -1      gui/mainwindow.cpp  
 M  +3 -3      jobs/createpartitionjob.cpp  
 M  +2 -2      ops/copyoperation.cpp  
 M  +1 -1      ops/newoperation.cpp  
 M  +2 -2      ops/restoreoperation.cpp  
 M  +2 -2      plugins/dummy/dummypartitiontable.cpp  
 M  +1 -1      plugins/dummy/dummypartitiontable.h  
 M  +2 -2      plugins/libparted/libpartedbackend.cpp  
 M  +6 -6      plugins/libparted/libpartedpartitiontable.cpp  
 M  +1 -1      plugins/libparted/libpartedpartitiontable.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1337488
Comment 14 Volker Lanz 2013-03-04 09:51:34 UTC
*** Bug 316056 has been marked as a duplicate of this bug. ***