This is the 20th day of my participation in the wenwen Challenge

Mount the device

All storage devices in a computer system manage files in the form of a directory tree. On Linux, all files are managed in a “large” directory tree rooted in the “/” directory. If you want to use storage devices such as USB storage devices, optical disks, or floppy disks, you must graft the “small” tree of these devices onto the “large” tree of the Linux system.

File system type of the mounted object: /proc/filesystems

vfat (fat32)     ext2    ext3     iso9660
Copy the code

The name of the device to which the object is mounted; In Linux, the device name is usually in the /dev directory, and the device name is named regularly.

/dev/hda1   /dev/sda2  /dev/fd0  /dev/cdrom
Copy the code

The directory to which the device is mounted is the mount point. In Linux, the/MNT directory is used as the mount point directory. Check whether the mount point directory exists before mounting a device. If not, you must create the directory first.

Procedure For mounting devices

  1. Viewing devices: Run the fdisk -l command to view storage devices
  2. Mount devices: Run the mkdir command to create the mount point directory, and then run the mount command to mount devices
  3. Access to equipment
  4. Unmounting a device: Do not remove the mounted device from the system after using it. Otherwise, the system may break down. You must run the uninstallation command before removing the deviceUmount [mount point or device name]

mkfs

MKFS [options][-t < file system type >] [Device name][Number of blocks]

Description: Format the specified device as the specified file system.

For example,

  • When formatting a hard disk:mkfs -t ext3 /dev/hda4
  • When formatting a floppy disk, you need to specify the device name and the number of blocks. Each block contains 1000 bytes. A 1.44MB floppy disk contains 1440 blocks. The formatting instructions are:mkfs -t ext3 /dev/fd0 1440

mount

Mount [options] < mount device name > < mount point > options:

  • T Mounted file system [ext2 ext3 vfat ISO9660]

For example, run mount -t ext3 /dev/fd0/mnt /floppy

  • O [parameter = value], a different set of parameters can be used for different types of mounted devices. [ro rw auto iocharset]

mount -o iocharset=cp936 /dev/sda1 /mnt/usb