简体   繁体   中英

Using SD card as external storage for Beaglebone Black

After following instructions found here:

http://elinux.org/Beagleboard:MicroSD_As_Extra_Storage

and here:

http://electronicsembedded.blogspot.com/2014/10/beaglebone-black-using-sd-card-as-extra.html?showComment=1434418179676#c2761158033046523777

I am still having trouble. I use the code it says to use and followed the instructions, I get 3 solid LED on the board upon load up with the SD inserted, and Windows 7 doesn't detect it at all.

The board works fine without the SD inserted, I can boot up and login via SSH and it is detected by Windows.

The code for my uEnv.txt is as follows:

mmcdev=1
bootpart=1:2
mmcroot=/dev/mmcblk1p2 ro
optargs=quiet

and I also added to the fstab file:

/dev/mmcblk0p1    /media/card     auto     auto,rw,async,user,nofail  0  0

Some results from checking the filesystem, my drive is called 'BBB_Ext'. This is after booting without the SD in it, and then putting it in after bootup:

root@beaglebone:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          3.5G  1.8G  1.5G  55% /
/dev/root       3.5G  1.8G  1.5G  55% /
devtmpfs        250M     0  250M   0% /dev
tmpfs           250M  4.0K  250M   1% /dev/shm
tmpfs           250M  248K  250M   1% /run
tmpfs           250M     0  250M   0% /sys/fs/cgroup
tmpfs           250M  4.0K  250M   1% /tmp
/dev/mmcblk0p1   70M   54M   16M  78% /media/card
/dev/mmcblk1p1   15G   16K   15G   1% /media/BBB_Ext_

Here is more details on the fdisk:

root@beaglebone:~# fdisk -l

Disk /dev/mmcblk0: 3867 MB, 3867148288 bytes, 7553024 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000000

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *          63      144584       72261    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          144585     7550549     3702982+  83  Linux

Disk /dev/mmcblk0boot1: 2 MB, 2097152 bytes, 4096 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk0boot0: 2 MB, 2097152 bytes, 4096 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk1: 15.9 GB, 15931539456 bytes, 31116288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000000

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk1p1            2048    31115263    15556608    c  W95 FAT32 (LBA)

Any help would be appreciated. I figured since this is Linux related that the question is applicable to SO, if it's better off in SE plz let me know.

For what I got, the uEnv.txt should be (saved on your SD card):

mmcdev=1
bootpart=1:2
mmcroot=/dev/mmcblk1p2 ro 
optargs=quiet

And add below line in /etc/fstab

/dev/mmcblk0p1    /media/data      auto   rw   0 0

Ok I believe I resolved the issue (for anyone who cares)

After looking at the fdisk log I realized that I needed to change the fstab line to be:

/dev/mmcblk1p1       /media/card          auto       rw     0  0

and then I also changed the uEnv.txt to be:

mmcdev=1
bootpart=1:2
mmcroot=/dev/mmcblk0p2 ro
optargs=quiet

From my understanding it was trying to boot off of a disk that wasn't there and that caused the problem. In addition, I didn't fix the fstab to be the correct port for the drive, which can be seen at the bottom of the fdisk check:

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk1p1            2048    31115263    15556608    c  W95 FAT32 (LBA)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM