The storage memory of my Yun

hello,

I succeeded in applying the expanding of Yun's disk space.

Now my Yun has 4GB of memory.

When I am unplugging the micro SD card, I see always almost 4GB in the administration panel of my Yun in the 'System > Software' part.

Do you think that it's normal?

Once you expand the Yun's system volume onto an SD card, you should always run with the SD card inserted. I do not believe the system root overlay mechanism supports hot swapping of the SD card. I recommend you always reboot or cycle power if you plan on removing or inserting the card.

If you boot with the SD card inserted, you should see the size of your SD system partition.

If you boot with the SD card removed, you should see the size of the on-board system.

If you boot with the SD card inserted, and then remove the card while running, I think you're asking for trouble.

ShapeShifter:
Once you expand the Yun's system volume onto an SD card, you should always run with the SD card inserted. I do not ::::SNIP::::

@ShapeShifter,

Correct on almost all counts.

The Yun can see a hot-insert of the SD, but not the hot-ejection; so, not hot-swappable. As you alluded to, you can boot and then insert the SD, but then removing an SD can cause issues.

It appears the software included has enough to recognize the SD, but they did not want to walk the line toward hot-swappable.

I'm too tired for a complete answer on this.
Jesse

jessemonroy650:
The Yun can see a hot-insert of the SD, but not the hot-ejection; so, not hot-swappable. As you alluded to, you can boot and then insert the SD, but then removing an SD can cause issues.

Really? I believe you, and am in no position to argue since I haven't tried it. I know it works well for data volumes on an SD card, I'm just surprised that the system can boot off of internal flash, and then at a later time detect the insertion of the SD card and then suddenly start using the system files off of the SD card.

Is that what you're saying? If so, I'm impressed.

But even so, I still stand by my statement that you should always run with the SD card inserted once you've expanded the space. If you sometimes run with it in, and sometimes with it out, and start installing packages or running upgrades, it seems to me that it would be a configuration management nightmare, and one would quickly lose track of what is where. Even if the system doesn't require it, for my own sanity I intend to always leave the SD cards in my Yuns.

ShapeShifter:
Is that what you're saying? If so, I'm impressed.

::::SNIP::::

@ShapeShifter,
Not quite. This is why I hesitated to answer early this morning. The sequence is as such:

  • recognize the hardware
  • see if there are known partitions (with kernel support)
  • see if there is A bootable partition (with kernel support)
  • boot from bootable partition (this is a MSDOS throwback, gone on some systems)
  • boot kernel from bootable partition
  • see if there are known filesystems (with kernel support)
  • do an fsck (filesystem check) on the file system (not done on all filesystem, notably journalling file system (wikipedia) do not need this, but can be forced to)
  • mount file system

If you've booted from the firmware, then #3,4,5 are not done.

If you insert the SD while the firmware booted system is running, the SD will be recognized. (Yes, I tried this as a recovery method for failed SD upgrades.)

However, if you pull an SD while the system is running (on the firmware), it does not register the SD removal -- it just keeps running as if it was still there. Now, if you try to access it, it will likely panic the system and possibly reboot or halt. Just to be clear, I have not tried to access the SD filesystem after I have removed the SD.

Questions?
Jesse

jessemonroy650:
Not quite. This is why I hesitated to answer early this morning. The sequence is as such:

I'm familiar with the sequence, but that level of detail isn't really important to this higher level of discussion.

If you insert the SD while the firmware booted system is running, the SD will be recognized. (Yes, I tried this as a recovery method for failed SD upgrades.)

Yes, the SD card is recognized. I'm not at all surprised by that. The question, which you seem to have alluded to in your prior post but did not confirm or deny in your last post is: when the "expanded" SD card is recognized upon insertion after booting from internal flash, is the pivot root overlay mounted and will reads/writes to the system files suddenly start happening on the SD card? Or will the system keep on accessing the internal flash. I suspect the latter.

If the former, I'm impressed. If the latter, then inserting the "expanded" SD card after booting doesn't really help anything, because you are still booted from, and running from, the internal flash, and anything installed in your expanded system on the SD card isn't really there.

And if it is the former, and the system files are suddenly coming from the SD card, I can see all sorts of interesting side effects when processes that were started from one system filesystem are suddenly running from another system filesystem. I can't imagine how it wouldn't get really messy and confusing to the processes that are running when the SD card is inserted and everything is changed out from under them.

ShapeShifter:
::::SNIP::::

Yes, the SD card is recognized. I'm not at all surprised by that. The question, which you seem to have alluded to in your prior post but did not confirm or deny in your last post is: when the "expanded" SD card is recognized upon insertion after booting from internal flash, is the pivot root overlay mounted and will reads/writes to the system files suddenly start happening on the SD card? Or will the system keep on accessing the internal flash. I suspect the latter.

::::SNIP::::

Sorry, still a bit out. Yes, the later is the case. If you boot from the flash, then after you insert the SD -- the SD looks like a mounted file system, regardless of what is on it.

jessemonroy650:
Sorry, still a bit out. Yes, the later is the case. If you boot from the flash, then after you insert the SD -- the SD looks like a mounted file system, regardless of what is on it.

Then I stand by my original statement: the safest bet is to either boot up with the SD card out and never insert it, or boot up with the SD card in and never remove it. I think trying to hot insert/remove the SD card which has had the system expanded onto it is asking for trouble.

Of course, if it's a data-only SD card, and has not been used with the disk expander sketch, then go ahead and insert/remove it as needed.