| STIK(8) | System Manager's Manual | STIK(8) |
stik — mount and
unmount removable devices as an ordinary user
stik |
mount [-nr]
device |
stik |
umount device |
stik |
-h | -V |
stik lets a user mount a USB stick, SD
card or other removable device without root, and without a desktop stack
such as PAM, elogind or udisks.
The user
must be in the group plugdev. stik is
installed setuid root, runnable only by root and the group
plugdev (root:plugdev 4750),
and refuses any caller that is neither root nor a member of
plugdev, whatever its file mode. Add a user with
# usermod -aG plugdev
userand have them log in again.
mount mounts device
at /media/name, where
name is the device's name, such as
sdb1 for /dev/sdb1. The
directory is created if needed. umount, also spelled
unmount, unmounts it again and removes the
directory.
The options are as follows:
-h-n-r-VOptions may be combined, as in -rn, and
may come anywhere on the command line.
device must be written as
/dev/name, where
name consists of letters, digits,
‘-’ and
‘_’ only, and must be a block device.
Symbolic links such as
/dev/disk/by-label/label are
not accepted.
Only removable devices are mounted. A device qualifies if it sits on USB or FireWire, if it is an SD card, or if it or the disk it belongs to reports removable in sysfs. Internal disks are refused, and so is soldered-in eMMC storage, even though it hangs off the same controller as SD cards. The device node must be the device that sysfs knows by that name.
A partition must be named, not the disk that holds its partition
table: /dev/sdb1, not
/dev/sdb. stik says so when
given a disk with a partition table. A LUKS volume must be unlocked
first.
The file system is recognised from its superblock: vfat, exfat, ntfs, ext2, ext3, ext4, btrfs, xfs, f2fs, iso9660 and udf. NTFS is mounted with the ntfs3 driver if the kernel has it, else ntfs.
Every mount is nosuid and
nodev; iso9660 and udf are also read-only.
vfat, exfat and ntfs store no owners: their files belong to the user who mounted them, with mode 644 for files and 755 for directories. iso9660 and udf files belong to that user as well.
ext2, ext3, ext4, btrfs, xfs and f2fs store owners on disk. For
these, stik maps on-disk user and group 0 to the
user who mounts, so a stick formatted by root is readable and writable
without changing anything on it. Files the user creates are stored as owned
by 0. Files of any other owner keep their ownership and may not be
accessible. The mapping needs Linux 5.12 or later and support in the file
system; without it, stik warns and mounts without
mapping. It is not applied with -n, nor when root
mounts.
When stik is run by root through
doas(1) or sudo(8),
ownership goes to the user named in DOAS_USER or
SUDO_USER.
umount only unmounts a device that is
mounted at /media/name; a
device mounted anywhere else is refused, so it cannot be used to unmount the
system's own file systems. Any member of plugdev may
unmount a stick another member mounted.
If a stick was pulled out while mounted, its device node is gone
but the mount stays. umount still detaches it.
plugdev.Mount a stick, write to it, unmount it:
$ stik mount /dev/sdb1 ==> Mounting /dev/sdb1 (vfat) to /media/sdb1 ==> Mounted at /media/sdb1 $ cp notes.txt /media/sdb1/ $ stik umount /dev/sdb1
Look at an ext4 stick read-only, with ownership as stored on it:
$ stik mount -rn
/dev/sdb1stik runs no other programs and reads no
configuration. It consults no environment variables except
DOAS_USER and SUDO_USER, and
those only when run by root.
| September 27, 2026 | stik 1.2 |