Linux Live from SDcard instead of USB

I am trying to get a version of Linux to load from an SDHC card. Everything works as expected from a USB. My laptop allows for UEFI SDcard boot, and some distros will start to boot, then hang up. The SDcard and USB are identical.
It looks like grub finds the SDcard, but as it transfers to the main OS, the driver is lost. The card shows up in lsblk as mmcblk0 with the correct size, but the data is not readable.

I want to use the SDcard because it can be write-protected. Combine that with a non-persistent RAM load, and I do not need to contaminate my windows system when tracking down malware.

2 Likes

Hello Ira,
It should be readable.
How did you install linux on the memory card? I think you may have to go back to that
but maybe first check
Does your OS have a driver for the memory card? I dont know what the driver’s name is, but if you use
dmesg | more
and search for where it detects the memory card, it should give you the driver name.
You might need sudo to use dmesg.
Then, if you check with
lsmod
you can see if the driver is loaded.
If it is not loaded , you can load it temporarily with
modprobe loadername
and see if that makes a difference to being able to read the data on the memory card.
If that works, you can load the driver permanently by putting its name in the file
/etc/modules.

However,
That may or may not help with booting the linux on the memory card.
It depends where you put grub.
Did you write grub to the SD card when you installed linux on it?
or
Are you using the grub you have on the internal disk?

Just some thoughts… you need to investigate a bit to diagnose this.
Regards
Neville

Another thought… the linux you have installed on the SD card may not itself be able
to read the SD card, so when it starts to boot it cant read the root filesystem.
If that is the case, find another linux. The boot process has to be able to find and read the root filesystem.

2 Likes

At one stage the raspberry pi would only install from a memory card so it should work, but that was raspberry os.

Not sure if that is still the case not tried for some time.

1 Like

RPi4 and earlier default to ONLY boot from SD-Card… RPi have some firmware where this is set (and the only way to write is with raspi-config command I think)… You could patch the firmware in the Pi4 to boot of USB 3 (which I did as it’s much faster than SD-Card), and the Pi5 can do that anyway out of the box - I don’t know about Pi Zero 2W - I boot both mine of SD-Card - because USB boot would suck too much power…

I used to use two Lenovo M series desktop machines - both supported booting off SD-card and Compact Flash (in the BIOS)… Never really tried booting Linux off SD-Card on them - but Compact Flash worked - I mostly ran either Oracle VM or VMware ESX on them - but also ProxMox and bare metal install of RHEL 7 (booting off CF).

I don’t see why SD-Card boot would fail - PhotonOS is the Linux “distro” that VMware ESX runs on - and I’d say the vast majority of VMware customers, would be running ESX on blades booting off SD-Card… I know most of my customers run VMware ESX that way…

I have a Samsung NetBook (N150) it has an SD-Card reader - but won’t boot off it - there’s not an option in the BIOS… I guess it might be possible for GRUB on the HDD to point at the SD-Card - but never got that far…

I also don’t think SD-Card boot is a BIOS / UEFI option on the Dell laptops I’ve run Linux on almost exclusively until about 2 years ago - when I switched to MacOS and run Linux on a Lenovo E495 thinkpad (I’ve never even been into the BIOS/UEFI on that - I just booted off USB and installed Pop!_OS)…

2 Likes

I too have a samsung netbook 150 and the bios will not allow you to boot to the sd as dan says, but other bios settings may be available on other machines, the samsung is limited but was a great tool in its day. Mine still runs lmde on a upgraded 2 gb memory slow but fine.

I wish I could find where I put mine - was going to fire it up and put something 32bit on it to try out… But can’t find it anywhere… I boosted it up to 2G RAM and 64 GB SSD… Last time I really used it was maybe around 2018 / 2019 - I ran Manjaro 32 bit on it - and it was quite “performant”…
If I ever manage to find it (and hope the power brick is with it) I might give LMDE a whirl… (is that LMDE 32 bit or 64 bit? I had issues on the past running 64 bit distros - in “theory” the Intel Atom is 64 bit - but it’s not an ideal platform for x86_64 - much snappier on i386/i686).

1 Like

Mine came with 1gb which i moved to 2. Left the hard disk in place not an issue.

Yes i theory 64 bit, but when i tried to install it failed so went for the 32 bit version.

Although i dont use it that much mainly as a loan machine or as a backup when setting things up in our village, a trusty workhorse in my to go bag

Thanks Neville,

I have been digging. The SDCard boots into grub. I can do anything available in grub. The boot into the main program then executes:
Run /init as init process
switch root from initramfs to ramfs
Comments - MiniOs live init
Comments - Setting dynamic ram compression
Comments - Probing for hardware
and then freezes.
if left for a while it will comment - Looking for MiniOS data in /MiniOS

IF I boot from identical iso, but using USB, it will freeze in the same place if the SD card is inserted.
However, if I boot from USB without the SDcard inserted, and then insert SD Card, it reads the SD card just fine.

Seems like it has something to do with the name given when root is switched.

Additional Info - While in grub from the SD card I can ls -l (hd0,1)/minios/ and see all of the files and subdirectories.

-Ira

1 Like

Hi Ira,

That could be the issue
You can do something to test that
Boot the SD card into grub, and in the menu on the MiniOs line do ‘e’
That puts you into an editor
move the cursor down to the ‘linux’ line
see what the root= parameter says ie is it a device name or a UUID
if it is a device name is it correct?
try changing it to a UUID
after you edit press F10 and it will boot with your changes

What you are doing in that editor is temporarily changing the boot parameters that are in /boot/grub/grub.cfg. The changes only apply to that one boot. To change a boot parameter permanently you have be in the linux on the sd card, go to /etc/default/grub and edit the
GRUB_CMDLINE_LINUX="root=UUID=uuidofrootfilesystem"
then do
update-grub
and it will make a new /boot/grub/grub.cfg file.
Then the changes will be permanent.
Only do that after you have tested it with a temporary edit.

Another thought… what is in /etc/fstab in your MiniOS? Does it define the root filesystem there? Is it correctly defined? If not edit /etc/fstab. You can use UUID instead of device name in fstab too. An example fstab entry
UUID=fd84d74d-325a-4e42-acbd-5ced9cfc4ebf / ext4 discard,noatime 1 1

How do you find the UUID of your root filesystem?
Be in the linux on the sd card and do blkid
You may have to install blkid
or , if you cant get blkid you can look in /dev/disk/by-uuid and try and guess which one it is.
You may need sudo to use blkid

That seems to prove it is not a driver problem. Clever .

What is MiniOS … never heard of it?

Regards
Neville

2 Likes

MiniOS is a super-lightweight linux setup. Kind of like Puppy, but it gave me more info before stopping. MiniOS - Fast. Simple. Reliable.. Works great on a USB, but I really want the lockable SD Card to work. I’ll dig into your suggestions tomorrow.
-Ira

3 Likes

I have tried 5 different Linux versions/distributions. They all seem to have the same problem, halting on transfer from Grub to the main OS. I tried a lite version of WindowsXPE and it works without a problem, so that is my solution for now until I have enough time to re-learn linux/unix better. My last real experience was with a Sun workstation, so it was a “few” years ago.
-Ira

2 Likes