akirak / helm-linux-disks

Emacs Helm interface for mounting removable disks in Linux
11 stars 0 forks source link
emacs-lisp linux mounting udisks

Build Status

helm-linux-disks

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.

Features

Prerequisites

Because udisks2 is specific to Linux, helm-linux-disks is for Linux.

Installation

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.

Usage

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.

Operations on a lsblk entry

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:

The type of the terminal is customizable as linux-disk-terminal-type variable.

Operations on a LVM volume group

The secondary Helm source of the command displays a list of LVM volume groups. The following operations on a selected volume group are supported:

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.

Multiple operations

Because helm-linux-disks is based on Helm, the following commands are supported in the session:

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:

  1. Move the cursor to /dev/sdb1.
  2. C-j to unmount the file system.
  3. C-c C-u to refresh the list.
  4. Move the cursor to /dev/sdb.
  5. C-j to power off the device.
  6. Close the Helm window.

Likewise, you can take a similar process to remove a crypted device:

  1. Unmount the file system.
  2. Lock the device.
  3. Power off the device.

You can even operate on a device with an encrypted partition containing a LVM physical volume:

  1. Unmount the file systems in the device.
  2. Deactivate the corresponding volume group.
  3. Lock the device.
  4. 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.

Non-goals

The following goals are not supported by this utility:

Alternatives

The following volume mounters are known to exist for Linux:

License

GPL v3