Hardware Configuration Flashcards
Common hard disk interfaces
PATA - Parallel Advanced Technology
SATA - Serial Advanced Technology Attachment
SCSI - Small Computer System Interface
external disk interfaces
- USB
- IEEE-1394 (firewire)
- Variants of SATA and SCSI
scsi disks
- support up to 8 or 16 devices per bus
- one device is the scsi host adapter (controller)
- serial attached scsi SAS brings advances in speed
scsi hard drive names are created within which directory?
/dev
scsi hard drive nomenclature
/dev/sdx where x is any letter from a-z
scsi tape nomenclature
/dev/stx (where x is any number from 0-i)
scsi cd-rom and dvd-rom nomenclature
/dev/scdx or /dev/srx (where x is any number from 0-i)
method of scsi id assignment
increasing order based on scsi id
hotpluggable external disks
- usb
- IEEE-1394 (firewire)
True or False: Always unmount external drive before unplugging it.
True
drive partition
data structure written to specified part of a hard disk
partitioning systems
- Master Boot Record (MBR)
- GUID Partition Table (GPT)
- Berkeley Standard Distribution (BSD)
MBR primary partition limit
four primary partitions or three primary and one extended
MBR partition type codes
one-byte (two-digit hexadecimal) numbers
- 0x0c (FAT)
- 0x07 (NTFS)
- 0x0f (newer type of extended partition)
- 0x82 (Linux swap)
- 0x83 (Linux filesystem)
GPT Datastructure - Protective MBR
- MBR exists on GPT partitioned disk to deterr creation of ordinary MBR partitions
- type code 0xee (EFI GPT)
- may also hold a boot loader in its code area
GPT Datastructure - header
- defines various GPT metadata
- defines size of the partition table
- defines locations of partition tables
- provides CRC (cyclical redundancy check) checksums to help system software detect data corruption
GPT Datastructure - partition table
- defines actual partitions
- can define up to 128 partitions on most disks
GPT partition scheme
partitions are numbered starting at 1 and need not be consecutive
MBR partition scheme
primary/extended/logical
LVM - Logical Volume Management
It is a system of managing logical volumes, or filesystems, that is much more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a filesystem
directory containing logical volume names
/dev/mapper
mount point
directory used as a way to access the filesystem on the partition, and mounting a filesystem is to link the filesystem to a mount point
- i.e. /home mount point would allow access to any subdirectory regardless of where subdirectory exists on a variety of physical drives
unified directory tree
directory structure which houses mount points
critical system directories to avoid splitting between partitions (without these Linux can’t function)
/etc /bin /sbin /lib /dev
low-level formatting
- creates a structure of sectors and tracks on the disk media
- should not be required after factory formats this upon production
high-level formatting
creates a filesystem
_____ disks can be low- and high-level formatted
- floppy
- fdformat /dev/fd0
common filesystem types
- ext2fs
- ext3fs
- ext4fs
- reiserfs
- btrfs
- non-native filesystems
ext2fs
- traditional linux native filesystem
- can be good for small /boot partitions
ext3fs
- adds journal (for recovery)
ext4fs
- adds ability to work with very large disks (over 32TB) and very large files (over 2TB)
reiserfs
- good with large amounts of small files
- designed as a journaling system
btrfs
- fast performer for handling very large disks and files (considered experimental as of kernel 2.6.34
FAT (file allocation table)
- old primitive but ubiquitous
ntfs
as of 2.6.x kernel, linux can reliable read and overwrite ntfs but not create new files
hfs and hfs+
apple - linux provides full read/write hfs support
non-native filesystems
- fat
- ntfs
- hfs/+
- iso-9660 (cd roms)
- joliet as part of iso-9660 (window’s implementation)
- udf (universal disc format) dvd
- bitlocker encryption
command to create a filesystem
- mkfs
- use -t option to pass the filesystem type code to mkfs
command often used to create ext2 and ext3 filesystems
mke2fs
bad-block check
analyzes disk for bad sectors
common causes of bad sectors on a hard disk
- bad disk
- bad cables or SCSI terminations
following command does what…mkfs -t ext3 /dev/hda6
create an ext3 filesystem on /dev/hda6
swap space command
mkswap [drive]
- i.e. mkswap /dev/hda1
swap space
- a partition or file that linux treats as an extension of memory
- requires preparation similar to that of a filesystem but doesn’t hold a filesystem and is not mounted like a filesystem
identifying swap space
linux uses /etc/fstab to define which partitions to use as swap space
command activate a swap space
swapon [drive]
i.e. swapon /dev/sdd1
tuning filesystems
- looking for journaling mechanism
- ext2fs should be backed up more often bc fs can’t correct itself
dump2fs [options] device
- command to display filesystem information
- i.e. dump2fs /dev/sdb7
command to change filesystem parameters reported by dump2fs
tune2fs [options] device
command to investigate issues with filesystem
debugfs [drive]
- i.e. debugfs /dev/hda11
major ext2fs limitation
journaling (data structure describing pending operations) - fs could be in an inconsistent state if not shut down properly which results in a necessary check of the filesystem before use
common journaling filesystems on linux
- ext3fs
- ext4fs
- reiserfs
- xfs
- jfs
command to check a filesystem for errors
- fsck [options] [filesystem]
- run only on unmounted filesystems or on filesystems in read-only mode
fsck switches
- a to check all files
- v to produce verbose output
- n to display what would happen without performing the action
command for disk monitoring by partition
- df [option] [file]
i. e. df -h
command for disk monitoring by directory
- du [options] [directories]
- reports how much disk space each directory consumes
df switches
- a include all filesystems
- B use scaled units
- i summarize inodes
- l local filesystems only
- display filesystem type
- t limit by filesystem type
du switches
- a all
- d print the total for a directory or file only if it is N or fewer levels (max depth)
- c produce a grand total
command to mount a filesystem
mount [-alrsvw] [-t fstype] [-o options] device dir
command to unmount a filesystem
umount [directory]
file used to perisistently mount
/etc/fstab
mount switches
- a mount all the filesystems listed in /etc/fstab
- r mount in read-only mode
- v produce verbose output
- w read/write
- t specify fs type
- L and -U mount fs with specified label or UUID respectively
BIOS
- firmware that initiates process of booting an operating system on a computer
- resides on mobo in rom, typically an electronicaly erasable programmable read-only memory (i.e. flash mem)
- mostly only usable physically (stripped down in VMs)
POST
- power-on self-test
- inits hardware to a known operational state (checks attached devices)
- loads boot loader from boot device
- passes control to the boot loader, which loads the OS
option to disable for booting w/o keyboard
something similar to “halt-on”
IRQs
interrupt request - a signal sent to the cpu to suspend current activity and handle some external event such as a keyboard input
IRQ numbering
IRQs are numbered 0 to 15
IRQ file
/proc/interrupts
/proc filesystem
virtual filesystem - no actual files just kernel data represented using a filesystem
I/O addresses
unique locations in memory reserved for comms between cpu and physical hardware devices
I/O addresses file
/proc/ioports
DMA
- direct memory addressing is an alternative method of communication to I/O ports where devices directly communicate without cpu
DMA file
/proc/dma
coldplug device
device intended to be disconnected only when computer has no power
PCI access mode
- BIOS
- Mmconfig, uses protocol of same name to detect pci devices
- Direct, uses linux specific direct-detection system
- any, tries mmconfig followed by Direct followed by BIOS
- most of the time pci is configured ‘any’ and walks up this tree
expansion cards
- most require configuration by OS to reserve resources for these
command to display pci information
lspci
lspci switches
- v produce verbose output
- n display info in numeric codes
- nn display both manufacturer and device name and associated codes
- x displays pci configuration space for each device as a hexadecimal dump
- b shows IRQ numbers and other data as seen by devices
- t displays a tree view depicting relationship b/w devices
- s displays only devices which match the listed specs (used to trim results)
kernel modules
stand-alone driver files
directory for kernel modules
/lib/modules
responsible for loading kernel modules
lsmod (no options)
command to display info about kernel modules
modinfo or modprobe
command to see memory consumed by kernel modules
lsmod
command to insert a module
insmod (use modprobe instead)
pros for modprobe
- automatically loads dependency modules
- add kernel options to the end of the command line
- specify module by name rather than filename
configure file for modprobe
/etc/modprobe.conf
modprobe switches
- v verbose output
- r remove mod
- l list modules
- f force even if kernel version isn’t a match
- n dry run
USB 2.0 speeds
up to 480Mbps
USB 3.0 speeds
up to 4.8Gbps
usb filesystem
/proc/bus/usb
command for usb management
lsusb
lsusb switches
lsusb utility displays basic info
- v verbose output about each product
- s restricts output to specified bus and device number
- d vendor and product codes
- t displays device list as a tree to more easily see connected controllers
- -version displays version of the lsusb utility and exits