Auto-mounting an SD Card - 2021.2 English

PetaLinux Tools Documentation: Reference Guide

Document ID
UG1144
Release Date
2021-10-27
Version
2021.2 English

Auto-mounting an SD Card during the Build

To auto-mount an SD card during the build, follow the instructions in https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842475/PetaLinux+Yocto+Tips#PetaLinuxYoctoTips-HowtoAutoMountSDcardinYoctoRecipes.

Auto-mounting SD Partitions after Linux is Running

To mount the SD partitions to a user-defined path, follow these steps:

  1. Boot the target to the Linux prompt.
  2. Create the direct path, for example:
    mkdir /media/card
  3. Edit the file as shown below:
    vim /etc/fstab

    Once the editor opens, add the following line:

    /dev/mmcblk0p2 /media/card ext4 defaults 0 1 4

    Save and exit.

    $ reboot
  4. Check the SD mount point using the mount command:
    root@xilinx-vck190-2021_2:~# mount
    /dev/root on / type ext4 (rw,relatime)
    devtmpfs on /dev type devtmpfs (rw,relatime,size=8053972k,nr_inodes=2013493,mode=755)
    proc on /proc type proc (rw,relatime)
    sysfs on /sys type sysfs (rw,relatime)
    debugfs on /sys/kernel/debug type debugfs (rw,relatime)
    configfs on /sys/kernel/config type configfs (rw,relatime)
    tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
    tmpfs on /var/volatile type tmpfs (rw,relatime)
    /dev/mmcblk0p2 on /media/sd-mmcblk0p2 type ext4 (rw,relatime)
    /dev/mmcblk0p1 on /media/sd-mmcblk0p1 type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
    devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
    root@xilinx-vck190-2021_2:~#