Removing Memory Cards Question


Karel Jansens

Active Member
Joined
Dec 21, 2007
Messages
679
Age
63
Location
Belgium, but trying to escape
Website
Visit site
Has anyone given attention to the "problem" of umounting memory cards vs. newbies? Linux is kinda fussy about removing storage media that it's using (the mount/umount mantra) and the Pandora's card slots are open to the atmosphere, meaning that file corruption is just one yank away.

Nokia's tablets e.g. have a door for the memory cards, with a magnetic switch that detects opening and closing. If a user opens the door, the operating system will either automagically umount the card behind that door, or put up a warning message that the card is in use and removal is a Bad Thing <TM>. Does the Pandora rely entirely on its user's savviness to remember to umount before yanking?
 
Both the GP2X and Pandora can detect when the card(s) is/are present or not, so they can both auto-umount (the gp2x does this already).

The cards can be mounted without caching, but if you remove the card whilst it's being written to, well, thats your own fault really.

The Nokia is better, as it can warn you before you remove the card, but the hardware is already finished, so there's little chance of that being implemented. Plus, there's not been much problem on the GP2X, and the idea could be patented.
 
Just to be clear: I wasn't saying Nokia's door should be copied (although I'm a bit at a loss at what exactly they could have patented: Magnetic sensors aren't spanking new and Psion was way ahead of Nokia in putting doors on card slots), but rather that having exposed mounted cards is a very good newbie trap.

I've seen lots of people on the forum who expressed both an interest in the Pandora and little to no knowledge of Linux (I'm not saying that's a bad or a good thing, just that it's a fact) and how it does things.

Now, there are two ways to approach this: The first is the ancient and proven UN*X Guru method, which consists simply of doing nothing; if the newbie loses all its data by pulling out a "live" card, the newbie has learned a lesson (ignoring that the lesson in most cases is that the newbie runs away as fast as it can, back into the warm and moist embrace of Windows) and the guru can continue on guruing without the annoying noises of clueless newbies.

The other way is to find things that might help the newbie, such as e.g. an ever-present icon in the UI that not only indicates clearly the state of the card, but also helps the newbie to (u)mount it with a simple click/tap. As the newbie gets (inevitably) smarter, he/she will learn about filesystems, /etc/fstab and more of that ilk and realize why things are done the way they are.

And maybe, on some glorious morning, in the copper light of the rising sun the former newbie will confidently open an xterm and type: "umount /media/sddisk2", to put some new pr0n on his card, and angel choirs will sing in praize of Linus.
 
Karel Jansens said:
Now, there are two ways to approach this: The first is the ancient and proven UN*X Guru method, which consists simply of doing nothing; if the newbie loses all its data by pulling out a "live" card, the newbie has learned a lesson (ignoring that the lesson in most cases is that the newbie runs away as fast as it can, back into the warm and moist embrace of Windows) and the guru can continue on guruing without the annoying noises of clueless newbies.
I'd like to point out that in Windows (even Vista, which I just tried now) external drives are mounted with caching enabled by default, therefore you do have the problem whereby pulling the card, even if it says it's done writing, could cost you your data. In Win98, in fact, it was quite difficult to disable this "feature". It's less severe in XP and Vista, but I remember many a time where I'd copy a file with Win2K, it would say it was done, the transfer light would stop blinking, but 3 seconds later it would start up again, copying the file in the background. Very annoying.
In Ubuntu 7.04 and later (possibly sooner, don't know) external drives are mounted with direct writing as default, or has been my experience. Or at least a much smaller, and faster dumped cache that the user doesn't even notice. In either case, when it says it's done copying, it's done. None of this background writing.
At least in this case, Windows is not the "warm and moist embrace" that you make it out to be, and Ubuntu is actually doing what I would expect. If the Pandora behaves the same way, then I don't see a problem.
If the user is actually foolish enough to pull the card while it's writing, and stupid enough not to learn from the mistake, they deserve a swift kick in the head.
 
Last edited by a moderator:
Strange, when I stick a USB stick into my PC on Windows, I see Windows has mounted the "optimised for quick removal." and I have to change the options so it optimises it for data transfer (or whatever windows calls it now), else it takes 30 minutes to delete a few hundred files (as it likes to rewrite the FAT after every single file deletion).

The other optimisation causes the 3 second delay as you say, which is annoying too. Why we can't have a third option that just delays caching for something like a quarter or half a second, I've no idea. That would seem like the ideal approach.
 
Squidge said:
Strange, when I stick a USB stick into my PC on Windows, I see Windows has mounted the "optimised for quick removal." and I have to change the options so it optimises it for data transfer (or whatever windows calls it now), else it takes 30 minutes to delete a few hundred files (as it likes to rewrite the FAT after every single file deletion).

The other optimisation causes the 3 second delay as you say, which is annoying too. Why we can't have a third option that just delays caching for something like a quarter or half a second, I've no idea. That would seem like the ideal approach.
Aye, that's what I mean. I don't know the details exactly, what is considered "caching" or "quick removal" or whatever. Point was in that 3 second delay, followed by some unspecified length of background file manipulation.
Strange that you get quick removal though. What version of Windows? Maybe it doesn't do it in Vista like I thought...
Of course, almost nothing in Vista is the way I thought, and it's fraking annoying.
 
Last edited by a moderator:
QUOTE
What version of Windows?


WinXP Pro. I'd never touch Vista, not even with a very large stick.
 
Squidge said:
WinXP Pro. I'd never touch Vista, not even with a very large stick.
:D

I assume the Pandora kernel is going to support the normal Linux filesystems, so I could use something that made sense like jffs jfs instead of FAT? :lol:
 
Last edited by a moderator:
well i corrupted two times SD card : first under windows with bad option :rolleyes:

and with homebrew DS ( in the begining of libfat )

and as flashcart , be careful when Pandora power down when battery is down

so newbie can have this problem yet under windows or other device ;)
 
AireTamStorm said:
Squidge said:
WinXP Pro. I'd never touch Vista, not even with a very large stick.
:D

I assume the Pandora kernel is going to support the normal Linux filesystems, so I could use something that made sense like jffs instead of FAT? :lol:
Jffs would make no sense, it is for direct access to NAND flash chips. Maybe you meant JFS? It's probably best to stick with EXT2 or 3, as there is a very nice driver available for windows as well.
 
Last edited by a moderator:
Senor Quack said:
Jffs would make no sense, it is for direct access to NAND flash chips. Maybe you meant JFS? It's probably best to stick with EXT2 or 3, as there is a very nice driver available for windows as well.

Yeah, I knew it was one or the other. I seem to remember EXT3 performing poorly on an SD card of mine, but maybe that is why it was on sale :lol:
 
Last edited by a moderator:
There is some mtd emulation over standard block device driver. However, I'd expect the whole 'SD card <-> SD interface <-> SD driver <-> MTD emulation <-> JFFS2' to be quite slow.
Might be interesting on older cards, the only real bottleneck would be the card's speed, and jffs might keep the card alive a little longer. And, of course, you could squeeze more data with the compression options.
Erm, never mind. This is stupid.

For compression, it would be nice to have compFUSEd included by default, though.
EDIT: no, not compFUSEd. FuseCompress seems simpler, cleaner design, and has been stable quite long. And the server isn't compromised every second day. (today compFUSEd's home page says "Joomla! Hacked by CR7". And it's not the first time it happens, seemingly.)
 
Back
Top