We have moved to a new Sailfish OS Forum. Please start new discussions there.
68

Wiki: microSD / microSDHC / microSDXC card

asked 2014-03-18 13:51:13 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2017-04-17 22:28:43 +0200

m2 gravatar image

[INFO] 1.0.4.20: directory change

1.0.4.20 - New location: /media/sdcard/xxxx-xxxx
1.0.3.8 - Old location: /run/user/100000/media/sdcard

Please vote for better integration of the SDcard into the OS core apps here!

There are as of 2014 3 types of µSD cards and Jolla should support all three formats:
microSD - from 64 MB to 2 GB
microSDHC - sizes between 4 GB to 32 GB
microSDXC - up to 128GB

Prices:
Be aware that there is loots of "fake/counterfeit" cards being sold on eBay/Amazon. Only buy from reputable sources.

How to check if you card is (not) fake/counterfeit?
Windows: - h2testw
Linux: - F3 (Fight Flash Fraud)
or simply try to fill up to the card with movies/ISO files to see if the card has claimed capacity.
When doing such a test, never interrupt/cancel the test as that may result in you µSDxx being corrupt.

Samsung microSDXC 64GB Class 10 UHS-1 Grade 1
Up to 70 MB/s read speed; and up to 20 MB/s write speed
£42.99 18-Mar-14
EUR 45,89 18-Mar-14

SanDisk Ultra microSDXC 64GB Class 10 Bi-coloured Card with Adapter
Up to 30MB/s read speed; write speed lower.
£33.20 18-Mar-14
EUR 45,99 18-Mar-14

SanDisk Extreme PLUS microSDHC/microSDXC UHS-I Card - SDSDQX-064G
Up to 80MB/s read speed; and up to 50MB/s write speed

SanDisk 64GB 95MB/s Extreme Pro - SDSDQXP-064G
£69.99 7-Jan-2015

SanDisk 128GB 30MB/s Ultra Micro SD Memory Cards with SD Adapter - SDSDQUA-128G
£64.99 7-Jan-2015

Cards that have fast write/read speeds like UHS-I are better as they will "not" slow down your phone, when it writes / reads from / to the card. I am assuming that Jolla is UHS-I compatible.

What should good quality µSD card have when buying new one?
- UHS-1 or even better UHS-3
- Class 10
- Fast Read / and most important Write speed


-- Jolla supports up to 64GB µSD cards in size. (strange that there is no mention of it on their website)


-- There is "NOT" (as of 22.12.2014 - 1.1.1.27 Vaarainjärvi ) support for the µSD indicator in the phones menu
as per post over here.


-- NEW CARDS:
- if you have brand new µSD card that you have purchased for the Jolla, most if not all of them come pre formatted to be able to use them straight away and compatible with Windows OS (so their file system is FAT16 / FAT32 aka vfat), so if you have card that is not bigger that 32Gb that will work out of box).
- according to post on xda-developers, 64Gb cards come formatted as exFAT, so use Linux PC or see below how to get the card working from the phone over ssh


-- Windows Users:
as per post over here, NTFS and exFAT formats are not supported, but FAT32 (vfat) is, but it has got limit of 4GB per file in size and single partition with 32 Gb size limit.

SD Formatter 4.0 for SD/SDHC/SDXC was created specifically for memory cards using the SD/SDHC/SDXC standards.


-- Reformatting micro SD card inside phone settings - EXT4 / via SSH
as per post over here, you can format the µSD from the developer mode, as root Howto log in / access dev mode over here.

[root@Sailfish nemo]# fdisk /dev/mmcblk1 - creater a partition on the card (this one is 64GB)
n (NEW)
p (PRIMARY)
1 (Partition number)
ENTER (First sector (2048-124735487, default 2048))
ENTER (Last sector, +sectors or +size{K,M,G,T,P} (2048-124735487, default 124735487): )
p (Print details)
w (Write changes)
[root@localhost nemo]# umount /dev/mmcblk1p1 - unmount the card
[root@localhost nemo]# mkfs.ext4 /dev/mmcblk1p1 - format the card
[root@localhost nemo]# chmod -R 777 /run/user/100000/media/sdcard/ - set permissions
[root@localhost nemo]# mount -t ext4 /dev/mmcblk1p1 /run/user/100000/media/sdcard/
you may have to manually mount the µSD card or use script (1.0.3.8 Naamankajärvi)


