Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-21-2013, 09:11 AM   #1
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 6,614
Karma: 43654592
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
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:
Originally Posted by jlynton View Post
My request is for it to be possible to use an ext3 (or ext4) formatted microSD card, mainly to get around the file limitations in the images directory.
My initial reply:

Quote:
Originally Posted by PeterT View Post
Maybe one of the tweakers in the Kobo Developer's Corner could look into this. I have a gut feeling that what is needed is a change to the script used for mounting the SD card.

Quote:
Originally Posted by \usr\local\Kobo\uDev\sd
Code:
DEV="/dev/mmcblk1p1"

if [ "$DEV" == "$DEVNAME" ]; then
	if [ "$ACTION" == "add" ]; then
		dosfsck -a -w $DEVNAME
		mount -r -t vfat -o shortname=mixed $DEVNAME /mnt/sd
		if [ $? != 0 ]; then
#			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
		else
			echo sd $ACTION $DEVNAME >> /tmp/nickel-hardware-status &
		fi
	fi
fi
It looks like the ability to mount non FAT32 formats was there at one point, and has now been commented out.
More discussion:
Quote:
Originally Posted by tshering View Post
If one makes changes there, one might also consider adjusting usr/local/Kobo/udev/usb.
Quote:
Originally Posted by jlynton View Post
This looks interesting, is there an easy way to access these files (glo, without removing internal microSD card)?
Quote:
Originally Posted by tshering View Post
One way of modifying these files is by using the upgrade mechanism. Unpack the file "KoboRoot.tgz" from the FW update file, which you can find here ,and then unpack its (KoboRoot.tgz's) content. After modifying some files you can pack them again into "KoboRoot.tgz" (you have of course to preserve the path of each modified file, but there is no need to include all the other files). Copy then "KoboRoot.tgz" to the folder ".kobo" of the reader. After unplugging the reader, it will copy the content of "KoboRoot.tgz" to the system partition. Confer the paragraph "The Kobo upgrade mechanism" of "Hacking the Kobo Touch for DUMMIES". This part is valid for Glo too.
Word of caution: Preserve lower and upper case of file and path names (e.g. udev, not uDev).
If you mess things up, you might have to factory reset the reader. If you have a lot of annotations and highlights, you might consider making a back up of .kobo/KoboReader.sqlite.
Quote:
Originally Posted by jlynton View Post
Thanks, this looks like something I could try on my day off. I have looked at the two files usr/local/Kobo/udev/usb and usr/local/Kobo/udev/sd, both have the commented out section that PeterT refers to. I assume that one refers to the internal microSD cards FAT32 partition, and the other to the external microSD card, do you know which is which?
Quote:
Originally Posted by PeterT View Post
Actually I believe that the sd is used only for the mounting of the external sd card; note that it mounts the card on /mnt/sd. usb is used for when the device is attached to your PC.

/mnt/onboard appears to be used for the partition that is accessible to us normally, and /mnt/sd to the external SD card.

I think that this section
Quote:
Originally Posted by /usr/local/Kobo/udev/usb
Code:
	if [ -e $DEV ]; then
		mount -r -t vfat -o shortname=mixed $DEV /mnt/sd
#		if [ $? != 0 ]; then
#			mount -r $DEV /mnt/sd
#		fi
	fi
should be similar to the code in /usr/local/Kobo/udev/sd
PeterT is offline   Reply With Quote
Old 05-21-2013, 11:26 AM   #2
jlynton
Addict
jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.
 
Posts: 255
Karma: 125600
Join Date: Feb 2012
Device: aura
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
Then I should be able to mount an ext3 formatted microSD card?
jlynton is offline   Reply With Quote
Old 05-21-2013, 02:22 PM   #3
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 6,614
Karma: 43654592
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
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.
PeterT is offline   Reply With Quote
Old 05-22-2013, 02:09 AM   #4
jlynton
Addict
jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.
 
Posts: 255
Karma: 125600
Join Date: Feb 2012
Device: aura
If I understand correctly, you are saying that the line should read
Code:
mount -r -s $DEVNAME /mnt/sd
is that correct?
jlynton is offline   Reply With Quote
Old 05-22-2013, 03:13 AM   #5
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 5,172
Karma: 4850112
Join Date: Jul 2011
Location: Australia
Device: Kobo Touch, Kobo Glo
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.
davidfor is offline   Reply With Quote
Old 05-22-2013, 04:40 AM   #6
jlynton
Addict
jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.
 
Posts: 255
Karma: 125600
Join Date: Feb 2012
Device: aura
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.
jlynton is offline   Reply With Quote
Old 05-22-2013, 09:58 AM   #7
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 6,614
Karma: 43654592
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
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.
PeterT is offline   Reply With Quote
Old 05-22-2013, 10:11 AM   #8
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 5,172
Karma: 4850112
Join Date: Jul 2011
Location: Australia
Device: Kobo Touch, Kobo Glo
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.
davidfor is offline   Reply With Quote
Old 05-22-2013, 12:37 PM   #9
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 645
Karma: 2018502
Join Date: Jan 2013
Location: New Brunswick, Canada
Device: Kobo Glo
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.
jgoguen is offline   Reply With Quote
Old 05-22-2013, 12:37 PM   #10
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 6,614
Karma: 43654592
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
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.
PeterT is offline   Reply With Quote
Old 05-22-2013, 12:49 PM   #11
jlynton
Addict
jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.
 
Posts: 255
Karma: 125600
Join Date: Feb 2012
Device: aura
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...

Quote:
Originally Posted by jlynton View Post
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.
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 :-)
jlynton is offline   Reply With Quote
Old 05-22-2013, 01:58 PM   #12
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 645
Karma: 2018502
Join Date: Jan 2013
Location: New Brunswick, Canada
Device: Kobo Glo
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?
jgoguen is offline   Reply With Quote
Old 05-22-2013, 02:17 PM   #13
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 1,382
Karma: 2667033
Join Date: Nov 2012
Location: New Zealand
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
GeoffR is offline   Reply With Quote
Old 05-23-2013, 08:17 AM   #14
jlynton
Addict
jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.
 
Posts: 255
Karma: 125600
Join Date: Feb 2012
Device: aura
Quote:
Originally Posted by jgoguen View Post
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?
The kobo sw appears to run as root.
jlynton is offline   Reply With Quote
Old 05-23-2013, 08:23 AM   #15
jlynton
Addict
jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.jlynton reads for the sheer pleasure of reading.
 
Posts: 255
Karma: 125600
Join Date: Feb 2012
Device: aura
Quote:
Originally Posted by GeoffR View Post
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.
Yes, ext2 would be fine as well.

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 ;-)
jlynton is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 05:15 AM.


MobileRead.com is a privately owned, operated and funded community.