Chapter 5
Video 3: Section 101.2 - Boot the system
- BIOS (Basic Input Output System)
- Change boot order
- Bootloader
- LILO (linux loader)
- GRUB (grand unified bootloader)
- Specifies what to boot: which drive, kernel etc.
- Show all information about boot and after
- # dmsg
- Show information about boot only
- # cat var/log/dmsg
- Init manages all other processes and is the parrent process
- Files that are loaded at boot are located at /boot/
- All the grub files are located at /boot/grub
Video 4: Section 101.3 - Runlevels and Rebooting
- Runlevels
- 0 = Halt (linux standard)
- 1 = Single User Mode (recovery) (linux standard)
- 2 = Debian/ubuntu default
- 3 = Redhat/SUSE (text mode)
- 4 = Wildcard
- 5 = Redhat/SUSE (GUI mode)
- 6 = Reboot (linux standard)
- Shows configuration file for init (when system boots up)
- # cat /etc/inittab
- Inside the /etc/init.d folder are scrips which can start or stop programs
- Inside the /etc/rc3.d folder are all the symbolic links that directs to /etc/init.d scripts
- The scripts in this folder are started when the pc is started with runlevel 3 (rc4.d = runlevel 4 etc)
- The scrips with K01, are killed
- The scrips with S01, are started
- Scrips are loaded on order of number
- One process depends on the other, you cant kill network before mail or mail will complain
- Shutdown
- # shutdown {options} {time} {message}
- [ -k ] = Notify users of a shutdown
- [ -c ] = Cancel a shutdown
- [ -r ] = Reboot
- [ -P ] = Power off
- {time} = now, 2205, +3 = specify a time for the shutdown (+3= 3 minutes for now
- {message} = A message for all the users
- Change runlevel
- # telinit {newrunlevel}
- # init {newrunlevel}
- On some systems init cant directly recieve commands
Video 6: Section 102.2 - Install Boot Manager
- LILO bootloader configuration file is in /etc/lilo.conf
- Install LILO
- # lilo
- GRUB Legacy bootloader configuration file is in /boot/grub/menu.lst
- default = automatic boot to (0 = 1st, 1 =2nd etc)
- timeout = time until the default boots
- LINUX
- title = Title
- kernel = kernel location, root= drive uuid, ro = read only, quiet = no feedback, splash = bootlogo
- Windows
- title = Titel
- root = drive where the partition is : (hd1,0) second harddrive, first partition
- chainloader = loads the windows-boot-loader
- Install GRUB Legacy
- # grub-install {device}
- {device} = /dev/sda = The device to install GRUB on
- Do not edit the GRUB2 configuration file but edit the /etc/grub.d of /etc/default.grub
- Backup the MBR
- # dd if={device} of={backupdirectory}.mbr bs=512 count=1
- {device} = The device that needs to be backuped
- {backupdirectory} = T
- bs = block space (standard 512b)
- count = number of partitions (mbr is first)
- Restore the MBR
- # dd if={backupdirectory}.mbr of={device} bs=512 count=1
- {device} = The device that needs to be restored
- {backupdirectory} = Directory that contains the *.mbr file/backup file
- bs = block space (standard 512b)
- count = number of partitions (mbr is first)
- A superblock contains information about a filesystem
Video 17: Section 103.8 - Basic File editing with "vi"
- Open a file in "vi"
- # vi FILE.txt
- Change modes (command mode is default)
- [ ESC ] = Go back to Command mode (read only)
- [ C ] = Command mode
- [ I ] = Insert mode (type at selected charcter)
- [ A ] = Append mode (type behind selected character)
- [ O ] = Add line below selected character
- Getting around the text
- [ H ] = Go Left
- [ J ] = Go Down
- [ K ] = Go Up
- [ L ] = Go Right
- Arrowkeys can be used also
- COMMAND MODE: Cut, Copy and pasting
- [ Y ] + [ Y ] = Copy the current line in the register (clipboard)
- [ D ] + [ D ] = Cut the current line and put it in the register
- [ D ] + [ W ] = Cut the current selected word and put it in the register
- [ D ] + [ L ] = Cut the current selected character and put it in the register
- [ P ] = Paste the line/word in the register under/after the current line
- COMMAND MODE: Search
- [ / ] + {searchterm} = Search in the file and go to the first occurance AFTER the cursor
- [ ? ] + {searchterm} = Search in the file and go to the first occurance BEFORE the cursor
- [ N ] = Next occurance
- [ SHIFT ] + [ N ] = Previous occurance
- COMMAND MODE: Execute
- [ : ] + "e!" = Revert back to saved file
- [ : ] + "w" = Save the file
- [ : ] + "w {newfile}"= Save As another file.
- [ : ] + "q!" = Exit without saving
- [ : ] + "wq" = Save and Exit
- [ Z ] + [ Z ] = Save and Exit
- COMMAND MODE: Change
- [ C ] + [ W ] = Change the selected word
- [ C ] + [ L ] = Change the selected character