% CST8207 Week 13 Notes - Boot Process, GRUB, Run Levels, services, telinit, chkconfig % Ian! D. Allen - idallen@idallen.ca - www.idallen.com % Winter 2013 - January to April 2013 - Updated Wed May 8 21:01:24 EDT 2013 Readings, Assignments, Labs, and ToDo ===================================== - Fill in your [Course Evaluation Survey] for this course. Only nine questions! Closes April 14. - Read (at least) these things (All The Words): - [Week 13 Notes HTML] - this file - ** Read All The Words ** - [Unix/Linux Partitions and File Systems - fdisk, mkfs, mount, swap] - [Create VMware Disk PDF] - [Unix/Linux Boot Process, GRUB, Run Levels, services, telinit, chkconfig] - [List of Commands] - From “Unix for Mac OS X Users” at [lynda.com] - more to come - Read (All The Words), Do, and save (not for hand in) - Fedora 12 Installation in VMware: [Lab Worksheet #07 PDF] - [Installing and Configuring VMware Tools for Fedora 12] - [CST8207 Frequently Asked Questions] - Have your instructor check you off on the installation using the five points on the last page of the worksheet. - [Lab Worksheet #11 PDF] - user and group management - [Lab Worksheet #12 PDF] - Disks, Partitions, and File Systems - [Lab Worksheet #13 PDF] - Boot Process and GRUB - Read (All The Words), Do, and then Submit via Blackboard: - optional BONUS Midterm#2 assignment: [Assignment #09 HTML] (optional) - [Assignment #11 HTML] - user and group management (Megadeth Project) - **New Due Date** Monday April 8 - [Assignment #12 HTML] - Disks, Partitions, and File Systems - [Assignment #13 HTML] - Boot Process, GRUB, Run Levels, telinit, chkconfig - Write down the dates of your Final Exams from the [Course Home Page].  ![The Freedom to Choose] Final Exam – April 24 1:30pm in C144 ==================================== - Your Final Exam schedule is posted in the ICT office. The Final Exam is closed-book, no aids, no devices. - Your Final Exam covers the entire course, with emphasis on material since the second midterm test, and on material that students did not answer well in the previous two tests. - You must read the [Test Instructions] before the test for important directions on how to enter your answers and the test version number on the mark-sense forms. - There may be more questions on the test than you can answer in the time allowed; answer the ones you know, first. - Practice tests are available for the Final Exam. - Read the [Practice Test README Information]. - See the [Practice Tests] and answer files. - The same questions are posted under **Practice** on Blackboard. From the Class Notes link on the Course Home Page ================================================= - Review last week. Did you do everything assigned last week? - [Unix/Linux Command Reference] From the Classroom Whiteboard/Chalkboard ======================================== - Your in-class notes go here. - Fill in your [Course Evaluation Survey] for this course. Only nine questions! Closes April 14. - Thu Apr 3: Expected 90 responses, received 50 `56%` - Read [Last Term’s Course Evaluations] Some Commands ============= Keep a notebook with a [List of Commands] in it. - Differences between files: the `diff` command: - `diff file1 file2` - lines marked with “`<`” are in the left file (`file1`) - lines marked with “`>`” are in the right file (`file2`) - each change is marked with the line number at which it was found Some Review Questions ===================== 1. Rewrite `/home/me/../you/../../etc/../home/./me/../you/../me/./foo` as a simplified absolute path. 2. In an empty directory, how many words are in file `b` after this: `echo x >a ; ls >b` 3. File `a` contains 3 lines. File `b` contains 4 lines. How many lines are in file `d` (not in `c`) after this command line: `ln a d ; ln d c ; cat a a b b d d >c` 4. What is the final link count of file `a` after all the commands in the above question? 5. What does password field `:x:` mean in /etc/passwd? 6. If you are in `/home/me` and `ls -l` shows `bar -> /foo` then dereference `bar` as an absolute path with no symbolic links. 7. If you are in `/home/me` and `ls -l` shows `bar -> foo` then dereference `bar` as an absolute path with no symbolic links. 8. If you are in `/home/me` and `ls -l` shows `bar -> dir/foo` then dereference `bar` as an absolute path with no symbolic links. 9. If you are in `/home/me` and `ls -l` shows `bar -> ../foo` then dereference `bar` as an absolute path with no symbolic links. 10. If you are in `/home/me` and `ls -l` shows `bar -> ../you/foo` then dereference `bar` as an absolute path with no symbolic links. 11. What command will show the type of file system inside a partition? 12. What command will show the amount of free disk space in a partition? 13. What command will recursively show disk usage in directories? 14. Give a command line that will show lines containing the name `root` inside all four account files under `/etc`. 15. Give a command line that will modify and move the home directory of account `bob` to be `robert` 16. Give a command that will recursively find all pathnames (anywhere) owned by UID 1000. 17. Give a command that shows all partition names and System IDs on the third disk. 18. True or False: The System ID of a partition restricts what kind of file system you can put into it. 19. Give the Linux and GRUB names of the third partition on the second disk. 20. Give a command that will change permissions on a directory to make the names in it readable by group members, but prevent group access to anything in the directory. Do not change any other permissions. 21. Name three types of partitions that you would find in a standard DOS partition table (e.g. as used by `fdisk`). 22. What kernel option keyword do you add to boot a machine single-user? 23. What GRUB line do you modify to add the above keyword? 24. Which option to ls displays the directory itself and not its contents? 25. What file records your default Run Level? 26. What command displays your numeric UID and GID? 27. How do you execute the program `foo` in the current directory? 28. How do you display the value of the `HOME` environment variable? 29. Comment out the `splashimage` line from your GRUB configuration file and reboot. What is different? 30. How do you make your shell always search for commands in directory `/usr/local/bin`? 31. Mount the file system in `/dev/sdb2` onto `/mnt/test` and try this command (as `root`): `ln /etc/passwd /mnt/test/foo` – why does it fail? *Hint: Links are made with inode numbers inside file systems. Different file systems have different sets of inode numbers.* How could you make a different kind of link that would work? 32. True or False: When going from Run Level 2 to Run Level 5, the system goes through Run Levels 3 and 4 first. 33. When you use `chkconfig` to enable a service, the service is immediately started. 34. True or False: The `service` command enables a service but does not immediately start it. 35. Why is the sum of **used** plus **available** disk space usually about 5% smaller than the actual free space in a Linux `ext` file system? Real Sysadmin Work ================== You are now logging in to multiple machines. Set your shell `PS1` prompt to include the machine name, so that you don’t type the wrong command on the wrong machine! Reporting Bugs – A Case History in Four Hours --------------------------------------------- My course notes are written using the `vim` text editor in [Plain Text] [Pandoc Markdown] format and then processed automatically into HTML. I needed to know how to have Pandoc produce a formatted plain-text output file that wouldn’t lose any of the formatting information and could be re-input to Pandoc to re-generate itself exactly. 1. `9:00am`: I go to the [Pandoc Markdown] web site and search the documentation for a “pandoc” output format. I don’t find anything. 2. `9:30am`: I go to the [Pandoc-Discuss] online discussion forum to see if anyone has asked about a “pandoc” output format. I don’t find anything. 3. `9:45am`: I join the [Pandoc-Discuss] discussion forum, using my Google account. 4. `9:48am`: I post [this question] to the [Pandoc-Discuss] discussion forum. 5. `11:17am`: I get a reply suggesting a partial solution from a user Dirk. 6. `11:31am`: I explain why Dirk’s solution doesn’t work. 7. `11:38am`: I get a reply from John MacFarline, **the author of Pandoc himself**, giving me the correct solution. He updates his answer again at `11:43` with a further explanation. 8. `11:45am`: I try his solution and discover something odd. I produce a small example that shows the odd formatting. 9. `12:12am`: I post the odd example to the forum. 10. `12:36am`: A user Tillmann Rendel say that I’ve discovered a bug. 11. `12:50am`: Tillmann goes to the source code of Pandoc and locates the Perl code that causes the bug. 12. `12:52am`: Pandoc author John MacFarlane confirms the bug and fixes it. He “pushes” the new version of the Pandoc source code out to the web server so that everyone can update their own copy of Pandoc. I download and build the fixed Pandoc. - Elapsed time from question posted to correct solution: 1 hour 50 minutes. - Elapsed time from my bug report to the bug fix by author: 40 minutes. (!) Let’s see you try doing that with a bug in Microsoft Word. `:-)` -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/ [Plain Text] - plain text version of this page in [Pandoc Markdown] format [Course Evaluation Survey]: https://coursefeedback.algonquincollege.com/etw/ets/et.asp?nxappid=WCQ&nxmid=start [Unix/Linux Partitions and File Systems - fdisk, mkfs, mount, swap]: 720_partitions_and_file_systems.html [Create VMware Disk PDF]: 730_create_vmware_disk.pdf [Unix/Linux Boot Process, GRUB, Run Levels, services, telinit, chkconfig]: 750_booting_and_grub.html [List of Commands]: 900_unix_command_list.html [lynda.com]: https://lyceum.algonquincollege.com/Lynda [Lab Worksheet #07 PDF]: worksheet07.pdf [Installing and Configuring VMware Tools for Fedora 12]: 009_vmware_tools.html [CST8207 Frequently Asked Questions]: 007_freqently_asked_questions.html [Lab Worksheet #11 PDF]: worksheet11.pdf [Lab Worksheet #12 PDF]: worksheet12.pdf [Lab Worksheet #13 PDF]: worksheet13.pdf [The Freedom to Choose]: common/poweredbylinuxTheFreedomtoChooseGreen2.png "The Freedom to Choose" [Test Instructions]: 000_test_instructions.html [Practice Test README Information]: PRACTICE_TEST_README.txt [Practice Tests]: indexcgi.cgi#XQuizzes__Tests__and_Exams [Unix/Linux Command Reference]: http://files.fosswire.com/2007/08/fwunixref.pdf [Last Term’s Course Evaluations]: ../../12f/course_evaluation.html [Plain Text]: week13notes.txt [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/ [Pandoc-Discuss]: https://groups.google.com/forum/#!forum/pandoc-discuss [this question]: https://groups.google.com/forum/#!topic/pandoc-discuss/oQqd5ck136E