Installation on SD Card for Raspb. Pi 4: Did I kill the card?

p.s. a couple more questions: if I make an image of the SD card with OpenWRT and flash it to another one, then in case we have a power outage and the card in the RasPi needs to be reinstalled, can I just insert the other one to get it going quickly, and meanwhile I could work on the screwed-up card and make it ready for the next power outage or whatever misfortune ?

I am planning on installing Unifi Controller on the top of it: I don't know yet how it goes, but I heard it's possible. Would my APs think that they are the same controller and would just get adopted to whichever card sit in RasPi, or would they have to be readopted if you switch cards ? This question actually applies if I get another RasPi only to install Unifi Controller.... which I might do for another network.

Yes! If you can make a proper image of the original card.
Raspberry OS has a built in function to do exactly this kind of backup of the installed Raspberry OS.

You should be able to start the OpenWRT SD card on the RaspPi at least once so the firmware are started and get its first boot configs written to the SD card at first boot.
Then you should be able to mount the SD card to a “real” computer that can read the file format and change config files offline from the RaspberryPi.
Or SCP to the Raspberry through the Ethernet port and change configs (like country setting).

Thank you for your hints !
Now I'm not sure if I understood you well, there are a few different things going on.... I haven't used Raspi OS yet (since I haven't gotten an extra SD card) but for now I can actually deal with the configuration without wifi, so I'm not in a hurry.

Now, did I understand it correctly, that:

  1. I install OpenWRT etc on an SD card, and boot at laest once RasPI with it, so that boot-config will be stored in the SD Card. (I should have done a bunch of stuff by then, so I would have booted it many times.)

  2. I make an image of that SD card using my laptop, and burn it to the second SD card.

  3. Then I would be able to use the second SD card immediately, in case the first one get messed up and needs to be reformatted/installed.

I'm not sure why I have to change the config files ?

The country setting is just another config line in the wifi config file. It is not a hardware setting.
One of the original questions was about changing country setting with some strange way of moving memory from Raspberry OS to a OpenWRT OS SD memorycard.

Why just not change the country code in the config in the first place? And boot the Raspberry Pi with OpenWRT SD card with a wireless config file with correct country setting!

Yes! That is how RaspberryPi works. It doesn't work like a normal computer as seen from a memory viewpoint. You don’t have any different memory areas like normal routers. There are absolutely noting saved or run on the computer board anywhere anytime, yes you have ram memory for the CPU to work with but that is cleared at every shutdown.
The SD card is the only saved memory you will find on the RaspberryPi.
The memory xGB options you have when you buy the RaspberryPi is only RAM memory, it isn’t like a smartphone where you share memory with the OS.
That is why you should not run anything that saves a lot of data like logs to the persistent memory (SD card) like on a normal computer because that data is then saved on the flash memorycard and that will burn out any form of SD card sooner or later.
In that case you want to save data you should have some external real harddrive that survives a lot of writes.

You maybe should start your project by playing around with the real RaspberryPi first to learn how it works before trying to build a router of it.

Personally I don’t even get why we do a router OpenWRT image for RaspberryPi in the first place because it really doesn’t stand out in network technology or speed.
4B is the first RaspPi ever to have actual Gbit ethernet, before that it was shared with USB bus and had 100Mbit/s max speed at best.
But a router needs at least two connections if it are supposed to do anything. WAN and some kind of LAN/WiFi (but OpenWRT really needs a LAN ethernet port to work), so where are the connections going in and out on a raspberry pi?
And you have not really any optimized WiFi transmitter ether on the raspberry pi. It is designed to receive WiFi data from a real router or access point. Not being a access point.
And 4B has massive thermal problems if you run it with a lot of data which needs a metal box (probably with a fan with noise) just for cooling which interferes with the wifi antenna on the circuit board.
I only see a Raspberry Pi as a small simple server hardware working inside the LAN in combination with a router (which normally in homes is a single box with a DHCP server, switch and access point in one box).

Thanks a lot for your clarification. Ok, so config-change belongs to the theme activating wifi properly, then.

As for OpenWRT on Raspi 4B, I was originally asking for suggestions here:

and Raspi4B was one of the recommendations. I could have picked up a "normal" router but I heard the name "Raspberry pi" somewhere and I thought I might give it a try. Then followed pretty much what these folks said, except that I went straight with a managed switch with PoE to make the port Wan/Lan instead of using USB-Ethernet adapter and USB-C power adapter. I watched this video and learned how to configure the port for wan/lan. (But I had luci from the beginning.)

So far it's going well. I have all my vlans I want.

I hope my SD card is not going to burn out... but if that's an obvious problem, these folks would have told me so, and a very specific kind of SD card was suggested, I think it was chosen so that it wont burn out. I am planning on learning to install Unifi Controller on the top of OpenWRT and that comes with saving log files. Using Raspi for Unifi Controller as such (I mean just the controller as the only thing to install) is commonly done, so I suppose it's not going to burn the SD card out.... ?

doubt it... but due to the antiquated mongodb... you'll need to crack one or two mini setup hoops in a stretch chroot to run it ~native~ on openwrt...

alot easier to get a second pi...

Thanks for your comment ! Which Pi do you suggest for Unifi Controller alone ? I would need it elsewhere anyway. (And I might not get to install it on OpenWRT-Raspi)

https://www.ciscopress.com/articles/article.asp?p=2181837&seqNum=10
You can do what ever you want with your network, I will not stop you. But I will give you the chance to read about the risk with this kind of VLAN setup where you share ports for wan and lan and put the protection firewall at the end point in the LAN.

Thank you very much for sharing the page !
I'm not sure if I understood it all that well, but the only port with untagged VLAN is WAN port to the ISP router, the connections to the RasPi are all tagged (except that vlan 1 untagged is sort of there from factory default, but my management VLAN is 16 and it's tagged, I'm not using vlan1), and the port to the APs will be also all tagged. So I don't see that traffic between Raspi and switch or APs and switch gets tagging stripped off and a fake vlan-tag ends up staying there... am I wrong ? Did you mean something else by your warning ?

And as long as I see, my switch doesn't have a function of DTP (I didn't even know that such thing exists!)

But this article is very informative, I was also glad to find that it's good to avoid vlan1 as native: I couldn't use vlan1 because Unifi doesn't allow tagged vlan1, I was worried that something wrong might happen at some point, but if cisco recommends using something else for native vlan, it should work fine!

RPi4 is absolutely one of the best price availability and performance points available now. It's one of the few options available that will route gigabit connections with SQM for under say $150. It has no thermal issues in normal use with typical cases. The fan running at 3.3v on most cases is inaudible. There is nothing wrong with tagged VLANs just be sure you don't misconfigure your switch.

1 Like

Thank you very much for the assurance ! I didn't buy a case with a fan because something else was recommended on the other thread (heat sink), but it's less than lurk warm, I think it's OK :slight_smile:

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