-- Formating the card as BTRFS as found in Answer to this question / via SSH.
[root@localhost nemo]# umount /dev/mmcblk1p1 - unmount the card
[root@localhost nemo]# mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
[root@localhost nemo]# mount -o subvolid=0 /dev/mmcblk1 /media/sdcard - mount the card
[root@localhost sdcard]# btrfs subvolume create Jolla - create folder called Jolla
[root@localhost sdcard]# chown -R nemo:nemo /run/user/100000/media/sdcard/Jolla - set ownership
[root@localhost sdcard]# chmod -R 775 /run/user/100000/media/sdcard/Jolla - set permissions
you may have to manually mount the µSD card or use script (1.0.3.8 Naamankajärvi)


-- Mapping your Jolla µSD card on your Linux PC using Secure SHell FileSystem (works on Debian Wheezy)
sudo apt-get install sshfs to install Secure SHell FileSystem if not already installed
sudo usermod -aG fuse marcel to add user marcel to fuse group
exec su -l $USER to restart your login
mkdir jolla make a folder where the µSD will be mapped
sshfs -p 22 nemo@192.168.1.26:/run/user/100000/media/sdcard ~/jolla -o follow_symlinks to mount the µSD card

-p 22 - is the SSH port of your Jolla
nemo@192.168.1.26 - is your Jollas default user / local IP address
/run/user/100000/media/sdcard - is where Jollas µSD card is mounted to (1.0.3.8 Naamankajärvi)
/media/sdcard/xxxx-xxxx - is where Jollas µSD card is mounted to (1.0.4.20, Ohijärvi)
~/jolla - is folder your Jollas µSD will be mounted to on you PC
-o follow_symlinks - is a command to follow symlinks on the µSD card

fusermount -u ~/jolla to unmount µSD card from your PC



-- Usefull commands from the developer mode:
##########################################################################################

- program for creation and manipulation of partition tables
[root@localhost nemo]# fdisk -l

[root@localhost nemo]# fdisk -l

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


Disk /dev/mmcblk0: 15.6 GB, 15634268160 bytes, 30535680 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/mmcblk0p1               1  4294967295  2147483647+  ee  GPT

Disk /dev/mmcblk1: 31.9 GB, 31914983424 bytes, 62333952 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/mmcblk1p1            8192    62333951    31162880    c  W95 FAT32 (LBA)


- df displays the amount of disk space available on the file system / µSD card
[root@localhost nemo]# df -h

[root@localhost nemo]# df -h
Filesystem            Size  Used Avail Use% Mounted on
rootfs                 14G  6.0G  7.3G  46% /
/dev/mmcblk0p28        14G  6.0G  7.3G  46% /
devtmpfs              406M   64K  406M   1% /dev
tmpfs                 407M  4.4M  402M   2% /dev/shm
tmpfs                 407M   21M  386M   5% /run
tmpfs                 407M     0  407M   0% /sys/fs/cgroup
tmpfs                 407M   16K  407M   1% /tmp
/dev/mmcblk0p28        14G  6.0G  7.3G  46% /swap
/dev/mmcblk0p19       8.0M  4.1M  3.9M  52% /drm
/dev/mmcblk0p25       8.0M  4.2M  3.8M  54% /persist
/dev/mmcblk0p28        14G  6.0G  7.3G  46% /home
/dev/mmcblk0p9         48M  9.4M   38M  20% /var/systemlog
/dev/mmcblk0p18        64M   45M   20M  70% /firmware
tmpfs                 407M     0  407M   0% /mnt/asec
tmpfs                 407M     0  407M   0% /mnt/obb
/dev/mmcblk1p1         30G   28G  2.3G  93% /run/user/100000/media/sdcard


- du - estimate file space usage, summarize disk usage of each FILE, recursively for directories.
[nemo@localhost ~]$ du -h


