an other question about ejecting sdcard safely


ahahah

Active Member
Joined
Feb 13, 2010
Messages
592
hello

i thought that if i eject a sd card during the standby/low-power mode, it is a safe procedure to eject a sd card.

but the 1st time i enable this mode, there is a warning message that says to not remove sd cards during this mode because it can corrupt datas. why this message? it should be without any risk, shouldn't it?
 
No, it shouldn't.

Suspend means that everything the unit does (including reading/writing data to/from storage devices) is put on hold.

If it wakes up to discover that the device it was read/writing to/from no longer exists, confusion will ensue

If you do a full shutdown, every process on the pandora finishes whatever it is doing and leaves everything tidy.

It might (ask someone else) be OK if you do a sync (ideally a umount) on the card you want to remove before suspending
 
But low power mode and standby mode are not the same thing, are they? At least I recall the wiki battery timings page having different results for each (though it's possible they're both the same thing but on different versions of the OS). Can anyone clarify?


AIUI, in low power mode, the risk of the machine being in the middle of doing something is elevated, since the machine is doing things much slower - although with wifi off, and most other devices that could cause events off, the odds of it trying to do anything when in low power mode are reduced, I guess. Whether it's lower or higher risk than in normal operation's very difficult to quantify therefore.


I would suspect a true standby/suspend mode would really be lower risk, provided you didn't go into suspend mode while something was happening. In normal parlance, such modes mean the CPU is actually frozen (or turned off) while RAM is either left powered up or written to disc. I've yet to see anything other than that wiki page suggest the Pandora handles such a mode (and with low power mode being so effective, it barely need it to be fair).
 
For brevity, low power and standby have been considered the same thing recently. When someone (typically a new user, or when talking to a new user who may not understand the difference) uses either term, they are referring to the suspend mode where the CPU is literally shut down.

Binky is absolutely correct. When it was first implemented, suspend would sync and then unmount the SD card, at which point you could happily pull the cards out and it wouldn't mind. Unfortunately this meant that you couldn't have any PNDs running, or have any open files on the cards at all. It wasn't a very useful feature like that. By request, Notaz changed it so that it no longer unmounts the card, but as Binky says, everything is immediately suspended and if it was in the middle of accessing the card only to find that card no longer exists it will complain.

Furthermore, on a more technical aspect, inserting and ejecting cards isn't a trivial thing: when the card changes, an interrupt is triggered which tells the operating system to run some code to figure out what has happened to that card. If the CPU is off when you change the card (eject or insert) then it never gets that interrupt. (in actuality the interrupt is still received and tells the CPU to wake up so there's a possibility of recovery, it's just not pleasant)

So now you've got a card which may or may not be in the middle of a write operation and a system that doesn't know whether there's an SD card inserted or not. And heaven forbid if you should eject a card and then put a completely different one in it will get REALLY confused.

This is actually a very, very difficult problem. There's a reason phones and the like keep their SD cards under the battery.
 
Ah. I thought low power mode didn't suspend the CPU, just clocked it to some low speed (150Mhz rings a bell), and turns off wifi and other bits. Am I out of date?


I'll probably have a go at editing the wiki later on if the standby timings can be hived off t an 'historical timings' section or something, if standby mode is not something that applies to the latest SZ. Personally I found it a little misleading as is.
 
Ah. I thought low power mode didn't suspend the CPU, just clocked it to some low speed (150Mhz rings a bell), and turns off wifi and other bits. Am I out of date?
No, you are correct, that's what "low power" mode does: the CPU keeps going and just the peripherals are shut down. Not sure if it clocks down anymore or not, it wouldn't make sense to with the current power management.What I'm saying is that when most people talk about "low power" they are actually talking about "suspend": no one (ie, the new users that have shown up lately) actually care about the technical differences, just that when they flip the power switch it "goes to sleep" and uses less power.
 
I do not understand what the difference is between mounting/unmounting and inserting/ ejecting a sd card?? :huh:  Are they both the same?
 
Last edited:
insert/eject is physically inserting and removing the SD card. Mounting and unmounting is what the operating system does before and after these things: insert card, operating system "mounts" it so you can use it. To cleanly remove a card, you must first "unmount" it (which tells the system to stop using it) and then eject it. If you just eject it without unmounting, there's a chance that the system was in the middle of using it, and that can cause major problems. It's usually unlikely that the system is using the card (unless you are aware of it, like intentionally saving or loading something) so you shouldn't really have to worry. I've accidentally ejected cards from standby before and it hasn't caused any problems, but I don't put it to sleep until I know all write operations have concluded. It makes the system confused, but you can put the SD card back and ignore the issue until the next reboot.
 
ok so the better way is to unmount 1st and eject after.
 
ok so the better way is to unmount 1st and eject after.
Absaloutely

Consider the difference between [asking someone to stop writing in a notebook] and [grabbing the notebook]

There's not much point asking them to stop writing after you grab it
 
insert/eject is physically inserting and removing the SD card. Mounting and unmounting is what the operating system does before and after these things: insert card, operating system "mounts" it so you can use it. To cleanly remove a card, you must first "unmount" it (which tells the system to stop using it) and then eject it. If you just eject it without unmounting, there's a chance that the system was in the middle of using it, and that can cause major problems. It's usually unlikely that the system is using the card (unless you are aware of it, like intentionally saving or loading something) so you shouldn't really have to worry. I've accidentally ejected cards from standby before and it hasn't caused any problems, but I don't put it to sleep until I know all write operations have concluded. It makes the system confused, but you can put the SD card back and ignore the issue until the next reboot.
Got it now.

Thanks again.
 
That won't affect the fact that they haven't finished their sentence.

If you want the content of the notebook to be coherent, you're best off giving it back before they next try to write in it.
 
Back
Top