


The following tutorial column will give you a detailed explanation of Centos7 disk partitioning and mounting. I hope it will be helpful to friends in need!
Recently, the existing system hard disk is not enough. It is necessary to add hard disk operations to the existing system. The original environment is centos71. Check the overall disk situation :sudo fdisk -l
##/dev/sda This disk is partitioned into two areas:
In this information, you can check which disk has not been partitioned: the /dev/sdb disk in the picture has 500G, and it has not been operated on yet:
2. Hard disk partition
You need to install parted before executing this command: (sudo yum install parted)
/dev/sdb. If there are multiple hard disks, yours may be called another name, such as: / dev/sda
Then the operation command is:1) sudo parted /dev/sdb
//Special reminder to make sure when executing 2)/ dev/sdb is a blank disk, otherwise your stuff will be gone.2) Delete all partitions of the current hard disk: (parted) mklabel gpt
3) You can check the partition status: (parted) print4) Split the disk:
(parted) mkpart primary ext4 0% 50%(parted) mkpart secode ext4 50% 80%5) Exit: (parted ) quit3. Format partition
Mine is divided into two areas: /dev/sdb1 and /dev/sdb2 (sdb1 and sdb2 This name is generated by the system and cannot be modified)
hang Upload the hard disk to a system folder
Create two folders:
sudo mkdir -p /picture1sudo mkdir -p /picture2
Persist the information:sudo vim /etc/fstabAdd the following line to the last line in /etc/fstab and use mount -a only The temporary partition will become invalid after restarting and needs to be persisted as follows: /dev/sdb1 /picture1 ext4 defaults 0 0/dev/sdb2 /picture2 ext4 defaults 0 0Final execution: sudo mount –aUse df -hl to check the specific disk situation.The above is the detailed content of Detailed explanation of disk partitioning and mounting of Centos7. For more information, please follow other related articles on the PHP Chinese website!

Alternatives to CentOS include UbuntuServer, Debian, Fedora, RockyLinux, and AlmaLinux. 1) UbuntuServer is suitable for basic operations, such as updating software packages and configuring the network. 2) Debian is suitable for advanced usage, such as using LXC to manage containers. 3) RockyLinux can optimize performance by adjusting kernel parameters.

The CentOS shutdown command is shutdown, and the syntax is shutdown [Options] Time [Information]. Options include: -h Stop the system immediately; -P Turn off the power after shutdown; -r restart; -t Waiting time. Times can be specified as immediate (now), minutes ( minutes), or a specific time (hh:mm). Added information can be displayed in system messages.

The key differences between CentOS and Ubuntu are: origin (CentOS originates from Red Hat, for enterprises; Ubuntu originates from Debian, for individuals), package management (CentOS uses yum, focusing on stability; Ubuntu uses apt, for high update frequency), support cycle (CentOS provides 10 years of support, Ubuntu provides 5 years of LTS support), community support (CentOS focuses on stability, Ubuntu provides a wide range of tutorials and documents), uses (CentOS is biased towards servers, Ubuntu is suitable for servers and desktops), other differences include installation simplicity (CentOS is thin)

Steps to configure IP address in CentOS: View the current network configuration: ip addr Edit the network configuration file: sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0 Change IP address: Edit IPADDR= Line changes the subnet mask and gateway (optional): Edit NETMASK= and GATEWAY= Lines Restart the network service: sudo systemctl restart network verification IP address: ip addr

CentOS installation steps: Download the ISO image and burn bootable media; boot and select the installation source; select the language and keyboard layout; configure the network; partition the hard disk; set the system clock; create the root user; select the software package; start the installation; restart and boot from the hard disk after the installation is completed.

The command to restart the SSH service is: systemctl restart sshd. Detailed steps: 1. Access the terminal and connect to the server; 2. Enter the command: systemctl restart sshd; 3. Verify the service status: systemctl status sshd.

Restarting the network in CentOS 8 requires the following steps: Stop the network service (NetworkManager) and reload the network module (r8169), start the network service (NetworkManager) and check the network status (by ping 8.8.8.8)

Reboot command is available to restart CentOS 7. The steps are as follows: Open the terminal window and enter the reboot command. Confirm the restart prompt. The system will restart and the boot menu will appear during this period. After the restart is complete, log in with the credentials.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.