Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add a new hard disk and partition it in centos6

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Centos6 to add a new hard disk and partition method is how, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

How do you add hard drives and partitions to centos6?

The specific requirements are as follows:

1. Add a new hard disk with a size of 1G

2. Divided into five zones, each with a size of 100m, mounted to / mnt/p1-4 (recommended parted)

Turn on the virtual machine

Use parted partitioning method

3. The first partition is mounted using the device path.

4. The third partition is mounted using volume label (game).

5. The fourth one is mounted using UUID

6. The fifth one is made into swap partition.

Introduction to the method of adding a New hard disk and Partition in centos6

1. First turn off the virtual machine (shut it down or not suspend it), then click on the virtual machine, click Settings, add, and set the hard disk size to 1G. Others can use the default one.

2 、

3. Save after exit (parted) quit

4. Reread the partition table partx-a / dev/sdd

5. Formatting

Mkfs-t ext4 / dev/sdd1mkfs-t ext4 / dev/sdd2mkfs-t ext4 / dev/sdd3mkfs-t ext4 / dev/sdd4mkfs-t ext4 / dev/sdd5

6. Mount (there are three methods, device path, volume label, UUID)

Create a mounted directory before mounting:

Mkfs-t ext4 / dev/sdd1mkdir / mnt/p1mkdir / mnt/p2mkdir / mnt/p3mkdir / mnt/p4

Device path mount:

Mkfs-t ext4 / dev/sdd1mount-t / dev/sdd1 / mnt/p1mount-t / dev/sdd1 / mnt/p1

Volume label mounting:

Mkfs-t ext4 / dev/sdd1e2label / dev/sdd3 game

Set the third partition to the game volume label and use blkid to see if the setting is successful

You can also see the UUID of / dev/sdd5 using blkid

Open the / etc/fstab file

Write

Mkfs-t ext4 / dev/sdd1/dev/sdd1 / mnt/p1 ext4 defaults 0 0/dev/sdd2 / mnt/p2 ext4 defaults 0 0LABEL=game / mnt/p3 ext4 defaults 0 0UUID=64a5fd73-34d7-4546-afb9-4862b959744a / mnt/p4 ext4 defaults 0 0

Save exit

7. Create a new swap partition

Use physical partitions to build swap partitions

Mkfs-t ext4 / dev/sdd1fdisk / dev/sdd5Command (m for help): n (then enter) Command (m for help): P (print the partition table, you can see the new partition) Command (m for help): tCommand (m for help): 6 (the new partition number is not necessarily 6) Hex code (type L to list codes): 82 (change to swap IP) Command (m for help): W

Save exit

Mkfs-t ext4 / dev/sdd1partx-a / dev/sdd

Load

Mkfs-t ext4 / dev/sdd1swapon / dev/sdd6 (load) free (View) total used free shared buffers cachedMem: 2038352 817280 1221072 3408 96160 323596 buffers/cache + buffers/cache: 397524 1640828Swap: 106360 0106360 is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, 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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report