3

Macbook Pro early 2013, Ubuntu 14.04 (latest updates as of March 30th 2016). Everything works in OSX. A regular 2GB SD card worked in Ubuntu.

When I plug it in it shows up in /dev as mmcblk0.

When I attempt to mount it:

domenic@mac:/dev$ sudo mount -t exfat mmcblk0 /media/domenic/thing/
[sudo] password for domenic: 
FUSE exfat 1.0.1
ERROR: exFAT file system is not found.

But I have fuse installed:

domenic@mac:/dev$ sudo apt-get install exfat-fuse
Reading package lists... Done
Building dependency tree       
Reading state information... Done
exfat-fuse is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

I have also tried a variety of file-system formats, and I have also tried varying sizes of disk partitions to eliminate these cases.

The solution shown here and here did not work for me as they simply recommend installing the fuse tools.

Here is what gparted sees. It will not create a partition table for this disk in any format: gparted display

Here is the output for fdisk -l:

domenic@mac:/dev$ sudo fdisk -l
[sudo] password for domenic: 

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders, total 490234752 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x9f793f3f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      409639      204819+  ee  GPT
Partition 1 does not start on physical sector boundary.
/dev/sda2   *      409640   411854951   205722656   af  HFS / HFS+
/dev/sda3       411856896   419854335     3998720   82  Linux swap / Solaris
/dev/sda4       419854336   490233855    35189760   83  Linux

Disk /dev/mmcblk0: 127.9 GB, 127864930304 bytes
4 heads, 16 sectors/track, 3902128 cylinders, total 249736192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mmcblk0 doesn't contain a valid partition table
4
  • 1
    Does gparted see the memory card at all? Does fdisk -l? Are you sure that it's even an exfat formatted filesystem?
    – Thomas Ward
    Mar 31, 2016 at 1:53
  • Hello @ThomasW. I have added the display of gparted, and the output of fdisk -l. I am sure that it is an exfat partition as I formatted in OSX, from which it works perfectly. I think the problem is deeper than this, as gparted isn't able to properly added a partition table to this disk.
    – DCurro
    Apr 1, 2016 at 2:58
  • Add exfat to ubuntu which is not included. Apr 5, 2016 at 9:10
  • @BhikkhuSubhuti exfat is included in the newer version of Ubuntu.
    – DCurro
    Apr 5, 2016 at 19:41

5 Answers 5

1

Having the card with a GPT partition table and ExFAT is the culprit. If I zero my USB flash device, then put it into the Mac, the format popup lets me choose between Apple / GUID / MBR. If I keep the default of GUID (GPT) now together with exFAT, I get the exact same behaviour on my Ubuntu 16.04LTS as you describe. This combination can only be read by Mac, but not Windows or Linux at the moment.

So you have to use Linux to make a readable exFAT partition as a first step.

Try

sudo fdisk /dev/mmcblk0 and make a new partition table in MBR format with o,n,p,1,Return,Return,t,7,w to make a new MBR drive with a partition of type 7 (NTFS/exFAT) which spans the full medium.

Now, from Ubuntu, do mkexfatfs -n YourVolumeNameHere /dev/mmcblk0p1.

Test SDCard under Ubuntu by mounting it (eject/reinsert should be enough), writing to it and if you like, with GParted. After that, boot to OSX and test the card again there for functionality.

Now it should work under all systems. I have tested it with a USB stick for Ubuntu 16.04LTS, Windows 10, and Mac OS X El Capitan.

