검색

이 콘텐츠는 선택한 언어로 제공되지 않습니다.

5.9.6. Adding/Removing Storage

download PDF
While most of the steps required to add or remove storage depend more on the system hardware than the system software, there are aspects of the procedure that are specific to your operating environment. This section explores the steps necessary to add and remove storage that are specific to Red Hat Enterprise Linux.

5.9.6.1. Adding Storage

The process of adding storage to a Red Hat Enterprise Linux system is relatively straightforward. Here are the steps that are specific to Red Hat Enterprise Linux:
  • Partitioning
  • Formatting the partition(s)
  • Updating /etc/fstab
The following sections explore each step in more detail.
5.9.6.1.1. Partitioning
Once the disk drive has been installed, it is time to create one or more partitions to make the space available to Red Hat Enterprise Linux.
There is more than one way of doing this:
  • Using the command-line fdisk utility program
  • Using parted, another command-line utility program
Although the tools may be different, the basic steps are the same. In the following example, the commands necessary to perform these steps using fdisk are included:
  1. Select the new disk drive (the drive's name can be identified by following the device naming conventions outlined in Section 5.9.1, “Device Naming Conventions”). Using fdisk, this is done by including the device name when you start fdisk:
     fdisk /dev/hda 
  2. View the disk drive's partition table, to ensure that the disk drive to be partitioned is, in fact, the correct one. In our example, fdisk displays the partition table by using the p command:
     Command (m for help): p Disk /dev/hda: 255 heads, 63 sectors, 1244 cylinders Units = cylinders of 16065 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 17 136521 83 Linux /dev/hda2 18 83 530145 82 Linux swap /dev/hda3 84 475 3148740 83 Linux /dev/hda4 476 1244 6176992+ 83 Linux 
  3. Delete any unwanted partitions that may already be present on the new disk drive. This is done using the d command in fdisk:
     Command (m for help): d Partition number (1-4): 1
    The process would be repeated for all unneeded partitions present on the disk drive.
  4. Create the new partition(s), being sure to specify the desired size and file system type. Using fdisk, this is a two-step process -- first, creating the partition (using the n command):
     Command (m for help): n Command action e extended p primary partition (1-4) p  Partition number (1-4): 1 First cylinder (1-767): 1 Last cylinder or +size or +sizeM or +sizeK: +512M 
    Second, by setting the file system type (using the t command):
     Command (m for help): t Partition number (1-4): 1 Hex code (type L to list codes): 82
    Partition type 82 represents a Linux swap partition.
  5. Save your changes and exit the partitioning program. This is done in fdisk by using the w command:
     Command (m for help): w

Warning

When partitioning a new disk drive, it is vital that you are sure the disk drive you are about to partition is the correct one. Otherwise, you may inadvertently partition a disk drive that is already in use, resulting in lost data.
Also make sure you have decided on the best partition size. Always give this matter serious thought, because changing it later is much more difficult than taking a bit of time now to think things through.
5.9.6.1.2. Formatting the Partition(s)
Formatting partitions under Red Hat Enterprise Linux is done using the mkfs utility program. However, mkfs does not actually do the work of writing the file-system-specific information onto a disk drive; instead it passes control to one of several other programs that actually create the file system.
This is the time to look at the mkfs.<fstype> man page for the file system you have selected. For example, look at the mkfs.ext3 man page to see the options available to you when creating a new ext3 file system. In general, the mkfs.<fstype> programs provide reasonable defaults for most configurations; however here are some of the options that system administrators most commonly change:
  • Setting a volume label for later use in /etc/fstab
  • On very large hard disks, setting a lower percentage of space reserved for the super-user
  • Setting a non-standard block size and/or bytes per inode for configurations that must support either very large or very small files
  • Checking for bad blocks before formatting
Once file systems have been created on all the appropriate partitions, the disk drive is properly configured for use.
Next, it is always best to double-check your work by manually mounting the partition(s) and making sure everything is in order. Once everything checks out, it is time to configure your Red Hat Enterprise Linux system to automatically mount the new file system(s) whenever it boots.
5.9.6.1.3. Updating /etc/fstab
As outlined in Section 5.9.5, “Mounting File Systems Automatically with /etc/fstab, you must add the necessary line(s) to /etc/fstab to ensure that the new file system(s) are mounted whenever the system reboots. Once you have updated /etc/fstab, test your work by issuing an "incomplete" mount, specifying only the device or mount point. Something similar to one of the following commands is sufficient:
 mount /home mount /dev/hda3 
(Replacing /home or /dev/hda3 with the mount point or device for your specific situation.)
If the appropriate /etc/fstab entry is correct, mount obtains the missing information from it and completes the mount operation.
At this point you can be relatively confident that /etc/fstab is configured properly to automatically mount the new storage every time the system boots (although if you can afford a quick reboot, it would not hurt to do so -- just to be sure).
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.