Add a new hard disk to the Linux system

Source: Internet
Author: User

Today the company testing Linux server hard disk is not enough, mainly MySQL data file is too big, bought a 500G hard drive back, here to record the new drive method
PS test server motherboard is too bad, there is no redundant power interface, only the power of the optical drive to take out, in order to let the hard disk use.
After the hard drive is installed, we use Fdisk-l to view the following:


The figure shows that the/dev/sdb is 500G, the newly added hard drive.
Next i use the command fdisk SDB to partition, enter p to view the new hard disk partition:

You can use the M command to see the internal command of the FDISK command; n command to create a new partition; d command to delete an existing partition; The P command to display the partition list; the T command to modify the type ID number of the partition, the command to display a list of partition ID numbers; a command to specify the boot partition The W command is to save changes to the partition table to make it work.
We are here to create a new partition, so input n then E is the extended partition, p is the primary partition, we enter P
The next number of blocks or something, all input 1, and finally choose the size, last cylinder or +size or +sizem or +sizek (1-60801, default 60801): +500GB//We input this means the partition size is 500G
Last input W save,:

Then you can see that SDB1 exists in the/dev/directory.
After partitioning, we need to format and format the SDB1 using the mkfs-t ext3/dev/sdb1 command. :

Formatting, I'm still in the middle of it, about half of it.
After the format is finished, we can mount the partition, we first create a directory called data and then mount the/DEV/SDB1 to the/data directory, the command is as follows
Mkdir/data
Mount/dev/sdb1/data
Finally, use the df-h command to view and modify the/etc/fstab for automatic loading. :

After saving, restart the server, everything OK.

Add a new hard disk to the Linux system

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.