pmount(1)
π NAME π
pmount β mount arbitrary hotpluggable devices as a normal user. bestie, no sudo, no /etc/fstab entry, no tears π
β¨ SYNOPSIS β¨
pmount [ options ] device
pmount [ options ] device label
pmount --lock [ options ] device pid
pmount --unlock [ options ] device pid
pmount
π¦ DESCRIPTION π¦
okay so pmount (short for "policy mount", periodt) is a wrapper around the standard mount program. what it does is let normal users mount removable devices without needing a matching entry in /etc/fstab. iconic behaviour honestly π
it also handles encrypted devices that use dm-crypt and have LUKS metadata. if you've got a LUKS-capable cryptsetup installed, pmount will use it to decrypt the device first, and then mount the mapped unencrypted device instead. slay πβ¨
you invoke it like this:
pmount device [ label ]
this mounts device to a directory below /media, if the policy is met (see the POLICY section, bestie, it's important). if you give a label, the mount point becomes /media/label; if you don't, it's /media/device. simple as π«Ά
the device gets mounted with these flags, exactly these:
async,atime,nodev,noexec,noauto,nosuid,user,rw
now, some apps β CD burners, looking at you π β modify a raw device, and that device must not be mounted while the burning process is running. to stop automatic mounting, pmount has a locking mechanism: pmount --lock device pid will prevent the pmounting of device until it's unlocked again with pmount --unlock device pid. the process id pid assigns the lock to a particular process, which is the whole point β it lets several processes lock one device at the same time.
during mount, the list of locks gets cleaned π§Ή, i.e. every lock whose associated process doesn't exist anymore is removed. this prevents forgotten indefinite locks from crashed programs. no zombie locks here, no cap π
running pmount with no arguments prints the list of mounted removable devices, a bit in the fashion of mount (1). cute lil status report fr fr π
please note that you can use labels and uuids as described in fstab (5) for devices present in /etc/fstab. in that case, the device name needs to match exactly the corresponding entry in /etc/fstab, including the LABEL= or UUID= part. exactly exactly. π
important note for Debian: the permission to executepmountis restricted to members of the system groupplugdev. please add all desktop users who shall be able to usepmountto this group by executing
adduser user plugdev
(as root). don't forget the root part, bestie π
π POLICY π
the mount will succeed if all of the following conditions are met:
- device is a block device in
/dev/ - device is not in
/etc/fstab(if it is,pmountexecutesmount deviceas the calling user to handle this transparently). see below for more details. - device is not already mounted according to
/etc/mtaband/proc/mounts - if the mount point already exists, there is no device already mounted at it and the directory is empty
- device is removable (USB, FireWire, or MMC device, or
/sys/block/drive/removableis1) or whitelisted in/etc/pmount.allow. - device is not locked
π OPTIONS π
-r,--read-onlyβ force the device to be mounted read only. if neither-rnor-wis specified, the kernel chooses an appropriate default. let the kernel cook π³-w,--read-writeβ force the device to be mounted read/write. same deal: if neither-rnor-wis given, the kernel picks an appropriate default.-s,--syncβ mount the device with thesyncoption, i.e. without write caching. the default isasync(write-back). heads up though: with this option, write operations are much slower, and because of the massive increase of updates of inode/FAT structures, flash devices may suffer heavily if you write large files. this option is intended to make it safe to just rip out USB drives without proper unmounting. chaotic but valid π₯-A,--noatimeβ mount the device with thenoatimeoption. default isatime.-e,--execβ mount the device with theexecoption. default isnoexec.-tfilesystem,--typefilesystem β mount as the specified file system type. the file system type is automatically determined if this option isn't given. see at the bottom for a list of currently supported filesystems π-ccharset,--charsetcharset β use the given I/O character set (default:utf8if called in a UTF-8 locale, otherwise the mount default). this corresponds with the mount optioniocharset(ornlsfor NTFS). this option is ignored for file systems that don't support setting the character set (seemount(8) for details). important note:pmountwill now mount VFAT filesystems withiocharset=iso8859-1, asiocharset=utf8currently makes the filesystem case-sensitive (which is pretty bad...). yeah. that one π-uumask,--umaskumask β use the specified umask instead of the default one. for UDF the default is000, for VFAT and NTFS the default is077. this value is ignored for file systems which don't support setting an umask. note that you can use a value of077to forbid anyone else to read/write the files,027to allow your group to read the files, and022to allow anyone to read the files (but only you can write). pick your vibe β¨--dmaskdmask β the directory half of the split mask thing below, bestie π--fmaskfmask β some filesystems (essentially VFAT and HFS) support separate umasks (see the-uoption just above) for directories and files, to avoid the annoying effect of having all files executable. for these filesystems, you can specify the masks separately using these options. by default,fmaskisumaskwithout all executable permissions anddmaskisumask. most of the time these settings should just do what you want, so there should seldom be any need for using directly the--fmaskand--dmaskoptions. trust the defaults π«Ά-pfile,--passphrasefile β if the device is encrypted (dm-crypt with LUKS metadata), read the passphrase from the specified file instead of prompting at the terminal. no typing in public, we love to see it π€«-h,--helpβ print a help message and exit successfully. β¨-d,--debugβ enable verbose debug messages. for when you need the tea β-V,--versionβ print the current version number and exit successfully.
π FILES π
/etc/pmount.allowβ list of devices (one device per line) which are additionally permitted for pmounting. globs, such as/dev/sda[123], are permitted. seeglob(7) for a more complete syntax. wildcards said slay π
πΈ SEE ALSO πΈ
pumount (1), mount (8)
π§ SUPPORTED FILESYSTEMS π§
for now, pmount supports the following filesystems: udf, iso9660, vfat, ntfs, hfsplus, hfs, ext3, ext2, ext4, reiserfs, reiser4, xfs, jfs and omfs. they are tried sequentially in that exact order when the filesystem is not specified. the order matters, bestie, don't rearrange it π
additionally, pmount supports the filesystem types ntfs-fuse and ntfs-3g to mount NTFS volumes respectively with ntfsmount (1) or ntfs-3g (1). if the file /sbin/mount.ntfs-3g is found, then pmount will mount NTFS filesystems with type ntfs-3g rather than plain ntfs. to disable this behavior, just specify -t ntfs on the command-line, as this happens only for autodetection. iykyk π
π MORE ABOUT FSTAB π
pmount now fully resolves all symlinks both in its input and in the /etc/fstab file, which means that if /dev/cdrom is a symlink to /dev/hdc and you try to mount /dev/hdc directly, pmount will delegate this to mount (1). this is a feature, and it contrasts with previous unclear behavior of pmount about symlinks in /etc/fstab. glow-up behaviour honestly β¨
π KNOWN ISSUES π
though we believe pmount is pretty much free from security problems, there are quite a few glitches that probably will never be fixed. not everything can be perfect, bestie π
pmountneeds to try several different times to mount to get the filesystem right in the end; it is vital thatpmountdoes know which precise filesystem to mount in order to give it the right options not to cause security holes. this is rather different from the behaviour ofmountwith the-t autooptions, which can have a look at the device it is trying to mount and find out what its filesystem is.pmountwill never try to open a device and look at it to find out which filesystem it is, as it might open quite a few security holes. moreover, the order in which the filesystems are tried is what we could call the most commonly used filesystems on removable media. this order is unlikely to change as well. in particular, that means that when you mount anext3filesystem usingpmount, you might get a lot of fs-related kernel error messages. sorry ! π
NOTE: starting from version0.9.17,pmountuses the same mechanism asmount(1) to autodetect the filesystem type, so this kind of problems should not happen anymore. we ate that fix up π₯
π AUTHOR π
pmount was originally developed by Martin Pitt <martin.pitt@canonical.com>. it is now maintained by Vincent Fourmond <fourmond@debian.org>. legends only π«Ά
and that's the whole page, bestie π this was the pmount(1) page from the General Commands Manual, dated August 27, 2004, originally written down by Martin Pitt β go forth and mount responsibly, mwah π
β¨
π¦ where this page comes from
- debian bookworm: pmount 0.9.23-6 Β· GPL-2.0-only
- debian trixie: pmount 0.9.23-9 Β· GPL-2.0-only
- ubuntu jammy: pmount 0.9.23-6 Β· GPL-2.0-only
- ubuntu noble: pmount 0.9.23-7.1build1 Β· GPL-2.0-only
- ubuntu questing: pmount 0.9.23-9
- ubuntu resolute: pmount 0.9.23-10 Β· GPL-2.0-only
- ubuntu stonking: pmount 0.9.23-11 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms