TLDR: (I found the book)
The .metadata file was blank! I copied another epub's .metadata file and renamed the title!
Read below for the full writeup!
My epub book disappeared along with all of my notes and tags.
Two things that were happening when I lost the book:
- tablet ran out of battery while viewing the book
- I had added over 200 tags to the ebook also I added 3 new pages
- Learn how to ssh into remarkable2: https://remarkable.guide/guide/access/ssh.html
- remarkable2 uses a busybox linux distro.
- search for where the find command is located to find what is installed on this on this box: "find / -name find"
find / -name '*Programming*'
- I was searching for a folder name but this (Did not work).find / -name '*.pdf'
- returned some pdf results (8 results).
a. looking at that folder all of the files have this content.
fa438554-9ce8-427e-86d3-bf906fcdeed9
fa438554-9ce8-427e-86d3-bf906fcdeed9.content
fa438554-9ce8-427e-86d3-bf906fcdeed9.local
fa438554-9ce8-427e-86d3-bf906fcdeed9.metadata
fa438554-9ce8-427e-86d3-bf906fcdeed9.pagedata
fa438554-9ce8-427e-86d3-bf906fcdeed9.pdf
fa438554-9ce8-427e-86d3-bf906fcdeed9.thumbnails
fbca10b7-5d30-4278-81ed-9cf767bdd3ab.tombstone
-
use
scp
to copy those files back to my mac to look at these pdfs. -
search for ebooks next.
a.find / -name '*.epub' | rev | cut -c 5- | rev | xargs -I {} echo {}content | xargs cat
b.find / -name '*.epub' | rev | cut -c 5- | rev | xargs -I {} echo {}content
-
use scp to copy the epub back to the mac computer.
-
It worked and I was able to find the epub ... and also my notes from the thumbnail sections as pngs.
-
Time to figure out how remarkable or the android software connects with these hashes
a.maybe I can add back the entry that somehow got removed
b.find / -name remarkable
c./.config/remarkable/ -
go back to comparing the good and bad ebook files: a.
find / -name '*.epub'
/home/root/.local/share/remarkable/xochitl/5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.epub
/home/root/.local/share/remarkable/xochitl/3b3b7668-63b5-4dc1-9cf1-5505e63a1735.epub
- make a tmp folder and move the two epubs to the same folder for comparison:
{
cd ~;
mkdir tmp;
cd /home/root/.local/share/remarkable/xochitl;
cp -rf 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c* 3b3b7668-63b5-4dc1-9cf1-5505e63a1735* ~/tmp
cd ~;
}
ls
on one line to visually compare:ls -l
drwxr-xr-x 2 root root 4096 Nov 16 20:36 3b3b7668-63b5-4dc1-9cf1-5505e63a1735
-rw-r--r-- 1 root root 300485 Nov 16 20:36 3b3b7668-63b5-4dc1-9cf1-5505e63a1735.content
-rw------- 1 root root 20638998 Nov 16 20:36 3b3b7668-63b5-4dc1-9cf1-5505e63a1735.epub
-rw-r--r-- 1 root root 74474 Nov 16 20:36 3b3b7668-63b5-4dc1-9cf1-5505e63a1735.epubindex
-rw-r--r-- 1 root root 4 Nov 16 20:36 3b3b7668-63b5-4dc1-9cf1-5505e63a1735.local
-rw-r--r-- 1 root root 423 Nov 16 20:36 3b3b7668-63b5-4dc1-9cf1-5505e63a1735.metadata
-rw-r--r-- 1 root root 654 Nov 16 20:36 3b3b7668-63b5-4dc1-9cf1-5505e63a1735.pagedata
-rw-r--r-- 1 root root 35561442 Nov 16 20:36 3b3b7668-63b5-4dc1-9cf1-5505e63a1735.pdf
drwxr-xr-x 2 root root 4096 Nov 16 20:36 3b3b7668-63b5-4dc1-9cf1-5505e63a1735.thumbnails
drwxr-xr-x 2 root root 4096 Nov 16 20:36 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c
-rw-r--r-- 1 root root 511784 Nov 16 20:36 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.content
-rw------- 1 root root 3318995 Nov 16 20:36 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.epub
-rw-r--r-- 1 root root 13640 Nov 16 20:36 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.epubindex
-rw-r--r-- 1 root root 4 Nov 16 20:36 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.local
-rw-r--r-- 1 root root 419 Nov 16 20:36 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.metadata
-rw-r--r-- 1 root root 629 Nov 16 20:36 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.pagedata
-rw-r--r-- 1 root root 5155189 Nov 16 20:36 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.pdf
drwxr-xr-x 2 root root 40960 Nov 16 20:36 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.thumbnails
- using cat on each of the file I spotted that the missing book had an empty .metadata
cat tmp/5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.metadata
cat tmp/3b3b7668-63b5-4dc1-9cf1-5505e63a1735.metadata
- Notice that the metadata file has a parent node that points to the folder it is located in the only other value that looks to matter in the metadata file is the title.
cat tmp/3b3b7668-63b5-4dc1-9cf1-5505e63a1735.metadata
{
"createdTime": "0",
"deleted": false,
"lastModified": "1680157688028",
"lastOpened": "1700161533461",
"lastOpenedPage": 32,
"metadatamodified": true,
"modified": true,
"parent": "7fa2cefb-1bce-43cf-a74d-685f5ce2d6b5",
"pinned": false,
"synced": false,
"type": "DocumentType",
"version": 0,
"visibleName": "Graphic Design Rules: 365 Essential Design Dos and Don’ts"
}
- get the title of the book using cat on the content file:
cat tmp/5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.content | grep title
- copy the other metadata file to get the right info pointing to the same parent folder as the other ebook.
cp tmp/3b3b7668-63b5-4dc1-9cf1-5505e63a1735.metadata tmp/5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.metadata
- modify the metadata file using vim to have the new title name: (may not be required.)
vi tmp/5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.metadata
<ESC>:wq<ENTER>
to save out of vim.
{
"createdTime": "0",
"deleted": false,
"lastModified": "1700165291499",
"lastOpened": "1700165121073",
"lastOpenedPage": 422,
"metadatamodified": true,
"modified": true,
"parent": "7fa2cefb-1bce-43cf-a74d-685f5ce2d6b5",
"pinned": false,
"synced": false,
"type": "DocumentType",
"version": 0,
"visibleName": "Property-Based Testing with PropEr, Erlang, and Elixir"
}
- update the original file with this tmp file we just created:
cd /home/root/.local/share/remarkable/xochitl;
cp ~/tmp/5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.metadata 5c5d7efe-02e2-4d2a-8072-2bbde1abd43c.metadata;
cd ~;
- Go back to the tablet. Restart your remarkable2 from the general tab in settings just to be safe.
- Look for your book and it should now exist with all your notes back!
- At this point I downloaded the book back on my computer just to be safe. I use the USB web interface. With the download succeeding I recieve a pdf with my notes intact!
If you know anything about remarkable 2, feel free to chime in with any comments and questions.
Being an outsider of the company I know nothing currently of most of this works under the hood.
Cheers! Michael Dimmmitt
TODO; (write scripts to make this easier for people)
These will be 3 separate scripts, the 3rd one will use the output from the first two.