Secure Digital card: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{RightTOC}}
{{RightTOC}}
The XO laptop has one slot for a MMC (MultiMediaCard), SD (SecureDigital) or SDHC (SecureDigital High Capacity) card. These cards, like USB flash drives, are automatically mounted and are accessed through the [[Journal Activity]] or the GNOME file browser. The [[Journal]] entry shows you how to access the add-on memory devices in Sugar; you can move files to and from the storage media by dragging and dropping the file in the Journal view to the USB stick icon at the bottom of the screen or by command line in the [[Terminal Activity]].
The XO laptop has a slot for an SD card. Once inserted, the contents are shown by the [[Journal Activity]] or the GNOME file browser. See [[Journal]] for how to use an SD card in Sugar; you can move files to and from the card by dragging and dropping the file in the Journal view to the card icon at the bottom of the screen.

See [[Talk:Secure_Digital_card|the talk page]] to talk about specific situations.


== About the Cards ==
== About the Cards ==


See Wikipedia for a good overview of [http://en.wikipedia.org/wiki/Secure_digital SD and SDHC cards]. There are various incompatibilities between cards from different manufacturers. In general, both SD and SDHC cards work.
See Wikipedia for a good overview of [http://en.wikipedia.org/wiki/Secure_digital Secure Digital] cards. There are various incompatibilities between cards from different manufacturers. In general, both SD and SDHC cards work.


== Quick Start ==
== Quick Start ==
#Insert card into the slot at the bottom of the screen. See below for more detailed instructions.
#Insert card into the slot at the bottom of the screen. See below for more detailed instructions.
#If Sugar is running, the card will show up at the lower left of the [[Journal]] if correctly mounted, and you can begin to use it.
#in [[Sugar]], a card icon will appear at the lower left of the [[Journal]], and you can begin to use it.
#If GNOME is running, an icon for the card will appear on the desktop, and a window will open showing the files on the card, and you can begin to use it.
#in [[GNOME]], an icon for the card will appear on the desktop, and a window will open showing the files on the card, and you can begin to use it.
#when finished with the card, you ''must'' tell the computer before removing it;
#If you wish to use a shell, such as the [[Terminal activity]] or console, the files on the card will be available in a subdirectory of <tt>/run/media/olpc</tt> based on the card's disk label, for example <tt>/run/media/olpc/''LABEL''/</tt>. If the card is not correctly mounted when booting the XO, an error message may briefly flash. The [[Linux software|Linux commands]] <tt>df</tt>, <tt>cat /etc/mtab</tt>, <tt>cat /etc/fstab</tt>, <tt>ls /run/media/olpc</tt>, and <tt>dmesg | grep mmc</tt> can help figure out the status.
:#click on it in the Journal and choose unmount,
#To stop the laptop using the card (safely remove), ''you must'' either click on it in the Journal and choose unmount, or click on it in the frame and choose unmount, or click the eject button in the GNOME window, or right-click on the GNOME desktop icon and choose ''Eject''. If you remove the card without this step, pending changes to the card may not be written and some files may be left in a corrupted state. Also, remounting the card before rebooting may be difficult.
:#click on it in the frame and choose unmount,
#Physically removing the card requires pushing it in slightly and releasing it ("click-in to load, click-in to eject"). The card should then protrude far enough to grab with fingernails. A non-standard card with excessive width may require tweezers.
:#click the eject button in the GNOME file browser window, or;
:#right-click on the GNOME desktop icon and choose ''Eject''.
:If you remove the card without this step, pending changes to the card may not be written and some files may be left in a corrupted state.
#Eject the card; push it in slightly until you feel a click, then release it.


== Supported cards ==
== Supported cards ==
* Most cards work,
* File systems FAT16 (usually on SD cards) and FAT32 (usually on SDHC cards) are supported.
* Some cards don't work,
* Most filesystems work; such as FAT16, FAT32, ext2, ext3, ext4,
* Some filesystems won't work, such as HFS+,
* Most card sizes should work; but we have not tested them all,
* Some cards work for file storage, but not for booting.


For deployments, carefully test a sample of the card being used.
* Cards of various sizes work. 8-gigabyte SD memory cards work. 16GB cards [http://en.forum.laptop.org/viewtopic.php?f=2&t=965&p=3035&hilit=sdhc+16GB have been reported to work]. While SD & SDHC cards up to 256 GB should be supported, larger cards can only be verified as they become available.

* Reduced Size MMC cards, like the ones Nokia uses in Nokia 770 work well. PQI 8 GB cards [[Talk:Secure_Digital_card#PQI_High_capacity_8GB_SD_card_did_not_work|do not appear to work]].

* Straight old MMC cards have not been tested. They should work, but some other hardware platforms do not support MMC cards.

* The [[Fedora on XO]] project [https://fedoraproject.org/wiki/QA/TestPlans/Fedora10_On_XO tested and recommends the Sandisk Extreme III line of SD/SDHC cards] to run a [[:Category:Linux distributions|Linux distribution]] "live image".


== Insertion==
== Insertion==


To properly insert the card the gold fingers on the card should be facing up and towards the front of the LCD screen. Insert the card until it is flush with the bottom of the screen, you will hear a click when the card is fully seated. It is a "Push to Click in and Push to Click out (Eject)" mechanism. When ejecting, push the card in again and release. It should come out far enough to grab with fingers, Try small tweezers if you have a hard time getting the card to come out again. While not required, you can also attach a little piece of adhesive tape to the card to give an easy handle to pull on the card if it sticks.
To properly insert the card the gold fingers on the card should be facing up and towards the front of the display. Insert the card until it is flush with the bottom of the screen, you will hear or feel a click when the card is fully seated. It is a "Push to Click in and Push to Click out (Eject)" mechanism. When ejecting, push the card in again and release. It should come out far enough to grab with fingers, Try small tweezers if you have a hard time getting the card to come out again. While not required, you can also attach a little piece of adhesive tape to the card to give an easy handle to pull on the card if it sticks.


The picture shows the proper way to insert the card; your card might not have that many contacts:
The picture shows the proper way to insert the card; your card might not have this many contacts, but it should be the same size and shape:


[[Image:Proper_SD_Card_Insertion.jpg]]
[[Image:Proper_SD_Card_Insertion.jpg]]
Line 43: Line 44:
* Cards and USB sticks may need to be writable for Sugar to index them correctly. Make sure any read-only switch is in the read/write position and not the read-only position.
* Cards and USB sticks may need to be writable for Sugar to index them correctly. Make sure any read-only switch is in the read/write position and not the read-only position.


* If regular, brand-new cards are not working, there may be a fault with the laptop.
* Be sure the cards are formatted as a FAT-16 or FAT-32 file system. Most new USB sticks and cards come FAT-formatted.

* If regular, brand-new cards and USB sticks are not working, it is possible there is something wrong with the hardware of your machine. You may want to [[Support_FAQ#What_is_the_warranty_info.3F_RMA_process.3F | contact the support line]] to see if it needs to be replaced.


* Another thing to try is a quick reboot of the XO. Hot-swapping cards can sometimes cause difficulty when booting with them already attached seems to work.
* Another thing to try is a quick reboot of the XO. Hot-swapping cards can sometimes cause difficulty when booting with them already attached seems to work.


* The SD/MMC/SDHC memory card will only mount when inserted properly into the XO laptop. Some (older?) slots may allow you to insert the card in either direction.
* The card will only work when inserted the right way around. Broken slots may allow you to insert the card in either direction.


* Many error messages can be found running "dmesg | grep mmc" from the terminal shell.
* Further diagnosis can be done using "dmesg | grep mmc" from the terminal shell.


=== Formatting (FAT 16 or 32) ===
=== Formatting ===
(Adapted from support help answers)


SD cards are pre-formatted by their manufacturers to work best for the device. It is not recommended that you reformat unless it really stops working; for example, if a freshly booted Linux refuses to mount it.
SD cards are pre-formatted by their manufacturers to work best for the device. It is not recommended that you reformat unless it really stops working; for example, if a freshly booted Linux refuses to mount it.


Install Gparted:
====Instructions for the command line in Terminal====

Insert your SD disk, check for current mount point, look for devices mounted in /run/media or /dev

$ df

Look for device names similar to <tt>/dev/mmcblk0p1</tt>; this example means the first MMC/SD card, and the first partition of that card.

Then unmount any file system from the card, so that "df" doesn't show the card any more.


$ sudo yum install -y gparted
$ umount /dev/mmcblk0p1


Run Gparted:
Then
mkdosfs /dev/mmcblk0p1
will reformat it as a FAT file system.


$ sudo gparted
=== Formatting and using with ext2 ===


Select the card, and create a partition with filesystem FAT.
See the talk page.


== Implementation ==
== Implementation ==

Revision as of 02:10, 8 October 2013

The XO laptop has a slot for an SD card. Once inserted, the contents are shown by the Journal Activity or the GNOME file browser. See Journal for how to use an SD card in Sugar; you can move files to and from the card by dragging and dropping the file in the Journal view to the card icon at the bottom of the screen.

About the Cards

See Wikipedia for a good overview of Secure Digital cards. There are various incompatibilities between cards from different manufacturers. In general, both SD and SDHC cards work.

Quick Start

  1. Insert card into the slot at the bottom of the screen. See below for more detailed instructions.
  2. in Sugar, a card icon will appear at the lower left of the Journal, and you can begin to use it.
  3. in GNOME, an icon for the card will appear on the desktop, and a window will open showing the files on the card, and you can begin to use it.
  4. when finished with the card, you must tell the computer before removing it;
  1. click on it in the Journal and choose unmount,
  2. click on it in the frame and choose unmount,
  3. click the eject button in the GNOME file browser window, or;
  4. right-click on the GNOME desktop icon and choose Eject.
If you remove the card without this step, pending changes to the card may not be written and some files may be left in a corrupted state.
  1. Eject the card; push it in slightly until you feel a click, then release it.

Supported cards

  • Most cards work,
  • Some cards don't work,
  • Most filesystems work; such as FAT16, FAT32, ext2, ext3, ext4,
  • Some filesystems won't work, such as HFS+,
  • Most card sizes should work; but we have not tested them all,
  • Some cards work for file storage, but not for booting.

For deployments, carefully test a sample of the card being used.

Insertion

To properly insert the card the gold fingers on the card should be facing up and towards the front of the display. Insert the card until it is flush with the bottom of the screen, you will hear or feel a click when the card is fully seated. It is a "Push to Click in and Push to Click out (Eject)" mechanism. When ejecting, push the card in again and release. It should come out far enough to grab with fingers, Try small tweezers if you have a hard time getting the card to come out again. While not required, you can also attach a little piece of adhesive tape to the card to give an easy handle to pull on the card if it sticks.

The picture shows the proper way to insert the card; your card might not have this many contacts, but it should be the same size and shape:

Proper SD Card Insertion.jpg

--KenXo 11:28, 24 December 2007 (EST)

Troubleshooting

  • There is a hidden folder that Sugar may put onto all mounted media, ".olpc.store/". A broken database there may keep the journal from working properly. Try removing the folder. You should always be able to see the device mounted using "df" in Terminal.
  • Cards and USB sticks may need to be writable for Sugar to index them correctly. Make sure any read-only switch is in the read/write position and not the read-only position.
  • If regular, brand-new cards are not working, there may be a fault with the laptop.
  • Another thing to try is a quick reboot of the XO. Hot-swapping cards can sometimes cause difficulty when booting with them already attached seems to work.
  • The card will only work when inserted the right way around. Broken slots may allow you to insert the card in either direction.
  • Further diagnosis can be done using "dmesg | grep mmc" from the terminal shell.

Formatting

SD cards are pre-formatted by their manufacturers to work best for the device. It is not recommended that you reformat unless it really stops working; for example, if a freshly booted Linux refuses to mount it.

Install Gparted:

$ sudo yum install -y gparted

Run Gparted:

$ sudo gparted

Select the card, and create a partition with filesystem FAT.

Implementation

XO-1 uses a custom microchip for SD card access: the Camera and Flash Enabler (CaFE). CaFE includes SDHC support, which is hardware level compatible with SD. Pierre Ossman wrote the Linux driver support for SDHC and CaFE is driven by the sdhci driver. SD cards up to about 256 GB should be supported. CaFE follows the standard host controller interface for SD controllers.

XO-1.5, XO-1.75 and XO-4 also support SD/MMC cards, but they don't use the CaFE ASIC.

SD standard

Again, see Wikipedia for a basic overview. SD block addressing works with a 32 bit address. In the CaFe chip, which is compatible with the standard "SDHCI" spec, the address goes in the 32-bit chip register at offset 8. For old SD cards (not the new SDHC cards), the address is a byte address, so the maximum size is 4 Gbytes. For the newer SDHC cards, the address is a block number, assuming 512 byte blocks, so the maximum size is 2 TBytes. In other words, SDHC just shifts the addresses by nine bits, allowing an effective 40 bit address. The 32 GB limit that's often written about is an artificial limit in Window's FAT formatter; Windows will use the generally incompatible NTFS file system instead. Linux can format FAT up to the ~300GB real limit just fine, after that the card will need to use a linux specific filesystem. None of this is CaFe-specific.

See also