Mount a USB flash drive to centos7

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.