Adding new hard disks and partition formatting points under Linux system

  
                  

Prerequisites

Before adding a hard disk to a host, you must first understand how to name the hard disk and partition under Linux.

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

There are two IDE interfaces on the motherboard. A total of four IDE devices can be installed. The two devices on the primary IDE correspond to hda and hdb respectively, and the two devices on the second IDE port correspond to hdc and hdd.

The general hard disk is installed on the main interface of the main IDE, so it is hda

The optical drive is generally installed on the main interface of the second IDE, so it is hdc (it should be used for hdb) The slave interface on the main IDE)

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

and so on

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

Each hard disk can have up to four primary partitions, which are used to name the primary partition of the hard disk. The logical partition starts from 5, and every time there is more than one partition, the number can be added. //This article comes from the computer software and hardware application network www.45it.com

For example, the general system has a primary partition used to boot the system, this partition corresponds to the C area that we often say, named under the linux hda1 . Later we divide the three logical partitions into the commonly said D, E, F, named under linux hda5, hda6, hda7

to the hard disk partition

There are two partition software under slackware Fdisk and cfdisk

For example, there is already a hard disk, and now add another hard disk to the system

Then according to the naming rules, this newly added hard disk should be hdb. You can use the following command to partition the hard disk

fdisk /dev/hdb

You can also use cfdisk to partition, the command is as follows

cfdisk /dev/hdb

Formatting the hard disk

Formatting into ext3 format

mkfs.ext3 /dev/hdb1

Formatting into reiserfs

mkfs.reiserfs /dev/hdb1

Let the hard disk boot automatically mount

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

Edit the /etc/fstab file with vi, add the following Content

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

Copyright © Windows knowledge All Rights Reserved