• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Unable to access sd card from Linux

JamesA

Newbie
Feb 11, 2010
20
1
Hi,
I've recently rooted my SGS2 (not sure if that's the cause of the problem), when I try to connect to my phone with linux I can see the directories and it mounts but the sd card directory (External_sd) is empty, almost like it's trying to unmount it. I want to be able to see this so I can transfer some music across and I'd rather not have to reboot into windows and use Kies.


Any ideas, I can't find anything that works through google.
Thanks
Jim
 
Hi,
I've recently rooted my SGS2 (not sure if that's the cause of the problem), when I try to connect to my phone with linux I can see the directories and it mounts but the sd card directory (External_sd) is empty, almost like it's trying to unmount it. I want to be able to see this so I can transfer some music across and I'd rather not have to reboot into windows and use Kies.


Any ideas, I can't find anything that works through google.
Thanks
Jim

That is what you should expect to happen, in part at least. When you mount the drives, you should see what you do see. external_sd is a mount point but while the sd card is mounted under Android, Linux cannot make use of the Android mounts so the sd card should show up separately as another drive and the external_sd directory should indeed be empty.

If you don't see the sd card mounted as a separate drive on your Linux computer, there is a problem but as far as you go in your description, what you are seeing is what is supposed to happen.
 
Upvote 0
Granted, I see what you mean, but I only seem to get one mount point (sdb). This is confirmed in dmesg

usb 2-3: New USB device found, idVendor=04e8, idProduct=6860
usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-3: Product: SAMSUNG_Android
usb 2-3: Manufacturer: SAMSUNG
usb 2-3: SerialNumber: 304D1919673CC48E
usb 2-3: USB disconnect, device number 27
usb 2-3: new high speed USB device number 28 using ehci_hcd
usb 2-3: New USB device found, idVendor=04e8, idProduct=6860
usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-3: Product: SAMSUNG_Android
usb 2-3: Manufacturer: SAMSUNG
usb 2-3: SerialNumber: 304D1919673CC48E
usb 2-3: USB disconnect, device number 28
usb 2-3: new high speed USB device number 29 using ehci_hcd
usb 2-3: New USB device found, idVendor=04e8, idProduct=685b
usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-3: Product: SAMSUNG_Android
usb 2-3: Manufacturer: SAMSUNG
usb 2-3: SerialNumber: 304D1919673CC48E
scsi19 : usb-storage 2-3:1.0
scsi 19:0:0:0: Direct-Access Android UMS Composite 00 PQ: 0 ANSI: 2
sd 19:0:0:0: Attached scsi generic sg2 type 0
sd 19:0:0:0: [sdb] Attached SCSI removable disk
sd 19:0:0:0: [sdb] 24133632 512-byte logical blocks: (12.3 GB/11.5 GiB)
sd 19:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sdb:
ja ~ $ ls /dev/sd*
/dev/sda /dev/sda2 /dev/sda5 /dev/sda7 /dev/sda9
/dev/sda1 /dev/sda3 /dev/sda6 /dev/sda8 /dev/sdb
But fdisk reports the only partition to be sdb4
ja # fdisk -l /dev/sdb

Disk /dev/sdb: 12.4 GB, 12356419584 bytes
64 heads, 32 sectors/track, 11784 cylinders, total 24133632 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

Device Boot Start End Blocks Id System
/dev/sdb4 0 0 0 0 Empty

So I've still no idea how to access the sdcard!

Thanks!
 
Upvote 0
All I get is this, my usual hard drive plus the phone, sdb4:
Desktop # fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0x00000080

Device Boot Start End Blocks Id System
/dev/sda1 * 620928378 625137344 2104483+ c W95 FAT32 (LBA)
/dev/sda2 96390 94478264 47190937+ 7 HPFS/NTFS/exFAT
/dev/sda3 94478265 625137344 265329540 f W95 Ext'd (LBA)
/dev/sda5 620928378 625137344 2104483+ dd Unknown
/dev/sda6 94478328 94687109 104391 83 Linux
/dev/sda7 94687173 172827269 39070048+ 83 Linux
/dev/sda8 172827333 182610854 4891761 82 Linux swap / Solaris
/dev/sda9 182610918 620928314 219158698+ 83 Linux

Partition table entries are not in disk order

Disk /dev/sdb: 12.4 GB, 12356419584 bytes
64 heads, 32 sectors/track, 11784 cylinders, total 24133632 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

Device Boot Start End Blocks Id System
/dev/sdb4 0 0 0 0 Empty
 
Upvote 0
I've not used LINUX, but I developed in UNIX for years in my earlier days. (showing my age now! :) )

It seems to me you would need to mount the device manually.
Do you know what the external sd card device name is in LINUX? (eg /dev/sdc1)
so try doing a mount /dev/sdc1 /mnt (for example)

If you dont have a device for it in /dev then you will need to do a mkdev for it. This would then depend on your LINUX system having the appropriate divers for the card device. If you dont then you will need to create and install a btld (boot time loadable driver) disk at boot time for it, or download one
 
  • Like
Reactions: zioalex
Upvote 0
On mine (using Ubuntu Oneiric Ocelot) the two drives (called INTERNAL and SDHC32GB, the latter being the name I gave my card) are automounted by Nautilus under /media.

The two drives also show up when I do an fdisk -l (remembering to run as root or use sudo) as sdb and sdc.

Have you tried plugging the micro SD card directly into your computer to see if there is something about the card that your computer doesn't like?
 
Upvote 0
Thanks Hawker!
I've tried your suggestion but i can't see the subpartition...
Could be something bind to my kernel config ... like shown in other posts.


I've not used LINUX, but I developed in UNIX for years in my earlier days. (showing my age now! :) )

It seems to me you would need to mount the device manually.
Do you know what the external sd card device name is in LINUX? (eg /dev/sdc1)
so try doing a mount /dev/sdc1 /mnt (for example)

If you dont have a device for it in /dev then you will need to do a mkdev for it. This would then depend on your LINUX system having the appropriate divers for the card device. If you dont then you will need to create and install a btld (boot time loadable driver) disk at boot time for it, or download one
 
Upvote 0
Hi JamesA,
Thanks for your suggestion but gentoo-wiki is not fully active now.

Please can you specify which module to enable?

Thanks
Alex

Please can you specify which
Ha, solved it. Needed to recompile my kernel with all the sd card options. This is detailed here SD and MMC card readers - Gentoo Linux Wiki

I think the critical part is the bit about multi USB card readers.

Let me know if this helps?
 
Upvote 0
Hi JamesA,
Thanks for your suggestion but gentoo-wiki is not fully active now.

Please can you specify which module to enable?

Thanks
Alex

Please can you specify which

For anyone else, the SD/MMC kernel options JamesA recommended were...

Code:
CONFIG_PCI_MMCONFIG=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_MINORS=8
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_MMC_SDHCI=m
CONFIG_MMC_SDHCI_PCI=m
CONFIG_MMC_RICOH_MMC=y

...all of which are under "Device Drivers ---> MMC/SD/SDIO card support "

But the multiple LUNs zioalex details is also essential.


Now to root my phone!
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones