mountコマンドは、デバイスをLinuxの任意の地点に配置するというもの。
HDDをパーティション単位で好きな箇所にマウントする、USBメモリやCD/DVDドライブをマウントする、など、デバイスをファイルシステムとして取り扱う。
HDDをパーティション単位で好きな箇所にマウントする、USBメモリやCD/DVDドライブをマウントする、など、デバイスをファイルシステムとして取り扱う。
標準Linuxでのmountコマンド
概要
helpを表示してみる。
~ # mount --help BusyBox v1.1.1 (2007.04.06-12:02+0000) multi-call binary Usage: mount [flags] DEVICE NODE [-o options,more-options] Mount a filesystem. Filesystem autodetection requires /proc be mounted. Flags: -a: Mount all filesystems in fstab -o option: One of many filesystem options, listed below -r: Mount the filesystem read-only -t fs-type: Specify the filesystem type -w: Mount for reading and writing (default) Options for use with the "-o" flag: async/sync: Writes are asynchronous / synchronous atime/noatime: Enable / disable updates to inode access times dev/nodev: Allow use of special device files / disallow them exec/noexec: Allow use of executable files / disallow them loop: Ignored (loop devices are autodetected) suid/nosuid: Allow set-user-id-root programs / disallow them remount: Re-mount a mounted filesystem, changing its flags ro/rw: Mount for read-only / read-write bind: Bind a directory to an additional location move: Relocate an existing mount point. There are EVEN MORE flags that are specific to each filesystem You'll have to see the written documentation for those filesystems ~ #
標準LinuxでのmountコマンドはBusyBoxが動作する。
コマンドの実行
- HDD装着(未フォーマット)
mountコマンドの実行結果は以下。
~ # mount /dev/root on / type jffs2 (rw,noatime) proc on /proc type proc (rw,nodiratime) sysfs on /sys type sysfs (rw) usbfs on /proc/bus/usb type usbfs (rw) devpts on /dev/pts type devpts (rw) /dev/ram1 on /mnt/ram type tmpfs (rw) /dev/mtd3 on /mnt/mtd type jffs2 (rw,noatime)
この出力を表にまとめてみる。
デバイス名 | マウント先 | タイプ | マウントオプション |
/dev/root | / | jffs2 | rw,noatime |
proc | /proc | proc | rw,nodiratime |
sysfs | /sys | sysfs | rw |
usbfs | /proc/bus/usb | usbfs | rw |
devpts | /dev/pts | devpts | rw |
/dev/ram1 | /mnt/ram | tmpfs | rw |
/dev/mtd3 | /mnt/mtd | jffs2 | rw,noatime |