reddit / emacs

Error using su/sudo with Tramp: "Copying directly failed"

yamobust · 2022-02-06 17:04
Using Emacs 27.2 on Slackware 15 I am trying to use su or sudo through Tramp to edit /boot/efi/EFI/Slackware/elilo.conf which is write protected on my EFI partition. I am able to login as root successfully, but when saving changes on this file in particular Tramp gives me this error in the messages buffer: Tramp: Opening connection for root@slackpad.local using su... Tramp: Sending command ‘exec su - root’ Tramp: Waiting for prompts from remote shell... Tramp: Sending Password Save auth info to file ~/.authinfo? [y/n/N/e/?] n Tramp: Waiting for prompts from remote shell...done Tramp: Found remote shell prompt on ‘slackpad.local’ Tramp: Opening connection for root@slackpad.local using su...done Tramp: Inserting ‘/su:root@slackpad.local:/boot/efi/EFI/Slackware/elilo.conf’...done elilo.conf has auto save data; consider M-x recover-this-file Tramp: Checking ‘vc-registered’ for /su:root@slackpad.local:/boot/efi/EFI/Slackware/elilo.conf...done elilo.conf has auto save data; consider M-x recover-this-file Saving file /su:root@slackpad.local:/boot/efi/EFI/Slackware/elilo.conf... Renaming /su:root@slackpad.local:/boot/efi/EFI/Slackware/elilo.conf to /su:root@slackpad.local:/boot/efi/EFI/Slackware/elilo.conf~...done Copying /tmp/tramp.genETK.conf to /su:root@slackpad.local:/boot/efi/EFI/Slackware/elilo.conf... Copying directly failed, see buffer ‘*tramp/su root@slackpad.local*’ for details. Copying /tmp/tramp.genETK.conf to /su:root@slackpad.local:/boot/efi/EFI/Slackware/elilo.conf...failed Renaming /su:root@slackpad.local:/boot/efi/EFI/Slackware/elilo.conf~ to /su:root@slackpad.local:/boot/efi/EFI/Slackware/elilo.conf...done tramp-error: Copying directly failed, see buffer ‘*tramp/su root@slackpad.local*’ for details. The error mentions checking buffer `*tramp/su root@slackpad.local*`, but that buffer is empty Troubleshooting I have tried: 1. I have no problems writing to this file or folder as root with `su -l` or sudo, using emacs/vim/nano/whatever 2. Using Tramp however, neither su or sudo works (`C-x C-f /su::/` or `/sudo::/`) 3. Running clean with `emacs -q` first before using Tramp did not help 4. Through Tramp I am able to use dired to create or edit files/folders in other write protected directories - I tried /root and /etc Any thoughts? ***UPDATE:*** The problem seems to be limited to anything within my EFI partition at `/boot/efi/` . I can use Tramp to write/edit files anywhere else in my root partition, including /boot itself, but not /boot/efi or anything under that For what it's worth, here is my entry in fstab (nothing unusual I think): $ grep efi /etc/fstab /dev/sda1 /boot/efi vfat defaults 1 0 ​
yamobust · 2022-02-12 15:54
Just wanted to add, this is affecting me on a separate Arch machine as well, only in that case the EFI partition is mounted to /boot instead of Slackware's /boot/efi ​ # /dev/nvme0n1p1 UUID=E493-5035 /boot vfat rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2