15

like NTFS, HFS+ or ext4, for SD cards? After all, journaling decreases the chance of data loss, which would be important for photographers. I lost an SD card containing maybe a thousand photos when in Bali -- a place I haven't got a chance to visit before or since.

Are there any precautions I can take before a trip the next time? Format the cards in camera?

Am I correct in understanding that SDXC (exFAT) and Sony Memory Stick offer no more reliability than SD cards?

mattdm
  • 143,140
  • 52
  • 417
  • 741
Kartick Vaddadi
  • 4,726
  • 10
  • 52
  • 94
  • Please post the SDXC vs SD card question separately. AFAICT it has nothing to do with journaling filesystems. – l0b0 Jan 05 '14 at 17:38
  • Hmm.. SDXC uses a different filesystem (exFAT), so it's related to the filesystem issue. I agree that it has nothing to do with journaling, but I was curious if exFAT / SDXC cards are more reliable than FAT32 / SD. I got my answer. Thanks. – Kartick Vaddadi Jan 05 '14 at 17:40
  • How are you suggesting I read these ext4 formatted cards on my Windows box? – Philip Kendall Jan 05 '14 at 19:54
  • 2
    running any of those filesystems on a SD can kill the flash memory pretty darn quickly. – Tim Seguine Jan 05 '14 at 23:54
  • @Tim That certainly sounds plausible. Do you have some references to back the statement up? (probably worth expanding your comment to an answer). – Philip Kendall Jan 06 '14 at 00:07
  • 1
    @PhilipKendall Not my source, but this SE answer mentions it: http://serverfault.com/questions/41674/flash-drives-should-be-formatted-ntfs ... anyway SSD hard drives actually need special logic to avoid trashing the flash when using normal filesystems. Cheap flash memory like that in SD cards is even less well suited to this kind of load. FAT is a very simple filesystem well suited for the sequential storage loads that cameras make and causes low flash memory wear.The primary issue is already in the provided answers though: added complexity for no gain. – Tim Seguine Jan 06 '14 at 00:15
  • 2
    The error here was keeping 1000 photos on a card without backing up. If traveling to a remote location where you will be without access to a computer on which to backup you should be carrying a backup device. – Jim Garrison Jan 06 '14 at 01:26
  • I wouldn't worry so much about a journaled filesystem reducing the life of the device by much. I'll happily choose a reduction in life span from say 5 years to 4.5 if it means my photos aren't lost. Jim, blaming the user for unreliable technology doesn't help. I expect my tools to be reliable. As for the "How do I access ext4 on Windows?" question, you can connect your camera to your computer and use MTP, or the camera OEM can bundle an ext4 driver which you install. Yes, it's inconvenient, but it's no more convenient to lose your photos. But I agree it's a tradeoff. – Kartick Vaddadi Jan 06 '14 at 05:21
  • Jim, I can't think of a good way to back up photos while traveling. I read http://photo.stackexchange.com/questions/533/how-can-i-backup-my-photos-while-travelling and http://photo.stackexchange.com/questions/924/how-can-i-backup-my-raw-photos-while-travelling-without-internet-access but they don't work for me. Please see my comment on Itai's answer for why. – Kartick Vaddadi Jan 06 '14 at 05:26
  • 1
    @KartickVaddadi What's your source for your numbers that a journaled file system will reduce life by 10% (5 years to 4.5 years)? Do you have some research you can point to? – Philip Kendall Jan 06 '14 at 08:32
  • 1
    @KartickVaddadi: The mapping layer between the logical sector numbers and physical disk blocks creates failure modes which are unlike any normally associated with magnetic media; file systems which don't understand the mapping layer which is hidden from them cannot avoid any failure modes posed by that layer. – supercat Jan 06 '14 at 17:33
  • @KartickVaddadi What if it reduces card life span from 5 to 2 years and costs twice as much? Would you still be happy with the tradeoff? – Michael C Jan 06 '14 at 19:04
  • Michael, of course not :) Supercat, agreed, and interesting. I bow down to your expertise here. Philip, you're right, I don't. Do you have research showing that it causes a drastic reduction in life? Or I guess we could just ask @supercat, since he's an expert in this area. – Kartick Vaddadi Jan 07 '14 at 06:34
  • I don't see JFFS mentioned here, which is designed to provide the value of a journaled file system while providing flash media wear leveling. Not arguing for it for photo uses, necessarily, but such a thing exists... – andersoj Jan 09 '14 at 01:00

