Mount a USB flash drive to centos7
Run the mount command: mount [-fnrsvw] [-t vfstype] [-o options] device dir
Parameters:
1.-t specifies the file system type of the device. Common options are described as follows:
(1) The earliest File System Used in minix Linux.
(2) common file systems in ext2 Linux.
(3) msdos MS-DOS FAT.
(4) vfat of VFAT Win85/98.
(5) nfs Network File System.
(6) ISO CD-ROM disc standard file system.
(7) ntfs Windows NT file system.
(8) hpfs OS/2 file system. A file system earlier than Windows NT 3.51.
(9) auto checks the file system automatically.
2.-o options is used to describe the mounting method of a device or file. Common parameters include:
Loop: used to connect a file to the system as a hard disk partition.
Ro: mounting a device in read-only mode
Rw: mounting a device in read/write mode
Iocharset: Specifies the character set used to access the file system
3. the device to be mounted.
4. mount point of the dir device on the system ).
I personally mount the file as follows:
Run the following command twice before and after inserting a USB flash drive:
# Fdisk-l
After the USB flash drive is inserted, run the fdisk-l command again to find that the content in the red box is added, that is, the size of the device/dev/sdb4 is 30277505, which is equivalent to 28.4 GB, it can be determined that I have a 32-bit USB flash drive:
Create a directory in the/mnt directory as a mount point:
# Cd/mnt # mkdir usb-fat32
Mount a USB flash drive in fat32 format:
# Mount-t vfat/dev/sdb4/mnt/usb-fat32
In case of garbled characters in the USB flash drive file, you can mount the file as follows:
# Mount-t vfat-o iocharset = cp936/dev/sdb4/mnt/usb-fat32
Now you can view the files in the USB flash drive:
# Ls, mnt, usb-fat32
You can detach a USB flash drive:
# Umount/mnt/usb-fat32
Or
# Umount/dev/sdb4