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 new hard disk, partition and format under Linux system

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "how to add a new hard disk, partition and format under the Linux system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to add a new hard disk, partition, and format under the Linux system.

Preliminary knowledge

Before we add a hard disk, we should first understand the naming method of hard disk and partition in linux system.

The device for IDE under Linux is named after hd, the first ide device is hda, and the second is hdb. And so on

We usually have two IDE ports on the motherboard, and a total of four IDE devices can be installed. The two devices on the primary IDE correspond to hda and hdb, and the two devices on the second IDE port correspond to hdc and hdd.

Usually our hard disk is installed on the main interface of the main IDE, so it is hda.

The optical drive is usually installed on the primary interface of the second IDE, so it is hdc (because hdb is used to name the slave interface on the master IDE)

The SCSI interface device is named after sd, the first device is sda and the second device is sdb. And so on

The partition is named with a device name plus a number. For example, hda1 represents the first partition on the hard disk device hda.

Each hard disk can have up to four primary partitions, which function as the primary partition of a 1-4 named hard disk. Logical partitioning starts at 5, and you can add a number for each additional partition.

For example, our general system has a primary partition to boot the system, which corresponds to what we often call Zone C, which is named hda1 under linux. After that, we are divided into three logical partitions corresponding to the commonly said D, E, F, which are named hda5, hda6 and hda7 under linux.

Partition the hard disk

There are two partition software fdisk and cfdisk under slackware

For example, we already have a hard drive, now add another hard drive to the system

So we know according to the naming convention that the newly added hard drive should be hdb. We partition the hard drive with the following command

Fdisk / dev/hdb you can also use cfdisk to partition, with the following command

Cfdisk / dev/hdb

Format the hard disk

Formatted into ext3 format

Mkfs.ext3 / dev/hdb1 is formatted into reiserfs format

Mkfs.reiserfs / dev/hdb1

Let the hard disk start automatic mount

For example, mount / dev/hdb1 partition to / mnt/hd directory

Edit the / etc/fstab file with vi and add the following

/ dev/dhb1 / mnt/hd reiserfs defaults 1 1

At this point, I believe that everyone on the "Linux system how to add new hard drives, partitions, formatting" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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