0

Here's the output of sfdisk -l:

Disk /dev/mmcblk0: 242560 cylinders, 4 heads, 16 sectors/track   
Units: cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0   

Device Boot Start     End   #cyls    #blocks   Id  System   
/dev/mmcblk0p1         64    2111    2048      65536   83  Linux   
            start: (c,h,s) expected (64,0,1) found (0,65,2)   
            end: (c,h,s) expected (1023,3,16) found (8,105,33)   
/dev/mmcblk0p2       2112   45311   43200    1382400   83  Linux   
            start: (c,h,s) expected (1023,3,16) found (8,105,34)   
            end: (c,h,s) expected (1023,3,16) found (180,131,15)   
/dev/mmcblk0p3          0       -       0          0    0  Empty   
/dev/mmcblk0p4          0       -       0          0    0  Empty   

When I run parted I'm told:

GNU Parted 3.2   
Using /dev/sr0   
Welcome to GNU Parted! Type 'help' to view a list of commands.   
(parted) p all   
Warning: The driver descriptor says the physical block size is 512 bytes, but Linux says it is 2048 bytes.   
Ignore/Cancel? i
Error: Can't have a partition outside the disk!
Ignore/Cancel? i
Model: T-Mobile USB SCSI CD-ROM (scsi)
Disk /dev/sr0: 7773kB
Sector size (logical/physical): 512B/2048B
Partition Table: mac
Disk Flags:

Number  Start   End     Size    File system  Name                             Flags
 1      512B    18.4kB  17.9kB               MRKS
 2      67.6kB  31.1MB  31.0MB  hfs+         Toast 8.0.1 HFS+/Joliet Builder

Model: SD SU08G (sd/mmc)
Disk /dev/mmcblk0: 7948MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      2097kB  69.2MB  67.1MB  primary  fat16
 2      69.2MB  1485MB  1416MB  primary  ext4

My goal is to grow the root partition to fill the whole 8G card.. but I'm not sure how to clean up the current problems.

1 Answer 1

2

If you can read the data on the card, the simplest way to "clean up" the existing problems and grow the partition to fill the card will be to back up all files on the card, create a new partition table (using fdisk or a higher level partition editor), then create new partition(s) using all available space, format to your chosen file system(s), and copy the data back to the card.

If you can't read the data on the card, you'll need to start with something along the lines of fsck to (hopefully) become able to read the data, then proceed as above. If fsck won't recover access to the file system, it's possible certain partition editors (the GUI version of GParted is one) can "rescue" the data, but this is likely to take a very long time because it requires a full-read raw bit pattern scan and analysis (I tried this once on a 4 GB USB stick, albeit on a very old computer, and it was still running without any progress indicator after two hours).

2
  • I have full access to the card. Were it not for wanting to use all of the available space I wouldn't have even known this problem exists.
    – ethrbunny
    Dec 25, 2014 at 22:38
  • Then you can most likely copy the contents of the first two partitions, repartition and reformat the card, and copy the data back in about twenty minutes -- half of which time you can spend doing short tasks in another window or away from the computer.
    – Zeiss Ikon
    Dec 26, 2014 at 0:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .