Vous êtes sur la page 1sur 17

Linux CompTIA

Certification
JC Camacho Asch DCH MH Book Study Group
With great power comes great responsibility Ben Parker
Chapter 1
Installing Linux
Dealing with Integrated Peripherals
As discussed previously System may have independent peripherals such as: CPU,
Devices, Disks, PCI and USB
But there are also built in peripherals in the Mother Board, such as:
Video Card
Network Card
Raid Controller

MOBO manufacturers usually send a Disk with drivers but most of them dont
support Linux
If this is the case we have 2 options:
Try and run the peripheral in a reduced capacity mode (VC without 3D)
Disable the onboard peripheral in the BIOS
Laying Out the Hard Drive
Storage comes in many ways, most common ones:
Local Hard Drives
Network Attached Drives
USB Drives
CD/DVD/Floppy
Partitions
A single disk is divided into one or more partitions that logically separate the disk
For example: a 3TB disk can be partitioned in 500GB partition for OS, 1TB for Database use
and 1.5TB for users home directories
Splitting a disk into partitions is a good idea to split possible disk problems and to tune
them accordingly to the intended use
Having a dedicated partition for OS may help protect that system in the event of an
unplanned shutdown, as files open for writing may not persist after a shutdown, as OS files
dont typically write only read data, this partition almost always survive
Partitions and File Systems
Linux uses device names (dev) to refer to drives and partitions
Drives are given a letter to identify them
Partitions are given a number which is appended to the name
Examples:
/dev/sda -> indicates the first Hard drive (a)
/dev/sda1 -> is the first partition (1) on the first Hard drive (a)
/dev/sdb3 -> is the third partition (3) on the second Hard drive (b)
Note: In partitions, partition 1 is the first one, but in other device definitions Zero (0) is
the first device, for example network cards: eth0 is the first card/port

Once a partition is defined its then Formatted with a Filesystem that allows it to
store files and be usable
Root File System
One main difference between
Windows and Linux is that Windows
each disk drive is assigned a different
File System identification: C: - D: - E:.
While on Linux it all falls within a main
File System identification called the
Root Directory (/)
In Linux the system starts with a single
root File System recognized as /
Linux stiches multiple partitions
together to look like one big
filesystem even though it may be span
across multiple devices or even
separate computers
It would be similar to DFS in Windows
Traditional File System Layout
Quick Lab
Important commands to use for
Filesystem management
pwd ls
mkdir mv
rmdir cp
touch df
rm and rm r du
chmod mount
chown umount
chgrp
cd
Partitions
When USB device is plugged in, your desktop program may automatically mount
it, if not you may need to run commands to mount them
When Deciding how to lay out your disks useful acronym to remember is PIBS:
Performance High I/O directories are recommended to sit on a disk alone for
example Database disks, separating them from users disks can increase user
experience
Integrity Segregate critical files into their own partition, it prevents disk resources
abuse, for example a user filling a disk where the OS/App/DB needs to write
Backup Separate partitions to have more control over backups, for example you may
want to back on a daily basis files in /home as users change them in a day to day
cadence, but other files that dont change that often such a /bin can be back up weekly
Security Splitting into partitions and file systems directory trees can help you control
security by leveraging mount options such as not allowing users other than root to
write or modify
Logical Volume Manager (LVM)
Feature that comes from Unix Enterprise and adopted by Linux
Logical Volume Manager allows for a layer of abstraction between your operating system and
the disks/partitions it uses. In traditional disk management your operating system looks for
what disks are available (/dev/sda, /dev/sdb, etc.) and then looks at what partitions are available
on those disks (/dev/sda1, /dev/sda2, etc.).
With LVM, disks and partitions can be abstracted to contain multiple disks and partitions into
one device. Your operating systems will never know the difference because LVM will only show
the OS the volume groups (disks) and logical volumes (partitions) that you have set up.
Because volume groups and logical volumes arent physically tied to a hard drive, it makes it
easy to dynamically resize and create new disks and partitions. In addition, LVM can give you
features that your file system is not capable of doing. For example, Ext3 does not have support
for live snapshots, but if youre using LVM you have the ability to take a snapshot of your logical
volumes without unmounting the disk.
LVM
LVM Terminology
LVM commands

More details:
http://www.datadisk.co.uk/html_docs/redhat/rh_lvm.htm
Commonly used Mounts
A file system can be mounted almost anywhere in Linux, with Root you have the
power to do it, it doesnt mean its recommended or you should do it
The two most common places to add partitions or file systems are:
/home Usually network file shared to be able to access it from multiple computers
/var Typically used for system logs and data files for ex: /var/lib/mysql

Depending on the nature of your business you may want to create partitions
meaningful for your business and that enables you to manage better the
business, for example:
/p To host all project related data
/vormetric To visibly understand that this is the area managed with encryption
/DCH if you wanted to create a partition for DCH related apps/scripts for support
Swap Files
Most partitions we have talked about store files
Swap partition stores memory instead of files
The OS uses virtual memory which means that the kernel presents a memory
space to each application to use, but the OS can store it wherever it needs to
If an application doesnt always use all its memory or it doesnt matter where the
memory is taking from (performance) you can store it on disk instead of RAM
This is when the kernel can swap memory pages to disk as needed allowing the
system to behave as if it had more memory than installed
Access to data in swap partition is slower than in RAM, so its advisable to avoid
the need to constantly swap memory as system/app may become slow
Swap should be seen as a safety need, specially when RAM resources are limited
Swap Commands
swapon
swapoff
cat /proc/swaps
swapon s
free (-g/-k/-m)
More info:
http://www.computerhope.com/unix
/swapon.htm
http://www.cyberciti.biz/faq/linux-
check-swap-usage-command/

Vous aimerez peut-être aussi