In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about how to automatically create partition formatting and mount the hard disk script under Linux, many people may not know much about it. In order to make you understand better, the editor summarizes the following content for you. I hope you can get something according to this article.
Many people will not mount the hard disk on the Linux CVM, and even if they follow the instructions, the hard disk cannot be mounted correctly. For the convenience of this type of users, you can solve the problem of partitioning, formatting, mounting and setting the hard disk to boot through a script.
Support for multiple Linux versions
This script supports most Linux images of CVM, such as CentOS, Ubuntu, Debian, SUSE, openSUSE, etc., but does not support FreeBSD with non-Linux kernel.
Operate in root users
All operations need to be done in the root user, otherwise a permission error will be prompted. Let's take operating in the CentOS operating system as an example.
How to use the hard disk for the first time
The first step is to enter the following command in the terminal, which will automatically download the script and grant permissions.
Wget http://mirrors.linuxeye.com/scripts/auto_fdisk.sh
Chmod + x auto_fdisk.sh
. / auto_fdisk.sh
In the second step, the script will automatically perform the initialization function of auto_fdisk.sh, after which the script will automatically detect the drive letter currently on the server except the system disk (/ dev/vda1) and display it, then you need to enter the drive letter to be executed, such as / dev/vdb, or Q if you exit.
In the third step, the script will automatically create the partition and format the hard disk, and then you will be asked to enter the location where the hard disk needs to be mounted, such as mounting / data to install the general lnmp environment and / www to install the wdcp environment. You can enter it here according to the actual needs.
The fourth step, at this time has completed all the input work, waiting for the script to automatically mount and set to boot automatic mount, Step 7 8 is to show the location of the hard disk mount and boot automatic mount configuration, this time has completed the CentOS system to create partition format and mount the hard disk all the work.
How to use hard disk that contains partitions and has been mounted
The first step is to enter the following command in the terminal, which will automatically download the script and grant permissions.
Wget http://mirrors.linuxeye.com/scripts/auto_fdisk.sh
Chmod + x auto_fdisk.sh
. / auto_fdisk.sh
In the second step, the script will automatically perform the initialization function of auto_fdisk.sh, after which the script will automatically detect the drive letter currently on the server except the system disk (/ dev/vda1) and display it, then you need to enter the drive letter to be executed, such as / dev/vdb, or Q if you exit.
The third step, at this time, the script will automatically detect that the hard disk you selected has been mounted and shows the location of the mount, then you will be prompted whether to uninstall the device. Enter y to determine the uninstall, and enter n to exit the script.
Step 4, after successfully uninstalling the device, the script will prompt you whether to start formatting the hard drive, enter y to determine the uninstall, and enter n to exit the script.
Step 5: after successfully formatting the device, the partition and formatting of the hard disk will be automatically performed. Next, you will be asked to enter the location where the hard disk needs to be mounted. For example, mounting / data is required to install the general lnmp environment, and mounting / www is required to install the wdcp environment. Enter it here according to the actual needs.
Step 6, at this time has completed all the input work, waiting for the script to automatically mount and set to boot automatic mount, Step 7, 8 is to show the location of the hard disk mount and boot automatic mount configuration, this time has completed the CentOS system to create partition format and mount the hard disk all the work.
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
After reading the above, do you have any further understanding of how to automatically create a script for partition formatting and mounting a hard disk under Linux? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.