You are not logged in.

#1 2024-11-03 13:23:37

SeagullFish
Member
Registered: 2023-08-10
Posts: 78

[SOLVED] GUI tool for relocking/closing LUKS encrypted external drive?

Encrypting partitions on external USB drives could be a wise thing to do, to prevent data leaks. Additionally, if a partition is encrypted with dm-crypt/LUKS, most graphical desktop environments (DE’s) seem to be able to identify the partition as being LUKS encrypted, which makes the task of mounting the partition very easy. When connecting the USB drive to your computer, the DE usually presents a dialog box, asking for the password/encryption key needed to unlock/open the partition. After entering the password/encryption key, Linux  immediately mounts the partition.

Disconnecting such a drive, on the other hand, seems to be a more cumbersome matter. As with unencrypted partitions, if you recklessly just rip out the USB cable without unmounting the partition in advance, you run the risk of corrupting the partition and all data stored on it. Moreover, with encrypted partitions, you also need to relock/close the partition after unmounting, before pulling the cable.

Most DE’s and/or file browsers provide some kind of GUI tool to unmount regular unencrypted partitions. Or alternatively, you could use the «power off» function provided by Gnome disk utility.

However, I haven’t found any equivalent GUI based tool to unmount and relock/close encrypted partition. All related information I have found on the web, including the Arch Linux wiki page, describe commands to be executed manually in a terminal emulator. Although such an approach does the job, it entails a somewhat greater workload. Additionally, it requires you to remember which commands and arguments that needs to be executed each time. If you don't use the external drive that often, you easily forget what to do.

Question:

Do you know a better solution to this issue? I am open to all suggestions, even if it involves switching to other competing encryption software or systems.

Last edited by SeagullFish (2024-11-07 20:25:54)

Offline

#2 2024-11-03 23:06:38

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,451

Re: [SOLVED] GUI tool for relocking/closing LUKS encrypted external drive?

I do not use a DE, so I can't comment on what they do, but udiskie [extra] is a graphical tool and by default locks the device after unmounting.

Offline

#3 2024-11-07 20:25:36

SeagullFish
Member
Registered: 2023-08-10
Posts: 78

Re: [SOLVED] GUI tool for relocking/closing LUKS encrypted external drive?

twelveeighty wrote:

I do not use a DE, so I can't comment on what they do, but udiskie [extra] is a graphical tool and by default locks the device after unmounting.

Thank you very much. That is exactly the kind of solution that I was looking for. I am using the Cinnamon desktop environment, and udiskie seems to work well with Cinnamon.
At first I didn't quite understand how to run udiskie, until I found and read the usage guide at GitHub. From my interpretation of the usage guide, udiskie could be started as a background process at bootup/login-time, with a tray icon present, by adding the following line into a file named "~/.xinitrc":

udiskie -t &

However, I chose another solution that seems to work just as well with Cinnamon. I created a file named "~/.config/autostart/udiskie.desktop", and added the following lines to it:

[Desktop Entry]
Name=Udiskie
Comment=Removable media mounting manager
Exec="/usr/bin/udiskie" "-t"
Icon=drive-removable-media-usb
Type=Application
StartupNotify=false
X-GNOME-Autostart-enabled=true

I thought that I should share that information, in case it becomes useful to someone else later.
Anyway, this thread is [SOLVED].

Offline

#4 2024-11-07 20:58:47

SeagullFish
Member
Registered: 2023-08-10
Posts: 78

Re: [SOLVED] GUI tool for relocking/closing LUKS encrypted external drive?

Additional comment:
As described in the usage guide and the man page, the following command can be executed to avoid auto-mounting of partitions:

/usr/bin/udiskie -At

This could be useful if udiskie is making conflicts while trying to auto-mount a non-encrypted partition, due to your desktop environment also trying to auto-mount the same partition at the same time.

Offline

Board footer

Powered by FluxBB