Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

This chapter is from the book

Installation Tasks

This section details some common tasks you may need to perform during or after installation. It covers using Disk Druid to partition the disk during installation, using fdisk to modify partitions after installation, using Kickstart to automate installation, and setting up a system that will boot either Windows or Linux (a dual boot system).

Using Disk Druid to Partition the Disk

Disk Druid, a graphical disk-partitioning program that can add, delete, and modify partitions on a hard drive, is part of the Red Hat installation system. You can use Disk Druid only while you are installing a system: It cannot be run on its own. You can use fdisk (page 58) to manipulate partitions after you install Red Hat Linux. As explained earlier, if you want a basic set of partitions, you can allow Disk Druid to partition the hard drive automatically.

Disk Druid includes Clone, a tool that copies the partitioning scheme from a single drive to as many other drives as needed. The Clone option is useful for making multiple copies of a RAID partition/drive when you are creating a large RAID array of identical partitions or identically partitioned drives. Click the RAID button to access the Clone tool, which is active only when at least one unallocated RAID partition exists.

During installation, the Disk Partitioning Setup screen gives you the choice between automatically and manually partitioning the hard disk. Choose automatic partitioning if you do not want to make any decisions about how to split up the hard disk.

The Automatic Partitioning screen gives you the following choices:

  • Remove all Linux partitions Removes all Linux partitions, deleting the data on those partitions and creating one or more chunks of free space (page 972) on the disk. You can create new partitions using the free space. If there is only a Linux system on the disk, this choice is the same as the next one.
  • Remove all partitions Deletes all the data on the disk and gives you a free space the size of the disk to work with, as though you were working with a new drive.
  • Keep all partitions and use existing free space Forces you to install Red Hat Linux in the free space on the disk. Does not work if there is not enough, free space.

Choosing automatic partitioning causes anaconda to split the free space, if possible, into three partitions: /boot (about 100 megabytes), swap (up to a few thousand megabytes), and / (root), which gets the bulk of the disk space.

The Automatic Partitioning screen has a frame that allows you to choose the hard disk you want to install Red Hat Linux on. This frame has meaning only if you have more than one hard disk. At the bottom of the screen is a check box, Review (and modify if needed) the partitions created. Put a check mark in this box to display the initial Disk Druid window (Figure 3-6) when you click Next.

03fig06.jpg

Figure 3-6 Disk Druid: Main screen with Help hidden

When you choose to partition the hard disk manually, Anaconda displays the Disk Setup screen, which is the Disk Druid main screen, shown in Figure 3-6 with the Help column hidden. This screen has three sections, from the top: a graphical representation of the disk drive(s) showing how each is partitioned, a row of command buttons, and a graphical table listing one partition per line. If you are starting with a new disk, no partitions are listed on the screen.

The row of command buttons has the following buttons:

  • New Adds a new partition to the disk (page 55).
  • Edit Edits the highlighted partition (page 56).
  • Delete Deletes the highlighted partition.
  • Reset Cancels the changes you have made and causes the Disk Druid table to revert so it matches the layout of the disk.
  • RAID Enables you to create software RAID partitions and to join two or more RAID partitions into a RAID device (page 31).
  • LVM Enables you to create LVM physical volumes, which you can then use to create LVM logical volumes (page 32).

The Disk Druid table has the following columns:

  • Device The name of the device in the /dev directory (for example, /dev/hda1).
  • Mount Point/RAID/Volume Specified where the partition will be mounted when the system is brought up (for example, /usr). Also used to specify the RAID device or LVM volume the partition is part of.
  • Type The type of partition, such as ext3, swap, or LVM.
  • Format A check mark in this column indicates the partition will be formatted as part of the installation procedure. All data on the partition will be lost.
  • Size The size of the partition in megabytes.
  • Start The number of the block the partition starts on.
  • End The number of the block the partition ends on.

At the bottom of the screen is a check box that allows you to hide RAID device and LVM volume group members. Do not check this box if you want to see all the information about the disk drives.