10
  • @DCurro: if necessary, eject and reinsert. Sometimes, the syncing doesn't work right. Make sure that fdisk -l /dev/mmcblk0 shows your changes.
    – emk2203
    Apr 4, 2016 at 20:36
  • I get an error when using fdisk: "Calling ioctl() to re-read partition table. Error closing file." I think the issue is deeper than me not understanding how to partition, as I can do it with other flash cards, and I can do it with this flash card on other operating systems.
    – DCurro
    Apr 5, 2016 at 19:43
  • 1
    I used a flash drive to replicate your issue, and I run into very similar problems on Windows and Linux when I use a Mac-GPT-exfat-formatted flash drive. Whatever the Mac does, it confuses the Windows diskmgmt.exe and fdisk on Linux so they don't work right. Insert the SDcard and make dd if=/dev/zero of=/dev/mmcblk0 bs=512 count=204800 to zero out the first 100 MB. Follow with dd bs=512 if=/dev/zero of=/dev/mmcblk0 count=204800 seek=$((blockdev --getsz /dev/mmcblk0 - 2048))` to zero out the last 100 MB. This gets rid of what the Mac has done. Then use the procedure in my answer.
    – emk2203
    Apr 5, 2016 at 20:43
  • And use sudo for the commands. I couldn't edit this in.
    – emk2203
    Apr 5, 2016 at 20:49
  • The last command should be dd bs=512 if=/dev/zero of=/dev/mmcblk0 count=204800 seek=$((`blockdev --getsz /dev/mmcblk0` - 204800))
    – emk2203
    Apr 6, 2016 at 8:44
0
  1. Launch the Disks app
  2. Click on the SD Card
  3. hit the gears
  4. hit format disk
  5. Choose a name for the SD card
  6. Hit format (It will reformat to FAT and all info will be lost on the SD card)
4
  • The disk still says 128GB Unknown.
    – DCurro
    Apr 5, 2016 at 19:38
  • will Mac OS X read it? if it doesn't then there may be an issue with the SD Card or your computer. If it doesn't work with Mac OS X on your computer, maybe try it on another. If it works on another and not on your mac, then you have a hardware issue. Apr 6, 2016 at 13:25
  • @DateOneLefty, my laptop is dual booted (OSX, Ubuntu). It's the same hardware used in the same way. OSX reads it just fine.
    – DCurro
    Apr 6, 2016 at 16:00
  • Try sudo apt-get install exfat-fuse exfat-utils i found this out from askubuntu.com/questions/451364/… Apr 10, 2016 at 15:53
0

If you can look into fdisk -l output, on last line it states:
Disk /dev/mmcblk0 doesn't contain a valid partition table

  • This means your SanDisk Extreme PRO SDXC 128GB card has either lost it's Partition Table or it has been corrupted.

To create new partition table on MSD/USB you can use GParted,
Choose: Device → Create Partition Table, Select New Partition Table Type, and click on Apply. It'll create a new partition table on MSD/USB. Don't forget to click on Apply All Oeration(Green Right mark below menu-bar)

You can refer GParted Documentation, Search for Creating a New Partition Table, same steps are there.

For doing the same using terminal, you can refer commands from following link:
- How to Use Fdisk to Manage Partitions on Linux

After your partition table is created your file-system will be able to mount it. But still check for any error on file-system, Goto Check and Repair Your Filesystem With fsck [Linux] for help.

2
  • GParted never succeeds in creating the partition table. It warns me about overwriting the disk, and then after a few seconds the top up disappears and I'm back where I started: looking at gparted claiming that my disk is unallocated and not being able to partition.
    – DCurro
    Apr 5, 2016 at 19:40
  • @DCurro ok!, I suggest try command given by emk2203 in above answer, use dd to write /dev/zero on your card. Then try to create partition table or try to format it with Windows OS. I had similar issue, and Windows Disk Manager helped me out; where in another case of mine dd worked for me as well. Give both a try.
    – Novice
    Apr 6, 2016 at 3:28
0

Search Disks in dash ,delete partition within Drive and create partition.

-3

You could create a disk image and dd it to the device.

sudo dd if=<disk partition identifier for the 2GB disk> of=./2GB.dd

Then write that to the other device.

sudo dd if=./2GB.dd of=/dev/mmcblk0 (make sure that is the correct device identifier!)

You could also do it in one step with

sudo dd if=/dev/2gbdiskid of=/dev/mmcblk0

That will take the entire disk from the small 2GB disk and write it (including the partition table etc.) to the 128GB disk. then gparted should be able to expand the partition.

Also make sure the tiny switch on the device (SD Card I assume) is set to allow writing to the device.

If you are using a microSD to SD adapter, make sure the Lock switch on the left side of the adapter card is slid up (unlock position) from here

2
  • I'm not looking to recover a partition, I'm looking to create a partition table.
    – DCurro
    Apr 5, 2016 at 19:40
  • This is a mounting issue, not a moving/recovering partitions/drive data issue. Apr 14, 2016 at 2:26

You must log in to answer this question.

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