File management

From Alpine Linux

File management and storage access in Alpine Linux Desktop environments involves various components. In Alpine Linux, file managers require additional software packages to:

  • Automatically mount removable media
  • Browse storage across shared networks
  • Display and access partitions using different filesystems with other installed operating systems

Prerequisites

  • Enable Polkit for privileged operations using a GUI

File managers

File managers provide a user interface to file management i.e manage files and folders. A partial list of file managers available in Alpine Linux is given below:

Tool Graphical/CLI Brief Notes
caja Graphical The file manager for the MATE desktop
dolphin Graphical File manager for KDE Plasma desktop
konqueror Graphical KDE File Manager & Web Browser
lf CLI Terminal filemanager written in Go with vim-style keybindings
lomiri-filemanager-app Graphical Convergent file manager: for mobiles, desktops e.g. Lomiri DE, postmarketOS
mc CLI Filemanager/shell that emulates Norton Commander
nautilus Graphical GNOME file manager also known as 'GNOME Files'
nemo Graphical File manager for Cinnamon desktop environment
nnn CLI The unorthodox terminal file manager
pcmanfm Graphical Extremely fast and lightweight file manager for LXDE
pcmanfm-qt Graphical Qt port of pcmanfm
ranger CLI VIM-inspired filemanager for the console
thunar Graphical File manager for Xfce

Disk management

Tools like GVfs and Udisks enable support for automatic mounting of removable storage and network storage. To mount encrypted devices ensure that appropriate packages like device-mapper and lvm2 are installed.

Udisks

udisks makes managing disks including removable drives like USB is much easier by providing a udisks daemon and cli based tool udisksctl. To install the udisks2 package issue the command:

# apk add udisks2

To see the mounted disks:

$ udisksctl status

To mount a disk /dev/sdb1:

$ udisksctl mount -b /dev/sdb1

To unmount a disk /dev/sdb1:

$ udisksctl unmount -b /dev/sdb1

GVfs

Many GUI file managers rely on GVfs, a userspace virtual filesystem implementation. GVfs comes with a set of backends for SFTP, SMB, HTTP, DAV, and many others. Depending on what devices you intend to mount, additional packages may be installed from the below list:

Package Name Brief Notes
ntfs-3g Stable, full-featured, read-write NTFS (driver)
gvfs-cdda CDDA support for gvfs
gvfs-afp AFP support for gvfs
gvfs-goa GNOME Online Accounts support for gvfs
gvfs-mtp MTP support for gvfs to mount android devices
gvfs-smb Windows fileshare support for gvfs
gvfs-lang Languages for package gvfs
gvfs-afc Apple mobile devices support for gvfs
gvfs-nfs NFS support for gvfs
gvfs-dev Backends for the gio framework in GLib (development files)
gvfs-archive Archiving support for gvfs
gvfs-dav WebDAV support for gvfs
gvfs-fuse FUSE support for gvfs to mount external storage devices
gvfs-gphoto2 gphoto2 support for gvfs
gvfs-avahi DNS-SD support for gvfs

To list descriptions of all gvfs- packages:

$ apk info -d gvfs-*

Automounting removable storage

GVfs and Udisks enable automatic mounting of removable storage like USB drives and other external storage devices. To install them issue the command:

# apk add gvfs-fuse udisks2

In addition to the above packages, fuse service supports automounting of a number of filesystems. Install the fuse-openrc package first.

# apk add fuse-openrc

Start the fuse service OpenRC service as follows:

# rc-service fuse start

If the desktop sessions are already in progress, they need to be restarted for the changes to take effect, i.e. log out and log in again.

The fuse service can be added to start up automatically at boot time:

# rc-update add fuse

When polkit is used with seatd, additional configuration is required for automounting to work.

Network browsing

For browsing of network shares that works seamlessly with file associations, install the gvfs packages for the required network protocols. For example, to browse in a SMB/cifs windows network:

# apk add gvfs-smb

Enabling privilege escalation GUI

When using File Managers, to enable the privilege escalation GUI for an admin user, ensure the following:

If the above steps are completed, When admin:// is typed in the address bar of File Manager, a password dialogue will appear.

Troubleshooting

Error due to missing polkit

Error mounting /dev/sda1: GDBus.Error:org.freedesktop.UDisks2.Error.NotAuthorized: Not authorized to perform operation (polkit authority not available and caller is not uid 0)

If Polkit is not available, the above error will occur. In this case either install and enable Polkit or using doas is recommended.

See also