CHDK Wiki
Register
Advertisement


Attention

IMPORTANT: The content of this page is outdated. If you have checked or updated this page and found the content to be suitable, please remove this notice.

Notice

This article describes a low level method of using Linux to prepare large SD cards for use with CHDK on older cameras. Documentation on easier & more common methods is available here : Prepare Your SD Card


Image

Hi, I am fairly new to CHDK and even owning a camera but I like to consider myself fairly techy and when I do something I always try to do it the best way possible. I am also fairly cheap and because of that bought myself a $80 Canon A480 and with the money I saved on not buying an expensive camera I bought a more pricey SD (32GB) card so I could fit more photos with less fuss(if I only knew).

As I was new to CHDK I did not realise that only FAT16 formatted cards were supported as bootable media for CHDK. This was a major problem because, as anyone reading this page would probably already know, FAT16 has a maximun size of 4GB. Simply put, CHDK was now basically rendering my pricey 32GB SD card useless.

I only decided to make a page about it because it took me some time to find a solution to this issue and I wanted to make it a little bit easier for anyone else in the same situation in future. Consider it thanks for all the great features CHDK added to my el cheapo camera. ;)

What you will need:

  • A linux system (most should be fine, I used Ubuntu myself) [a simple method for Mac described here]
  • A Canon camera supported by CHDK
  • The appropriate CHDK version for your supported Canon camera
  • A SDHC card (over 4GB is advisable simply because it's not worth the fuss if it isn't)
  • A USB adapter for your SD card

Let's get started

  1. Boot up your Linux system
  2. Insert your USB SD card adapter
  3. Start Terminal


From here on I will quote terminal commands pretty much verbatim. Please note that my SD card was mounted as sdd but it may be different on your system and making changes like the following can be extremely harmful if done to the wrong disk. Backup any media you do this to before you start. I TAKE NO RESPONSIBILITY FOR ANY DAMAGE DONE BY FOLLOWING THIS GUIDE.

To determine where your SD card is mounted use: sudo fdisk -l

It will be the disk which has the same ammount of space as your SD card and should be pretty obvious that it is your SD card.

  1. sudo fdisk /dev/sdd
  2. o (create empty dos partition table)
  3. n,p,1,1,+10M , n,p,2,enter,enter (creates sdd1 and sdd2 as primary partitions - commas are enters; PS: the second 1 here, the start block number is not always 1, it can even be 2048, just the first block in your card. And I only use +1M, because the need files in the first patition only 436k in my case. So you can check the size of the three files to be copied in here and decide the size you need.)
  4. t,1,6 , t,2,b (changes sdd1 to FAT16 and sdd2 to FAT32)
  5. w (write changes to disk and exit)
  6. mkdosfs /dev/sdd1 (writes filesystem to partitions)
  7. mkdosfs -F32 /dev/sdd2 (writes filesystem to partitions)
  8. echo -n BOOTDISK | dd bs=1 count=8 seek=64 of=/dev/sdd1 (make sdd1 bootable)
  9. sfdisk -uS -N3 -f /dev/sdd
  10. enter <start> <#sectors> <id> of sdd1, in my case "62 12338 6" (creates sdd3 as a clone of sdd1)
  11. sfdisk --id /dev/sdd 1 5 (changes partition id of sdd1 to extended)
  12. mount /dev/sdd3 /mnt/usb -o uid=1000,gid=1000,flush (the /mnt/usb can be path, I just mkdir /mnt/usb for easy reach; you should adapt the uid and gid to your system.)
  13. Copy the DISKBOOT.BIN, PS.F12, vers.req into the mounted /mnt/usb/ (We need these three files in the bootable patition)
  14. umount /mnt/usb
  15. mount /dev/sdd2 /mnt/usb -o uid=1000,gid=1000,flush (see above for explanation)
  16. Copy the CHDK directory into the mounted /mnt/usb (Now the /mnt/usb should be the mounted large FAT32 patition)
  17. Make sure your card lock is in the locked partition so your card is bootable
  18. You should now have a bootable CHDK SD card which by default uses the large FAT32 partition for saving pictures


Note: if any of these commands don't work as I have specified you may need to add the word 'sudo' before the command. It may also prompt you for your administrator(root) password to continue.

Note: You do not need to install linux to do this. You can download a live iso for Ubuntu and a number of other distrobutions which you can burn as an image and use as a temporary instance of a linux operating system.

Advertisement