I'm trying to format my CF card for use in my DSLR (Canon 400D). Apparantly that's not an easy feat in Linux. Although I can't find anything about it on the interwebs, several people I've asked can't get this to work, either. To make sure it's not anything about the partition-table or CHS settings, I've first formatted the card in my camera. This works perfectly, and I'm able to take pictures on it, no error. I then use mkdosfs (or mkfs.vfat) with -F32 to format the (only) partition on the CF card. No errors here either, and Linux can mount, read and write the freshly formatted partition perfectly. When I then put the card in my camera however, it gives me an ERR CF: "There is a problem with your CF card. Please replace your card." I've tried several settings in -s or -S to set the clustercount equal to the FS the camera put on it, unfortunately to no avail. GParted give the same results. Is anyone able to get this to work, and if so, how do you do it? Any tips or hints where to search for a solution are great, too. PS: "Just format the card in the camera", however logical to you, is not the answer I'm looking for, else I wouldn't have spent hours on this problem already.
Just forma-- oh, never mind... Argh. OK. I have to ask. Why don't you just format the card in your camera? Most OS's format the clusters in different sizes depending on the detected volume size. I don't know about Linux but Windows will select a cluster size from 2KB to 64KB depending on the capacity of the CF card. I don't know if the Embedded OS in the Canon is compatible for all those cluster sizes but some photography forums suggest not. This seems to correspond to some extent with Wikipedia: What capacity is your CF card?
I'm creating a guide to hide data in fake bad-blocks in a filesystem. This is an excellent way to hide data on a card in your camera, without having to worry of a photo overwriting your hidden data. So obviously I can't format the card in the camera, without losing the bad-blocks data, and risking overwriting anyway.
It's 256MB, but the camera formats it as F32, so no problems there. I've already tried the cluser-size route, as it's the only metadata I can get about the filesystem created by the camera (camera FS). I used -s and -S to make the filesystem have the same amount of clusters as the camera FS, which, because both FS's were the same size, should equalize the cluster-size, but this did not solve the problem. I wish Linux had a command to literally get all metadata about a FAT FS. Added: A friend linked me to this summary of FAT, I'll use that and a hexeditor to get the metadata.
Canon may be weird. I connect my Panasonic USB, switch on, Vista spots the card and offers to copy the latest photos over to the PC no problem. With the Canon, zilch. I have to navigate with Explorer down to the right subfolder and copy manually or use the dreadful Canon software.
These are my findings: Bytes per sector: 2 (!) Sectors per cluster: 8 Reserved sectors: 256 FAT Copies: 2 Root Directory Entries: 2 (!) Numbers of sectors per track: 8192 Number of heads: 4096 Hidden sectors: 8192 --------------------------------- Total number of sectors: 117489422 Sectors per FAT: 687898624 (!) The settings under the line are obviously related to the card size so not really important. The settings annotated with (!) are fishy: Bytes per sector: 2 (!) -> Fishy, because that's too low for FAT specifications. The minimum is 512, which is also the minimum mkdosfs uses, so one can't actually create a FS with 2bps using mkdosfs. This number is probably correct because the total number of sectors is set to 117489422, which equals 224MB, give or take, which is kinda close to 256MB capacity. Root Directory Entries: 2 (!) -> Fishy, because this would mean only 2 files or folders in the root directory are possible. The FAT specified standard values are 112 for floppy drives and 512 for hard disks. Again, mkdosfs wouldn't accept 2, so I had to use 512. Edit: I've since learned this is not applicable to FAT32 Using these settings, including the "fixed" ones, I executed this command: Code: mkdosfs -f2 -F32 -h8192 -nCANON_EOS -r512 -R256 -s8 -S512 -v /dev/sdd1 Which creates an FS that is again, not usable by the camera. Apparantly, the camera is really sensitive to that 2bytes-per-sector setting.