Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Chapter 8 disk Operation-centos7.5 knowledge

Shulou Source: shulou.com Published: 2022-06-01 05:37:17 10月05日 Update

1. Disk marking

Under Windows FAT32 partition, you can store a single file up to 4G.

II. Partition operation

fdisk command

View or manage disk partitions

fdisk -l [disk device]

or

fdisk [disk device]

Common commands in interactive mode

m、p、n、d、t、w、q

Make Filesystem, Create File System (Format)

mkfs -t file system type partition device

As a front end tool for several other partition commands,

By "-t... "option specifies file system type

or

mkfs.btrfs mkfs.cramfs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.fat mkfs.minix mkfs.msdos mkfs.vfat mkfs.xfs

Mount or unmount file systems

Mount command

Display mounted devices

Mount Device Name Mount Point

Mount file system, ISO image to specified folder

mount [ -t type] Storage device mount point directory

mount -o loop ISO image file mount point directory

example

Mkdir /mnt/mount directory

mkdir /mnt/sdf1disk15g

mount /dev/sdf1 /mnt/sdf1disk15g/

df -h

mount

umount command

Unmount mounted file systems

umount Storage device location

mount mount point directory

Note: Unloaded equipment cannot be in use. How to do it: check that the task is completed and enter cd command.

mkswap command

make swap to create a swap file system

mkswap partition device

free -m View cache size

[root@localhost ~]# mkswap /dev/sdb5

Setting up swapspace version 1, size = 2097148 KiB

no label, UUID=9673550e-9dfd-4fa8-8683-255680230f10

[root@localhost ~]# cat /proc/meminfo | grep SwapTotal

SwapTotal: 8257532 kB

[root@localhost ~]# swapon /dev/sdb5

Views

[root@localhost ~]# cat /proc/meminfo | grep SwapTotal

or free -m

SwapTotal: 10354680 kB

[root@localhost ~]# swapoff /dev/sdb5

-----------

Solve permanent mount problem

DF command

df [options] [files]

[root@localhost ~]# df -hT

File System Type Capacity Used Available % Mount Point Used

/dev/mapper/VolGroup-Lv_root ext4 6.7G 4.1G 2.3G 65% /

/dev/sda1 ext4 99M 11M 83M 12% /boot

tmpfs tmpfs 252M 0 252M 0% /dev/sdb1 ext4 19G 173M 18G 1%

Assignment:

1. Enter the meanings of "w" and "q" in the fdisk environment.

What is the sequence of actions in the fdisk environment to create a 20GB primary partition?

Tags: File device system command disk directory type storage device environment mirror storage input maximum task location front end single meaning size capacity Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Huawei Shulou Information Redmi Docker