In order to add a new partition to a hard drive, there must be enough free space on the hard drive to accommodate the partition. Click the New button to add a partition; Disk Druid displays the Add Partition window (Figure 3-7). Specify the mount point (the name of the directory that the partition will be mounted over [page 442]) and the filesystem type; use the arrow buttons at the right end of these text boxes to display drop-down menus of choices. If there is more than one drive, mark the check box next to the drive you want the partition to be created on in the Allowable Drives frame. Specify the desired size of the partition and, in the Additional Size Options frame, mark Fixed size to create the partition close to the size you specify. Because of block-size constraints, partitions are not usually exactly the size you specify. Mark Fill all space up to (MB) and fill in the maximum size you want the partition to be to create a partition that takes up the existing free space, up to the maximum size you specify. In other words, Disk Druid does not complain if it cannot create the partition as large as you would like. Mark the third choice, Fill to maximum allowable size, to cause the partition to occupy all the remaining free space on the disk, regardless of size. Mark the Force to be a primary partition check box to create a primary partition. Click OK, and Disk Druid adds the partition to its table (but does not write to the hard disk).

03fig07.jpg

Figure 3-7 Disk Druid: Add Partition window

To modify an existing partition, highlight the partition in the Disk Druid table or the graphical representation of the disk drive and click the Edit button; Disk Druid displays the Edit Partition window (Figure 3-8). From this window, you can change the mount point of a partition or format the partition as another type (ext3, vfat, swap, and so on). You cannot change the size of a partition from this window; instead, you must delete the partition and create a new partition of the desired size.

03fig08.jpg

Figure 3-8 Disk Druid: Edit Partition window

Using the Kickstart Configurator

Kickstart is Red Hat's program that completely or partially automates the same installation and postinstallation configuration on one or more machines. You create a single file that answers all the questions that are normally asked during an installation. Then the installation script refers to this file instead of asking you the questions. Using Kickstart, you can automate language selection, network configuration, keyboard selection, boot loader installation, disk partitioning, mouse selection, X Window System configuration, and more.

The system-config-kickstart (FEDORA) and redhat-config-kickstart (RHEL) utilities run the Kickstart Configurator (Figure 3-9), which creates a Kickstart installation script.

03fig09.jpg

Figure 3-9 Kickstart Configurator

Figure 3-9 shows the first window the Kickstart Configurator displays. The first text box, Language, is the language that will be used for installation. The Language Support box, toward the bottom of the window, is the language that the new system will use after installation.

To generate a Kickstart file (ks.cfg by default), go through each section of this window (along the left side) and fill in the answers and mark the appropriate boxes. Click the Help button for instructions on completing these tasks. When you are finished and click Save File, the Kickstart Configurator gives you a chance to review the generated script before it saves the file.

fdisk: Reports On and Partitions a Hard Disk

The fdisk utility reports on and manipulates hard disk partitions. You can display the size (in 1024-byte blocks) of a hard disk by using the fdisk with the –s option followed by the device name of the hard drive:

   # fdisk -s /dev/hda
   12714912

Run fdisk with the –l option to display information about partitions on the drives you specify:

   # /sbin/fdisk -l /dev/hda

   Disk /dev/hda: 123.5 GB, 123522416640 bytes
   255 heads, 63 sectors/track, 15017 cylinders
   Units = cylinders of 16065 * 512 = 8225280 bytes

      Device Boot    Start       End    Blocks   Id   System
   /dev/hda1   *         1        13    104391   83   Linux
   /dev/hda2            14      2563  20482875   83   Linux
   /dev/hda3          2564      5113  20482875   83   Linux
   /dev/hda4          5114     15017  79553880    f   Win95 Ext'd (LBA)
   /dev/hda5          5114      7663  20482843+  83   Linux
   /dev/hda6          7664     10213  20482843+  83   Linux
   /dev/hda7         10214     11488  10241406   83   Linux
   /dev/hda8         11489     12125   5116671    83   Linux
   /dev/hda9         12126     12252   1020096    83   Linux
   /dev/hda10        12253     12379   1020096    83   Linux
   /dev/hda11        12380     12506   1020096    83   Linux
   /dev/hda12        12507     12633   1020096    83   Linux
   /dev/hda13        12634     12887   2040223+   82   Linux swap
   /dev/hda14        12888     15017  17109193+   8e   Linux LVM

In the preceding output, /dev/hda4 is an extended partition (page 28), /dev/hda13 is a swap partition (page 435), and /dev/hda14 specifies a part of the disk that is managed by LVM (page 32).

In addition to reporting on the layout and size of a disk drive, you can use fdisk interactively to modify the layout. Be extremely careful when using fdisk in this manner, and always back up the system before starting. Changing the partition information (the partition table) on a disk destroys the information on the disk. Read the fdisk man page and the Linux Partition mini-HOWTO before modifying a partition table.

To partition a disk, start fdisk without any options and give an m command, which displays the following help message. You can safely ignore a warning message about the number of cylinders being too large.

   # /sbin/fdisk /dev/hda

   Command (m for help): m
   Command action
      a   toggle a bootable flag
      b   edit bsd disklabel
      c   toggle the dos compatibility flag
      d   delete a partition
      l   list known partition types
      m   print this menu
      n   add a new partition
      o   create a new empty DOS partition table
      p   print the partition table
      q   quit without saving changes
      s   create a new empty Sun disklabel
      t   change a partition's system id
      u   change display/entry units
      v   verify the partition table
      w   write table to disk and exit
      x   extra functionality (experts only)

When you choose p (print), fdisk displays the current partitions on the disk:

   Command (m for help): p
   Disk /dev/hda: 123.5 GB, 123522416640 bytes
   255 heads, 63 sectors/track, 15017 cylinders
   Units = cylinders of 16065 * 512 = 8225280 bytes
      Device  Boot   Start       End    Blocks   Id  System
   /dev/hda1    *        1        13    104391   83  Linux
   /dev/hda2            14      2563  20482875   83  Linux
   /dev/hda3          2564      5113  20482875   83  Linux
   /dev/hda4          5114     15017  79553880    f  Win95 Ext'd (LBA)
   /dev/hda5          5114      7663  20482843+  83  Linux
   /dev/hda6          7664     10213  20482843+  83  Linux
   /dev/hda7         10214     11488  10241406   83  Linux
   /dev/hda8         11489     12125   5116671   83  Linux
   /dev/hda9         12126     12252   1020096   83  Linux
   /dev/hda10        12253     12379   1020096   83  Linux
   /dev/hda11        12380     12506   1020096   83  Linux
   /dev/hda12        12507     12633   1020096   83  Linux
   /dev/hda13        12634     12887   2040223+  82  Linux swap
   /dev/hda14        12888     15017  17109193+  8e  Linux LVM

Each disk entry includes the filename within the /dev directory, the cylinders the partition starts and ends on (use u to change the units to sectors), the number of 1024 (1 kilobyte) blocks, the ID number of the partition type (l [ell] lists the partition types), and the name of the partition type.

In the preceding example partition 4 defines an extended partition that includes almost the entire disk. You cannot make changes to this partition without affecting all the partitions within it. Following are guidelines to remember when defining a partition table for a disk. For more information, refer to "Partitioning a Disk" on page 29.

  • Do not modify the partition that defines the entire disk. This partition is called the backup, or overlap, partition.
  • Do not overlap partitions that contain data. If the first partition ends at cylinder 187, the second partition should begin at cylinder 188. If you overlap partitions, the filesystem will become corrupt as data for overlapping files is written to the disk. Because the overlap partition contains no data or filesystem, it is safe to have other partitions overlap it.
  • Never put a raw partition on cylinder 0. A few sectors on cylinder 0 are reserved for such things as the disk label, bad blocks, and partition tables. A filesystem will preserve this information, but when you use cylinder 0 as part of a raw partition, this information is deleted, and the disk may become unusable. An example of a raw partition is a swap partition (page 435) or raw database partition, as used for a Sybase or Oracle database. Start all raw partitions at cylinder 1 or greater.
  • It is a good idea to put /boot at the beginning of the drive (partition 1) so that there is no issue of Linux having to boot from a partition too far into the drive. When you can afford the disk space, it is desirable to put each major filesystem on a separate partition. Many people choose to combine root, /var, and /usr into a single partition, which generally results in less wasted space but can, on rare occasions, cause problems. You can also put the contents of the boot directory in the root filesystem.
  • When using megabytes to specify the size of a partition, remember to check how many cylinders have been allocated so you know where to begin the next partition.
  • Use tune2fs (page 447) to make all partitions, except swap and /boot, type ext3, unless you have a reason to do otherwise.

