udiskie is a useful program for mounting/unmounting removable devices in Linux, but it doesn't support LVM at present. This helm-linux-disks
package provides an alternative, manual interface for mounting volumes in Linux through udisks2 with minimal support for LVM.
- Display a hierarchy of block devices using
lsblk
command - Use
udisksctl
command to run a bunch of operations on a device- Mount/unmount a file system
- Kill Emacs buffers under its mount point before unmounting the file system
- Lock/unlock a dm-crypted device
- Power off a device
- Mount/unmount a file system
- Primitive support for LVM which helps you handle a LVM-on-LUKS device
- Activate/deactivate a LVM volume group
- Run dired on the mount point of a device
- Run terminal on the mount point of a device
- You can operate on multiple devices without closing the Helm window through
helm-execute-persistent-action
- Emacs 25.1
- Helm
- udisks2 package and
udisksctl
command
Because udisks2 is specific to Linux, helm-linux-disks
is for Linux.
This package is not available on MELPA. Maybe it will never be on MELPA because it is limited to Linux? Use Quelpa or something to install the package from this repository.
To perform an actual mount/unmount operation on a device, udisksd
daemon must be running. See this tutorial for information.
udiskie is an easier, automatic way to mount removable devices. helm-linux-disks may be useful when you unmount a device.
The main entry point is helm-linux-disks
command, which is a Helm interface displaying a list of devices.
The primary Helm source of the command displays entries from lsblk
command.
It supports various operations on the selected device or on the mount point of the device:
- "Dwim" action, i.e. mount/unmount, lock/unlock, or power off the entire device depending on the type and state of the entry
- Run dired
- Run a terminal
- Display information
The type of the terminal is customizable as linux-disk-terminal-type
variable.
The secondary Helm source of the command displays a list of LVM volume groups. The following operations on a selected volume group are supported:
- Deactivate all the logical volumes in the volume group (default)
- Activate all the logical volumes in the volume group
- Display information on the volume group
Note that there is no dwim action for a volume group. The default action deactivates all the logical volumes in the group, so use it with caution. This is because the LVM support is primarily intended for removing a device.
Because helm-linux-disks
is based on Helm, the following commands are supported in the session:
helm-execute-persistent-action
(defaultC-j
) runs the default action but keep the Helm window openhelm-refresh
(defaultC-c C-u
) refresh contents in the Helm buffer
This can be especially useful in removing a device. For example, if you have to remove a storage device /dev/sdb
containing a file system /dev/sdb1
which is currently mounted at somewhere, you can take the following steps in helm-linux-disks
:
- Move the cursor to
/dev/sdb1
. C-j
to unmount the file system.C-c C-u
to refresh the list.- Move the cursor to
/dev/sdb
. C-j
to power off the device.- Close the Helm window.
Likewise, you can take a similar process to remove a crypted device:
- Unmount the file system.
- Lock the device.
- Power off the device.
You can even operate on a device with an encrypted partition containing a LVM physical volume:
- Unmount the file systems in the device.
- Deactivate the corresponding volume group.
- Lock the device.
- Power off the device.
Note that the pattern of running C-j
(helm-execute-persistent-action
) and C-c C-u
(helm-refresh
) in sequence is so common when you use helm-linux-disks
.
The following goals are not supported by this utility:
- Create/remove/shrink/expand a file system: You can use GParted (or a command line) for those tasks. However,
helm-linux-disks
can help mount/unmount file systems. - Mac or Windows support: They won't be supported because those platforms have neither
lsblk
nor udisks2. Becausehelm-linux-disks
is basically a wrapper aroundlsblk
andudisksctl
, supporting platforms with none of those means re-implementing most parts of the package. And I suppose those platforms already have a good GUI utility for the purpose.
The following volume mounters are known to exist for Linux:
GPL v3