# Mounting partitioned MicroSDHC card w/ G1

## John5788

I'm running into some issues with a partitioned microsdhc card that I am using with my tmobile g1.

i partitioned the card like this:

```
# fdisk /dev/sdb 

Command (m for help): p

Disk /dev/sdb: 8067 MB, 8067743744 bytes

249 heads, 62 sectors/track, 1020 cylinders

Units = cylinders of 15438 * 512 = 7904256 bytes

Disk identifier: 0x000eadb7

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1         941     7263548    c  W95 FAT32 (LBA)

/dev/sdb2             942        1005      487398   83  Linux

Partition 2 does not end on cylinder boundary.
```

however, when I go to view or try to mount the partitions, i don't see them in /dev/

```
# ls /dev | grep sd

lrwxrwxrwx  1 root root         4 2009-07-20 15:55 root -> sda3

brw-rw----  1 root disk    8,   0 2009-07-20 15:55 sda

brw-rw----  1 root disk    8,   1 2009-07-20 15:55 sda1

brw-rw----  1 root disk    8,   2 2009-07-20 15:55 sda2

brw-rw----  1 root disk    8,   3 2009-07-20 15:55 sda3

brw-rw----  1 root disk    8,  16 2009-07-21 20:43 sdb
```

when I check dmesg, after plugging into my computer

```
[78640.618666] sd 30:0:0:0: [sdb] 15757312 512-byte hardware sectors: (8.06 GB/7.51 GiB)

[78640.620661] sd 30:0:0:0: [sdb] Write Protect is off

[78640.620664] sd 30:0:0:0: [sdb] Mode Sense: 03 00 00 00

[78640.620667] sd 30:0:0:0: [sdb] Assuming drive cache: write through

[78640.624658] sd 30:0:0:0: [sdb] 15757312 512-byte hardware sectors: (8.06 GB/7.51 GiB)

[78640.626659] sd 30:0:0:0: [sdb] Write Protect is off

[78640.626662] sd 30:0:0:0: [sdb] Mode Sense: 03 00 00 00

[78640.626665] sd 30:0:0:0: [sdb] Assuming drive cache: write through

[78640.626669]  sdb: sdb1 sdb2

[78640.633034] usb 1-2:1.0: uevent

[78640.633122] usb 1-2: uevent

[78640.899187] usb 1-2:1.0: uevent

[78640.899276] usb 1-2: uevent

[78641.054596] VFS: Can't find ext3 filesystem on dev sdb1.
```

but HAL somehow mounted /dev/android as ext3 TWICE in /media

```
/dev/android on /media/disk-1 type ext3 (rw,nosuid,nodev,uhelper=hal)

/dev/android on /media/disk-3 type ext3 (rw,nosuid,nodev,uhelper=hal)
```

does linux just not deal well with partitioned sd cards? or is there something in the kernel I need to set? I am using

```
# uname -a

Linux john5788 2.6.29-gentoo-r5 #1 SMP Fri May 29 16:56:58 PDT 2009 x86_64 Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux
```

----------

## VinzC

From what I know of Linux kernel, not to see partitions right after creating them implies to reload the kernel, i.e. reboot. Not seeing partitions under /dev after rebooting although they exist might be a udev rule problem.

----------

## John5788

ive tried a few reboots, but same results. the system will not recognize both partitions and mount them independently. it either gets stuck mounting the ext3 or stuck mounting fat32.

----------

## VinzC

Out of curiosity, I've just formatted an SD card I have (I've got no MicroSD, unfortunately) and made two partitions, one FAT, one ext2 and Xfce automatically mounted both. So I assume this is just a configuration issue...

----------

## John5788

most likely it is configuration, but where do I start?

----------

## VinzC

What surprises me is that [partitions on] your SD card appears like /dev/sdXn instead of /dev/mmcblk0pN, which is true on my computer...

----------

## John5788

well I have the sdcard mounted through my G1 which is connected through USB

----------

## VinzC

 *John5788 wrote:*   

> well I have the sdcard mounted through my G1 which is connected through USB

 

I'd say then the Androïd doesn't expose all its partitions through USB, does it make sense? Have you tried with a universal card reader?

----------

## John5788

i dont know, because when I plug the phone in, i see this in my dmesg

```
[ 8494.763604] sd 8:0:0:0: [sdb] 15757312 512-byte hardware sectors: (8.06 GB/7.51 GiB)

[ 8494.765972] sd 8:0:0:0: [sdb] Write Protect is off

[ 8494.765976] sd 8:0:0:0: [sdb] Mode Sense: 03 00 00 00

[ 8494.765978] sd 8:0:0:0: [sdb] Assuming drive cache: write through

[ 8494.769597] sd 8:0:0:0: [sdb] 15757312 512-byte hardware sectors: (8.06 GB/7.51 GiB)

[ 8494.771595] sd 8:0:0:0: [sdb] Write Protect is off

[ 8494.771598] sd 8:0:0:0: [sdb] Mode Sense: 03 00 00 00

[ 8494.771600] sd 8:0:0:0: [sdb] Assuming drive cache: write through

[ 8494.771603]  sdb: sdb1 sdb2

[ 8494.777813] usb 1-2:1.0: uevent

[ 8494.777901] usb 1-2: uevent

[ 8495.042911] usb 1-2:1.0: uevent

[ 8495.042995] usb 1-2: uevent

[ 8495.343036] VFS: Can't find ext3 filesystem on dev sdb1.
```

and now al lof a sudden I can see my fat32, but not the ext3 partition. i think its a configuration problem :/

----------

## John5788

I just pulled the phone from USB and plugged it back in. now I cannot see the fat32 partition:

```
[ 9015.769872] sd 11:0:0:0: [sdb] 15757312 512-byte hardware sectors: (8.06 GB/7.51 GiB)

[ 9015.772741] sd 11:0:0:0: [sdb] Write Protect is off

[ 9015.772745] sd 11:0:0:0: [sdb] Mode Sense: 03 00 00 00

[ 9015.772747] sd 11:0:0:0: [sdb] Assuming drive cache: write through

[ 9015.779369] sd 11:0:0:0: [sdb] 15757312 512-byte hardware sectors: (8.06 GB/7.51 GiB)

[ 9015.782741] sd 11:0:0:0: [sdb] Write Protect is off

[ 9015.782745] sd 11:0:0:0: [sdb] Mode Sense: 03 00 00 00

[ 9015.782747] sd 11:0:0:0: [sdb] Assuming drive cache: write through

[ 9015.782751]  sdb: sdb1 sdb2

[ 9015.789336] usb 1-2:1.0: uevent

[ 9015.789419] usb 1-2: uevent

[ 9016.109556] usb 1-2:1.0: uevent

[ 9016.109638] usb 1-2: uevent

[ 9016.300311] FAT: bogus number of reserved sectors

[ 9016.300314] VFS: Can't find a valid FAT filesystem on dev sdb2.

[ 9016.479312] kjournald starting.  Commit interval 5 seconds

[ 9016.479321] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended

[ 9016.481778] EXT3 FS on sdb2, internal journal

[ 9016.481783] EXT3-fs: mounted filesystem with ordered data mode.
```

----------

## VinzC

This clearly looks like a bug in android as it doesn't seem to expose the partitions correctly. I suppose this is not the only one external storage that you have? I mean do all USB disk properly expose their partitions and can you mount the filesystems they contain without errors?

----------

## John5788

perhaps, but this leads me to believe a bug in hal or udev. after my many attempts of plugging and unplugging to get the fat32 partition exposed, im left with a bunch of ghosts:

http://img187.imageshack.us/img187/9764/screenshotcpm.png

----------