10 Answers10

28

Let's do a little cost benefit analysis:

  1. A journaled file system is more complicated - this means longer development time, more bugs, more battery power drain, higher production cost etc.

  2. the problem solved by a journaled filesystem - corrupted FS data but file data intact - is handled pretty well by 3rd party data recovery tools.

  3. journaled file system does not solve all problems, you really need good backups - and not only that systems with built-in backups exists (dual card slots) it's a feature that is used to make pros get more expensive cameras.

  4. there isn't a big memory card reliability crisis, those cards are pretty reliable and failure is relatively rare.

  5. and finally, there is no journaled file system that is supported out-of-the-box on both Windows and Mac.

So - if you were the product manager in charge would you approve a project that 1. solves an already solved (with 3rd party tools) problem in an incomplete way, 2. is not important enough to be a selling point and 3. will make a significant part of the market unable to use the camera (at least without installing additional software they won't need with the competing brands)?

Nir
  • 20,825
  • 4
  • 38
  • 74
  • 3
    Actually, OSX can read NTFS volumes, and write to them with some terminal foo. – Justin Dearing Jan 05 '14 at 21:12
  • 1
    @JustinDearing: neat! You should cross-post that as a QA into askdifferent. – Oleg Jan 06 '14 at 02:02
  • the default filesystem configuration in OS X (meaning, the configuration that all Macs come preinstalled with) is HFS+ with journaling enabled. in fact, Time Machine requires journaling to be enabled. – strugee Jan 09 '14 at 03:02
  • 1
    @strugee - I didn't say OS X doesn't have a journaling file system - I said there is no single system that both OS X and Windows can use out of the box (Windows doesn't understand HFS+ at all and Macs (by default) can't write NTFS) – Nir Jan 09 '14 at 07:33
  • @Nir ah, nevermind. I misunderstood. – strugee Jan 09 '14 at 17:49
11

Journaled file-systems only ensure the integrity of the file-system. If a card truly fails, it fails with the whole file-system. Now if you have some bad memory cells, you would only use whichever photo occupied that space and a journaled file-system would not help either. In other words, this is the wrong solution to the incident you describe.

The real solution is redundancy which is why you will find high-end offerings from Nikon, Pentax and Canon which offer dual memory-card slots and the ability to write images to both cards at once. This gives you an instant backup. If those cameras are not convenient to you, the you have to find some other way to make frequent backups. Some people do it daily onto a laptop, portable drive, optical-disk.

While I have not tried this yet and am not sure how practical it is, you can also use a WiFi device or card (SD/SDHC only AFAIK) which automatically sends your images as they are captured to another networked device, maybe a tablet or something with good storage.

While SDXC comes format as exFAT by default, you can format it yourself at FAT32 too. Most cameras will accept it both ways. The difference in reliability is probably zero though.

Itai
  • 102,570
  • 12
  • 191
  • 423
  • Yes, but that's not the only failure mode, is it? In my case, a stress test of writing multiple times to the entire card did not detect an error, so I don't think it's a question of bad memory cells; just some corruption. Regarding bad memory cells, a journaled filesystem will ensure that only photos stored there will be lost and not the whole filesystem, with thousands of photos, right? If a journaled filesystem is the wrong solution to the problem, I'm afraid I don't see what the right solution is. When I travel, I don't always have my laptop, tablet or portable disk to backup photos to. – Kartick Vaddadi Jan 05 '14 at 14:40
  • Journaled file-systems make sure the whole file-system is consistent but they really do not do anything for corruption. You would need some redundancy for that. – Itai Jan 05 '14 at 15:34
  • And making sure the whole filesystem is consistent means that only files that have corrupt blocks will be lost, not the whole thing. – Kartick Vaddadi Jan 05 '14 at 15:44
  • @KartickVaddadi for backing up photos while travelling, refer to this question – Saaru Lindestøkke Jan 05 '14 at 16:36
  • Thanks, Bart. I took a look at that question and the question linked from there. I don't want to go looking for an internet cafe in the limited time I have when I'm on vacation, type my passwords into public computers, etc. That's IMHO a cure worse than the disease. There are also backup devices, but I have to agree with the answer that says they are expensive, or inconvenient, or you risk losing them when you stay in cheap hotels. I already travel often with gear worth thousands of dollars, and I don't want to make it any worse. – Kartick Vaddadi Jan 06 '14 at 05:25
  • 1
    @KartickVaddadi I think it's best to assume when you buy any type of flash memory it will fail at some point in time. The best you can do if you are unwilling to invest to reduce the risk when you are out in the field is to make sure you purchase reliable cards from reputable manufacturers. – Peng Tuck Kwok Jan 06 '14 at 05:56
  • 4
    @KartickVaddadi You are trying to swallow a camel to avoid straining to eat a gnat. If you've spent 'thousands of dollars' on your gear, what is another $20 for an extra memory card that you would have to purchase anyway to take advantage of a second card slot? – Michael C Jan 06 '14 at 07:46
  • $20 is nothing, but I am referring to the convenience aspect -- I want to minimize the number of loose items I carry. Besides, I can take a dozen cards with me, but having another card isn't going to help recover photos from the corrupted card, while journaling makes that situation unlikely. Carrying another card is a work-around, a hack, for unreliable technology. I can't believe you are arguing that it should stay unreliable. – Kartick Vaddadi Jan 06 '14 at 10:22
  • 1
    @KartickVaddadi: Doing a stress test of writing multiple times to the entire card wont do anything other than push your card closer to unreliability since it is flash storage we are talking about and not magnetic media. Flash storage (NAND based at least) only supports a limited number of writes before erase blocks start failing. The translation layer will try to hide this from us by mapping failing blocks to working blocks when writing. – Leo Jan 07 '14 at 06:18
  • Leo, if some blocks have permanently gone bad, then I shouldn't be able to successfully write 8GB of data onto an 8GB card, can I? Not just write but also read it back successfully. Yes, I know that it reduces the life of the card a bit, but what I needed to know that if the card is unreliable, in which case I would have thrown it away. Or if it's a one-time corruption. – Kartick Vaddadi Jan 07 '14 at 06:24
  • @KartickVaddadi: Yes, you should. Most NAND flash chips come with reserve blocks that are used specifically as replacement blocks so the user won't notice blocks going bad. As has been noted in other comments: NAND flash is inherently unstable, pushing it to it's limits just makes it even more likely to fail. – Leo Jan 07 '14 at 06:28
  • Thanks, I'll keep that in mind. So do you suggest I throw away that particular SD card? – Kartick Vaddadi Jan 07 '14 at 06:32
  • I would have destroyed that card as soon as I failed to get the photos off of it. Backing up to a portable drive every night should be achievable on the computer most hotels have for customers to browse the web or almost any web café. – Steve Barnes Jan 10 '14 at 21:40
5

It comes down to resolving "is there a market?" and "what are the barriers to adoption?". Each of those presents a huge barrier to adoption even if it were worthwhile.

NTFS would incur costs for licencing even if a suitable library even exists for the camera's processors (which is not guaranteed) and support outside of Windows would be patchy. While HFS+ and ext4 have no native support in Windows, eliminating much of the potential customer base. So there's no market for those.

As you mention, exFAT is required by the SCXD standard so you'll see that as support for larger and faster cards appears but it's not as simple as that since more code is also more to go wrong, and with embedded systems like cameras, you really don't want to push out firmware updates so expect that while writes to an exFAT card might be readable and in the right format, it may not actually use any of the exFAT features that might offer any protection. So there are significant barriers to adoption too.

The failure mode of most cards is as likely to be the controller as a memory cell it is a lot of work (cost to manufacture) for little benefit.

Sony MS (MemoryStick) is still SLC or MLC flash memory, it's just the controller and physical connection which differs between the systems. Your best protection in the situation you've experienced is to take a small portable backup device with you, they are pocket sized and relatively inexpensive (and probably incompatible with Journaled filesystems too.)

James Snell
  • 9,709
  • 25
  • 39
  • NFS is not an on-disk file system, it is a network protocol (roughly on par with its considerably more familiar cousin FTP in terms of the problem it solves). Did you mean HFS+ (the file system used natively by Mac OS)? – user Jan 05 '14 at 19:48
  • I did indeed mean HFS+, will edit :) – James Snell Jan 05 '14 at 22:36