- lsblk - list block devices.
[root@localhost Jolla]# lsblk


[root@localhost Jolla]# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0 14.6G  0 disk 
├─mmcblk0p1  179:1    0    4M  0 part 
├─mmcblk0p2  179:2    0   32M  0 part 
├─mmcblk0p3  179:3    0    4M  0 part 
├─mmcblk0p4  179:4    0    4M  0 part 
├─mmcblk0p5  179:5    0    4M  0 part 
├─mmcblk0p6  179:6    0    2M  0 part 
├─mmcblk0p7  179:7    0    2M  0 part 
├─mmcblk0p8  179:8    0    4M  0 part 
├─mmcblk0p9  179:9    0   48M  0 part /var/systemlog
├─mmcblk0p10 179:10   0    4M  0 part 
├─mmcblk0p11 179:11   0    4M  0 part 
├─mmcblk0p12 179:12   0    2M  0 part 
├─mmcblk0p13 179:13   0    2M  0 part 
├─mmcblk0p14 179:14   0    2M  0 part 
├─mmcblk0p15 179:15   0    2M  0 part 
├─mmcblk0p16 179:16   0    2M  0 part 
├─mmcblk0p17 179:17   0    2M  0 part 
├─mmcblk0p18 179:18   0   64M  0 part /firmware
├─mmcblk0p19 179:19   0    8M  0 part /drm
├─mmcblk0p20 179:20   0   12M  0 part 
├─mmcblk0p21 179:21   0   12M  0 part 
├─mmcblk0p22 179:22   0    8M  0 part 
├─mmcblk0p23 179:23   0    8M  0 part 
├─mmcblk0p24 179:24   0  508M  0 part [SWAP]
├─mmcblk0p25 179:25   0    8M  0 part /persist
├─mmcblk0p26 179:26   0    8K  0 part 
├─mmcblk0p27 179:27   0    8M  0 part 
└─mmcblk0p28 179:28   0 13.8G  0 part /
mmcblk1      179:32   0  7.4G  0 disk 
└─mmcblk1p1  179:33   0  7.4G  0 part



-- How user can take backups out of device to SD post over here, creating tar file

  • to create back up on your Jolla -> Settings -> Backup (pick what you want to backup - Accounts, Browser, Gallery, Playlists, Messaging, People, Phone) -> Create
  • Backup files are located in Jolla memory in /home/nemo/.vault hidden folder


- check that the µSD card is mounted
[nemo@localhost ~]$ mount | grep media

/dev/mmcblk1p1 on /run/user/100000/media/sdcard type vfat (rw,relatime,uid=100000,gid=100000,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)


/dev/mmcblk1 on /run/user/100000/media/sdcard type btrfs (rw,relatime,thread_pool=4,ssd,noacl,space_cache)


- and that BackUp has been created on your Jolla
[nemo@localhost ~]$ ls -ald ~/.vault

drwxr-xr-x 1 nemo privileged 144 2014-03-18 09:42 /home/nemo/.vault


- to check what is the size of the backup folder
[nemo@localhost ~]$ du ?????


- create a BackUp file "vault.tar" to your µSD card (I think it could be a good practise to date the file vault_20140319.tar):
[nemo@localhost ~]$ tar cf $XDG_RUNTIME_DIR/media/sdcard/vault.tar -C $HOME .vault


- to check that the BackUp has been created:
[nemo@localhost sdcard]$ ls -ila /run/user/100000/media/sdcard/vault*

13194 -rwxr-xr-x 1 nemo nemo 1544919040 2014-03-19 11:44 /run/user/100000/media/sdcard/vault.tar




ToDo:
- copying files to µSD card over cable
-

edit retag flag offensive close delete

Comments

Thank you for the summary!

