armhf.com Ubuntu 13.04 on the BBB gets a little confused,

http://armhf.com Ubuntu 13.04 on the BBB gets a little confused, even if it does still work, if you boot off the internal flash (eMMC) with an SD card inserted. I found myself presented with a seemingly double mmcblk0p2, after mounting the SD card fs. Df and mount said

/dev/mmcblk0p2 1.8G 898M 781M 54% /
devtmpfs 248M 4.0K 248M 1% /dev
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 50M 248K 50M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 248M 0 248M 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/mmcblk0p1 71M 67M 3.9M 95% /boot/uboot
/dev/mmcblk0p2 3.3G 2.8G 351M 89% /media/16GBp2

This is because /etc/fstab by default has the names of the mmc device files listed, in my case

/dev/mmcblk0p2 / auto errors=remount-ro 0 1
/dev/mmcblk0p1 /boot/uboot auto defaults 0 0

… with no SD card in the slot, this is probably correct, because eMMC becomes /dev/mmcblk0. With SD inserted though, the current 3.8 kernel enumerates the SD card to be /dev/mmcblk0 and internal eMMC to be /dev/mmcblk1.

To clean this up, it helps to put a UUID line in there. ‘blkid’ shows UUIDs for available filesystems. Replace the /dev/mmcblk0p? fields in /etc/fstab with the correct UIDs to avoid apparent body doubles. My above fstab now says:

proc /proc proc defaults 0 0

Don’t copy my UUIDs, find your own with blkid

UUID=31c7703c-ab54-436f-9017-2a9a0e3ac2bb / auto errors=remount-ro 0 1
UUID=BC22-2319 /boot/uboot auto defaults 0 0

The system still happily boots with or without SD card inserted, but the doubles have gone. After mounting the SD fs, df and mount now report

/dev/mmcblk1p2 1.8G 905M 774M 54% /
devtmpfs 248M 12K 248M 1% /dev
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 50M 244K 50M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 248M 0 248M 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/mmcblk1p1 1004K 472K 532K 48% /boot/uboot
/dev/mmcblk0p2 3.3G 2.9G 230M 93% /media/16GBp2

… much better, and much safer for imaging and such.

BTW IMHO it would be better still if the kernel could be told to enumerate eMMC as /dev/mmcblk0, and SD slot as /dev/mmcblk1. That would be more hot plug friendly. Having a hotpluggable SD would be nice for storing data and such.