% CST8207 Week 12 Notes – disks, partitions, file systems % Ian! D. Allen - - [www.idallen.com] % Winter 2014 - January to April 2014 - Updated Thu Apr 3 05:38:38 EDT 2014 Readings, Assignments, Labs, and ToDo ===================================== - Read (at least) these things (All The Words): - [Week 12 Notes HTML] – this file – **Read All The Words** - [Unix/Linux Partitions and File Systems - fdisk, mkfs, mount, swap] - [List of Commands You Should Know] - [Video Tutorials on Lynda.com] - Using your [lynda.com] account, watch [Unix for Mac OS X Users] - **4. Ownership and Permissions 34m 58s** - The root user 1m 57s - sudo and sudoers 5m 20s Assignments and Lab work this week ---------------------------------- ____ _ ____ ____ | _ \| | ___ __ _ ___ ___ | _ \ ___ / ___|___ _ _ _ __ ___ ___ | |_) | |/ _ \/ _` / __|/ _ \ | | | |/ _ \ | | / _ \| | | | '__/ __|/ _ \ | __/| | __/ (_| \__ \ __/ | |_| | (_) | | |__| (_) | |_| | | \__ \ __/ |_| |_|\___|\__,_|___/\___| |____/ \___/ \____\___/ \__,_|_| |___/\___| _____ _ _ _ | ____|_ ____ _| |_ _ __ _| |_(_) ___ _ __ | _| \ \ / / _` | | | | |/ _` | __| |/ _ \| '_ \ | |___ \ V / (_| | | |_| | (_| | |_| | (_) | | | | |_____| \_/ \__,_|_|\__,_|\__,_|\__|_|\___/|_| |_| When you are done your evaluation do `touch courseval_done` in your `Assignments` directory on the CLS and the nag messages will go away. Check the due date for each assignment and put a reminder in your agenda, calendar, and digital assistant. - Read All The Words, Do, and then Submit via Blackboard: - [Assignment #08 HTML] – CentOS installation and configuration - You need to get this working before you can do the final assignments in this course. See your instructor for help. - [Assignment #10 HTML] – [Permissions], [Umask] and [Worksheet #08 HTML] - minimum permissions needed for basic file operations - [Assignment #11 HTML] – processes, syslog, crontab, at, mail, tar - [Package Management], [System Logs], [Processes], [Cron and At] - [Assignment #12 HTML] – [Users and Groups] - Simpsons, StarWars, and the Megadeth Project - Coming Soon: Assignment #13 HTML – Disks, Partitions, File Systems - Really do **Read All The Words**. You don’t get a second chance to get it right. ### Optional Bonus Assignments – extra marks - [Assignment #03 HTML] – *Optional* BONUS VIM Text Editor Practice - this is an *optional* worksheet for a BONUS assignment using `vim` - Optional Reading: [The VI (VIM) Text Editor] - [Worksheet #06 HTML] – *Optional* VIM Text Editor Practice - this is an *optional* worksheet for a BONUS assignment using `vim` - Optional command-line VIM tutorial: the `vimtutor` program on the CLS. - [Assignment #09 HTML] – BONUS assignment to review second midterm test - this is an *optional* BONUS assignment worth extra credit - there is a checking script available to verify the format of your file From the Class Notes link on the Course Home Page ================================================= - Review last week. Did you do everything assigned last week? ![http://xkcd.com/1316/] From the Classroom Whiteboard/Chalkboard ======================================== - **Take notes in class!** Your in-class notes would go here. - Updated [Network Diagnostics] with information from Kevin. See if this fixes your SSH problems into your Linux machines. - Survey survey (really!): - eText survey: - $1000 in gift certificates - Dogbert on [satisfaction surveys] - Pay attention to how permissions work with `su`, `sudo` and shell redirection! See the notes on redirection in [Users and Groups – sudo] - `$ sudo touch foo >bar` - `$ su -c 'touch foo' >bar` - `$ sudo cp /etc/shadow foo` - `$ su -c 'cp /etc/shadow foo'` - `$ sudo cat /etc/shadow >bar` - `$ su -c 'cat /etc/shadow' >bar` - The `userdel` command does not delete HOME directories (unless you use the `-r` option). What does `ls` show for a file’s user and group if that user and group have been deleted from the system? See `userdel` in [Users and Groups – userdel] # useradd redshirt # id redshirt uid=508(redshirt) gid=509(redshirt) groups=509(redshirt) # ls -ld /home/redshirt drwx------ 2 redshirt redshirt 4096 Nov 20 02:38 /home/redshirt # userdel redshirt # id redshirt id: redshirt: No such user # ls -la /home/redshirt [... what does ls show now? ...] - Reminder that [Assignment #12 HTML] contains at the start short descriptions of the command names you need to complete the assignment. This is in addition to having the names mentioned in the [List of Commands You Should Know]. - Reminder on searching the course notes: Recall that in a previous [Assignment 4] you were shown how to use `fgrep` on the CLS to search for a string in all the course notes? Please do it. $ fgrep -l 'whois' newnotes/*.txt newnotes/900_unix_command_list.txt newnotes/assignment11.txt newnotes/week02notes.txt newnotes/week03notes.txt newnotes/week04notes.txt - In-class symlink exercise on the CLS: Create one of these symbolic link targets in /tmp Use your CLS userid as the link name in /tmp You may have to remove an existing name first Easy target: linux Medium target: symbolic link Hard target: $$$ It's a "symbolic link" $$$ You can check your work by executing the script `/tmp/do.sh` - Your selected editor for `crontab -e` is in `~/.selected_editor` and can be changed with `select-editor` - Choose VIM. Your CentOS Linux install has no other editor. - Use an [SMS Gateway List] to find the email address of your SMS enabled phone, and email a test message directly to your phone. (May be subject to length restrictions and incur an arbitrary delay.) - SMS Gateway List (from Christopher Mckee) - SMS Gateway List (from Matthew Mercier) - SMS Gateway List - “I found out that when using wind mobile you have to send a text message to 4000 to initialize your mailbox.” – Christopher Mckee Don’t create World-Writable Files --------------------------------- Finding things that are not symbolic links that have *other* write permissions: find dir ! -type l -perm /o+w -ls (You have one assignment that requires you to create world-writable files.) Multiple Remote Login Sessions ------------------------------ 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! Real Sysadmin Work ================== - The full documentation on basic commands (better than `man` pages): - Google propels Linux to the top - [How to fix any computer] - Joke (from a Linux student): > Subject: joke, clean\ > Why didn’t the chicken cross the road?\ > Because he did not have an absolute path and could’t find his way.\ > HAHAHAHAHA! Linux/Unix Jobs --------------- - From Michael Anderson: - Linux Videos ------------ - Nixie Pixel explains Linux (with a background music soundtrack): - The BASH Shell I - The BASH Shell II - Linux File Systems - Network Tools and Diagnostics - Password Security (with [XKCD Password] reference) Take Notes In Class! -------------------- - [Take Notes In Class] ![Take Notes in Class] -- | 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 [www.idallen.com]: http://www.idallen.com/ [Unix/Linux Partitions and File Systems - fdisk, mkfs, mount, swap]: 720_partitions_and_file_systems.html [List of Commands You Should Know]: 900_unix_command_list.html [Video Tutorials on Lynda.com]: 910_lynda_index.html [lynda.com]: https://lyceum.algonquincollege.com/Lynda [Unix for Mac OS X Users]: http://wwwlyndacom.rap.ocls.ca/Mac-OS-X-10-6-tutorials/Unix-for-Mac-OS-X-Users/78546-2.html [Permissions]: 500_permissions.html [Umask]: 510_umask.html [Package Management]: 520_package_management.html [System Logs]: 580_system_log_files.html [Processes]: 600_processes_and_jobs.html [Cron and At]: 630_crontab_at_job_scheduler.html [Users and Groups]: 700_users_and_groups.html [The VI (VIM) Text Editor]: 300_vi_text_editor.html [http://xkcd.com/1316/]: http://imgs.xkcd.com/comics/inexplicable.png "http://xkcd.com/1316/" [Network Diagnostics]: 000_network_diagnostics.html [satisfaction surveys]: http://dilbert.com/strips/comic/2005-04-07/ [Users and Groups – sudo]: 700_users_and_groups.html#sudo-doesnt-affect-shell-redirection [Users and Groups – userdel]: 700_users_and_groups.html#userdel-delete-user [Assignment 4]: assignment04.html#searching-for-text-inside-files-e.g.course-notes [SMS Gateway List]: http://en.wikipedia.org/wiki/List_of_SMS_gateways [How to fix any computer]: http://theoatmeal.com/blog/fix_computer [XKCD Password]: http://xkcd.com/936/ [Take Notes In Class]: http://read101.ca/1013/03/algonquincollege.html [Take Notes in Class]: data/remember.jpg "Take Notes in Class" [Plain Text]: week12notes.txt [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/