Boot from SSD with N2


Recommended Posts

The module is there in the official build with the bsp 4.9 kernel

 

If its missing from @balbes150 build then you can clone his repo from https://github.com/150balbes/Build-Armbian and build an image from that. When asked if you want to modify the kernel config, choose yes. When you get to the kernel config screen choose to build uas into the kernel (CONFIG_USB_UAS)

 

If you struggle I can provide detailed instructions tomorrow

Link to post
Share on other sites
Armbian is a community driven open source project. Do you like to contribute your code?

I succeed in building a new kernel with UAS driver. I have an issue when I want to install the .deb package.  The same issue when I do 'apt upgrade' with a new kernel release available.

Preparing to unpack .../linux-image-aml-g12_5.98_arm64.deb ...
Unpacking linux-image-aml-g12 (5.98) over (5.98) ..........................................................................................................................................................................................] 
dpkg: error processing archive /var/cache/apt/archives/linux-image-aml-g12_5.98_arm64.deb (--unpack):
 unable to make backup link of './boot/System.map-5.3.0-aml-g12' before installing new version: Operation not permitted
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
mv: cannot stat '/boot/vmlinuz-5.3.0-aml-g12': No such file or directory...................................................................................................................................................................] 
Preparing to unpack .../nodejs_12.11.1-1nodesource1_arm64.deb ...
Detected old npm client, removing...#########################..............................................................................................................................................................................] 
Unpacking nodejs (12.11.1-1nodesource1) over (12.10.0-1nodesource1) ...
Errors were encountered while processing:##################################................................................................................................................................................................] 
 /var/cache/apt/archives/linux-image-aml-g12_5.98_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

 

 

Link to post
Share on other sites

@balbes150 I have to go back to your kernel. Mine have strange issue. The system reboots without any reason. I have no error coming from the UAS driver in the syslog.

Even with your kernel, I have noticed that reboot doesn't really work. The system stops, but the hardware doesn't restart. Could be a pain for a headless server.

Link to post
Share on other sites

Same issue here.

 

With official petitboot or not. I have copy manually my armbian boot.ini at the root of my SSD but nothing.

 

Note my SSD need 10 seconds to be detected.

 

Armbizn bionic desktop 5.4 kernel.

 

I want to test armbian (with GPU integration) without erase my official ubuntu.

Link to post
Share on other sites

Team, do we expect to have any improvements here, besides dumping the JMicron USB-SATA enclosures?

 

I don't believe it is JMS issue at all, given my ASM1153 based USB-SATA adapter is also failing with any of the 5.4 kernels to boot from SATA.

 

It just works with 4.9.x, therefore my guess is we are dealing with a Linux issue here, but that's where my skills end - how to proceed from here? Anybody aware of a bug tracking this one?

 

@qstaqI've seen you put quite some efforts into this troubleshooting, any comments maybe?

Link to post
Share on other sites

I've managed to get this to work finally, for my use case, which is a directly connected Seagate desktop drive - ID 0bc2:3321 Seagate RSS LLC - using the latest Armbian release 20.08.3 with kernel version 5.8.10, booting from petitboot.

 

The steps I took were basically:

 

  • Install armbian 20.08.1 onto an MMC card.
  • Boot the N2 from the card and "apt update" and "apt upgrade" to bring it up to the latest kernel etc. and perform other basic configuration.
  • Make a partition on the hard drive ready to take the root partition.
  • Run nand-sata-install to copy the root partition onto the hard drive.
  • Edit /boot/boot.ini and add "usb_storage.quirks=0bc2:3321:" to the linux command line parameters. This enables smartctl to work correctly when the system is up and running.
  • Create a directory /etc/initramfs-tools/scripts/local-block
  • Create an executable script in that directory with these contents:

    delay=20

    echo Sleeping for ${delay} seconds to allow disk to be found...

    sleep ${delay}

  • I tried various values for $delay, for me 20 seems to work consistently, values higher or lower would work sporadically.

  • "update-initramfs -u" to incorporate the new script into the ramdisk.

  • Reboot the N2 from the MMC card and verify that it boots correctly and uses the root FS that's now on the hard disk.

  • "umount /boot" to get the MMC out of the way. /boot should now be empty.

  • "rsync -av /media/mmcboot/boot/ /boot" to copy the /boot directory from the MMC to the hard disk.

  • power the N2 down, remove the MMC card and flick the switch so it boots using SPI.

  • Power it up, system should now boot solely using petitboot and the hard drive.

I don't really understand why this has worked, but hope it may help someone else. None of this script business with the delay was necessary when using kernel 4.9.x so there definitely seems to be some problem with the 5.x kernel series, presumably around the UAS driver or whatever, but this is beyond my understanding.

Link to post
Share on other sites

I tested this on 3 N2 Systems. I found that this part alone solves my reboot issues:

 

  • Create a directory /etc/initramfs-tools/scripts/local-block
  • Create an executable script in that directory with these contents:
    delay=20
    echo Sleeping for ${delay} seconds to allow disk to be found...
    sleep ${delay}
  • "update-initramfs -u" to incorporate the new script into the ramdisk.

Of course I still have the SD Cards within these systems, but that a very minor issue to me.

 

Thanks @lavorrick for providing that guidance.

Edited by ebkde
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...