View Single Post
Old 07-16-2021, 05:10 PM   #1
Cootey
Absentminded Reader
Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.Cootey ought to be getting tired of karma fortunes by now.
 
Cootey's Avatar
 
Posts: 1,339
Karma: 7440829
Join Date: Apr 2017
Device: Kobo Mini, Libra Colour & Elipsa; Kindle Paperwhite 3 & 4; iOS apps
How to backup your Kobo on a Mac

I backup my Kobo for two reasons: 1) Peace of mind and 2) Creating a clean backup before experimenting with third party scripts & apps. I’m not a dev, but I know my way around the Mac Terminal, so I thought I’d share what I learned here for others. Thanks to everybody’s helpful feedback.

There are two ways to backup your Kobo. The first is the simplest and quickest. It's perfect for keeping an up to date backup available on your hard drive. The second is the total disk image—a complete clone of your Kobo. It’s the most thorough, but it is also the most time consuming and complicated. It's also overkill for typical backup needs.

When you plug your Kobo into your Mac, only the KOBOeReader partition mounts. There are two other hidden Linux partitions as well, but the Kobo only allows KOBOeReader to mount. This is fine if you just want a backup of your personal data, but if you want a complete clone of your Kobo internal memory, skip over this first part.

A) Backing Up Your Personal Data - Simple & Quick

1) Decide where you want to store your backup. Create a folder there with a memorable name. For example, I might label mine “KoboElipsa_2021-07-26”, but “KoboBackup” or something like that works as well.

2) Open a Terminal shell (/Applications/Utilities/Terminal.app) and type the following, but don’t hit “return”:

Code:
cp -Rvp /Volumes/KOBOeReader/
In the Finder, drag your backup folder over the Terminal window and drop it. Its path will autofill for you. It should look something like "cp -Rvp /Volumes/KOBOeReader/ /Volumes/Drive/path/backupfolder/".

“cp” will copy the contents of your Kobo’s public partition, recursively (-R) drilling down through folders to find all the files, preserving (-p) their times, dates, etc., and mirroring back everything it is copying to the Terminal (-v, verbose mode). You can leave the “v” off the command if you aren’t interested in seeing all the files stream by.

And that’s it! Your Kobo’s database, ebooks, and other personalized items will be safely backed up. You’ve created an exact backup of your Kobo’s public partition.

3) If you should ever need to restore your Kobo from the backup, type this into the terminal:

Code:
rsync -av --delete --progress /Volumes/Drive/path/backupfolder/ /Volumes/KOBOeReader/
“Rsync” will synchronize your Kobo to match the backup. Use “rsync” here instead of “cp” to remove any new misconfigured files or corrupted databases that could be causing problems since you last backed up. Obviously, change the path and folder name above to match your own. You could type the first part into Terminal, then drag & drop your backup folder onto the Terminal, then do the same for your Kobo to autofill the Unix paths for you.

✧ ✧ ✧


B) Creating a Total Disk Image of Your Kobo – Time Consuming & Complicated


As mentioned before, Kobo hides its Linux partitions from the Mac when mounting the Kobo to the Desktop. To create a clone of the full disk image on your Mac, please follow these steps:

1) To access your Kobo’s internal SD card, turn off your Kobo, then remove the back. At this point, I will refer you to Youtube or other threads where the specifics for disassembling your Kobo are discussed.

2) Remove the SD card from its socket and plug it into a USB card reader connected to your Mac. The Linux partitions are still hidden, but they are now accessible to your Mac.

3) Open a Terminal shell (/Applications/Utilities/Terminal.app) and type the following, then hit "return":

Code:
diskutil list
Look to see which disk number is assigned to KOBOeReader just above and to the left of its name. It might look something like /dev/disk4. From now on, I will refer to it as diskX, with "X" representing the drive number your individual Mac gave to your Kobo.

4) Next, we need to unmount the Kobo through the Terminal without ejecting it. Type the following, then hit "return":

Code:
diskutil unmountDisk diskX
If it is successful, you will see the following message:

Code:
Unmount of all volumes on diskX was successful
3) Now we are ready to create a backup disk image of your Kobo's entire SD card. Think of where you want to store your backup disk image and what you'd like to call it. Type the following, BUT DO NOT HIT “RETURN” YET:

Code:
sudo dd if=/dev/diskX of=
In the Finder, drag and drop the folder of where you want the disk image to be stored onto the Terminal window. It's Unix path will be autofilled in for you. Then type the archive name that you’d like at the end of the path, leaving no spaces between the "/" and your filename. Mine looked like this:

Code:
sudo dd if=/dev/disk4 of=/Volumes/Raven\'s\ Whim/Crypt/KOBOeReader/KOBOeReader-2021-07-16.dmg
(Wondering what this does? "sudo" means "super user do", and it will prompt you for your password, then give "dd" full access to the entire Kobo volume. "dd" means "Data Definition", and it's a geeky reference to an old IBM command. Basically, it clones your Kobo volume exactly—even the unused space. "if" means "input file" and "of" means "output file".)

Now hit "return". You will be prompted for your password. Once it is accepted, go catch a movie. This will take quite some time as it is making an exact copy of your Kobo's SD card bit by bit, including the two hidden Linux partitions. dd doesn't give any feedback, unfortunately, but expect 2-4 hours.

(There is are two ways get dd to give you progress updates, but one requires interrupting the process, and the other requires homebrewing your Mac, which is outside the scope of this tutorial. If there's interest, I'll post more details in a comment.)

4) Once dd does its thing (you'll see a final report and be returned to the prompt >), you can safely detach your Kobo from your Mac. You now have an exact duplicate of your Kobo on your Mac.

With compression, my 128GB SD card created a 127.3GB disk image. The larger the SD card on your Kobo, the longer this process will take. It's slow, but extremely thorough. Double clicking on the disk image will mount it as if it is your actual Kobo.

5) In the event you need to restore your Kobo’s entire disk image, connect your Kobo to the Mac and use "diskutil list" in Terminal to see which disk number has been assigned to your Kobo. Then type "diskutil unmountDisk diskX" in the Terminal to prepare your Kobo for the final step. Type the following into Terminal:

Code:
sudo dd if=/path/backup_disk_image.dmg of=/dev/diskX
Replace "path" and "backup_disk_image.dmg" with the actual path and filename of your backup. You can use the drag and drop technique with Finder if you’d like. Don't forget to change "diskX" to reflect your Kobo's drive number. Then hit return. This will also take a long time, so be patient. When it is finished, your Kobo will be an exact clone of the backup.

I hope this has been helpful.

Last edited by Cootey; 07-27-2021 at 04:28 AM.
Cootey is offline   Reply With Quote