WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Failing to read files after sdcard removed  (Read 72 times)

Offline seandepagnier

  • Newbie
  • *
  • Posts: 20
Failing to read files after sdcard removed
« on: July 04, 2026, 02:55:18 AM »
I was testing what would happen if the sdcard stopped working by removing it once booted.

The idea is tinycore linux could continue to run even if the sdcard fails at runtime making it more reliable than other distributions.

Instead I am able to read some files but not others: "read error: Input/output error"

Is there a way to force it to sync?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12899
Re: Failing to read files after sdcard removed
« Reply #1 on: July 04, 2026, 09:49:50 AM »
Hi seandepagnier
Did you create a  copy2fs.flg  file in your  tce  directory?

If you didn't, try this:
Code: [Select]
touch /mnt/mmcblk0p2/tce/copy2fs.flg
Then reboot.

Offline seandepagnier

  • Newbie
  • *
  • Posts: 20
Re: Failing to read files after sdcard removed
« Reply #2 on: Today at 01:32:55 AM »
Thanks for pointing this out.

It did boot but somehow my openssh didn't start...  but it also took a lot longer to boot.

This might be a hard ask, but is there a way to boot normally, then somehow migrate packages to ram at runtime, or hint the linux kernel to keep buffers in ram then casually read every file so they end up there?

The idea that it would boot just as fast, but also be resilient to sdcard failing while running.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12899
Re: Failing to read files after sdcard removed
« Reply #3 on: Today at 09:04:05 AM »
Hi seandepagnier
... It did boot but somehow my openssh didn't start ...
Maybe you ran out of RAM and it didn't load?
If this command doesn't display a result, it's not loaded:
Code: [Select]
tce-status -i | grep openssh
Quote
... but it also took a lot longer to boot. ...
Normally, extensions are loop mounted. That means the extension gets
mounted and looks like a read-only storage device. Then, links get created
in  /usr/local/bin/  that point to the files in the extensions  /usr/local/bin/
directory. The same happens for any other directories the extension contains.
This is a relatively quick operation involving very little data, but requires
that the storage device remains connected.

The  copy2fs.flg  file tells the system to copy the files in the extension to RAM.
This allows you to remove the storage device but involves copying a much
larger amount of data which takes more time.

Quote
...This might be a hard ask, but is there a way to boot normally, then
somehow migrate packages to ram at runtime, ...
Not that I'm aware of. You could remove less important extensions from your
onboot.lst file and load them in the background once the system is up.
This way, extensions that are not needed immediately won't slow down the
boot process.