Score:0

Access an e-reader via USB on the command-line

es flag

I have a Likebook Mars e-reader. When I plug it into my laptop with a USB cable, it appears in PCManFM-Qt, and I can access the files on it graphically from there:

A screenshot of PCManFM-Qt with "Likebook T80D" in the sidebar

That works okay. What I want to do is browse, read, and write files on the command line with cd, ls, cp, etc. But the e-reader doesn't seem to be reachable via anywhere I can cd to in the real filesystem (even if I've already looked at some of the files in PCManFM-Qt, which in other cases seems to be necessary). Having looked at the question How to access a usb flash drive from the terminal?, I tried lsblk, but the e-reader doesn't seem to be listed:

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
nvme0n1     259:0    0 953.9G  0 disk 
├─nvme0n1p1 259:1    0   300M  0 part /boot/efi
├─nvme0n1p2 259:2    0 653.6G  0 part /
├─nvme0n1p3 259:3    0    16M  0 part 
└─nvme0n1p4 259:4    0   300G  0 part /media/hippo/A4A60CCCA60CA142

df provides no hints, either:

Filesystem      Size  Used Avail Use% Mounted on
tmpfs           1.6G  1.9M  1.6G   1% /run
/dev/nvme0n1p2  643G  240G  371G  40% /
tmpfs           7.6G     0  7.6G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
/dev/nvme0n1p1  300M   33M  267M  11% /boot/efi
tmpfs           1.6G   92K  1.6G   1% /run/user/1000
/dev/nvme0n1p4  300G  154G  147G  52% /media/hippo/A4A60CCCA60CA142
user535733 avatar
cn flag
Are there any mounts under `/run/user/<your_UID>/`? For example, `/run/user/1000/gvfs` is where Nautilus puts mounts for my user.
Kodiologist avatar
es flag
@user535733 Bingo. Looks like it shows up as `/run/user/1000/gvfs/mtp:host=Boyue_Likebook-T80D_CNBT80D20200601412`. Thanks.
Kodiologist avatar
es flag
@guiverc Yes, the PCManFM in question is PCManFM-Qt. I don't think the old version is often used these days.
guiverc avatar
cn flag
`pcmanfm` is a different program (https://packages.ubuntu.com/kinetic/pcmanfm) to `pcmanfm-qt` used by LXQt/Lubuntu (https://packages.ubuntu.com/kinetic/pcmanfm-qt). Yes the GTK2 program is used a lot (server users with LXDE added commonly), but not by Lubuntu. They are not the same application. Lubuntu doesn't use *deprecated* GTK2 apps.
Kodiologist avatar
es flag
I see, I'd thought that "PCManFM" would be unambiguous by this point. I've edited the question text.
Score:2
es flag

As hinted in the comments by user535733, plugging in the e-reader creates a directory in /run/user/`id -u`/gvfs for the e-reader's filesystem. The name of the new directory (mtp:host=Boyue_Likebook-T80D_CNBT80D20200601412 in my case) seems to be consistent for a given device, even after the host machine reboots.

The underlying protocol here seems to be Media Transfer Protocol (MTP), as opposed to the more familiar USB mass storage.

BaTycoon avatar
mm flag
MTP was the same headache I had with my Kindle Paperwhite; Did you find a software solution to browse, read, and write files?
Kodiologist avatar
es flag
@BaTycoon I'm not sure I understand your question. My answer here describes how to find a directory that corresponds to the device filesystem. You can then use whatever file manager you like with it.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.