Fat Filesystem On Ext Device?


bmadgett

Still Fresh
Joined
Jun 28, 2006
Messages
4
Hi all,

First post here... so be gentle :p

Got my BOB yesterday to go with my mk2 GP2X. I have a slightly (I think) unusual plan to use it while travelling as a means of allowing me to copy pictures off my CF cards via a USB card reader and onto an external (self-powered) USB hard drive. I've done this before using a laptop but really need to cut back on hand luggage weight for the flights, hence a GP2X is vastly lighter weight... I use external USB drives rather than one of these combined card reader/hard drives because those tend to be a: expensive and b: small in capacity (I'm looking at needing 400Gb for a 4 week trip, yes, I take lots of pictures).

Anyway, I've got the card reader recognised via the BOB and it can read off the CF card fine, but only when the CF card is formatted FAT32. Sadly my camera (Canon 20d if anyone's interested) will format any card smaller than 2Gb in FAT and only uses FAT32 for cards bigger than that (my cards are all 1Gb). If I put a FAT-formatted card in the reader, the GP2X won't recognise it :(

So, is there any way to patch things so that I can read from FAT-formatted cards via the BOB / EXT? I don't mind if it involves some scripting hackery, manual mounts or something, doesn't have to work "out of the box" - just as long as I can get it to work _somehow_ (and reliably).

The alternative is formatting all the cards as FAT32 via Windoze and using them in the camera like that, but then if I format on-camera (to wipe clean) it goes back to FAT... and I'd be stuffed if I didn't have a laptop with me to reformat back to FAT32.

Hope some of that made sense. Any thoughts on getting FAT working via BOB / EXT?

Cheers!

Barns
 
Hi all,

First post here... so be gentle :p

Got my BOB yesterday to go with my mk2 GP2X. I have a slightly (I think) unusual plan to use it while travelling as a means of allowing me to copy pictures off my CF cards via a USB card reader and onto an external (self-powered) USB hard drive. I've done this before using a laptop but really need to cut back on hand luggage weight for the flights, hence a GP2X is vastly lighter weight... I use external USB drives rather than one of these combined card reader/hard drives because those tend to be a: expensive and b: small in capacity (I'm looking at needing 400Gb for a 4 week trip, yes, I take lots of pictures).

Anyway, I've got the card reader recognised via the BOB and it can read off the CF card fine, but only when the CF card is formatted FAT32. Sadly my camera (Canon 20d if anyone's interested) will format any card smaller than 2Gb in FAT and only uses FAT32 for cards bigger than that (my cards are all 1Gb). If I put a FAT-formatted card in the reader, the GP2X won't recognise it :(

So, is there any way to patch things so that I can read from FAT-formatted cards via the BOB / EXT? I don't mind if it involves some scripting hackery, manual mounts or something, doesn't have to work "out of the box" - just as long as I can get it to work _somehow_ (and reliably).

The alternative is formatting all the cards as FAT32 via Windoze and using them in the camera like that, but then if I format on-camera (to wipe clean) it goes back to FAT... and I'd be stuffed if I didn't have a laptop with me to reformat back to FAT32.

Hope some of that made sense. Any thoughts on getting FAT working via BOB / EXT?

Cheers!

Barns

One thing you might want to try.

If the CF reads when formated fat32 and the camera doesn't have a problem storing the pictures on the card. I would (if I were you) use the file explorer on the gp2x to transfer and then delete the pictures off the card. That way you wont have to format the card to wipe it clean.

Another way you could get the pictures off is to write a small script that finds all pictures on the CF card and moves them to the HD.

Fat sd cards used to work in the earlier firmwares either the ability has been removed or the automounter for the ext port isn't setup to use fat formated junk if its not setup you could in theory run this command in a script "mount -t fat16 /dev/whatever/the/device/is/called /mnt/ext"

hope that helps
 
Last edited by a moderator:
One thing you might want to try.

If the CF reads when formated fat32 and the camera doesn't have a problem storing the pictures on the card. I would (if I were you) use the file explorer on the gp2x to transfer and then delete the pictures off the card. That way you wont have to format the card to wipe it clean.

Another way you could get the pictures off is to write a small script that finds all pictures on the CF card and moves them to the HD.

Fat sd cards used to work in the earlier firmwares either the ability has been removed or the automounter for the ext port isn't setup to use fat formated junk if its not setup you could in theory run this command in a script "mount -t fat16 /dev/whatever/the/device/is/called /mnt/ext"

hope that helps

That sounds like I have a few things I can work on at least. Ideally I'd like to be able to format the cards in the camera (or at least have that option) - I've historically found them more reliable that way rather than just deleting files off (fragmentation maybe? dunno). But that manual mount command is worth trying - having a little util script that mounts a CF card and copies its contents across to an external HD would be just dandy.

Thanks for your help, I'll let you know how I get on.

Barns
 
Last edited by a moderator:
Fragmentation shouldn't be a problem if you delete most/all of the files each time; it only happens when the filesystem has to place files around other files. Also, on a flash card, fragmentation isn't as big of a deal anyway, since there's very little penalty for seeking to a different spot (no moving parts).
 
Fragmentation - I must admit it was a previous camera that used to have problems with cards when files were deleted rather than reformatted, I think it assumed some sort of clean structure but ended up corrupting the FAT, or something. All I know is that formatting in-camera is quick, easy, and safe :)

Mounting the FAT cards - had a play around for a bit last night and there are strange things going on. The following script works :

--------
fdisk -l /dev/sdb
mount -t vfat /dev/sdb1 /mnt/ext >mount.out 2>mount.err

# return to the menu screen
cd /usr/gp2x
exec /usr/gp2x/gp2xmenu
--------

A few things to note :

i) I ended up with '-t vfat' rather than '-t fat16'. I was having various problems, saw somewhere else recommending vfat, was trying that option when it worked, so it's stuck with that. Don't know the difference between vfat and fat16 options... do I need to worry?

ii) The weird use of fdisk there. If you don't do the fdisk (which is just listing the partitions) then the mount will always fail. Once you've done one fdisk, mount "spots" the disk just fine. Very very strange, almost like fdisk is doing something that prods it into life. Took me ages to find this hack by accident, no mounts I was trying beforehand were working.

iii) If you whip the compactflash card out of the reader whilst still mounted, the GP2X doesn't spot it and will in fact still let you load files off it via explorer, photo viewer etc - I'm assuming that's because there's some sort of filesystem caching going on. In fact even if you put a new card in, it doesn't spot it's changed unless you run the mount script again.

My plan is to change this script so that it mounts the card, copies its contents across to the external hard disk (assuming I get that working - not tried it yet), and dismounts when it's finished.

Hope this proves helpful to others in the future, would be much nicer if someone figured out how to get the auto-mounting of EXT devices working with FAT cards though!

Cheers

Barns
 
I noticed on one computer that it wouldn't update a card reader's partition table unless you actually read it first, that's probably what's happening with the mysterious fdisk requirement.
 
Back
Top