Partition Manager fails to see MMC/SD cards

Bug #1045896 reported by Matteo Croce
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE Partition Manager
Fix Released
Medium
partitionmanager (Debian)
Fix Released
Unknown
partitionmanager (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

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

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

Tags: patch
Revision history for this message
In , quantumphaze (quantumphazor) wrote :

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

Revision history for this message
In , AaronPeterson (alpeterson) wrote :

Also in Kubuntu 11.04, very tough for me to create a dos boot disk to flash my firmware.

Revision history for this message
In , Fathi Boudra (fboudra) wrote :

bug is confirmed.

Revision history for this message
In , Matteo Croce (teknoraver) wrote :

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

Revision history for this message
In , adaptee (adaptee) wrote :

*** Bug 291008 has been marked as a duplicate of this bug. ***

Changed in partitionmanager (Debian):
status: Unknown → New
Changed in partitionman:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Matteo Croce (teknoraver) wrote :

here is the fix

Revision history for this message
In , Matteo Croce (teknoraver) wrote :

Created attachment 73712
add mmcblk devices to the devices list

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "mmcblk.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
In , Volker Lanz (vl-fidra) wrote :

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?

Revision history for this message
In , Matteo Croce (teknoraver) wrote :

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?

Revision history for this message
In , Volker Lanz (vl-fidra) wrote :

Is that some kind of "640kb ought to be enough" trick question? ;-)

What's wrong with fixing the regex?

Revision history for this message
In , Matteo Croce (teknoraver) wrote :

Created attachment 73722
add mmcblk devices to the devices list

Revision history for this message
Matteo Croce (teknoraver) wrote :

add mmcblk devices to the devices list (this patch supports more than 10 MMC devices)

Changed in partitionmanager (Ubuntu):
status: New → Fix Committed
Changed in partitionmanager (Ubuntu):
status: Fix Committed → Confirmed
Revision history for this message
Matteo Croce (teknoraver) wrote :

Anyone can please include this patch?

Revision history for this message
In , Andrius Štikonas (stikonas) wrote :

*** Bug 311194 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Andrius Štikonas (stikonas) wrote :

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

Changed in partitionman:
status: New → Fix Released
Revision history for this message
In , Andrius Štikonas (stikonas) wrote :

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.

Changed in partitionman:
status: Fix Released → Confirmed
Revision history for this message
In , Andrius Štikonas (stikonas) wrote :

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

Changed in partitionman:
status: Confirmed → Fix Released
Revision history for this message
In , Volker Lanz (vl-fidra) wrote :

*** Bug 316056 has been marked as a duplicate of this bug. ***

Changed in partitionmanager (Ubuntu):
status: Confirmed → Fix Committed
importance: Undecided → Low
Changed in partitionmanager (Ubuntu):
status: Fix Committed → Fix Released
Changed in partitionmanager (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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