LPI 2010 NLLGG Trainer: Jeroen van Pelt Bijeenkomst 5: Hardware en het opzetten van Filesystemen
Terugblik bijeenkomst 4 Determine and configure hardware settings Create partitions and filesystems Maintain the integrity of filesystems Afronding en huiswerk Agenda
Candidates should be able to determine and configure fundamental system hardware. Key Knowledge Areas Enable and disable integrated peripherals. Configure systems with or without external peripherals such as keyboards. Differentiate between the various types of mass storage devices. Set the correct hardware ID for different devices, especially the boot device. Know the differences between coldplug and hotplug devices. Determine hardware resources for devices. Tools and utilities to list various hardware information (e.g. lsusb, lspci, etc.) Tools and utilities to manipulate USB devices Conceptual understanding of sysfs, udev, hald, dbus Boek: LPI Determine and configure hardware settings
Geheugenbeheer Procesbeheer Communicatie met device drivers Communicatie met bestandssystemen Communicatie met de shell Taken van de kernel
Fysiek + logisch (Swap) = virtueel geheugen Adresruimte Gebruik code door meerdere processen Geheugenbeheer
pstree System-calls Signals SIGSTOP SIGKILL Communicatie tussen processen: Message queues (named pipes) Semaphores Shared memory Procesbeheer
Communicatie met apparaten Apparaatbestanden (udev) Major/minor nummer (/dev; mknod) Drie typen Character (zonder buffer) Block (512/1024 bytes blocks) Network (netwerksubsysteem) Device drivers
lsmod modprobe (-v / -r) modinfo Configuratie opties: /etc/modprobe.conf /etc/modprobe.d Beheer van afhankelijkheden depmod modules.dep Kernel modules
alias Alternatieve naam install Voer shell script uit bij laden remove Voer shell script uit bij verwijderen include Neem aanvullende configbestanden mee blacklist Gebruik de interne aliasnamen niet Modprobe.conf
/proc/sys debug dev fs kernel net vm Aanpassen echo /proc/sys/ sysctl Aanpassen van kernel parameters
Oefenen
Candidates should be able to configure disk partitions and then create filesystems on media such as hard disks. This includes the handling of swap partitions. Key Knowledge Areas Use various mkfs commands to set up partitions and create various filesystems such as: ext2 ext3 xfs reiserfs v3 vfat Boek: LPI Create partitions and filesystems
Apparaatbestanden /dev/hda /dev/sda Filesystemlabel mkfs -t ext3 –L mijnlabel /dev/sda2 tune2fs –L mijnlabel /dev/sda2 LABEL=mijnlabel i.p.v. /dev/sda2 Udev apparaatnamen /dev/disk Adresseren van opslag
fdisk Oefenen op aparte schijf/USB stick Partities beheren
mkfs [options] -t [fstype] device [blocksize] Common options: -t: fstype:File system type. -c :Check the device for bad blocks before building the filesystem. Examples: mkfs -t msdos /dev/fd0 Bestandssystemen aanmaken
mke2fs [options] device [blocksize] Common options: -b: Specify the block sizefstype: File system type. -c : Check the device for bad blocks before building the filesystem. -j: Create the filesystem with an ext3 journal. -L: Set the volume label for the filesystem. Examples: mkefs -b 2048 /dev/fd0 -L floppy Extended bestandssystemen
du [options] [files...] Common options: -a: All files not just directories -b: Print size in bytes -c: Total -h: Human readable format. (1K, 20M,...) Examples: du -ch /home/jeroen du – disk usage
df [options] [files...] Common options: -a: All included filesystems with 0 blocks. -t: Limit listing to a filesystem type. -h: Human readable format. (1K, 20M,...) Examples df -t ext2 -h df – filesystem disk space
Candidates should be able to maintain a standard filesystem, as well as the extra data associated with a journaling filesystem. Key Knowledge Areas Verify the integrity of filesystems. Monitor free space and inodes. Repair simple filesystem problems. Boek: 5.4 LPI Maintain the integrity of filesystems
fsck [options] -t [fstype] device [fsck-options] Common options: -A: Check all filesystems in fstab Common fsck-options: -a: Automatically repair. -r: Interactively repair. Example: fsck -t msdos /dev/fd0 -a fsck -t reiserfs /dev/hda2 -r Integriteit van bestandssysteem
e2fsck [options] device Common options: -b: Use an alternate super block filename. -c: Run badblocks program and mark allbad blocks. -f: Force checking even if the filesystem seems clean. -a or -p: Automatically repair. -y: Non-interactive mode Examples: e2fsck -ay /dev/fd0 e2fsck -f /dev/hda2 Extended bestandssystemen checken
debugfs device Common commands: Help:Give an help on all the command available. Stats: Give a statitstics of the media. Stat file:Give a statistic of the file on the media. logdump: Dump the journal's media into a file Filesystem debug
dumpe2fs [options] device Common options: -b: print the bad blocks of the filesystem. -h: Display only the superblock information. Examples: dumpe2fs -h /dev/fd0 Dump ext filesysteminfo
tune2fs [options] device Common options: -i#: Interval between filesystem checks [d|m|w]. -l: List the contents of the filesystem superblock. -L: Set the volume label of the filesystem. Examples: tune2fs -L floppy /dev/fd0 Tune extended filesystems
xfs_check xfs_repair XFS analyseren en beheren
“Gebruikers, permissies, procesbeheer” Lees in boek: 6.1: Aanmaken van gebruikersaccounts (p ) 6.6: Werken met quota (p ) 7.1: Eigenaars (p ) 7.2: Werken standaard permissies: read, write, execute (p ) 9.1: Linux-processen begrijpen (p ) 9.2: Procesmonitoring (p ) 9.3: Processen beheren (p ) Herhaal de opdrachten van bijeenkomst 5 Huiswerk: