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

I have three RaspberryPi (3B, 1GB and 2x4B, 4GB and 8GB) and nothing is ever saved on the board, you don’t even have any memory to save configs to on the board.

And that is kind of the idea! If you want other settings or a other OS you just switch memory card.
The instructions you linked to is more the version of config without access to the GUI of RaspberryPi so you need to write to the config files on the memory card by mounting the memory card to another computer and write manually to the files.
But that is also a person not looking in to the manual of Raspberry Pi because even without any available hardware gui you can still run the Pi OS from VNC viewer, thats is why VNC viewer and Pi foundation is in partership with each other.

Pi OS (or the old OS name NOOB) is the Pi foundation original operating system. In practical terms a Debian OS stripped down and modified to function best with Raspberry Pi hardware. There are alternative OS to choose between but I haven’t found any one that actually work at all as well as Pi OS workes. Mostly because only RaspberryPi 4 is the only Pi with enough ram memory to actually start a web browser without crashing after uploading a modern webbpage with some graphics on it.

Raspberry pi has known problem with some types of 32GB memory cards, that is more info on this on their support forum.
But the general answer is not to use 32GB cards that doesn’t work with RaspberryPi.
So it isn’t necessarily the card that is malfunctioning.

Thank you very much for your info ! I will then use VNC viewer, which is compatible with my old Mac, fortunately. I will have to get another SD card: I only have a spare 1GB: just enough for OS lite, but not a version with a desktop. For VNC Viewer "Rasp OS Lite" is not going to help, I will have to get the version with a desktop.

I couldn't find the info on known problem with 32GB memory card in Raspi Forum. Could you possibly give me a link ?
My 32GB card is working in the end, after I decided to use dd instead of balenaEtcher..... for now ! (OpenWRT)

I still don't understand why one can activate wifi using RaspiOS and then switch to OpenWRT and it would still work, even though the card is different and supposedly nothing would be stored on the device....

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=58151#p1485558

I don’t think VNC Viewer works with a OpenWRT image since it is not a hardware comm system.
If you can’t use the LAN port I guess you are down to the serial port or change config manually in another computer on the memory card.

im in agreement with you on this... let's face it... the pi foundation ( or relavent third party vendors ) are not exactly open when it comes to SOC hardware...

( in fairness they perform better than many other vendors )

that said... some people whom I respect have also provided sensible opposing views... so until the associated vendors decide to provide ( or we find ) information otherwise... we will have no definitive answer...

O, I meant that I am going to use VNC Viewer for Raspi OS in order to set the country code for the wifi. With OpenWRT I have no problem, DHCP server is already active, so I can ssh or get to luci right away.

On the other hand, since the situation with wifi is rather ambiguous, I think I am just go ahead configuring OpenWRT further without wifi: I just wanted to have access to Luci in case I mess up the port. I have to just do it carefully not to mess the port up and make frequent back-ups.

Meanwhile I did manage to configure OpenWRT more or less to my liking in terms of vlan and firewall without messing the port up;; I was overly scared, I guess I didn't have to;;

Coming back to the title of the topic, in the end, I think the following should be correct:

My Laptop: Mac OS 10.12.6. (imager does not support this) card: Samsung endurance pro 32 gb.

  1. Whenever I want to reinstall openwrt, I should use "killdisk.app" first, then imaged file using
    sudo dd if=file.img of=/dev/disk2
  2. I should not use balenaEtcher to flash openWRT.

Thank you all for all your hints !!

The whole thing with raspberry pi is that you cant brick it, at least I haven’t heard about it. Maybe if you take a hammer and destroy it by force, but it hasn’t any real firmware to brick.
If it crash you just remove the SD card and reflash it and you start over from the beginning with original settings again.

Every time it boots it reads the firmware of “the day” from the SD card and runs it to the next shutdown and at the next boot it reads the firmware “for the day” from the SD card again. Like Doris in the movie finding Nemo, always a new life experience at every startup.

I don’t know of any other way to crash it, I have tried a lot of softwares and if they start at all then every unofficial OS crash and burn sooner or later by themself exempt the original Raspberry OS, it just runs and runs and never stops.

So if you flash a SD card with raspberry OS and change WiFi country.
Then mount another SD card with some other OS or ubuntu server that are availible in the OS burner program, then check the country code. Is the country code reset or is it set left as you set it before switching OS?
Not even OpenWRT itself remembers the country code if you reset a router.

Yeah you are right. I just didn't think that wifi is going to be this hard, so I thought it would be nice to have for a peace of mind. I had scary memories from the time when I was setting up OpenWRT on Fritzbox 4020, where having wifi saved me many times. But Fb4020 doesn't even have a reset button, and since I learned now that I'm not really going to kill the SD card permanently by power-cycling, having wifi isn't so crucial. As a matter of fact I'm actually almost done with the configuration of RasPi as a router :slight_smile:

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.