05-21-2013, 09:11 AM | #1 | |||||||||
Grand Sorcerer
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
Hacking SD card file system
After some discussions got started over in the Upgrade thread on changing the SD card to a different format than the default FAT32 I thought I would move the discussion over here.
Original request: Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||||||
05-21-2013, 11:26 AM | #2 |
Evangelist
Posts: 414
Karma: 216544
Join Date: Feb 2012
Device: Kobo Clara HD, Moaan Inkpalm 5.
|
While I am a seasoned Linux user, I am merely a toddler when it comes to coding. Would I be right to assume that if I removed the comments from
Code:
# mount -r $DEVNAME /mnt/sd # if [ $? != 0 ]; then echo sd mount fail $DEVNAME >> /tmp/nickel-hardware-status & # else # echo sd $ACTION $DEVNAME >> /tmp/nickel-hardware-status & # fi |
05-21-2013, 02:22 PM | #3 |
Grand Sorcerer
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
I believe so; the advice would be to make the changes in both the sd and usb scripts. Possibly some "smartness" could be added by seeing if the file -s command on the raw device works; from my reading file -s $DEVNAME should identify the file system type, and would allow selective running of the correct fsck command.
|
05-22-2013, 02:09 AM | #4 |
Evangelist
Posts: 414
Karma: 216544
Join Date: Feb 2012
Device: Kobo Clara HD, Moaan Inkpalm 5.
|
If I understand correctly, you are saying that the line should read
Code:
mount -r -s $DEVNAME /mnt/sd |
05-22-2013, 03:13 AM | #5 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I don't think that is what Peter means.
From the code, it is attempting to mount the SD card as FAT32. If that fails, it gives an error. The commented out lines attempt to mount the SD card without specifying a file system type. I think Peter is suggesting running a command to test the file system and from that deciding the parameters for the mount command. There is a good chance that simply uncommenting the lines will work. The file system type is optional for the mount command as it can determine this if the appropriate file systems are available to it. I would expect a SD card formatted with ext3 or ext4 to work. But NTFS or HFS probably wouldn't. Or, as you know what file system you formatted the card with, you can add the appropriate parameter to second mount command. In any case, the test won't damage anything so long as you are prepared to do a factory reset to get the device working again. |
05-22-2013, 04:40 AM | #6 |
Evangelist
Posts: 414
Karma: 216544
Join Date: Feb 2012
Device: Kobo Clara HD, Moaan Inkpalm 5.
|
Thank you both, David and Peter, for your help and suggestions.
I will try to uncomment the lines on both files (usr/local/Kobo/udev/usb and usr/local/Kobo/udev/sd), and use an ext3 formatted microSD sometime this weekend. I will then report back as to how it goes. |
05-22-2013, 09:58 AM | #7 |
Grand Sorcerer
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
One thiong I'm wondering about, and unfortunately, don't have enough knowledge to answer.
If the SD card IS in ext2 / ext3 / ext4 format, will it be accessible via the PC when connected via USB? I've got a gut feeling that the answer is NO. If that IS the case it kind of makes the whole exercise moot. |
05-22-2013, 10:11 AM | #8 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
It will depend on the OS running on the PC. A Linux system should have no problem. A Windows system won't read it. But, there are installable ext3/ext4 file systems available for Windows. I haven't tried one for a while. I don't know what a Mac would do, but my guess would be either native support or easily added.
|
05-22-2013, 12:37 PM | #9 |
Generally Awesome Person
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
|
For OS X, the only option I'm aware of is installing OSXFUSE and its ext2 module. For Windows, ext2fsd but I think that defaults to read-only support and doesn't support ext3/4 journaling.
|
05-22-2013, 12:37 PM | #10 |
Grand Sorcerer
Posts: 12,160
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
So that means that while it is likely possible that we can make the external SD card into a different file system type that for most users it will not be worthwhile; Windows will not recognize it which means neither Kobo desktop or calibre will either.
|
05-22-2013, 12:49 PM | #11 |
Evangelist
Posts: 414
Karma: 216544
Join Date: Feb 2012
Device: Kobo Clara HD, Moaan Inkpalm 5.
|
Ok, I have bitten the bullet (and missed my siesta), and can report a complete success!
To clarify, I do use Linux on my desktop (and everywhere else!). I did as I said I would... The only (small) hiccup was that I had to change the microSD card's permissions to make it read/write to me before calibre would see the card. Otherwise there were no problems, and as far as I can tell everything is working perfectly :-) |
05-22-2013, 01:58 PM | #12 |
Generally Awesome Person
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
|
Wouldn't you also need the filesystem to be world-writable? So that the cover images can be written and the database updated? Or does the Kobo software run as root?
|
05-22-2013, 02:17 PM | #13 |
Wizard
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
Nice work, it is good to know this option is available if Kobo don't come up with a better way to store cover images by the time I reach the FAT limit.
I don't use Windows so haven't tried it, but according to Wikipedia Ex2IFS will allow mounting a read/write ext2/3 filesystem in Windows. Edit: Journaling support is not necessary anyway, FAT doesn't have a journal so you don't lose anything by formatting the card ext2 without a journal. Last edited by GeoffR; 05-22-2013 at 02:28 PM. Reason: fix url |
05-23-2013, 08:17 AM | #14 |
Evangelist
Posts: 414
Karma: 216544
Join Date: Feb 2012
Device: Kobo Clara HD, Moaan Inkpalm 5.
|
|
05-23-2013, 08:23 AM | #15 | |
Evangelist
Posts: 414
Karma: 216544
Join Date: Feb 2012
Device: Kobo Clara HD, Moaan Inkpalm 5.
|
Quote:
Everything is still working beautifully, with the added bonus that calibre to glo transfers seem to be about 2X faster, and even the browsing of shelves etc. withing the glo seems a bit snappier. EXT2IFS would be a possibility for windows users, but a real solution would be to ditch M$ and use Linux instead ;-) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
kindle 3 hardware hacking (micro usb & sd card) | damaru | Amazon Kindle | 5 | 03-16-2012 08:19 AM |
360 Pocketbook 360 and SD card file system error | readerreader | PocketBook | 2 | 08-29-2011 12:10 AM |
K2 system file access | dwallbaum | Amazon Kindle | 2 | 09-08-2010 04:32 PM |
File System Information | Adam B. | iRex | 0 | 10-29-2008 08:46 AM |
how to clean more disk space in root file system to upgrade system | chinaet | iRex | 1 | 12-18-2006 03:54 PM |