Steps and considerations for adding a new hard disk to Linux (Centos)

Source: Internet
Author: User
Tags tag name uuid

It's been a while since I started studying Linux, and this week I've been working on a few days to figure out how to add a new hard drive to a running system, which I think is important because the hard drive is almost a consumable now. And I think it's possible to get a summary of some of the basics that I've been focusing on for a while.
(I practiced on a virtual machine I installed myself)
The first step: Add a new hard disk to the virtual machine such as

Select the SCSI hard disk size I set to 200MB, and then start the virtual machine.
Part II: View the disk file name of the newly added hard disk use fsdisk-l This command to see all the disks (in fact, plug the U-disk is also this step) such as:

The bottom one, the DISK/DEV/SDD:213MB, this is my new hard drive. This command is actually to determine the directory
Section Three: Partitioning, this step is not necessary you can also do not partition the entire disk format, but for the sake of the effect I still partition it. Or do you use Fdisk as the command?

Enter m to see all the help (because it's not good enough to remember I enter m every time I practice)

You can first enter a p to print out some information about this disk and look it up.

I think it's more important here. I think it should be the first line and the second line, the first line will not say a look on the know. The second line means that there are 64 heads that manage the disk, and 32 sectors of each head tube have a total of 204 magnetic columns. This is a knowledge point to understand the hardware structure of some hard disks and that's the 204 number you need to know.
Press N to add a new partition such as

E and P These two options I think this is another point of knowledge (to understand why the primary partition is 1-4, extended partition and logical partitioning these concepts) here I create a new primary partition

Partition Number: Here I enter 1
First cylinder (1-204, default 1): Here The 204 is out, direct enter I use the default is starting from 1
Last cylinder, +cylinders or +size{k,m,g} (1-204, default 204): 50 Here, I wrote a 50, no more than the range. You can also use the +xxk\m\g to limit the size of the creation can also be written in this line, Then I was creating an extended partition because the logical partition was built on the extended partition, so I gave the rest to the extended partition as

You can take a look at the job you just did in the input p.

In the logical partition input n in the input L I'm just going to split one. This is easier. You can divide the results according to your own needs.

There should be two places in the picture above, and I think it's a knowledge point.
1, why the logical partition to start from SDD5
2, Sdd5 start and End Magnetic column why is the same
So the partition is not over if you want to save the input w cancel on Q we press W.
Part fourth: Formatting with MKFS. Format your separate sections as

I've looked at a couple of important points here, but I don't know how to change that. You can show me the best in the comments behind.
1, "Filesystem label=" This seems to be a disk tag name can have a command can be modified but I forgot what order.
2, Block size=1024 (log=0) I also did not set what parameters should be 4k my this why is 1K with the hard disk set too small to have a relationship?
The others seem to be in no doubt.
Fifth: Mount---Mount is important if you do not mount it can not be used this is not a lot of ramble about who knows.

Use DF to see that the mount is successful. You can use this hard drive, and here is a description of the directory as a mount point should be an empty directory, I am here to create a new directory
Fifth: Through the fourth part is available, but if the mount information disappears after the reboot, it will be re-mounted so if you want to make it permanent, you should write to the/etc/fstab file to see the file first.

You can see all the information that is automatically mounted after the boot. Each column here represents what is clear.
It's interesting how this UUID knows the UUID of your disk, and it's going to be dumpe2fs.

There's too much stuff here, not just the UUID, the number of inode, the size of the block, the size, and so much more. I would like to follow the/etc/fstab in front of the UUID, but a bit long is useless.
Modify. Follow the lines above to add the following line to the/etc/fstab "/dev/sdd5/hard/sd5 ext4 defaults 0 0"
Then be sure to check the syntax of this file, if the file is wrong, the system must not start because I broke it several times. Later only to know that the check grammar is also very simple as long as the modified after the use of "mount-a" This command will be able to pay attention to use this command before the first to put this ssd5 if mounted first uninstall so basically completed.

Steps and considerations for adding a new hard disk to Linux (Centos)

Related Article

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.