The following sequence of commands defines a 300 megabyte, bootable, Linux partition as partition 1 on a clean disk:

# /sbin/fdisk /dev/hda

Command (m for help): n                     
   (create new partition)
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
p                                           
   (select primary partition)
Partition number (1-4): 1                   
   (select partition number 1)
First cylinder (1-1582, default 1):         (allow first cylinder to default to 1)
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2, default 2): +300M (300 MB partition)
Command (m for help): t                     
   (set partition type)
Partition number (1-12): 1                  
   (specify which partition)
Hex code (type L to list codes): 83      
   (83 is Linux, 82 is Linux swap, press L for a list)
Changed system type of partition 1 to 83

Command (m for help): a                     
   (specify a bootable partition)
Partition number (1-12): 1                  
   (specify partition 1 as bootable)

After defining a partition using k or m to specify kilobytes or megabytes, run p to check for the ending cylinder. Do this before defining the next contiguous partition so that you do not waste space or have any overlap. After setting up all the partitions and exiting from fdisk with a w command, make a filesystem (mkfs, page 397) on each partition that is to hold a filesystem (not swap). Use mkswap (page 435) to create a swap partition. You can use e2label (page 396) to label partitions.

Setting Up a Dual-Boot System

A dual-boot system is one that can boot one of two operating systems. Dual-boot in this section refers to a system that can boot Windows or Linux. The biggest problem in setting up a dual-boot system, assuming you want to add Linux to a Windows system, is finding disk space for Linux. The Linux+WindowsNT mini-HOWTO covers installing Linux first and Windows NT second or the other way around. The next section discusses several ways to create the needed space.

Creating Free Space on a Windows System

Typically, you install Red Hat Linux in free space on a hard disk. In order to add Red Hat Linux to a Windows system, you must provide enough free space (refer to "Disk space" on page 25) on a hard disk that already contains Windows. There are several ways to provide/create free space. Following are some ways, from easiest to most difficult:

If there is sufficient free space on the Windows disk, you can install Linux there. This technique is best, but there is rarely enough free space on an installed hard disk.

Add another disk drive to the system and install Linux on the new disk, which contains only free space. This technique is very easy and clean but requires a new disk drive.

If you can delete a big enough Windows partition, you can install Linux in its place. In order to delete a Windows partition, you must have multiple partitions under Windows and be willing to lose any data in the partition you delete. In many cases, you can move the data from the partition you delete to another Windows partition.

Once you are sure a partition contains no useful information, you can use Disk Druid to delete it when you install Linux: From the Disk Partition screen (page 49), choose to partition the disk with Disk Druid manually, highlight the partition you want to delete, and click the Delete button. After deleting the partition, you can install Red Hat Linux in the free space left by the partition you removed.

Installing Red Hat Linux as the Second Operating System

After creating enough free space on a Windows system (previous section), start installing Red Hat Linux. When you get to the Disk Partitioning Setup screen (page 49), you must choose manual partitioning if you need to delete a Windows partition. You can choose either automatic or manual partitioning if you already have free space to install Red Hat Linux in. If you partition the disk automatically, choose to keep all partitions and install Red Hat Linux in free space (page 27). If you partition the disk manually, use Disk Druid (page 53) to delete the appropriate Windows partition if necessary and create the Red Hat Linux partitions in the free space. When you boot, you will be able to choose which operating system you want to run.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020