Procedure for adding an IDE Hard Disk in RedHatLinux

Source: Internet
Author: User
Reason: Recently, due to insufficient space, a hard disk has been added to the server and Oracle tablespace has been migrated. For more information, see this article and & lt; oracle Data File Migration & gt;, this article content: Use RedHatlinux (9.0 or AS4.0 +) to add an IDE hard disk operation step and detailed description of the/etc/fstab file content. Use redhatlinux (9.0 or AS4.0 +) to add an IDE Hard Disk

Reason: Recently, due to insufficient space, a hard disk has been added to the server and Oracle tablespace has been migrated. For more information, see this article and < >. Content of this article: Use RedHat linux (9.0 or AS4.0 +) to add an IDE hard disk operation step and detailed description of the/etc/fstab file.

Use redhat linux (9.0 or AS4.0 +) to add an IDE Hard Disk:

---- How to add a second IDE hard disk?

Question: How can I add an IDE hard disk when using redhat linux (9.0 or AS4.0 +?

Solution:For IDE hard disks, the first hard disk is hda, and the second hard disk is hdb. The first partition of the first IDE hard disk is hda1, and the second partition is hda2. The first partition of the second IDE hard disk is hdb1, and the second is hdb2. This article assumes that you have installed the system on an IDE hard drive and it has been identified by the system at startup.

The following example shows how to add the second IDE Hard Disk/dev/hdb.

Log on as a root user and perform the following steps:

* The fdisk command is used to create a partition table. Enter the following command to create a partition on the second IDE Hard Disk/dev/hdb:

# Fdisk/dev/hdb

* Input m to get help information for each command:

Command (m for help): m

* Input n to add a new partition:

Command (m for help): n

* Input e to add an extension:

Command action

E extended

P primary partition (1-4)

E

Note:Other articles in the Knowledge Base detail how to use fdisk to create a primary partition and extended partition.

* Input 1 to specify the first partition:

Partition number (1-4): 1

Enter enter to accept the default value:

First cylinder (1-2654, default 1 ):

Using default value 1

Enter enter to accept the default value:

Note:To specify the partition size in MB, enter + M or specify the partition size in KB, and enter + K. Here is an integer.

For example, if the size of a specified partition is 100 MB, the input value is + 100 MB, or the size of the specified partition is kb, the type value is + kb.

Last cylinder or + size or + sizeM or + sizeK (1-2654, default 2654 ):

Using default value 2654

* Enter p to display the partition list:

Command (m for help): p

* Input w to write and save the partition table:

Command (m for help): w

The above steps complete the partition of the/dev/hdb hard disk.

You may need to restart the system to identify the new partition table and create a file system on the disk. You can use the reboot command to complete the process.

In addition, some systems can use the partprobe command to re-read the partition table. If any errors occur during the file system creation process below, you should restart the system.

Create an ext3 File System in the/dev/hdb1 partition and enter the following command:

 # Mke2fs-j/dev/hdb1

The following command creates a/opt2 empty directory to load the newly created/dev/hdb1 partition.

# Mkdir/opt2

To load/dev/hdb1 on/opts, enter the following command:

# Mount-t ext3/dev/hdb1/opt2

Edit using a text editor/Etc/fstab, Add the following line, so that the system will start the next time,

You can identify this partition:

/Dev/hdb1/opt2 ext3 defaults 1 2

A modified/etc/fstab file looks similar to the following one ):

LABEL = // ext3 defaults 1 1

LABEL =/boot ext3 defaults 1 2

None/dev/pts devpts gid = 5, mode = 620 0 0

None/proc defaults 0 0

None/dev/shm tmpfs defaults 0 0

/Dev/hda2 swap defaults 0 0

/Dev/hdb1/opt2 ext3 defaults 1 2

/Dev/cdrom/mnt/cdrom iso9660 noauto, owner, kudzu, ro 0 0

/Dev/fd0/mnt/floppy auto noauto, owner, kudzu 0 0

Now the second IDE Hard Disk can read/write data at the/opts loading point. For details, refer to fdisk,

For more information, see the help documentation for mount and fstab.

Detailed description of the/etc/fstab file

Etc/fstab mainly includes six items:

For example, print the content of the two middle lines, as shown below:

LABEL = // ext3 defaults 1 1

/Dev/sda2/mnt/D/vfat defaults 0 0

Column 1: device name or device volume name (/dev/sda10 or LABEL = /)

Column 2: Device Mount directory (for example, the above "/" or "/mnt/D /")

Column 3: Device File System (for example, the above "ext3" or "vfat ")

Column 4: mount parameters (see help man mount)

If you want to change the mount parameters for a mounted device, such as/dev/sda2, you do not need to detach the device, but use the following command.

(The remount parameter is invalid if no device is mounted ):

# Mount/mnt/D/-o remount, ro (Change defaults to ro)

To ensure security, you can specify other mount parameters, such:

Noexec (the execution file is not allowed to be executable, but do not mount the root partition as noexec,

The system cannot be used, and even the mount command cannot be used. In this case, only the system is re-built!

Nodev (device files cannot be mounted)

Nosuid and nosgid (suid and sgid attributes are not allowed)

Nouser)

Column 5: Indicates whether to back up data. (0 indicates no backup, 1 indicates backup, and generally the root partition must be backed up)

Column 6: indicates the self-check sequence. (0 indicates no self-check, and 1 or 2 indicates self-check,

If the root partition is set to 1, other partitions can only be 2)

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.