1

Topic: Formatting SD/SDHC cards

Im trying to format sd/sdhc cards in opensuse. Creating the filesystem (mkfs.ext2) always fails as gparted tries to access the card with a "part1" , where the actual device is "p1". For example something like mccblk0p1.
I can do the same exact command with the correct name and it will work. Is this configurable to gparted to switch it to p1  instead of part1?

2

Re: Formatting SD/SDHC cards

What version of GParted or Live CD are you using?

Would you be able to provide the output from the following two commands?

fdisk -l -u

where one of the options is a lower case "L" and not the number one.

parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/mmcblk0

3

Re: Formatting SD/SDHC cards

gedakc wrote:

What version of GParted or Live CD are you using?

0.4.7 (not the live cd)

Would you be able to provide the output from the following two commands?

fdisk -l -u

where one of the options is a lower case "L" and not the number one.

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000080

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   146801969    73400953+   7  HPFS/NTFS
/dev/sda2   *   146801970   234436544    43817287+   f  W95 Ext'd (LBA)
/dev/sda5       146802033   178273304    15735636    c  W95 FAT32 (LBA)
/dev/sda6       178273368   209744639    15735636   83  Linux
/dev/sda7       209744703   232187444    11221371   83  Linux
/dev/sda8       232187508   234436544     1124518+  82  Linux swap / Solaris

Disk /dev/mmcblk0: 2032 MB, 2032664576 bytes
255 heads, 63 sectors/track, 247 cylinders, total 3970048 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00023397

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1              63     3968054     1983996   83  Linux
parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/mmcblk0

brw-rw----  1 root   disk    179,   0 2010-01-23 14:54 mmcblk0
brw-rw----  1 root   disk    179,   1 2010-01-23 14:54 mmcblk0p1

4

Re: Formatting SD/SDHC cards

Pickle wrote:

Is this configurable to gparted to switch it to p1  instead of part1?

GParted uses the libparted library from the parted project to identify names for devices.  Hence whatever parted uses is what GParted will use.

The output listed above for parted looks like it is from the command "ls -l | grep mmcblk0".

Would you be able to provide the output from the following command:

parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/mmcblk0

5

Re: Formatting SD/SDHC cards

Sorry, yeah that was 'ls'

Model: SD SD02G (sd/mmc)
Disk /dev/mmcblk0: 3970048s
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End       Size      File system  Flags
 1      0s     3970047s  3970048s  ext2

6

Re: Formatting SD/SDHC cards

Would you be able to save the gparted_details.htm log file when you try to format the SD/MMC device?
You can do this immediately after the operations fails (or succeeds).

My hope is that this might provide some clues as to what is occurring.

7

Re: Formatting SD/SDHC cards

Here I delete the existing partition and attempt to create a new one

GParted 0.4.7
Libparted 1.9.0
Delete /dev/mmcblk0_part1 (ext2, 1.89 GiB) from /dev/mmcblk0  00:00:00    ( SUCCESS ) 
      
   calibrate /dev/mmcblk0_part1  00:00:00    ( SUCCESS ) 
      
  path: /dev/mmcblk0_part1
start: 0
end: 3970047
size: 3970048 (1.89 GiB) 
   delete partition  00:00:00    ( SUCCESS ) 
  ========================================
Create Primary Partition #1 (ext2, 1.89 GiB) on /dev/mmcblk0  00:00:00    ( ERROR ) 
      
   create empty partition  00:00:00    ( SUCCESS ) 
      
  path: /dev/mmcblk0_part1
start: 0
end: 3968054
size: 3968055 (1.89 GiB) 
   set partition type on /dev/mmcblk0_part1  00:00:00    ( ERROR ) 
   libparted messages    ( INFO ) 
      
  /dev/mmcblk0: unrecognised disk label 
  ========================================

8

Re: Formatting SD/SDHC cards

From the log file I can see that GParted is being passed an incorrect name for the partition.

GParted uses the libparted library from the parted project to detect and manipulate partition tables.  The function call that GParted uses to read the partition name is as follows:


char * ped_partition_get_path (const PedPartition *part)
           Return a path that can be used to address the partition in the operating system.


For some reason, libparted appears to be returning an incorrect device access name "/dev/mmcblk0_part1" instead of the correct name "/dev/mmcblk0p1".


To see if this problem still exists in the most recent release of parted-2.1, would you be able to try downloading the latest parted and gparted source code, compiling these, and testing the problem again?

The source code for each of these applications can be found using the following links:
Parted 2.1 Release Announcement
GParted application source code

9

Re: Formatting SD/SDHC cards

it works correctly with the latest parted and gparted

10

Re: Formatting SD/SDHC cards

Thank you for reporting back.  It is good to hear that this problem is resolved with the latest parted and gparted.  smile