Auto-mounting an SD Card - 2022.2 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
Release Date
2022.2 English

Auto-mounting an SD Card during the Build

To auto-mount an SD card during the build, follow the instructions in

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-2022_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)