HDD

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

This article describes the setup of an internal SATA or PATA (IDE) rotational hard disk drive.

Installation

Hardware detection

To choose the right driver, first detect the used storage controller. lspci can be used for this task:

root #lspci | grep --color -E "IDE|SATA"

(At runtime) show identification and feature info (replace /dev/sdX with the right device):

root #hdparm -I /dev/sdX

For more detailed information see the hdparm article.

BIOS

For AHCI SATA controllers, check the system's BIOS or firmware to see if if AHCI has been activated.

Kernel

Note
If the root partition is on this drive, the file system drivers have to be built into the kernel.

Activate the following kernel options:

KERNEL CONFIG_SCSI, CONFIG_BLK_DEV_SD, CONFIG_ATA_ACPI, CONFIG_SATA_PMP, CONFIG_SATA_AHCI, CONFIG_ATA_BMDMA, CONFIG_ATA_SFF, CONFIG_ATA_PIIX
Device Drivers --->
  SCSI device support  ---> 
    <*> SCSI device support
    <*> SCSI disk support
  <*> Serial ATA and Parallel ATA drivers (libata)  --->
    [*] ATA ACPI Support

    # If the drive is connected to a SATA Port Multiplier:
    [*] SATA Port Multiplier support

    # Select the driver for the SATA controller, e.g.:
    <*> AHCI SATA support (ahci)

    # If the drive is connected to an IDE controller:
    [*] ATA BMDMA support
    [*] ATA SFF support (for legacy IDE and PATA)

    # Select the driver for the IDE controller, e.g.:
    <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support (ata_piix)

Configuration

Generally when configuring a hard disk drive one or more partitions will need to be created and filesystems written into them.

Usage

Filesystems can be mounted in several ways. Notable methods include:

  • The mount command.
  • /etc/fstab file - Automatic mount at boot time (does not support on demand mount).
  • removable media - Automated mount on demand.
  • AutoFS - Automated mount on demand.

Troubleshooting

See also

  • SSD — provides guidelines for basic maintenance, such as enabling discard/trim support, for SSDs (Solid State Drives) on Linux.

External resources