[SOLVED] Permanently Install OpenWrt on /dev/sda (Intel, 64Bit)

Hello,

I have decided to go for a little Intel-N5095-powered Mini PC, sweet 8.5x8.5cm and close to the size of a Raspberry. The device is having two Ethernet ports, which makes it ideal for OpenWRT.

I have created the USB Stick with ext4-combined-efi, that worked so far. But currently, the system boots from USB Stick, as soon as I detach the, stick, the system won't boot. I need to permamently install OpenWRT on /dev/sda. I have tried this by the command "DD if=...img of=/dev/sda". This did not work out.

Any hint for me?

SOLUTION:
The command to copy the image to the internal drive has to use the image for efi, otherwise the system will not boot.

cd /tmp
wget https://downloads.openwrt.org/releases/22.03.3/targets/x86/64/openwrt-22.03.3-x86-64-generic-ext4-combined-efi.img.gz
unzip openwrt-22.03.3-x86-64-generic-ext4-combined-efi.img.gz
dd if=openwrt-22.03.3-x86-64-generic-ext4-combined-efi.img of=/dev/sda

Afterwards I continued to resize the main SSD with this well written guide: [HOWTO] Resizing root partition on x86

dd, not DD, and I assume the rest of if=.. was removed ?

2 Likes

Yes, you are right, the command starts with "dd" this is what I have executed. Before executing, the was a "naked" Win11 installed, after executing, I get this result on the console:

root@OpenWrt:~# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 238.5G  0 disk 
├─sda1   8:1    0    16M  0 part 
└─sda2   8:2    0   104M  0 part 
sdb      8:16   1   3.7G  0 disk 
├─sdb1   8:17   1    16M  0 part /boot
│                                /boot
├─sdb2   8:18   1   104M  0 part /
└─sdb3   8:19   1   239K  0 part 

Clearly, dev/sda is the internal SSD, dev/sdb the USB Stick. I see the smaller 16mb partition on both entries.

this looks OK, which combined image did you use ?
plain or EFI ?

Well, I think the plain one. While the EFI is running on the USB Stick. Was this my mistake?

It depends on the BIOS and its settings, these days I'd always try the combined-efi image first (and try really hard to get that one working, before regressing to the non-efi images).

Maybe this as the uuid for the GPT partition would have changed?

If he's writing the image, it shouldn't be a problem, but you can always replace the root= param value with root=/dev/sda2 in Grub, but I'd try the efi 1st.

@Matthias17 how far are you getting in the boot sequence.

1 Like

So, I have redone the command, explicit with the file "openwrt-22.03.3-x86-64-generic-ext4-combined-efi.img", for simplicity I renamed it after unzipping to "openwrt_efi.img":

dd if=openwrt_efi.img bs=1M of=/dev/sda

After powering down the system, ejecting the USB Stick, no bootable device is available on next start.

don't even need to unzip it, do zcat image.img > /dev/sda next time, but there's no need for redoing it.

checked the boot sequence in BIOS ?
I can't imagine why it wouldn't pick up the SATA, but it doesn't hurt to check.

I was wrong, the system booted correctly. I tried at first to connect by SSH, which failed. After attaching a display, the system is there.

I guess, the firewall rule kept me out.

there were two ports, try the 2nd one, one will be LAN, the other WAN.

Thanks for your support. A little impression from this tiny device: It's powered up by 12V / 2.5A PoE Splitter with DC jack. Dual-NIC by Realtek with 1Gbps, M2.2240 SSD with 256GB, which can even be extended. Unfortunately the RAM size is fix and cannot be upgraded.
By USB the VDSL modem is powered up as well, which "only" consumes 0.5A.

As I was asked, here are some details:

https://www.amazon.de/dp/B0BLY1DR42

Modell: Acamagician
Key facts:
8GB / 256GB SSD in M2.2240
Wifi5 / Bluetooth 4.2 (pretty outdated)
2x Ethernet
size 8.4x8.4cm

It has a fan, which stays silent with OpenWRT is running. The device temperature on the outside is quite cool.

The device can be powered by a PoE splitter, as it needs 12V / 2.5A. Of course, there is limited capacity for external drives, but that‘s not the aim.

I have paid 202 Euro on Amazon, maybe on AliExpress it cheaper.

My aim was to have a dual NIC device for OpenWRT, which I can use for Smart Home, if I cannot get OpenWRT as productive system.

it was ~135 on US Amazon the other day, but it's back at $199 now.

https://camelcamelcamel.com/product/B0BFGLSRMD

Great price, $135 plus taxes.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.