Extended Brain Storage

BlackBerry: Media CIFS Mount

Posted on June 6, 2016

A short reminder to be able to mount an internal storage or a media card of a BlackBerry device using CIFS in Arch Linux…

File Sharing in BlackBerry

The appropriate sharing options are located in the BlackBerry device in System Settings -> Storage and Access as follows:

Browsing the CIFS/Samba Network

A useful command to list all available shares using Server Message Block (SMB), one version of which was also known as Common Internet File System (CIFS), is as follows:

$ smbclient -L BLACKBERRY-IP -U BlackBerry
Enter WORKGROUP\BlackBerry's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.37]

	Sharename       Type      Comment
	---------       ----      -------
	IPC$            IPC       IPC Service (Samba (BLACKBERRY))
	removable_sdcard Disk      removable_media_SDCARD
	media           Disk      media
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.37]

	Server               Comment
	---------            -------

	Workgroup            Master
	---------            -------

Apparently, the following (two) shares are available:

  1. removable_sdcard (the SD card, if inserted) and
  2. media (the internal storage, if applicable).

Mounting Troubles #1: Permission denied

Trying to mount the device using the mount -t cifs command raised the following error:

mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

The same occurred when configured via /etc/fstab.

The workaround is to use the mount.cifs instead of the mount -t cifs command.

Mounting Troubles #2: Host is down

Trying to mount the device using the mount.cifs command (according to the previous workaround) raised another error:

mount error(112): Host is down
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

This problem is caused by the fact that BlackBerry device (even with an up-to-date OS version) is running an ancient version of the Samba software. BlackBerry proves, that security is really not they care about, as this fact is not new.

The solution is to explicitely specify the version, i.e. “1.0” (the default is currently “3.0”).

Note: The version specification also eliminated the previously required workaround.

Solution: Mounting “The Right Way”

The following script incorporates all observations to be able to mount the BlackBerry device again (at least, DEVICEIP and PASSWORD need to be changed accordingly):

# General setup
DEVICESHARE="media" # or "removable_sdcard"
# Mount procedure (with version specified, both mount.cifs and mount -t cifs work)
sudo mount -t cifs //"$DEVICEIP"/"$DEVICESHARE" \
       "$MOUNTPOINT" \
       -o username="$USERNAME",password="$PASSWORD",vers="$VERSION"

A helping hand with useful hints were kindly provided by the linuxquestions.org and serverfault.com servers.

Tags: #CIFS #Samba #Arch Linux

⏴ Previous Post Next Post ⏵