|
|
Thread Tools | Search this Thread |
06-01-2021, 01:06 AM | #1 |
Enthusiast
Posts: 36
Karma: 10
Join Date: Feb 2017
Device: Kobo Aura H2O
|
Working Around Kobo Libra H2O Mounting as Root When Hotplugged
Some versions ago, the way Gnome/Linux loads hotplugged USB devices changed so the drives are owned by root when they're mounted automatically. The problem with this is that I can't copy files to my Kobo without doing so as root. As I typically use Calibre to do this, I have to run Calibre as root so it has the ability to write to the Kobo (mounted as a USB device) to copy my many side-loaded books. (I confirmed that this works with Calibre when it's running as root, just to be sure this is the problem.) I could probably hard-code the UUID in fstab/ or some such as a dirty hack to fix it, but that's not portable (I'd have to recreate it in every copy of fstab across multiple devices) and would be annoying to set up in the first place.
Is there any way to make a hotplugged Kobo load as my user (or some specific user) or at least with the files have r/w global permissions so that I could copy files while running Calibre as my user? I'm running Ubuntu 20.04 with Gnome 3.30+2. |
06-01-2021, 02:46 AM | #2 |
Absentminded Reader
Posts: 1,287
Karma: 6916983
Join Date: Apr 2017
Device: Kobo Mini, Libra Colour & Elipsa; Kindle Paperwhite 3 & 4; iOS apps
|
Working Around Kobo Libra H2O Mounting as Root When Hotplugged
Have you tried creating a mount point for it, then setting your user as owner? I’m mostly a Unix/Darwin user, but I was just dealing with a similar issue yesterday on my rPi and found the first part of this page helpful:
Code:
sudo mkdir /mnt/kobo sudo chown -R pi:pi /mnt/kobo sudo chmod -R 775 /mnt/kobo sudo setfacl -Rdm g:pi:rwx /mnt/kobo sudo setfacl -Rm g:pi:rwx /mnt/kobo Obviously, call the mount point whatever you want. Sent from my iPhone using Tapatalk Pro |
Advert | |
|
06-01-2021, 03:55 AM | #3 | |
Grand Sorcerer
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
|
|
06-01-2021, 09:19 AM | #4 |
the rook, bossing Never.
Posts: 12,388
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
I don't see ANY problem with Kobo, Kindle, Nook, Sony etc on Linux Mint 20.1 (which is similar). No need to be root or use sudo. I've never had to change anything.
There is an issue with SOME MTP devices that can't be re-enabled when unmounted from the file manager. Stopping the "gvfs-mtp-volume-monitor" process before plugging in an MTP device solves that. But the Libra uses USB Mass Storage mode. I've had no problem on 18.3 (32 or 64 bit) or 20.1 (that's 64 bit only) |
06-01-2021, 02:07 PM | #5 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Definitely your disto being crazypants, the device has nothing to do with that.
You'll have to find another poor sap suffering through Ubuntu (and/or Gnome, I wouldn't put it past its VFS thingy to try to do something stupid with an USBMS drive) for help . |
Advert | |
|
06-02-2021, 08:59 AM | #6 |
the rook, bossing Never.
Posts: 12,388
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
I always install more than one user and more than one desktop (usually Cinnamon and Mate) so I can compare or easily recover. Though you CAN do Ctrl-Alt-F1 and install a desktop from a console!
Something has got messed up. Ubuntu + Gnome (3?) doesn't need USB MS user to be root. Try creating a new user and then a different desktop if a new user doesn't work. I used to use Ubuntu for years after Red Hat and then switched to Mint + Mate when Canonical drank Mobile-Win8 kool-aid (or antifreeze) and had "Unity". One nice feature of most Linux is Themes and Desktops. Win10 is now less configurable than Win 3.x, Win9x, Win8, XP, Vista etc. I had one laptop, a notebook, with SIX choices of desktop at logon time to see which suited the miniscule screen best. Setting font dpi to 65 helps with low screens. Last edited by Quoth; 06-02-2021 at 09:04 AM. Reason: desktop options. |
06-04-2021, 09:15 PM | #7 | |
Enthusiast
Posts: 36
Karma: 10
Join Date: Feb 2017
Device: Kobo Aura H2O
|
Quote:
If you have a Kobo that automatically mounts with r/w permissions for your user, could you tell me where it's being mounted and what the user+group permissions are on the mount point when it is and isn't mounted? If you know what's responsible for mounting it, that would also tell me something. I'm wondering if this is a Gnome-specific problem or bug. |
|
06-04-2021, 09:40 PM | #8 | |
Grand Sorcerer
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
|
|
06-05-2021, 12:41 PM | #9 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
The standard-ish path ought to be something like /run/media/$USER/$Volume_Name, all handled dynamically via udev + udisks (meaning the mountpoint doesn't actually exist until it's needed).
|
06-08-2021, 04:18 AM | #10 |
Grand Sorcerer
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Just remember to check this. Mine is mounted as /media/$USER/KOBOeReader. I am sure it has been like this since I first setup this machine. That would have been under Ubuntu 18.04 or 18.10 and it has since updated to 20.04. I don't remember doing anything except plugging the ereader.
|
06-08-2021, 07:52 AM | #11 | |
Wizard
Posts: 2,792
Karma: 6990707
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
|
Quote:
Did you change the mount options in gnome-disk-utility, or add a line to /etc/fstab (or a systemd mount unit) for it? If so, ensure you didn't enable the auth option for it. If that isn't the problem and you use one of the common DEs, then post the relevant lines from the udisks log. Also, ensure you don't have something external auto-mounting stuff as another user. |
|
06-12-2021, 05:40 AM | #12 |
Enthusiast
Posts: 36
Karma: 10
Join Date: Feb 2017
Device: Kobo Aura H2O
|
My Kobo also mounts at /media/$USER/KOBOeReader, and the mount point doesn't exist before it's created. The problem is clearly the ownership of the created mountpoint:
drwxr-xr-x 16 root root 4.0K Dec 31 1969 KOBOeReader There's no /etc/fstab entry for this mountpoint, and I haven't futzed with the systemd mount unit (and I don't recall seeing a script having futzed with it either). I also don't think I've done anything with gnome-disk-utility, though I'm less sure about that. The relevant bits from syslog where it's mounting my ereader: Code:
Jun 12 01:19:04 hostname kernel: [2453801.783537] usb 3-1: new high-speed USB device number 4 using xhci_hcd Jun 12 01:19:04 hostname kernel: [2453801.937323] usb 3-1: New USB device found, idVendor=2237, idProduct=4232, bcdDevice= 4.01 Jun 12 01:19:04 hostname kernel: [2453801.937327] usb 3-1: New USB device strings: Mfr=3, Product=4, SerialNumber=5 Jun 12 01:19:04 hostname kernel: [2453801.937329] usb 3-1: Product: eReader-4.26.16704 Jun 12 01:19:04 hostname kernel: [2453801.937330] usb 3-1: Manufacturer: Kobo Jun 12 01:19:04 hostname kernel: [2453801.937332] usb 3-1: SerialNumber: N87309W070170 Jun 12 01:19:04 hostname kernel: [2453801.938239] usb-storage 3-1:1.0: USB Mass Storage device detected Jun 12 01:19:04 hostname kernel: [2453801.938391] scsi host6: usb-storage 3-1:1.0 Jun 12 01:19:04 hostname mtp-probe: checking bus 3, device 4: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-1" Jun 12 01:19:04 hostname mtp-probe: bus: 3, device: 4 was not an MTP device Jun 12 01:19:05 hostname mtp-probe: checking bus 3, device 4: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-1" Jun 12 01:19:05 hostname mtp-probe: bus: 3, device: 4 was not an MTP device Jun 12 01:19:05 hostname kernel: [2453802.959905] scsi 6:0:0:0: Direct-Access Linux File-Stor Gadget 0401 PQ: 0 ANSI: 2 Jun 12 01:19:05 hostname kernel: [2453802.960158] sd 6:0:0:0: Attached scsi generic sg1 type 0 Jun 12 01:19:05 hostname kernel: [2453802.964497] sd 6:0:0:0: Power-on or device reset occurred Jun 12 01:19:05 hostname kernel: [2453802.964879] sd 6:0:0:0: [sdb] 14139389 512-byte logical blocks: (7.24 GB/6.74 GiB) Jun 12 01:19:05 hostname kernel: [2453802.965153] sd 6:0:0:0: [sdb] Write Protect is off Jun 12 01:19:05 hostname kernel: [2453802.965155] sd 6:0:0:0: [sdb] Mode Sense: 0f 00 00 00 Jun 12 01:19:05 hostname kernel: [2453802.965396] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Jun 12 01:19:05 hostname kernel: [2453802.989366] sdb: Jun 12 01:19:05 hostname kernel: [2453803.000125] sd 6:0:0:0: [sdb] Attached SCSI removable disk Jun 12 01:19:06 hostname usbmount[1093713]: executing command: mount -tvfat -osync,noexec,nodev,noatime,nodiratime /dev/sdb /media/usb0 Jun 12 01:19:06 hostname kernel: [2453803.954561] FAT-fs (sdb): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. Jun 12 01:19:06 hostname usbmount[1093713]: executing command: run-parts /etc/usbmount/mount.d Jun 12 01:19:06 hostname dbus-daemon[1279]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.84' (uid=1000 pid=3458 comm="/usr/bin/gnome-shell " label="unconfined") Jun 12 01:19:06 hostname systemd[1]: Starting Hostname Service... Jun 12 01:19:06 hostname systemd[1]: Finished Clean the /media/user/KOBOeReader mount point. Jun 12 01:19:06 hostname udisksd[1329]: Mounted /dev/sdb at /media/user/KOBOeReader on behalf of uid 1000 |
06-12-2021, 01:19 PM | #13 |
Wizard
Posts: 2,792
Karma: 6990707
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
|
The ownership shouldn't be an issue, since on Debian-based systems, ACLs are used by default on /media.
Check the output of `findmnt --target /media`. If it has `noacl`, remove that option from `/etc/fstab`. Check the output of `sudo dumpe2fs -h $(findmnt -no SOURCE --target /media) | grep "Default mount options:"` If it doesn't have `acl`, run `sudo tune2fs -o acl $(findmnt -no SOURCE --target /media)`. If you made any changes in these steps, reboot. Check the output of `ls -lah /media/*`. If there is not a plus sign beside the `.` entry for your user, ensure the `acl` package is installed, then run `sudo setfacl -m u:$USER:rx /media/$USER`. |
06-12-2021, 07:22 PM | #14 |
Wizard
Posts: 1,226
Karma: 5372649
Join Date: Jun 2011
Location: Ontario, Canada
Device: Kobo Aura HD
|
Looks like you have the "usbmount" package installed,,, try removing it. (If removing usbmount isn't a good option for you due to dependancies, try installing the 'pmount' package.)
Mounting removable drive these days is generally done by the desktop environment file browser, and does not require the external usbmount. |
06-13-2021, 05:56 AM | #15 |
Enthusiast
Posts: 36
Karma: 10
Join Date: Feb 2017
Device: Kobo Aura H2O
|
This is getting more puzzling.
I checked that noacl was not set in /etc/fstab, it is not. dumpe2fs looks right: Code:
dumpe2fs 1.45.5 (07-Jan-2020) Default mount options: user_xattr acl Code:
/media/user: total 8.0K drwxrwx---+ 2 root root 4.0K Jun 12 20:50 . drwxr-xr-x 11 root root 4.0K Dec 5 2020 .. |
Tags |
calibre, linux, linux debian ubuntu |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dictionaries not working on Kobo Libra H2O | Neverendingstory | Kobo Reader | 7 | 10-24-2020 01:13 AM |
Transferring books from Kobo Aura H2O to Kobo Libra H20 | gfeps | Kobo Reader | 16 | 09-24-2020 02:45 AM |
Kobo Libra H2O | hidari | Kobo Reader | 11 | 08-17-2020 07:09 PM |
Kobo Clara HD or Libra H2O? | jackj | Which one should I buy? | 49 | 05-12-2020 06:29 PM |
New to Kobo world with Libra H2O | mspalacios | Kobo Reader | 8 | 10-14-2019 12:35 AM |