명령줄에서 USB 저장소 마운트 및 마운트 해제

명령줄에서 USB 저장소 마운트 및 마운트 해제

USB 하드 드라이브를 마운트 및 마운트 해제하는 백업 스크립트가 있습니다. Ubuntu에서는 이 명령을 사용했지만 udisksctlDebian 7.7 저장소에는 포함되어 있지 않습니다. 데비안에 USB 장치를 마운트하고 마운트 해제하는 유사한 명령이 있습니까?일반 사용자로서?

답변1

나는 당신이 이것을 pmount대신 사용할 수 있다고 믿습니다. 이는 Debian 7.7 저장소에 있습니다.

$ apt-cache search pmount
libpmount-dev - portable mount library - development files
libpmount0.0 - portable mount library - shared library
pmount - mount removable devices as normal user

용법

$ pmount -h
Usage:

pmount [options] <device> [<label>]

  Mount <device> to a directory below /media/ if policy requirements
  are met (see pmount(1) for details). If <label> is given, the mount point
  will be /media/<label>, otherwise it will be /media/<device>.
  If the mount point does not exist, it will be created.

pmount --lock <device> <pid>
  Prevent further pmounts of <device> until it is unlocked again. <pid>
  specifies the process id the lock holds for. This allows to lock a device
  by several independent processes and avoids indefinite locks of crashed
  processes (nonexistant pids are cleaned before attempting a mount).

pmount --unlock <device> <pid>
  Remove the lock on <device> for process <pid> again.

Options:
  -r          : force <device> to be mounted read-only
  -w          : force <device> to be mounted read-write
  -s, --sync  : mount <device> with the 'sync' option (default: 'async')
  -A, --noatime
                mount <device> with the 'noatime' option (default: 'atime')
  -e, --exec  : mount <device> with the 'exec' option (default: 'noexec')
  -t <fs>     : mount as file system type <fs> (default: autodetected)
  -c <charset>: use given I/O character set (default: 'utf8' if called
                in an UTF-8 locale, otherwise mount default)
  -u <umask>  : use specified umask instead of the default (only for
                file sytems which actually support umask setting)
  --fmask <fmask>
                use specified fmask
  --dmask <dmask>
                use specified dmask
  -p <file>, --passphrase <file>
                read passphrase from file instead of the terminal
                (only for LUKS encrypted devices)
  -d, --debug : enable debug output (very verbose)
  -h, --help  : print this help message and exit successfuly
  -V, --version
                print version number and exit successfully

장치를 설치하려면:

$ pmount /dev/sdb1

제거

$ pumount /dev/sdb1

관련 정보