[FE training-materials-updates] labs/buildroot-basic: the SD card can be recognized as /dev/sdX

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed Jun 24 16:01:15 CEST 2015


Repository : git://git.free-electrons.com/training-materials.git

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=9f9e1ef9de2174bf02525bfd412c513087ca6221

>---------------------------------------------------------------

commit 9f9e1ef9de2174bf02525bfd412c513087ca6221
Author: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Date:   Wed Jun 24 07:59:15 2015 +0200

    labs/buildroot-basic: the SD card can be recognized as /dev/sdX
    
    The instructions assumed that the SD card will be seen on the PC as
    mmcblk0, but in fact when you use an external SD card reader, it will
    be seen as /dev/sdX. Add instructions to explain this.
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>


>---------------------------------------------------------------

9f9e1ef9de2174bf02525bfd412c513087ca6221
 labs/buildroot-basic/buildroot-basic.tex | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/labs/buildroot-basic/buildroot-basic.tex b/labs/buildroot-basic/buildroot-basic.tex
index 23e201b..80590ca 100644
--- a/labs/buildroot-basic/buildroot-basic.tex
+++ b/labs/buildroot-basic/buildroot-basic.tex
@@ -320,7 +320,20 @@ Our SD card needs to be formatted in two partitions:
 
 \end{itemize}
 
-To achieve this, do the following steps:
+First, let's identify under what name your SD card is identified in
+your system: look at the output of \code{cat /proc/partitions} and
+find your SD card. In general, if you use the internal SD card reader
+of a laptop, it will be \code{mmcblk0}, while if you use an external
+USB SD card reader, it will be \code{sdX} (i.e\code{sdb}, \code{sdc},
+etc.). {\bf Be careful: \code{/dev/sda} is generally the hard drive of
+  your machine!}.
+
+If your SD card is \code{/dev/mmcblk0}, then the partitions inside the
+SD card are named \code{mmcblk0p1}, \code{mmc0blkp2}, etc. If your SD
+card is \code{/dev/sdc}, then the partitions inside are named
+\code{/dev/sdc1}, \code{/dev/sdc2}, etc.
+
+To format our SD card, do the following steps:
 
 \begin{enumerate}
 
@@ -329,7 +342,8 @@ To achieve this, do the following steps:
 
 \item Erase the beginning of the SD card to ensure that the existing
   partitions are not going to be mistakenly detected:\\
-  \code{sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=16}.
+  \code{sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=16}. Use
+  \code{sdc} or \code{sdb} instead of \code{mmcblk0} if needed.
 
 \item Create the two partitions.
 
@@ -351,10 +365,12 @@ To achieve this, do the following steps:
   \end{itemize}
 
 \item Format the first partition as a {\em FAT16} filesystem:\\
-  \code{sudo mkfs.vfat -F 16 -n boot /dev/mmcblk0p1}.
+  \code{sudo mkfs.vfat -F 16 -n boot /dev/mmcblk0p1}. Use \code{sdc1}
+  or \code{sdb1} instead of \code{mmcblk0p1} if needed.
 
 \item Format the second partition as an {\em ext4} filesystem:\\
-  \code{sudo mkfs.ext4 -L rootfs -E nodiscard /dev/mmcblk0p2}.
+  \code{sudo mkfs.ext4 -L rootfs -E nodiscard /dev/mmcblk0p2}. Use
+  \code{sdc2} or \code{sdb2} instead of \code{mmcblk0p2} if needed.
 
 \end{enumerate}
 



More information about the training-materials-updates mailing list