From Gentoo Wiki
Jump to:navigation Jump to:search

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


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.


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


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

Activate the following kernel options:

Device Drivers --->
   <*> Serial ATA and Parallel ATA drivers  --->
      [*] 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 SFF support
      [*] ATA BMDMA support

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

   SCSI device support  ---> 
      <*> SCSI device support
      <*> SCSI disk support


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


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.


See also

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

External resources