linux file mount

Under linux, almost everything is treated as a file (even memory is managed as a file). Then, when a new device (such as usb, CD-ROM) is connected to the computer, we also need to find a way to mount the device to a folder and manage it as a file.

 

1. Look at the current hard disk partition and mount point mount

mount -t file system type -o option parameter device (device) dir (mount point)
    -t: such as fat32, ext3, ios9660, ntfs, etc., but this option usually does not need to be specified, and the system can often recognize it automatically
    -o: The meaning of the option option can be -ro (read-only), -rw (read and write), -loop (see the file as a partition)

Example:
    When we are in command mode, after inserting the CD, we need to mount the CD to a specific folder. to access
1.su -account//login account
2.mkdir /dir/dir1 //Create an empty folder
3.mount /dev/cdrom/dir/dir1 //mount
4.cd/dir/dir1 //You can see the contents of the CD

2. Unmount umount

Usage: umount dir (mount point) or umount dev (mounted device)
Example: uount /mnt/cd //Look again, there is no such device in this directory

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324853684&siteId=291194637