Changes

Jump to: navigation, search

OPS235 Lab 1 - Fedora17

1,475 bytes removed, 12:26, 24 September 2018
no edit summary
= Using Linux to Access Block Devices and Filesystems =
[[Category:OPS235]][[Category:OPS235 Labs]]
== Objectives ==* Format, mount, {{Admon/caution|THIS IS AN OLD VERSION OF THE LAB|'''This is an archived version. Do not use, and unmount ext3, ext4, and vfat filesystems on USB flash drivesthis in your OPS235 course.* Create filesystems on various storage devices* Create hard disk partitions* Backup filesystems and images* Mount a filesystem stored within a a regular file'''}}
=Fedora 17 Installation (on Main Host - f17host)= Reference ==* [http://linuxmanpages.com/ man pages] for cp, mount, umount, fdisk, mkdir, file, mkfs, dumpe2fs, grep, dd* Online reading material for weeks 1 and 2.
== Required materials ==
* [http://fedoraproject.org/get-fedora Fedora 12] Live CD
* USB flash drive, 64 MB or more in size (Warning: the contents of this drive will be erased)
* One SATA hard disk in a removable drive tray (minimum 80GB)
== Instructions Introduction==# Set your computer's drive selector switch to external, then power up the computer.# Insert the Fedora Live CD into the CD/DVD drive.# Reboot the system.# The boot process is completed when you see the GDM Login Screen. Click on "Automatic Login" to login as the "Live System User".# We are going to start by opening a terminal window to access our shell environment. Click on Applications --> System Tools --> Terminal to start the terminal.# At the top of the terminal window, you should see the command prompt similar to [liveuser@localhost ~]$ This prompt indicates that it is ready to take your command. The program that is running is called a shell.# At the command prompt, enter the command whoami (all in one word) and press return. This command shows the so-called User Name. Make notes of this user name.# At the command prompt, enter the command pwd and press return. This command shows the so-called present working directory or current working directory. Record the present working directory of the shell running on the terminal window. As we have not yet changed directories this should also be your users home directory. (Also indicated by the ~ character in the prompt)
{{Admon/important|Using Superuser Privilege|Throughout :* In this courselab, you may need are going to execute commands using install the privileges of the the administrative user Fedora (username "root", also called the "superuser"GNU/Linux Distribution). To switch to your removable hard disk from your account to the root account, type the command: <code>su -</code>burned DVD.
After switching user notice and make note of the change :* Although this will be a simple install, this Fedora Operating System will be a platform for other Virtual Machine Fedora installations (in your shell promptfuture labs). Also note Therefore, it is very important that you take the difference in output for the <code>whoami</code> time to carefully read and perform ALL steps, and <code>pwd</code> commandstake time to check your work.
Whenever this is required:* After performing the Fedora17 DVD installation, make a note of ityou will collect baseline information about your Fedora GNU/Linux system, and determine why superuser privilege is requiredperform some post installation configuration to prepare your system for the remainder of the labs.
When you are finished ==Objectives== # Perform a GNU/Linux installation using the root account type exit Fedora 17 distribution# Investigate information during and after the Fedora 17 installation# Perform an update after a recent installation ==Required Materials (Bring to return to your previous accountAll Labs)== * Fedora 17 LIVE CD* Fedora 17 x86_64 Installation DVD* SATA Hard Disk (in removable disk tray)* USB Memory Stick* Lab Logbook ==Prerequisites== * None (First Lab) ==Linux Command Online Reference== Each Link below displays online manpages for each command (via [http://linuxmanpages.com/ http://linuxmanpages.com]): {|width="100%" cellpadding="5" width="50%"|'''Utilities:'''|- valign="top"|:* [http://linuxmanpages.com/man8/rpm.8.php rpm]:* [http://linuxmanpages.com/man1/hostname.1.php hostname]:* [http://linuxmanpages.com/man1/uname.1.php uname]:* [http://linuxmanpages.com/man1/ps.1.php ps]:* [http://linuxmanpages.com/man8/ifconfig.8.php ifconfig]:* [http://linuxmanpages.com/man8/netstat.8.php netstat]:* [http://linuxmanpages.com/man8/route.8.php route]:* [http://linuxmanpages.com/man1/nslookup.1.php nslookup]:* [http://linuxmanpages.com/man1/wc.1. Avoid php wc]|} Normally you would read man pages on the machine you're working on using the superuser account unless absolutely necessaryman command, because for example '''man rpm''' will show you the manual page for the rpm command. ==Resources on the superuser account has unlimited privilege web==Additional links to tutorials and a typo can destroy your systemHOWTOs::* [http://docs.fedoraproject.org/en-US/Fedora/17/html/Installation_Guide/ Fedora 17 Installation Guide]}}=Performing Lab 1= ==Investigation 1: How to Perform a Fedora DVD Install on Your Removable Hard Drive ==
{{Admon/note|Disabling the Auto-mounting of Devices|At this point we need to disable the ability for our linux system to automatically detect and mount removeable media. This would interfere with the learning objectives of the rest of the lab. To do this enter the command=== Part 1: <code>killall devkit-disks-daemon</code>. '''You will need to do this again if you reboot during this lab.'''}}Simple Things ===
=== Investigation 1: How does Linux enable you # Insert your '''removable SATA hard disk''' into the drive tray.# Set your computer's drive selector switch to access two different drives without using '''external''' (a.k.a ''position #4'').# Power up the computer and insert the '''Fedora 17 Installation DVD''' into the CD/DVD drive designator? ===.# Wait until the Fedora DVD boots (could take a few moments).
{{Admon/important|NTFS Flash Drives|Most flash drives are formatted using the FAT Boot-up Issues (or "VFAT" or "FAT32"Fedora17) filesystem in Seneca's Computer labs|If for compatibility with a wide range of computer systems. However, some drives may be formatted with another filesystem type such as NTFS (primarily used on Windows systems). Ifreason, in the following steps, your drive Fedora17 Installation DVD does not mount with the type "vfat", try again with type "ntfs".}}boot:
# Type :* Restart the command mount. Describe the output of the command in your lab log. What do the fields of data represent? Use the man page for the mount command computer, and google searches to find this information# Insert your USB flash drive into a USB port on the computer.# Because we have turned off '''press the automatic mounting feature nothing will happen. In order function key F10 to access specify the file system on this storage device we must mount it on to our existing file/directory structureboot''' (eg. DVD drive).# To mount :* If the user is prompted for a device we must first create a mount point to mount it on. Create a new directory called <code>/media/usb</code> password, '''simply press ENTER''' (These steps should be done as "root"without typing any password)# Next we need to use at the mount command to mount the devicepassword prompt. Try typing the following command: <code>mount -t vfat /dev/sdb1 /media/usb</code>. This command contains 3 important pieces of information (command arguments):#* <code>-t vfat</code> tells Choose the mount command to mount it as a FAT filesystemDVD drive from the list of devices avalable for boot. (Most likely choice for a USB flash drive)#:* <code>/dev/sdb1</code> tells the mount command which device You will need to mount. (If perform this didn't work try <code>/dev/sdc1</code> or <code>/dev/sda1</code>)#* <code>/media/usb</code> tells the mount command where technique to mount ensure that Fedora boots from the device hard drive (the "mount point"in future labs)# Type the command mount and compare the output with the output from step 1. Record what has changed.# What file system type is the USB device mounted as? Where was it mounted? What is the device name?# Create a file in the directory /media/usb/ by redirecing the output of the cal command: cal >/media/usb/month# Display a detailed listing of the directory where the device is mounted * If you have tried this technique, and record the output: ls -l /media/usb# Type the command umount /media/usb -- What happened Fedora Installation DVD does not boot, you may have to the contents of the /media/usb directory? Compare results with step 9.# Type the command mount and observe the output. What is different from step 6? Why?# Make burn a new mount point called /media/usb2 Mount your usb flash drive on the new mount pointFedora Installation DVD.|# Display a detailed listing of the new mount point again. Is your file there?}}
Answer <ol> <li value="5">Note the Investigation 1 question: How does Linux enable time at the beginning of your installation.</li> <li>When the Fedora17 Installation DVD boots, it will prompt the user to test the media (i.e. DVD) for integrity. Since time is limited for installation in the lab, select '''SKIP'''. On the other hand, if the install did not work, then you can test out the integrity of the DVD in the computer lab during your spare time.</li> <li>Select the default language ('''English''') in the next install screen, and click '''Next'''.</li> <li>Select the default '''keyboard layout''' and '''Basic Storage Devices''' in the following installation screens.</li> <li>Set your hostname (name of the computer) to <big>'''f17host'''</big> (one word, no space, all lowercase).</li> <li>Set your time zone to access two different drives without using '''Toronto'''. Note that the system (BIOS) clock is set to local time, not UTC.</li> <li>Root Password: enter a drive designator? password of your own choosing. Pick one that is hard to guess to protect your system. (Write Recommendation: use the first letter and all the answer in your lab log bookpunctuation from a favorite phrase or song verse. For example, "To be or not to be, that is the question!" could become the password "Tbontb,titq!").</li> </ol>
=== Investigation Part 2: How do you create a vfat or ext3 filesystem? Partitioning ===
{{Admon/tip | Flash drives with no partition table You're supposed to use this hard drive only for this course| If your device name ends in a letter (But if you really need to use it for exampletwo courses, and the professor for the other (probably windows) course will allow it is <code>/dev/sdb</code> instead of <code>/dev/sdb1</code>), add <code>-I</code> to the <code>mkfs</code> commands in this section. This is because ask your USB flash drive does not have a partition table, which normally causes an error; the <code>-I</code> option tells mkfs to proceed anywaysprofessor for help with partitioning.}}
# Unmount your USB flash drive.# Enter the command: <codeol>mkfs -t ext3 /dev/sdb1 </codeli>#* What is the purpose of this command? Use the man page for mkfs to research what If you did get a warning with this command.#* Did we execute the command on the something like "This device name or the mount point?# Attempt to mount the USB flash may contain data" - it's probably your new hard drive using the command and you used in Investigation 1can safely use it. What was the result?</li># Check the man page for the mount command to see how to change your command <li>Select '''Create Custom Layout''', we don't want to mount the device correctly, and issue that command.# Once the device is mounted do a long directory listing of use the mount pointFedora default setup now. What has changed?# Do an internet search to find out what the <code/li>lost+found </codeli> directory is for. Record On your findings in your notes.# Create a new file on the device using drive you will need at least the same technique used in Investigation 1following partitions.# Unmount the device and remount it on the original mount pointThese may be primary partitions or logical drives. Is the new file there?# Type the command mount and observe the type value for the USB flash drive filesystem. Compare this value to If you have more space than 250GB available - you can add the type found extra space in Investigation 1.# Change your current working directory equal parts to where the device is mounted./home and /var/lib/libvirt/images</li># Attempt to unmount the USB flash drive <ul><li>'''20GB''' for '''/''' (i. What was the result? Why? Record your findings in your notese."root")</li># Solve the error and unmount the device.# Consult the man pages for <codeli>mkfs'''30GB''' for /home</codeli> and <codeli>mkfs.ext3'''8GB''' for '''swap''' (Note: "swap" must be selected from the drop down menu)</codeli> to see how to reformat the device to a ext3 file system with a volume label that is the same as your learn ID.# Enter the command to reformat the device.# The <codeli>dumpe2fs '''100GB''' for '''/var/lib/libvirt/devimages'''</sdb1li></codeul> command will allow us to see detailed information about ext3 filesystems. Use it to confirm your volume label is correct and record the size of your journal.# Mount the device again as an ext3 filesystem.# While the device is still mounted reformat the device as a vfat filesystem. What error message did you receive? Why? <li>Record your conclusions briefly in your notes.# Unmount the device lab logbook what partitions you created of what size and format it as vfat.# Now you will investigate what happens when you copy files device names were assigned to the device name rather than the mount point. Issue the command cp /etc/hosts them (/dev/sdb1# Now mount your devicesda1, etc. Was it successful? Try mounting it as ext3). Was it successful? What has happened to the filesystem on the device?</li># Reformat it as vfat and mount it.# Unmount the device.</ol>
===Investigation Part 3: How do you create an ext3 filesystem on a USB flash drive with a volume label?Completing Installation ===
{{Admon/tip | Tip: | Check the man page for <codeol>dumpe2fs </codeli>.}}# Shutdown your computer. Select in the next screen the '''Graphical Desktop''' applications, and in the additional repositories section (Under at the "System" menubottom)# Insert your removable SATA hard diskaccept the default settings, remove your USB flash drive and restart the computerthen proceed. (Leave your You may look at what's available if you choose "Live CDCustomize now" in but you don't need to customize the computer)software installed at this point.</li># When <li>Add in your lab logbook a brief description of the computer has restarted term "software repository" and what its major purpose serves (what you have logged inthink it does). Insert your USB flash drive into We will not add any existing repositories since we are not currently connected to the USB portInternet.# Open a terminal window and run Therefore, we will customize the repositories later.<code/li>mount </codeli> command.# It is quite possible that '''Proceed with the device name for your USB flash drive has changed from what you were using previouslyinstallation. Your hardware configuration is different because now you have a hard drive connectedThis may take some time'''. One way to determine what Record in your USB device name is now is to look at the system lab log. Use the tail command to view the last 20 lines of -book the file <codeu>/var/log/messagesgeneral</codeu> There should be kernel entries that were generated when you inserted steps in the installation process (displayed in the devicedialog box).</li># Create a Linux ext3 filesystem on the USB device <li>When installation is complete, giving it a volume label of "Lab1"screen will confirm completion, and record the following in in your logbook:#* What is the block size for the new format?#* How many blocks were created?#* How often will the new filesystem be automatically checked?#* What volume label was given to ask the filesystem?# According user to remove the man page what is DVD, and reboot the purpose of dumpe2fs?# If you executed dumpe2fs on an MScomputer. Write in your lab log-DOS filesystem what do you think would be book the result?time it took to perform this DVD Fedora install.</li># Mount the USB device onto the mount point /media/lab1# Copy the files <code>/etc/services</codeli>Remove the Fedora Installation DVD,<code>/etc/networksand click '''Reboot'''.</codeli> to the USB flash drive.
=== <li>When the system starts, set or accept the time and date default.</li> <li>Create a user account for yourself using the same user ID as your learn account, and create a suitable password.</li> <li>Normally, you would want to enable '''Network Time Protocol''', but since we will be experimenting with the networking turned off in later labs, '''leave it disabled'''.</li> <li> Click on '''Do Not Send Hardware Profile'''.</li> <li>Finish the post-installation customization, wait for the login screen to appear, and then login to your computer account and your created (i.e. your name).</li> <li>Proceed to Investigation 4 - How do you create hard disk partitions?===2</li> </ol>
* Enter '''Answer the command <code>fdisk -l Investigation 1 observations /dev/sda</code> and describe the output questions in your lab log book. The output may be similar to the following:'''
Disk /dev/sda: 12.0 GB, 12072517632 bytes 255 heads, 63 sectors/track, 1467 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System ...* Read Investigation 2: How many file packages and study this [http://tldp.org/HOWTO/Partition/fdisk_partitioning.html reading] about how to use the fdisk command before you go files are installed on to the next step.* Review the man page for the fdisk command.system?==
{{Admon/caution | Important/warning! | The following operation will erase '''For the contents rest of your hard disk. If you have any useful data stored on your diskthe tasks in this lab, you must back it up first or use another hard disk that does not contain useful data on it.|Do not plan on sharing the hard disk with the Windows course! You will be doing lots of tasks that may cause you login to lose your data.}}# Enter installed Fedora system using your Learn account, open a terminal and execute the command fdisk /dev/sda following listed Linux commands to start the hard disk partition program.# At the fdisk command prompt, enter the letter obtain information for your lab-logbook'''p''' to print out the current partition table of the hard disk(lab1). If there are any partitionsyou get a Permission Denied message when trying to execute a command, use then switch to the '''dsuperuser''' option to delete all of them, starting with the highest partition number first.# At account by running the fdisk command prompt, use the '''nsu -''' and '''t''' commands to create these three partitions: /dev/sda1 - 300MB type in your password for "root" (primary, Linux Native) /dev/sda2 - since you are the rest of the hard disk (extended) /dev/sda5 - 300MB (logical, Linux Nativemain administrator for your Fedora system) * Use the '''p''' option the display the new partition and record it in your log book.* Remember to use Once the '''w''' option intended command is executed, type "exit" to write exit from the new partitions information instead of the '''q''' option superuser account and return to quit without saving.* Logout and restart Fedorayour regular Learn account.
Answer the Investigation 4 question in your lab log book.
===Investigation 5 - How do {{Admon/important|Using Superuser Privilege|Throughout this course, you create and access a Linux filesystem on a hard disk partition?===may need to execute commands using the privileges of the the administrative user (username "root", also called the "superuser"). To switch from your account to the root account, type the command: <code>su</code>
# After rebooting Fedora, open up a Terminal Window switching user notice and enter make note of the command <code>fdisk -l /dev/sda</code> to display the hard disk partition table. Verify that you have partitioned change in your hard disk correctlyshell prompt.# Create a Linux 3rd extended filesystem (ext3) on the 300MB primary partition /dev/sda1# Create Also note the empty directory <code>/mnt/harddisk</code> to serve as a mount point difference in output for the partition.# Use the command <code>mount -t ext3 /dev/sda1 /mnt/harddisk</code> to attach the file system you just created to the Fedora Live Linux file system tree.# Copy the files <code>/etc/passwdwhoami</code> and <code>/var/log/messagespwd</code> to the mounted partition. Can you do this with a single command?# Unmount the partitioncommands.
Answer the Investigation 5 question in your lab log book'''Whenever this is required, make a note of it, and determine why superuser privilege is required.'''
===Investigation 6 - How can When you save an image of are finished using the root account type exit to return to your previous account. '''Avoid using the superuser account unless absolutely necessary, because the superuser account has unlimited privilege and a filesytem?===typo can destroy your system.'''
# Your In some documentation, you may see the command <code>/dev/sda1su -</code> partition is formatted with an ext3 filesystem and contains 2 files. You can now create an "image" used in place of that device and duplicate it.# First create an image of the device using the following command: #*<code>dd if=/dev/sda1 of=sda1.imgsu</code># . The image file you created is a byte by byte duplicate of the original device and all of its contents. You can even mount it as a if it was a real partition. # Make a mount point called dash argument causes <code>/media/sda1-imagesu</code> and mount to go through the steps that would normally be performed when the image file using root user logs in, including (1) running the following command: #* startup scripts (such as<code>mount -o loop -t ext3 sda1.img /mediaetc/sda1-imageprofile</code>#* (The and <code>-o loop/root/.bash_profile</code> option is used and (2) changing to mount regular files as if they were real block storage devices.)# List the contents of the mount point. Are your files there?# Copy the file root user's home directory (<code>/var/log/boot.logroot</code> to the mount point.# Unmount the image).
Answer Note that the Investigation 6 question root user's home directory (<code>/root</code>) is ''not'' the same as the root directory of the system (<code>/</code>). It is also in your lab logbooka different directory than the rest of the home directories, which are typically in <code>/home</code> -- the reason for this is that <code>/home</code> is sometimes on a network filesystem shared by another server (as is the case on Matrix), and it's important that the system administrator be able to log in to the system even if the network is not operating normally.}}
===Investigation 7 - How can restore/duplicate an image of a filesystem?===
# <code>/dev/sda5</code> was Navigate through your Graphical Fedora system, '''locate and run a partition created exactly the same size as <code>/dev/sda1</code>. We should be able to restore the <code>/dev/sda1</code> image file terminal program (in order to it without any loss of dataissue Linux commands).# Remember that <code>/dev/sda5</code> was unformatted. Restore Issue and record the image file by using commands used and the <code>dd</code> command:#* <code>dd if=sda1.img output generated in each of=/dev/sda5</code># Now attempt to mount <code>/dev/sda5</code> onto the mount point <code>/media/harddisk</code> # Were you successful? # Does the partition contain a filesystem?# List the contents of <code>/media/harddisk</code> are all 3 files there?following steps:'''
Answer # The name of the Investigation installation log file is <code>'''/root/install.log'''</code> -- It is an ASCII file (how can you be sure?) which can be viewed with the <code>'''less'''</code> command. # You can make use of this file to determine how many packages have been installed: complete the following command to count the number of packages that are labelled "Installing" in the installation log file::: <code>'''grep ________________ /root/install.log | wc -l'''</code><ol> <li value="3">Using the <code>rpm</code> command: you can also use the following commands to list all the installed packages, and the total number of packages installed:</li></ol>:: <code>'''rpm -q -a'''</code>:: <code>'''rpm -q -a | wc -l'''</code>:: <code>'''rpm -qa | wc -l'''</code><ol> <li value="4">The <code>'''-q'''</code> option means query, and the <code>'''-a'''</code> option means all (in other words, query all installed software packages). Did you get the same number of packages from the above two methods?</li> <li>Some of the files on your system were installed with the software packages, and some were created by system activity (for example, by creating your Learn account and by logging in). If you know the package name (from the <code>install.log</code>), you can list all the files that were installed from the package by using the following command:</li></ol>:: <code>'''rpm -q -l package_name'''</code><br />(where '''package_name''' represents the name of the ''application'' or ''package'')<ol> <li value="6">This combines the <code>'''-q'''</code> (query) option with the <code>'''-l'''</code> (list filenames) option</li> <li>You can pipe the outupt through <code>'''wc -l'''</code> to count the number of lines:</li></ol>:: <code>'''rpm -ql package_name| wc -l'''</code><ol> <li value="8">Using what you learned in steps 3, 4, and 7 question in , get a count of the total number of files installed by all of the software packages on your system.</li><li>To find out the name that you have assigned to your Linux system, enter the command: <code>'''hostname'''</code></li><li>To find out the kernel version of your GNU/Linux workstation and the date it was created, enter the command: <code>'''uname -rv'''</code></li><li>To find out all the system processes running on your lab logbookGNU/Linux workstation, enter the command: <code>'''ps -ef'''</code></li><li>To capture the list of all the system processes to a file called <code>'''ps.lst'''</code>, enter the command: <code>'''ps -ef > ps.lst'''''</code></li></ol>
===Investigation 8 {{Admon/important|Pathname for USB Stick|The procedure has changed to refer to the usb device for distributions prior to Fedora17 (eg. /media/usb- Accessing a compressed file system image===device-name). For Fedora17, the new device pathname is:<br /><b>/run/media/userloginid/usb-device-name</b> .<br /><br />Note: You can press the <b>tab</b> key to guess what the userloginname/usb-device-name is...}}
# Download [https://cs.senecac.on.ca/%7Efac/ops235/lab1-image.bin | lab1-image.bin] and copy that file to your mounted hard disk partition.# To determine the file type of the file <code>lab1-image.bin</codeol>, enter the command:#* <codeli value="13">file lab1-image.bin</code># Record the output. What was Copy the original name of the uncompressed installation log file?# The <code>file<'''/code> command in the previous step should also report that <code>lab1-image.bin<root/code> is a gzip compressed data fileinstall. # Use the <code>gunziplog'''</code> command to uncompress and the file'''ps.# You will probably receive an error message when you run the <code>gunzip</code> command. You may need lst''' to rename the file before you can uncompress it successfully. See the man pages for additional information if required.# After you have uncompressed the file rename it to the original name reported in step 3.# To determine the file type of the file <code>lab1-image.img</code>a USB memory key, enter the command:#* <code>file lab1-image.img</code># Record the output. What type of data does the file contain?# Mount the file system image. The command should be similar to what you used in investigation 6.# Copy the contents of the file system image or '''scp''' to your desktop.# To display the specific information about the ext3 file system contained in the file <code>lab1-imagematrix account as a backup.img</codeli>, enter the command:#* <code>dumpe2fs lab1-image.img</codeol># From the output, find out the volume name and the block count of the ext3 file system.
Conclusion: Not only can we put a Linux file system on a removeable storage {{Admon/tip |Backup up to your USB Key|When your USB key is inserted into your computer, the device, or is recognised and assigned a hard disk partition, we name. You can view your USB drive by issuing the command <code>ls /run/media/yourusername</code> and view the mounted devices. Then you can also create issue a Linux file system command as "super-user" to copy the files to your USB device.}}<ol><li value="14">View the section below to learn about and perform an update on your fresh Fedora install (you may have to find spare time to perform this install if you are running short on a regular disk filelab time). '''Do <u>not</u> proceed to Investigation 3 without performing an update'''.</li></ol>
Answer {{Admon/tip |Consider Remaining Lab Time Prior to Performing Upgrade|'''Carefully check the Investigation 8 question remaining time in your lab logbookprior to performing an upgrade on the operating system'''. It can take 30 - 90 minutes to perform an upgrade...}}
===Investigation 9 - How do you create a file system in a regular file?===
# Create an empty file that {{Admon/tip |Updating Fedora|The Fedora software is exactly 3 MB in size using updated frequently to add features, fix bugs, and upgrade security. '''Perform a system update to get the following command:#* <code>dd if=/dev/zero latest versions of=/tmp/fstest bs=1k count=3072</code># How does this command ensure that the file is 3 MB in size? # What is packages installed in Fedora: Start the file at first?# Create an ext3 filesystem within the newly-created file <codeFirefox web browser, turn off popup window blocking (select ''Edit>/tmp/fstest</code>.# Note Preferences'', then select the warning message/question that appears.# Mount Content tab and uncheck the filesystem (remember box to use the loopback option; refer Block Popups), then login to Investigation 8 if required)SeneNET. Use Open a mountpoint of your choosing.# Copy the files <code>/etc/services</code> terminal and type <code>/etc/protocolssu</code> to the filesystem mounted in the previous stepstart a shell as root.# Unmount Enter the filesystem.# Test your filesystem to be sure that the files command <code>/etc/servicesyum update</code> ''' This will download and <code>/etc/protocols</code> were in fact copied into install all of the filesystem within packages that have been updated since the file named <code>/tmp/fstest</code>installation DVD image was created.# How much space is left in that filesystem? If you complete this command at Seneca it should run quite fast as Seneca College hosts a Fedora Repository mirror (Hint: <code>df -h</code>a copy of all of the current fedora packages, on a local web server).}}
'''Answer the Investigation 9 question 2 observations / questions in your lab logbooklog book.'''
===Investigation 10 - How can you backup 3: What is the MBR (Master Boot Record)network configuration?===
{{Admon/note | Please take note! | A master boot record (MBR), is the 512-byte boot sector that is the first sector of a partitioned hard disk. The MBR is used for the following:
* Holding a disk's primary partition table.
* Bootstrapping operating systems after the computer's BIOS passes execution to the MBR.
* Uniquely identifying individual disk media, with a 32-bit disk signature.}}
# We {{Admon/tip |Rusty Issuing Linux commands since ULI101?|To be an effective Linux administrator, you need to become comfortable on issuing Linux commands in a shell, and use resources to quickly learn how to properly formulate Linux commands...<br /><br />You can duplicate run the first 512 bytes of following online tutorials to practice (refresh) issuing Linux commands. These tutorials were designed for another course called "OPS435", but you can still use them for practice. Simply open a hard disk using shell, SSH into the dd commandMatrix server (eg. ssh yourusername@matrix.senecac.on.ca) and run the following 4 tutorials (you can copy and paste these separate pathnames and run like a program):#* <codebr /><br />'''/home/ops435/tutorials/tutorial1<br />/home/ops435/tutorials/tutorial2<br />/home/ops435/tutorials/tutorial3<br />dd if=/devhome/sda of=mbr.bak bs=512 count=1ops435/tutorials/vi-tutorial'''<br /><br /code># Use You can also refer to the section above called '''Linux Command Online Reference''' to see how use use the command following Linux commands to backup obtain the MBR of your hard diskrequired information.# Under what circumstances do you think this will be useful?}}
Answer # To check the Investigation 10 question network configuration settings obtained from the DHCP server, run the following commands, describing the output in your lab logbooklog book:#* '''ifconfig'''#* '''route'''#* '''nslookup''' (at the > prompt, enter the word "server" (do not type the quotes) and record the output. Type exit to leave nslookup).<br /><br /># Find the following information in the output of the above commands:#* '''MAC address''' (physical or hardware address) of the ethernet network interface#* '''Subnet mask'''#* '''The IP address''' (logical address) assigned by the DHCP server#* '''The default route''' (gateway)#* '''The DNS nameserver'''
== Completing '''Answer the Lab ==Investigation 3 observations / questions in your lab log book.'''
{{Admon/important | Important! | Arrange evidence of each of the following items on the screen, and then ask your professor or lab monitor to check them== Investigation 4:}}SELinux ==
# USB Formatted as ext3 ( )
# Volume Label is "LAB1" ( )
# USB Mounted on <code>/media/lab-one</code> ( )
# Following files on USB services, networks ( )
# <code>/dev/sda5</code> contains 3 files ( )
# jpg on Desktop ( )
# <code>/tmp/fstest</code> mounted ( )
# Instructor satisfied with complete and detailed lab notes ( )
== Preparing {{Admon/important|SELinux|SELinux stands for '''Security-Enhanced Linux'''. It is a component that helps to better secure the Quizzes ==system to protect against intrusion (hackers). Usually, SELinux is enabled upon the default install of Fedora. SELinux can be a good thing, if you take care of it and are aware that it is enabled or disabled. It is recommended that you '''disable SELinux by default''' for this course, since you will be communicating with other virtual machines and can cause machines NOT to communicate.}}
The online readings linked # Disabling SELinux on Fedora is actually quite simple, just edit the course web page contain some useful information about Free file '''/etc/selinux/config''' and Open Source Software. Use them and Internet searches to answer change the following questions line to help you prepare for the quizzeslook like this:#* SELINUX=disabled
# Who is Linus Torvalds?# Name 3 open source software projects widely used today?# What license agreement does GNU/Linux use?# What are = Completing the 4 basic software freedoms that define "Free Software"?# Who makes up the Fedora Community?# Name 4 other significant Linux "Distros"# What command can you use to determine the type of data a file contains?# What are 3 journalled filesystems supported by Linux?# What command will create a Linux ext3 file system on <code>/dev/sdb5</code>, with a volume label called "ops235"?# What is the main function of the <code>fdisk</code> utility?# What command is used to attach the file system on a storage device (e.g. hard disk partition, flash memory card etc) to the file system on a running Linux/UNIX system?# What command is used to detach the file system on a storage medium from the file system on a running Linux/UNIX system?# What type of files are stored in the <code>/dev</code> directory?# Is the <code>dd</code> command used to copy multiple files to another directory?Lab =
==Useful Information=='''Check off the following items before asking your instructor to check your lab:'''
Hard disk partition names (disk drive is * '''xTask 1''' - Install GNU/Linux Workstation using Fedora * '''Task 2''' - Collect system information after installation.* '''Task 3''')- Fedora Updated{|class="sortable" border="1" cellspacing="0" width="80%"* '''Task 4''' - Collect network information
|-!Partition!1!2!3!4!5!6!...'''Arrange evidence for each of these items on your screen, then ask your instructor to review them and sign off on the lab's completion:'''
|-* Can login with your "learn" account name* Has the package count|Type* Has correct size partitions for:|primary:* '''root /''' (20GB), '''/home''' (30GB), extended'''swap''' (8GB):* '''/var/lib/libvirt/images''' (100GB)|primary, extended:* Hint: Can issue '''lsblk''' (listblock command)|primary, extended* Has the correct IP address and MAC address|primary, extended* Find out the default route (gateway)|logical* IP of the DNS name server|logical* Name and contact information on your disk pack|logical* Lag Logbook (lab1) notes filled-in.
|-|Linux Name|/dev/sdx1|/dev/sdx2|/dev/sdx3|/dev/sdx4|/dev/sdx5|/dev/sdx6|/dev/sdx7 -- sdx15= Preparing for Quizzes =
|}# How many packages were installed?# How many files (correct to the nearest hundred) were installed?# How many users were created automatically on your system (do not count your learn account)?# What is your learn account's UID and GID?# What is your learn account's home directory?# What is the home directory for the user "root"?# How do you determine the host name of your GNU/Linux workstation?# What command can display the NIC's MAC address?

Navigation menu