UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
730 Views
Registered: ‎09-10-2018

how to mount sd card on open source linux??

Jump to solution

Hi Guys

 

I am trying to mount sd card after booting linux(open source) from sd card but i m seeing an error saying 'invalid argument'

 

zynq> mount -t vfat /dev/mmcblk0 /mnt/
mount: mounting /dev/mmcblk0 on /mnt/ failed: Invalid argument


zynq> mount  /dev/mmcblk0 /mnt/
mount: mounting /dev/mmcblk0 on /mnt/ failed: Invalid argument

I believe that linux has detected the card as if I try fsdik -l, its showing me the right results:

 

zynq> fdisk -l

Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
4 heads, 16 sectors/track, 242560 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

        Device Boot      Start         End      Blocks  Id System
/dev/mmcblk0p1             129        8320      262144   b Win95 FAT32
Partition 1 does not end on cylinder boundary
/dev/mmcblk0p2            8321      242560     7495679+  f Win95 Ext'd (LBA)
Partition 2 does not end on cylinder boundary
/dev/mmcblk0p5            8322      242560     7495648   7 HPFS/NTFS

I found a similar thread : https://forums.xilinx.com/t5/Embedded-Linux/mount-mounting-dev-mmcblk0p1-on-mnt-failed-Invalid-argument/m-p/432116#M8371

 

and the accepted solution says 'check if sd-card is enabled in your design' but there the designer booted from qspi and not from sd card and in this case, I actually booted linux from sd card.

 

Thank you very much for your time!

0 Kudos
1 Solution

Accepted Solutions
Scholar watari
Scholar
700 Views
Registered: ‎06-16-2013

Re: how to mount sd card on open source linux??

Jump to solution

Hi @ali.digitekeng

 

Would you execute the following command ?

 

$ mount /dev/mmcblk0p1 /mnt/boot

$ mount /dev/mmcblk0p2 /mnt/

 

Bets regards,

 

 

 

0 Kudos
4 Replies
Scholar watari
Scholar
701 Views
Registered: ‎06-16-2013

Re: how to mount sd card on open source linux??

Jump to solution

Hi @ali.digitekeng

 

Would you execute the following command ?

 

$ mount /dev/mmcblk0p1 /mnt/boot

$ mount /dev/mmcblk0p2 /mnt/

 

Bets regards,

 

 

 

0 Kudos
683 Views
Registered: ‎09-10-2018

Re: how to mount sd card on open source linux??

Jump to solution

Hi Watari

 

Thanks for the reply. I tried the commands you suggested

zynq> cd /mnt/boot/
zynq> ls
BOOT.bin                   devicetree.dtb             uramdisk.image.gz
System Volume Information  uImage
zynq> mkdir test_dir
mkdir: can't create directory 'test_dir': Read-only file system

So the first command mount worked but I cant write anything in that partition.

 

For the second comamnd

zynq> mount /dev/mmcblk0p2  /mnt/
EXT4-fs (mmcblk0p2): unable to read superblock
EXT4-fs (mmcblk0p2): unable to read superblock
EXT2-fs (mmcblk0p2): error: unable to read superblock
mount: mounting /dev/mmcblk0p2 on /mnt/ failed: Invalid argument

I am not able to mount the second partition. For the first problem(readonly mount) I even tried to add -w switch but it didnt help either

 

Please suggest

0 Kudos
670 Views
Registered: ‎09-10-2018

Re: how to mount sd card on open source linux??

Jump to solution

Update:

 

I found that my sd card had partitioning issue. After fixing it, I can mount both partitions.

 

Now the only issue is I cant write on either partitions.

zynq> mkdir test_dir
mkdir: can't create directory 'test_dir' : Read-only file system

 

PS: I created two partitions, one for linux boot stuff and other for my applications and other data

0 Kudos
646 Views
Registered: ‎09-10-2018

Re: how to mount sd card on open source linux??

Jump to solution

Update

 

I found this AR:

https://www.xilinx.com/support/answers/61064.html

 

After reading it I found that write protect pin was floating in my design. I assigned a constant 0 and that solved the writing issue.

 

This thread is closed.

0 Kudos