Linux command mount (mount command) detailed

Linux is an excellent open source operating system that can run on a variety of computer systems ranging from large to small to handheld. With the maturity and stability of Linux systems and the unique advantages of its open source, Linux is worldwide. Get more and more widely used applications. Many enterprise computer systems are now a hybrid system consisting of UNIX systems, Linux systems, and Windows systems. Data exchange is often required between different systems. Below I will introduce how to mount (mount) CD image files, mobile hard disks, USB flash drives, and Windows network shares and UNIX NFS network shares under Linux system based on their actual work experience.

Mount is a command under Linux. It can connect a partition to a folder in Linux, thus associating the partition with the directory. Therefore, if we access this folder, it is equivalent to accessing the partition.

Mounting concept brief:

To access a file other than the root file system, it must be "associated" to a directory on the root file system. The associated operation is "mount", which is the "mount point". ", the process of releasing this association is called "unloading"

1. Mount: Access is achieved outside the root file system by associating to a directory on the root file system

2. Mount point: mount_point, used as an access point for another file system;

(1) exist in advance;

(2) Use a directory that is not or will not be used by other processes;

(3) The original file under the mount point will be hidden;

Mount command (mount)

First of all, introduce the use of the mount (mount) command, the mount command parameters are very many, here we mainly talk about what we need to use today.

Command format: mount [-t vfstype] [-o opTIons] device dir

1, -t vfstype specifies the type of file system, usually do not have to specify, mount will automatically select the correct type.

CD or CD image: iso9660

DOS fat16 file system: msdos

Windows 9x fat32 file system: vfat

Windows NT ntfs file system: ntfs

Mount Windows file network share: smbfs

UNIX (LINUX) file network share: nfs

2, -o opTIons is mainly used to describe the way the device or file is attached.

Loop: used to attach a file as a hard disk partition to the system

Ro: Mount the device in read-only mode

Rw: use the read and write mode to mount the device

Iocharset: specifies the character set used to access the file system

3, device device to be mounted (mount).

4. The mount point of the dir device on the system.

Mounting a CD image file

1. Create a CD image file from the CD. Insert the CD into the CD drive and execute the following command.

#cp /dev/cdrom /home/sunky/mydisk.iso or

#dd if=/dev/cdrom of=/home/sunky/mydisk.iso

Note: Execute any of the above commands to make the CD in the current CD-ROM drive into a CD image file /home/sunky/mydisk.iso

2. Make the files and directories into a CD image file and execute the following commands.

#mkisofs -r -J -V mydisk -o /home/sunky/mydisk.iso /home/sunky/ mydir

Note: This command makes all the directories and files in the /home/sunky/mydir directory into the CD image file /home/sunky/mydisk.iso, and the CD volume is marked as: mydisk

3, the mount of the CD image file (mount)

#mkdir /mnt/vcdrom

Note: Create a directory for the mount point

#mount -o loop -t iso9660 /home/sunky/mydisk.iso /mnt/vcdrom

Note: All files in the disc image file mydisk.iso can be accessed using /mnt/vcdrom.

1KW-8KW Power Inverter

Nkm Hybrid Inverter With Mppt Charge,Inverter Power Inverter,Hybrid Inverter Charger,Hybrid Grid Tie Inverter

suzhou whaylan new energy technology co., ltd , https://www.whaylan.com