Strange behaviour sd card on hikey (lemaker)


#1

I can boot my hikey 2gb board from both emmc and sd card into debian using recent images. However, when I expand the rootfs to fill the disk, the board will no longer boot from the sd card. This has been the case both when I expand the partition using gparted on a linux box outside the system; or when I use the resize-helper.sh script suggested n the getting started guide. I have tried with a 4GB microsd, a 32GB microshdc and a 64 GB microsxdc all to the same effect.
Unfortunately I do not currently have an operative UART to give me the debugging information at boot to see what is going on when the rootfs partition has been altered.

Does anyone else have any experience of this, or have suggestions about what I must be doing wrong?


#2

Hi @mgfm99

I had a similar experience.

I mounted the SD card which I re-sized on the regular Linux PC,
and then edit the /etc/fstab as bellow on the second partition on SD
with the label “rootfs”.

/dev/disk/by-label/rootfs     /         ext4 errors=remount-ro 0 1
/dev/disk/by-label/boot       /boot/efi vfat defaults          0 0

It seems like the kernel with fail to parse the GPT after expanding the size of rootfs on SD.

Please let me know if it works for you or not.


#3

Thanks for the suggestion, the fstab of the image I used (latest official build) had
/dev/disk/by-partlabel/system / ext4 errors=remount-ro 0 1
/dev/disk/by-partlabel/boot /boot/efi vfat defaults 0 0

As far as I was aware (according to Gparted) the rootfs was only labelled rootfs and not system but it booted as long as I didn’t expand the rootfs partition.

I tried switching fstab to by-label instead and introducing rootfs but that didn’t make it bootable.


#4

Having investigated further - fastboot specifies root device by reference to udev rules as /dev/mmccblk1p2 so presumably it isn’t accessing /etc/fstab while booting.
The rootfs is mounted as system at boot - a common value between emmc and sdcard boot - hence the standard fstab entry.
The Hikey seems to have real problems with sdcards that have multiple partitions. Booting from emmc and inserting sdcards after a session is live I get the following results: If I create a FAT16 and an EXT4 partition on a 32GB microsdhc then the Hikey cannot see the partitions, dev simply has mmcblk1 with no partitions listed. This is the same for old style MBR and GPT. If there is a single partition on the disk with a GPT partition table the system has no problem. It also has no problem with the original disk images from the 96boards site.

So there seems to be a problem still in the way that the sd card driver is dealt with.


#5

Hi @mgfm99,

Thank you for reporting the symptom.

We think we found the cause and currently in the process of uploading the fixed images.