suchende Posted March 26, 2018 Share Posted March 26, 2018 I made a kernel upgrade which was not successful The kernel does not boot up. Unfortunately armbian does not contain a fallback method to load the old kernel. Therefore I need a way to restore the old kernel. I copied a working boot folder from another sdcard which does not work. What did I miss? Link to comment Share on other sites More sharing options...
martinayotte Posted March 26, 2018 Share Posted March 26, 2018 copying /boot folder is not enough to recover an upgrade, especially if you upgraded U-Boot, this one is installed on sectors outside partitions, usually starting at byte #8192 of the sdcard. Also, there is the /lib/modules/<kernel-number> that needs to be rescued if deleted after an upgrade, but I don't think it is deleted ... Link to comment Share on other sites More sharing options...
suchende Posted March 26, 2018 Author Share Posted March 26, 2018 the dump from fdisk: p device Boot begin end sectors size Kn typ /dev/mmcblk0p1 8192 30396575 30388384 14,5G 83 Linux F beginn end sectors size 2048 8191 6144 3M 30398464 30703615 305152 149M the raw copy with `dd if=/dev/mmcblk0 of=/dev/sdc skip=2048 seek=2048 bs=512 count=6144 conv=notrunc` fails. Did you meant byte #8192 or sector? the kernel modules are still there. Link to comment Share on other sites More sharing options...
martinayotte Posted March 27, 2018 Share Posted March 27, 2018 As I said, the u-boot is not inside a partition. Depending of the SoC and boards, the first byte is usally at byte#8192, for example, copying an u-boot image from file to sdcard would be : dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8 If you wish to extract an copy u-boot from a device to another, like you seems to wish, than it would be something like that, assuming that this u-boot is smaller than 500K : dd if=/dev/mmcblk0 of=/dev/sdc bs=1024 seek=8 skip=8 count=500 conv=notrunc As you can see, your previous copy was copying an entirely different location ... Link to comment Share on other sites More sharing options...
suchende Posted March 27, 2018 Author Share Posted March 27, 2018 Thank you very much. I fixed it with a different approach in while. Take all necessary files in /boot and /lib/modules and copy them. Save the mbr and partition table with fdisk to a file, then copy straight with the dd if=/dev/mmcblk0 of=/dev/sdc bs=512 count=8192 and restore afterwards the saved fdisk dump. I forget to mentioned it here: the SoC is the odroid HC1. Link to comment Share on other sites More sharing options...
Recommended Posts