Thursday, March 15, 2012

Linux 4 – Hard Disk Layout

  • Partitons and Disk
  • Filesystems
  • mount points
  • swap space
  • design considerations

Important folders in Linux

/boot → (about 100MB+ is fine) for kernel, initrd
can not be read if software raid is present
/home → user related folders & files, configuration files, etc
/etc → configuration files, system wide
/root → root’s home directory, could also be kept on a separate device
/var → log files, webserver will keep files, db also, system, etc.
/opt → this is where a lot of 3rd party stuff goes
/usr → binary programs, that are generally not written to a lot
SWAP → nice to have some

Any of thse folders can be mounted on different harddrives

How to design different partitions and mounts:

A basic system (desktop machine)

/boot / swap

The / is the root parition

  • / is biggest
  • /boot
    • 100MB+ will hold a couple of kernel revisions and GRUB configuration files
    • some older GNU/Linux distributions don’t support multi-terabyte
      • modern OS do not neet a separate parition for this
    • needs to be the first paritition
  • swap
    • general rule of thumb is 1 to 2 times the ammount of RAM
    • similar to the paging file in Windows

A network workstation

  • /
    • usually local harddrive
  • /boot
    • separate partition or not depends on OS, hardware, policies
  • /home
    • This can be a NFS file server, mount over SMB or SSH
    • Needs to be very fast as a lot of traffic will go here
  • swap

Server Setup

  • /
    • mounted on a local hdd
  • /home
    • mounted from somewhere else, or either local, or fast SSD
  • /var
    • own HDD/SSD, very fast, a lot of use, separate if possible
  • /usr
    • can be on a slower drive, mounted on a network as a readonly


No comments:

Post a Comment