Mount
lastmod 2023-08-08created 2015-07-249 edits
To use various hardware devices, they must be recognized by the Linux server, and what makes this possible is mounting (mount). In the Windows 95/98/NT we use, hardware devices such as floppies and CD-ROMs are almost all recognized automatically as the system boots and can be used right after booting. Also, newly installed hardware is mostly recognized automatically by a feature called PnP (Plug and Play). Of course Linux also supports the PnP feature, but when adding a hard disk, or for devices such as CD-ROMs, you must manually perform an operation called mounting (mount) after the system boots in order to use them. And certain devices (CD-ROM, etc.) must be unmounted (umount) after use. Simply put, mounting means connecting a hardware device to a directory in order to use a specific device. For example, if the device name of a hard disk, one piece of hardware, is /dev/hda, connecting this device name to a designated mount point (directory location) is mounting (mount).
Accessing a shared folder in Virtual Box using the mount command
If you go to Settings > Shared Folders > Add Shared Folder and name the folder PUBLIC, use it as follows.
Usage
The basic usage of the mount command is as follows.
-
mount [-lhV] -
mount -a [-fFnrsvw] [-t vfstype] [-O optlist] -
mount [-fnrsvw] [-o option[,option]...] device|dir -
mount [-fnrsvw] [-t vfstype] [-o options] device dir
If you want to see the information currently mounted on the system, just run the mount command without any arguments.
Example
## CD-ROM 마운트 방법.
$ mount -t iso9660 /dev/cdrom /media/cdrom
$ mount /dev/cdrom /media/cdrom
## MS-DOS 마운트 방법.
$ mount -t msdos /dev/hda3 /msdos
## Windows XP 마운트 방법.
$ mount -t ntfs /dev/hda1 /media/xp
## ISO File 마운트 방법.
$ mount -o loop /root/test.iso /media/iso
## NFS File system 마운트 방법.
$ mount -t nfs fedora.net:/home/nfs /fedora-nfs
Automatic mounting
See fstab.
Accessing a Windows shared directory
To access a Windows shared directory from Linux, you need to know the following information.
- The path of the shared directory. (The shared directory path including the IP or domain, starting with
//). - The path in your Linux directory to mount to. (You must create the directory in advance with mkdir)
- Access permissions for the mounted directory. (If none are given, it connects with root privileges.)
- The user name and password for accessing the shared directory.
Using the information above, enter it in the following form.
$ mount -t cifs //192.168.0.1/PublicDirectoryName /home/Myhome/Files -o uid=name, gid=users, username=administrator, password=1234
To unmount, enter the following.
If Korean file names are garbled, add the following options.
For reference, cifs stands for Common Internet File System. For the list of options used with -o, see http://linux.die.net/man/8/mount.cifs.
mount.exfat
The way to make Linux recognize the exFat file system is as follows.
Download:
- http://download1.rpmfusion.org/free/el/updates/6/x86_64/repoview/exfat-utils.html
- http://download1.rpmfusion.org/free/el/updates/6/x86_64/repoview/fuse-exfat.html
rpm -Uvh exfat-utils-1.0.1-1.el6.x86_64.rpm
rpm -Uvh fuse-exfat-1.0.1-1.el6.x86_64.rpm
## mount!!
mount.exfat /dev/sdb1 /media
smb/cifs mount
Install cifs-utils:
See also
- umount: Unmount a device.
- fstab
- fdisk
- Loop device
- Linux:Hardware
Favorite site
- mount(8) linux man page
- mount(8).cifs linux man page
- Linux mount tutorial: mount
- Usage examples of the Linux mount command
- How to mount a Windows shared directory on Linux
- What to do when mount error(12) appears when accessing a Windows 7 folder from Ubuntu. (Using the nounix, noserverino options.)
- Fixing Cannot allocate memory in mount.cifs