Question: When I am running linux from sd card and try to mount sd card -no problem, works fine. But when I am running linux from flash memory I am unable to mount my SD card:

```
# mount /dev/mmcblk0p1 /mnt/ 
mount: mounting /dev/mmcblk0p1 on /mnt/ failed: Invalid argument

```

What could be the basic reason for this error ? 

**Additional Info**

```
root@Xilinx-ZC702-14_7:/# mount -t /dev/mmcblk0p1 /mnt
mount: can't find /mnt in /etc/fstab 

root@Xilinx-ZC702-14_7:/var/volatile/log# ls
wtmp

root@Xilinx-ZC702-14_7:/var/volatile/log# dmesg
dmesg: klogctl: Function not implemented

```

Answer: 
Basic reasons: (updated)

1) Your system does not (properly?) initialize or does not recognize the SD when booting from flash. Is there the `/dev/mmcblk0` device after you boot from flash? What does `fdisk -l /dev/mmcblk0` say?

2) There is no file system on /dev/mmcblk0p1, you need to create a file system first (`mkfs ...`). Check with `file -s /dev/mmcblk0p1`

3) The file system on /dev/mmcblk0p1 is corrupted, you need to check / repair it, try `fsck /dev/mmcblk0p1`, or create a new one

4) Your kernel (when booting from flash) does not have the needed file system driver, check `cat /proc/filesystems` and `ls "/lib/modules/$(uname -r)/kernel/fs/"` and see if that list contains the needed file system type. Typically, older kernels don't support ext4, while your OS might already have tools to create an ext4 file system.

5) Hardware defect - could be the SD card, the controller, wiring ... but if it works when booting from the SD card then this is most probably not the case.
Maybe you need to use (parted command) due to partition size:

```
# /sbin/parted /dev/mmcblk0p1
(parted) mklabel gpt
this disk will be lost. Do you want to continue?
Yes/No? yes
....
(parted) quit

```

To make sure that the partition is properly created use `/sbin/parted /dev/mmcblk0p1 print”`

Then you have to format the created partition

```
/sbin/mkfs -t correct_type /dev/mmcblk0p1

```