5

As far as I know, all digital cameras produced to be sold on the retail market incorporate the Design rule for Camera File System (DCF). Part of the DCF standard is that the FAT file system must be used by compliant devices. This standard was adopted as the de facto standard for storing digital image and sound files in memory devices by the digital camera industry to insure interoperability from one brand to the next.

See https://photo.stackexchange.com/a/46387/15871 for more information about DCF.

Michael C
  • 175,039
  • 10
  • 209
  • 561
  • Would the standard preclude a camera vendor from using NTFS. HFS+, or other file system if a card was inserted that was formatted with one of those systems, or would the camera be required to simply say "card unusable"? – supercat Jan 05 '14 at 22:19
  • At one point the spec didn't include FAT32 IIRC. At present (DCF v2, published 2010) the spec is limited to all the FAT variants + exFAT. So there are precedents for DCF to be extended in the future to include other filesystems if the members wanted that. – James Snell Jan 05 '14 at 22:50
  • @supercat It would be outside the standard as it is now written. Standards are always subject to revision. But the question seems to be asking why don't any current cameras support journaled file systems. – Michael C Jan 06 '14 at 07:32
  • @JamesSnell Regular FAT16 also tops out at 2 GiB per partition, so the move to allow something slightly more modern solved a very real problem. Widespread support for FAT32 in non-Microsoft systems seems to have been implemented in the years around 2000, and FAT32 tops out at a significantly more useful even today 2 TiB per partition when using a 512 bytes logical sector size. – user Jan 08 '14 at 15:50
  • @MichaelKjörling - I'm well aware of the limitation of FAT16 thanks and I'm not saying FAT32 was added in 2010 (that's when exFAT was added). The point is that CIPA found it useful to extend the specification and could do so with future filesystems if they wished. Clearly they saw a need / desire for something beyond FAT32. – James Snell Jan 08 '14 at 18:00
4

One obvious reason: because a journaling filesystem on a camera very likely would not have helped you (or anyone).

As a very high level overview, here's what a journaling filesystem does: Before each write to the metadata (or data, if data-journaled as well), first write what you're going to change to the journal. Only once you're sure that's on disk, go ahead and write the change. Basically, this means that if power is interrupted during the write, you can recover the filesystem by using the journal—you go ahead and perform any actions in the journal.

This is valuable on a desktop PC, where the power might go out, or the user may hit the reset button, or pull the plug, etc. Also valuable, but less so, on servers (power failure) and laptops (reset button).

A camera is battery-powered. It has an off switch, but this normally tells the firmware to shut it down—it isn't a physical power disconnect. There isn't usually a reset button, or if there is, its basically never used. So, you don't need journaling, the firmware can just finish the write. The only exception would be if you physically removed the battery. Maybe that'd happen with an external power pack, but other than that, a camera should never experience an unclean shutdown.

Also, almost no flash devices actually handle unexpected power failure well. Get them in the middle of a sector relocation (wear leveling), and all bets are off. So even if you had a journaling filesystem, you'd still not be safe from power failure.

A journaling filesystem does not protect you from:

  • Bugs in the flash controller on the SD, etc. card.
  • Bugs in the camera's SD host hardware
  • Bugs in the filesystem code on the camera
  • Bugs in the firmware's SD drivers
  • Loss of sectors on the media
  • Hardware malfunction (e.g., due to cosmic rays, static discharge, EM noise, water, ...)

In fact, a journaling filesystem is more complicated, so you are actually more likely to have filesystem bugs. It amplifies writes, so you're more likely to hit flash controller or SD host bugs. And you're going to wear out the flash slightly sooner.

derobert
  • 141
  • 3
3

Journaled File systems are bad for SD cards (or any NAND Flash device).

Write operations are expensive for NAND Flash devices and journaled file systems tend to write more than non-journaled file systems for the same activities.

So the SD card will work slower and will last less with a Journaled file system.

FLASH-based storage, at its core, uses a technology called NAND FLASH. NAND FLASH is readable and writable, but with several wrinkles.

  1. The fundamental read/write unit is a "page", not a sector. FLASH devices of the 2007-2008 generation have a 2K page size, migrating to a 4K page size in the 2009 generation and 16K page sizes have been observed in 2011 generations.

  2. You can't write a page anytime you want - before you write to it, you must first erase it. But you can't erase a single page at a time - you must erase an entire "erase block" of (typically) 64 consecutive pages (128Kbytes or 256Kbytes depending on the generation). And after you have erased the block, you can't write to the pages in an arbitrary order, you must write them sequentially starting at the first one.

  3. Blocks tend to wear out over time. After a certain number of erase cycles, a block will "go bad" permanently, so that it will no longer reliably hold data. Pages can also develop data errors as a result of write activity to other pages, and even as a result of reads!

http://wiki.laptop.org/go/How_to_Damage_a_FLASH_Storage_Device

Edit: It is worth to mention that Journaled File systems will not bring significant advantage over non-Journaled File systems.

S182
  • 139
  • 4
  • 1
    Flash devices use a block remapping layer (FTL), so you're not writing to the same physical block again and again. Android uses filesystems like ext4, so I don't see the validity of your argument that it's unsuitable for flash. – Kartick Vaddadi Jan 06 '14 at 06:05
  • Android devices usually have some RAM as well as flash, don't they? – Michael C Jan 06 '14 at 07:39
  • 1
    Block remapping doesn't increase the total number of writes per block before a block goes bad, it just spreads write operations out over the entire card so that almost every block is worn at the same rate. Journaled systems use more write operations to do the same thing than non-journaled systems do, so the total number of writes before a card goes bad will occur sooner in its life cycle with a journaled system. – Michael C Jan 06 '14 at 07:42
  • I know that, but I'm okay with a slightly shorter life on my SD cards if it means I'm less likely to use your photos. Everything you said holds for Android, which does use a journaled filesystem on flash. So it's not as big a deal as you're making it out to be. – Kartick Vaddadi Jan 06 '14 at 10:24
  • 1
    Android have some problems related to the storage (I/O lags) and they are implementing the TRIM command to improve the situation. SD cards were made to be cheap and small, not to be robust. There are alternatives more robust but they are more expensive. – S182 Jan 06 '14 at 17:05
  • 1
    Android uses JSF because those devices are constantly writing information from several processes and they are prone to shout down unexpectedly (OS blocks, low battery, etc). It is not the best but they need it. In the other hand persistence operations in Cameras are much more simpler and a JFS would bring more problems than solutions. A Journaling File System is more resilient and is less prone to corruption, but not immune., in most cases you can repair a non journaled FS with a "scandisk". – S182 Jan 06 '14 at 17:25
  • @Kartick Vaddadi: I think a JSF could have not help you with the data loss problem you mentioned in the OP. The general recommendations on SD management are: Don't format them yourself, because they come with factory specific format settings. And always use a SD card twice of the size you need, because it will distribute the erase/writing operations across more blocks. – S182 Jan 06 '14 at 17:41
  • @MichaelClark: An even more important function of block remapping is to allow the disk to behave as a drive with independently-writable 512-byte sectors even though the media itself has far more restrictions on the sequence in which data can be written. – supercat Jan 06 '14 at 17:57
  • Serge, I was told that a good practice of SD card management is to format them in camera, so that it creates the optimal filesystem configuration for its use. Like FAT32 vs exFAT, and whatever configuration parameters you can specify while formatting a filesystem. Is that not true? Serge, your point about Android is valid, and I realize my comparison is not 100% accurate. Thanks for the information and perspective. However, it's not right to say that a journaled filesystem is not 100% reliable, so let's not use it. Nothing solves ALL problems. If it solves some, it's a step forward. – Kartick Vaddadi Jan 07 '14 at 06:36
2

Different file systems require different amount of RAM in a system that is using them. A system that needs to write a file to a FAT file system could in theory get by with a single 512-byte buffer, though performance would be pretty dreadful. Expanding to two or three 512-byte buffers would improve things enormously. Going beyond that would improve things somewhat more, and getting optimal performance from a larger card would require more memory than getting optimal performance from a smaller one, but a camera which only included enough buffers to achieve optimal efficiency with smaller cards would still be able to work with larger ones, even if less efficiently.

A trickier issue centers around the fact that memory-card standards specify that each card behave as a numbered collection of 512-byte sector that can be read and written independently in arbitrary sequence, but that's not how the data is stored on the chips within the cards. The memory chips used in a typical memory card are divided into 528-byte pages; those in turn are grouped into blocks of 256 or more. Once a page is written, it cannot be rewritten without erasing it and all the other pages in its block. In theory, it would be possible for an SD card to honor a request to write a 512-byte sector by copying to RAM all the data in its block, erasing the block, and writing the whole block back but with new data in one sector. In practice, performance would be dreadful. Instead, writing a sector will cause the SD card to pick a blank page, write the data there along with its sector number and various ancillary information (the reason pages are 528 bytes rather than 512), and somehow keep track of that being the proper location for the data. When blank pages get to be in short supply, the controller will identify a block whose pages have been mostly superseded by pages written more recently, copy all still-current pages from that block to blank blocks, and then erase the entire now-redundant block. All this logic is handled entirely by the card itself, without any intervention by the camera.

All this logic means that in addition to the FAT32 or other file system seen by the camera, the SD card will need to have its own block allocation and management system. Any problems that occur in that system are likely to cause data loss, regardless of what sort of system sits on top of it. In theory, many memory cards are designed to ensure that even if power is unexpectedly removed during some operation the card will be able to either roll back the state of the card to what it was before the operation began, or else run it to completion (if all the necessary data had been written, and the card was simply cleaning out redundant data). Unfortunately, cards differ in how well they implement such logic. If unexpected power loss clobbers the storage management tables of a card, software which understands the inner workings of such tables might be able to recover data which is invisible to any software that simply uses the sector-based read-write interface.

Personally, I think it would have been better for the SD Consortium to specify a file system independent of FAT32, or at minimum specify that even if a card had to be readable as a FAT32 volume, it should be written using a file-based communications protocol. A card which knows which groups of sectors are members of each file could optimize its defragmentation routines around that, and could also do a better job of protecting against data loss than could one which had to present the disk as a bunch of independent 512-byte sectors, but for better or for worse that's not how things are specified.

supercat
  • 451
  • 2
  • 7
  • I think there's already a standard solution: a block-remapping layer, with a standard filesystem (NTFS, HFS+, ext4) on top. And it's used in mobile as well, on Android. Camera OSs may be more primitive, but that needs to be fixed. – Kartick Vaddadi Jan 06 '14 at 06:09
  • @KartickVaddadi: The block-remapping layer is standard; my point was that if the memory card which implemented the block-remapping layer was at least somewhat cognizant of file-system layout, it could optimize the remapping layout more effectively than is possible without such knowledge. – supercat Jan 06 '14 at 07:40
  • Sure, but I'd prefer to take something tried and tested rather than come up with new interfaces between the block device layer and the filesystem. We're not talking CS research here :) I want to take something that works on my computer, and my phone, and put it on my camera. – Kartick Vaddadi Jan 06 '14 at 10:25
  • @KartickVaddadi: I've designed some wear-leveling flash file systems for embedded devices with various constraints. If the wear-leveling system is told "I want to write a file; here – supercat Jan 06 '14 at 17:41
  • ...here's the data; that's it. I want to write another file; here's the data; that's it", it can behave somewhat more intelligently than if it is simply given a bunch of individual sectors to work with and has no idea what they represent. Among other things, all the data blocks associated with each file could be marked with tags saying e.g. "block 347 of file id 193,291,374, update 273,837,199." – supercat Jan 06 '14 at 17:49
  • @KartickVaddadi: Having every block of a file marked with such tags could help avoid data loss. Having data blocks marked with logical sector numbers which have no relation to file allocations is far less helpful. – supercat Jan 06 '14 at 17:55
  • @KartickVaddadi: In a rush to beat the five-minute timer after I accidentally clicked "add comment" [and not quite succeeding] I neglected my main point, which actually goes beyond recovery issues: an API which was optimized for the usage patterns typical of camera applications could allow much faster and more consistent performance than one that has to support arbitrarily-sequenced 512-byte sector writes. For example, if one had most of the space formatted as 128K chunks, and required that a 1000K file be written as seven 128K chunks and 26 4K chunks... – supercat Jan 07 '14 at 16:32
  • ...then most of the flash wouldn't get fragmented with blocks containing a mixture of old and new data; all unused space would be consolidated in completely-blank blocks. Only when writing the last little bit of a file would finer allocation be required. – supercat Jan 07 '14 at 16:35
  • Yeah, I was thinking of http://www.networkcomputing.com/storage-networking-management/seagate-boosts-disk-drive-intelligence/240162976 – Kartick Vaddadi Jan 08 '14 at 01:57
