How do I mount rootfs instead of fatfs with g_multi?

Hello All,

At one point I accidentally had the root filesystem mounting and perusable from my desktop file browser – which was useful to me (unlike the fatfs). I am trying to duplicate this deliberately, but can’t find where to configure this. Any help with this is much appreciated…my google-fu is failing me.

Thanks in advance.


There's an example here:



Just point the "file=/dev/mmcblkXpY" option in g_multi to the rootfs partition..


Thank you Robert.

Are there any caveats to erasing the fatfs and resizing rootfs ? And if I did that would your script mount rootfs without modification?

Well... "in theory" with the newer images that should still work.. The
big (and i mean big) issue, the u-boot (MLO/u-boot.img) files where
dd'ed below the 1Mb position. So as long as you leave the 1MB hole at
the start of the drive alone, it 'should' work..


I took the risk.

Since it was on an sd card I popped it out and used gparted to erase the fatfs and then resize rootfs (leaving that holiest of 1M holes). I booted fine except for:

[ 15.517979] g_multi failed to start g_multi: -2

‘mount’ shows:

/dev/mmcblk0p2 on / type ext4 (rw,noatime,errors=remount-ro,data=ordered)

…it’s still calling itself partition 2, which is probably a good thing since /etc/fstab is referring to it by its /dev entry

So now I’m going to figure out how to re-enumerate the partition and change the fstab entry accordingly.

But, I’m hoping to be able to use this card to flash eMMC and now I’m wondering if all this is going to break your scripts?

I managed to change the partition number
…and g_multi is serving up my rootfs as pretty as a peach.

The odd thing is that I forgot to modify /etc/fstab and it still mounted (?)

“mount” gives me:

/dev/mmcblk0p1 on / type ext4 (rw,noatime,errors=remount-ro,data=ordered)


“cat /etc/fstab” gives this line:

/dev/mmcblk0p2 / ext4 noatime,errors=remount-ro 0 1