Unfortunately, even after the upgrade to 1.0.4.20 it is not possible to use a 64GB MicroSD-card without Problems - the paths in the file-Manager and in saildock are not matching anymore and using such a Card can cause a serious mess in your home-directory - (https://together.jolla.com/question/33840/home-directory-totally-messed-up-after-changing-sd-card-after-update-to-10420/)

R.G. Sidler ( 2014-03-18 14:58:24 +0200 )edit

thanks for this wiki, but at first you mention that jolla supports SDXC but then you state that "Jolla supports up to 64GB µSDHC cards"

So is SDXC supported?

c.la ( 2014-03-18 15:08:07 +0200 )edit
1

Well, I can answer this for you - by specification, there is no such thing as "64GB µSDHC", it has to be a SDXC (http://en.wikipedia.org/wiki/SDXC#SDXC, http://en.wikipedia.org/wiki/SDXC#SDHC)

R.G. Sidler ( 2014-03-18 15:13:17 +0200 )edit
1

@c.la
I have made a mistake, as @R.G. Sidler pointed out, it should have been for the 64 GB µSDXC , I have corrected the post now.

m2 ( 2014-03-18 15:34:31 +0200 )edit
1

Does someone know for sure if Jolla is UHS-I compatible?

Neo ( 2014-03-18 20:18:12 +0200 )edit

6 Answers

Sort by » oldest newest most voted
4

answered 2015-06-23 03:10:10 +0200

DrYak gravatar image

as per post over here, NTFS and exFAT formats are not supported

Not anymore !

exFAT

Now available in BloodyFoxy's OpenRepo :

with this (and the mount-sd.sh script which comes in the latest version of Sailfish OS) micoSDXC should finally work without needing to reformat first.

NTFS

I've recompiled Tuxera's ntfs-3g :

UDF

That's a very nice solution which works out of the box on all major OSes (Linux, Mac OS X and even Windows - using a small partition trick), doesn't have the limitation of FAT32 (it can work with files bigger than 4GiB), and is gentler on the flash wear, due to being a log-structured file system.

More info about this solution:

As soon as I get some free time, I'll recompile it for Sailfish OS too. Stay tuned.

TODO

  • compile kernel .ko (Sailfish OS doesn't include it out of the box)
  • compile udftools
edit flag offensive delete publish link more

Comments

For UDF please have a look at this bug report as the SailfishOS kernel is most likely affected: https://bugzilla.kernel.org/show_bug.cgi?id=53021

V10lator ( 2015-06-23 11:16:14 +0200 )edit

Thanks, @V10lator .

Actually, it seems that the SailfishOS is not affected :

  • ...the patch fixing this bug
  • ...seems to have already been applied in the LTS kernel that Sailfish uses.

So that presages good luck. As soon as I have free time.

DrYak ( 2015-06-24 02:48:35 +0200 )edit

Since some time there's a better (faster, less CPU intensive) way to access exFAT formatted storage: https://openrepos.net/content/v10lator/exfat-nofuse

Also F2FS (the flash friendly file system) support: https://openrepos.net/content/v10lator/f2fs / https://openrepos.net/content/v10lator/f2fs-utils

@DrYak Any luck with compiling UDF ? So far all my tries failed.

V10lator ( 2015-07-20 03:10:03 +0200 )edit

Forgot something at my last comment: For f2fs you need a more experimental mount-sd.sh script: https://openrepos.net/content/v10lator/bleeding-edge-sd-utils

V10lator ( 2015-07-20 15:36:13 +0200 )edit

Does Sailfish support UDF now?

kat6 ( 2016-08-20 22:39:35 +0200 )edit
3

answered 2016-06-22 16:05:56 +0200

V10lator gravatar image

The Jolla Phone does not support UHS cards. This can destroy your card(a 128 GB Transcend card already died, see https://together.jolla.com/question/136852/important-question-for-a-sd-manufacturer-is-the-jolla-1-uhs-1-compatible/ for more informations).

It might be a purely artificial restriction in the kernel code initializing the SoC but UHS is disabled (SFOS 2.0.2.45) :

//.uhs_caps = (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
    //  MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 |
    //  MMC_CAP_UHS_SDR104 | MMC_CAP_MAX_CURRENT_800),
edit flag offensive delete publish link more

Comments

1

Disabled? I mounted my home and android partitions on my 128 GB Sandisk SDXC and have absolutely no intention of reverting the process for no reason whatsoever, can you please confirm if this is the case? if so, which measures are to be taken? My file system is ext4. I am still on 2.0.1.11 though so I would like the best info before I try and update

DameCENO ( 2016-06-22 19:28:14 +0200 )edit
1

my 64gb uhs-1 card is still working without any problems, after almost 2 years usage in jolla1, so I would assume a normal card failure in mentioned case...

lpr ( 2016-06-22 20:38:25 +0200 )edit
1

To quote from the Sandisk knowledge base: "There is no compatibility problem using a UHS card with a non-UHS device."

https://kb.sandisk.com/app/answers/detail/a_id/2520/~/sd%2Fsdhc%2Fsdxc-specifications-and-compatibility

Dietmar ( 2017-10-04 23:25:10 +0200 )edit
0

answered 2014-03-20 10:04:53 +0200

estatarde gravatar image

My SD card was working perfect before the last release. When Sailfish went out of beta, the phone is much great, but I can not find my sd neither with fileman not with Cargo Dock, ¿any idea? thanks a lot

edit flag offensive delete publish link more

Comments

1

Have a look at: sdcard-location changed after update Cheers - Roland

R.G. Sidler ( 2014-03-20 10:11:21 +0200 )edit

Thanks, but the thing is I am a normal user an it did affected us, in Cargo Dock an fileman, The say some release will come to fix it.

estatarde ( 2014-03-20 10:21:11 +0200 )edit

I am a normal user, too, so I do have the same Problem - cheers - Roland

R.G. Sidler ( 2014-03-20 11:55:32 +0200 )edit

I have a SanDisk Ultra microSDXC 64GB Class 10 Bi-colored Card .. I have formatted it to NTFS.. after update 1.1.7.24, I am not able to write on it, whether on phone using file browser on PC(Windows), I get permission denied, how can I give permission to be able to copy stuff on it

kibet85 ( 2015-07-20 00:48:44 +0200 )edit

@kibet85 No idea what could have happened but NTFS isn't ideal for flash storage anyway. Even Microsoft recommends to use other file systems (exFAT) there.

So I would suggest copying the files off the card, reformatting it with another FS and moving the files back on it.

//EDIT: If you also can't reformat the card (or can't write to it below the FS level in another way, for example with dd) the card may be death. This can happen if the card is very old, had extremely much writes or is a fake. Note that filesystems with a log like NTFS do more writes than simpler ones (like exFAT). There are also FSes trying to higher the lifetime of the card (like F2FS).

V10lator ( 2015-07-20 03:13:13 +0200 )edit
0

answered 2017-04-18 00:13:17 +0200

cemoi71 gravatar image

Here is something that works for ext4.

sd card which absolutely works with it is:
SanDisk Ultra microSDXC 64GB 80 MB/Sek, Class 10

edit flag offensive delete publish link more
0

answered 2017-09-21 14:34:53 +0200

alloj gravatar image

Sony Xperia X with Sailfish OS Does it support SDXC and what is the maximum size supported? Does it support UHS-2? Thank you!

edit flag offensive delete publish link more

Comments

1

The Xperia X supports the SDXC standard, so it should theoretically have a limit of 2TB – although I haven’t seen MicroSDXC cards larger than 400GB. Since Sailfish doesn’t boot from this card, you can format it with any Sailfish/Linux supported file system (at least ext4 and Btrfs) and it should support up to whatever the limit of that file system is.

A 64GB card with Btrfs (raw partition) file system works fine on my Jolla 1.

Note that the Intex model only supports the SDHC spec if I remember correctly.

I don't think any phone on the market today has a UHS-2 card slot but the cards themselves should be backwards compatible. UHS-2 cards are still pretty rare though.

wvh ( 2017-09-21 15:40:12 +0200 )edit
0

answered 2020-04-24 20:25:22 +0200

olf gravatar image

An updated, comprehensive guide hiw to partition, format and use SD-cards is available

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
36 followers

Stats

Asked: 2014-03-18 13:51:13 +0200

Seen: 17,929 times

Last updated: Apr 24 '20