1

Assuming the card was simply corrupted, and you haven't tossed it or overwritten it, I strongly suggest you try PhotoRec. (It got me out of a slightly less bad situation a few months ago. It even found a few images that had survived being deleted for a year or two.)

http://www.cgsecurity.org/wiki/PhotoRec

Regarding a journaling FS, I've had the same question many times. As others have said, current flash media actually is fragile compared to magnetic media, and journaling is hard on it. Since the usage pattern for cameras is generally take a bunch of photos, read them, then delete them all, there isn't much need for advanced FS features. Simple, tested implementations are probably more important than the marginal benefit of journaling. As an added benefit, the dumb allocation strategy of FAT makes it easier for tools like PhotoRec.

user25159
  • 19
  • 1
1

1, God cannot save you, if you physically lost the card. What do you mean you lost a card in Bali?

2, Journaled FSs are built for occasions like sudden OS-failure or sudden power-failure. They keep the FS meta-data consistent, when those bad things happen. They are not helping if you want your deleted files come back.

3, Bad-block is the most vital problem of the NAND FLASH based storages. Bad-blocks come up when writings occur. Hence, when choosing FS for a NAND FLASH storage, writing frequency is the first thing you should consider. Obviously, like all the others said, Journaled FSs bring more things to write.

4, Journaled FSs take more power, of course. More complicated, sure. But these are not the dominant reasons that we don't adopt them for NAND FLASH, I think.

TADA~~ That's it.

Garf
  • 11
  • 1
  • See my comment on AJ's answer. 2. I did not manually delete the files. 3. Like I wrote on the other comments, how do you explain Android's use of a journaled FS on flash? It's not as bad as you're making it out to be. Not losing photos is more important than a marginal reduction in card lifetime.
  • – Kartick Vaddadi Jan 06 '14 at 10:27
  • 3
    Most Journaled FSs need one or more daemon processes/threads to manage their "journals". (For an instance, kjournald in Linux for EXT3) It will be hard to adopt them if the env is not a full fledged OS, where we have no concept of process/thread. – Garf Jan 06 '14 at 13:41
  • @KartickVaddadi Again, please give a pointer to some research showing that a journaled file system produces only a "marginal" reduction in card lifetime. This is the second time you've asserted it. – Philip Kendall Jan 06 '14 at 21:52
  • Fair question, but keep in mind Android uses it, as I said many times already. They wouldn't have used it if causes a drastic reduction in the life of the media, would they? Besides, I can just as well ask you to cite research showing that it causes a drastic reduction in life :) – Kartick Vaddadi Jan 07 '14 at 06:30
  • Maybe we should just ask @supercat, since he's an expert, and neither of us have cited data. – Kartick Vaddadi Jan 07 '14 at 06:39
  • @KartickVaddadi: I know nothing of how Android's file system is implemented, but I would expect that a typical card may be viewed as being able to accommodate some certain total number of sector writes in its lifetime, and that the more aggressively a file system tries to ensure everything is always up-to-date, the more writes it would perform. I suspect, however, that most cards are replaced for reasons other than having exceeded the maximum number of sector writes. It's also worth noting that a camera's memory usage pattern will be very different from a phone's. – supercat Jan 07 '14 at 16:20
  • So, are you saying that a journaled filesystem on a camera will cause a negligible reduction in the file of the SD card? – Kartick Vaddadi Jan 08 '14 at 01:58