= Using Linux to Access Block Devices and Filesystems =[[Category:OPS235]]{{Draft}}
[[Category:OPS235]][[Category:OPS235 Labs]]
=OPS235 Lab 1 GNU/Linux Installation - Fedora 16= Objectives ==* Format, mount, use, and unmount ext3, ext4, and vfat filesystems on USB flash drives.* Create filesystems on various storage devices* Create hard disk partitions* Backup filesystems and images* Mount a filesystem stored within a a regular file
== 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 Introduction==* Fedora 13 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 160GB)
== Instructions ==# Set your computer's drive selector switch to external:* In this lab, 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 install 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 Fedora (GNU/Linux Distribution) 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 removable hard disk from your users home directoryburned DVD. (Also indicated by the ~ character in the prompt)
{{Admon/important|Using Superuser Privilege|Throughout :* Although this coursewill be a simple install, you may need to execute commands using the privileges of the the administrative user this Fedora Operating System will be a platform for other Virtual Machine Fedora installations (username "root"in future labs). Therefore, also called it is very important that you take the "superuser"). To switch from your account time to the root accountcarefully read and perform ALL steps, type the command: <code>su</code>and take time to check your work.
:* After switching user notice performing the Fedora16 DVD installation, you will collect baseline information about your Fedora GNU/Linux system, and make note of the change in perform some post installation configuration to prepare your shell prompt. Also note system for the difference in output for remainder of the <code>whoami</code> and <code>pwd</code> commandslabs.
'''Whenever this is required, make a note of it, and determine why superuser privilege is required.'''==Objectives==
When you are finished #Perform a GNU/Linux installation using the root account type exit to return to your previous account. '''Avoid using Fedora 16 distribution#Investigate information during and after the superuser account unless absolutely necessary, because the superuser account has unlimited privilege and Fedora 16 installation#Perform an upgrade after a typo can destroy your system.'''recent installation
In some documentation, you may see the command <code>su -</code> used in place of <code>su</code>. The dash argument causes <code>su</code> to go through the steps that would normally be performed when the root user logs in, including (1) running the startup scripts (such as <code>/etc/profile</code> and <code>/root/.bash_profile</code> and (2) changing to the root user's home directory (<code>/root</code>).
Note that the root user's home directory ==Required Materials (<code>/root</code>) is ''not'' the same as the root directory of the system (<code>/</code>Bring to All Labs). It is also in a 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.}}==
{{Admon/important|Disabling the Auto* '''Fedora 16 LIVE CD''' -mounting of Devices|Normally, when You can burn this onto a storage device such as a USB drive is inserted, CD-R in the system will automatically detect the storage device and use it. However, for this lab, we need to disable the ability for our Open Lab* '''Fedora system to automatically detect storage devices; this would interfere with the learning objectives of the rest of the lab. To do disable auto-detection of devices, this enter the command: <code>killall udevd</code>. 16 x_64 Installation DVD'''- You will need to do can burn this again onto a DVD-R in the Open Lab (or burn image onto a DVD+R if you reboot during this labare using the Freedom Toaster).* '''SATA Hard Disk'}}'' (in removable disk tray)* '''USB Memory Stick''' (minimum 64M)* '''Lab Logbook (Lab1 Reference Sheet)''' (to make notes and observations).
=== Investigation 1: How does Linux enable you to access two different drives without using a drive designator? =Prerequisites==
{{Admon/tip|NTFS Flash Drives|Most flash drives are formatted using the FAT * '''None''' (or "VFAT" or "FAT32"First Lab) filesystem 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). If, in the following steps, your drive does not mount with the type "vfat", try again with type "ntfs".}}
{{Admon==Linux Command Online Reference==Each Link below displays online manpages for each command (via [http:/caution | Important/warning! | The following operation will erase the contents of your usb flash drivelinuxmanpages. If you have any useful data stored on your disk, you must back it up first or use another usb flash drive that does not contain useful data on itcom/ http://linuxmanpages.com])::* [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. Do not plan on sharing the usb flash drive with the Windows course! You will be doing lots of tasks that may cause you to lose your data1.}}php wc]
# Type 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 and google searches to find this information# Insert your USB flash drive into a USB port ==Resources on the computer.web==# Because we have turned off the automatic mounting feature nothing will happen. In order Additional links to access the file system on this storage device we must mount it on to our existing file/directory structure.tutorials and HOWTOs:# To mount a device we must first create a mount point to mount it on. Create a new directory called <code>/media/usb</code> (These steps should be done as "root")# Next we need to use the mount command to mount the device. Try typing the following command: <code>mount -t vfat /dev* [http:/sdb1 /media/usb</code>. This command contains 3 important pieces of information (command arguments):#* <code>-t vfat</code> tells the mount command to mount it as a FAT filesystemfedora. (Most likely choice for a USB flash drive)#* <code>/dev/sdb1</code> tells the mount command which device to mountredhat. (If this didn't work try <code>com/devdocs/sdc1</code> or <code>/dev/sda1<release-notes/code>)Fedora Release Notes]#:* <code>/media[http:/usb</code> tells the mount command where to mount the device (the "mount point")# Type the command mount and compare the output with the output from step 1docs. Record what has changedfedoraproject.# 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 >org/media/usb/month# Display a detailed listing of the directory where the device is mounted and record the output: ls en-l /media/usb# Type the command umount /mediaUS/usb -- What happened to the contents of the Fedora/media16/usb directory? Compare results with step 9.# Type the command mount and observe the output. What is different from step 6? Why?# Make a new mount point called html/mediaInstallation_Guide/usb2 Mount your usb flash drive on the new mount point.# Display a detailed listing of the new mount point again. Is your file there? Fedora 16 Installation Guide]
Answer the Investigation =Performing Lab 1 question: How does Linux enable you to access two different drives without using a drive designator? (Write the answer in your lab log book).=
=== Investigation 21: How do you create to Perform a vfat or ext3 filesystem? =Fedora DVD Install on Your Removable Hard Drive ==
{{Admon/tip|Flash drives with no partition table | If # Insert your device name ends in a letter (for example, it is <code>/dev/sdb</code> instead of <code>/dev/sdb1</code>), add <code>-I</code> to '''removable SATA hard disk''' into the <code>mkfs</code> commands in this sectiondrive tray. This is because # Set your USB flash computer's drive does not have selector switch to '''external''' (a.k.a partition table, which normally causes an error; ''position #4'').# Power up the computer and insert the <code>-I<'''Fedora 16 Installation DVD''' into the CD/code> option tells mkfs to proceed anywaysDVD drive.# Wait until the Fedora DVD boots (could take a few moments).}}
# Unmount your USB flash drive.# Enter the command to format your USB drive{{Admon/important|Boot-up Issues (Fedora16) in Seneca's filesystem: <code>mkfs -t ext3 /dev/sdb1</code>#* What is the purpose of this command? Use the man page Computer labs|If for mkfs to research what you did with this command.#* Did we execute the command on the device name or the mount point?# Attempt to mount the USB flash drive using the command you used in Investigation 1. What was the result?# Check the man page for the mount command to see how to change your command to mount the device correctlysome reason, and issue that command.# Once the device is mounted do a long directory listing of the mount point. What has changed?# Do an internet search to find out what the <code>lost+found</code> directory is for. Record your findings in your notes.# Create a new file on the device using the same technique used in Investigation 1.# Unmount the device and remount it on the original mount point. Is the new file there?# Type the command mount and observe the type value for the USB flash drive filesystem. Compare this value to the type found in Investigation 1.# Change your current working directory to where the device is mounted.# Attempt to unmount the USB flash drive. What was the result? Why? Record your findings in your notes.# Solve the error and unmount the device.# Consult the man pages for <code>mkfs</code> and <code>mkfs.ext3</code> to see how to format the device again (using <code>mkfs</code>) as a ext3 file system with a volume label that is the same as your learn ID.# Enter the command to reformat the device.# The <code>dumpe2fs /dev/sdb1</code> 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? Record your conclusions in your notes.# Unmount the device and format it as vfat.# Now you will investigate what happens when you copy files to the device name rather than the mount point. Issue the command cp /etc/hosts /dev/sdb1# Now mount your device. Was it successful? Try mounting it as ext3. Was it successful? What has happened to the filesystem on the device?# Reformat it as vfat and mount it.# Unmount the device.Fedora16 Installation DVD does not boot:
===Investigation 3: How do you create an ext3 filesystem on * Restart the computer, and '''press the function key F10 to specify the device to boot''' (eg. DVD drive). :* If the user is prompted for a USB flash password, '''simply press ENTER''' (without typing any password) at the password prompt.:* '''You will need to perform this technique to ensure that Fedora boots from the hard drive with (in future labs)'''.:* If you have tried this technique, and the Fedora Installation DVD does not boot, you may have to burn a volume label?===new Fedora Installation DVD.|}}
{{Admon/tip|Tip: manpage| Check the manpage for <codeol>dumpe2fs </codeli value="5"> using Note the time at the command: beginning of your installation.<code/li>man dumpe2fs </codeli>When the Fedora16 Installation DVD boots, it will prompt the user to test the media (i.e.}}# Shutdown your computerDVD) for integrity. Since time is limited for installation in the lab, select '''SKIP'''. (Under On the other hand, if the "System" menu)# Insert your removable SATA hard diskinstall did not work, remove your USB flash drive and restart then you can test out the integrity of the DVD in the computerlab during your spare time. </li> <li>Select the default language (Leave your "Live CD" '''English''') in the computer)next install screen, and click '''Next'''.</li># When <li>Select the computer has restarted default '''keyboard layout''' and you have logged '''Basic Storage Devices''' in. Insert your USB flash drive into the USB portfollowing installation screens.</li># Open a terminal window and run <li>Set your hostname (name of the computer) to <codebig>mount'''f16host'''</codebig> command(one word, no space, all lowercase).# It is quite possible that the device name for <br />Record in your USB flash drive has changed from what lab logbook why you were using previously. Your hardware configuration think it is different because now you have a hard drive connected. One way important to determine what set your USB device hostname to this exact name instead of using another name is now is to look at the system log. Use the tail command to view the last 20 lines of the file ..</li> <codeli>/var/log/messagesSet your time zone to '''Toronto'''.</codeli> There should be kernel entries that were generated when you inserted the device.# Create <li'''>Root Password: enter a Linux ext3 filesystem on the USB device, giving it a volume label password of "Lab1"your own choosing'''. Pick one that is really, and record the following in in really hard to guess to protect your logbooksystem. (Recommendation:#* What is use the block size for first letter and all the new format?#* How many blocks were created?#* How often will the new filesystem punctuation from a favorite phrase or song verse. For example, "To be automatically checked?#* What volume label was given or not to the filesystem?# According to the man page what be, that is the purpose of dumpe2fs?# If you executed dumpe2fs on an MS-DOS filesystem what do you think would be question!" could become the result?password "Tbontb,titq!").</li># Mount the USB device onto the mount point /media/lab1# Copy the files <codeli>/etc/servicesSelect '''Use All Space''', to have the entire disk for the current Fedora16 OS.</codeli> and <code/ol>{{Admon/etc/networks</code> important|Previous Contents of Hard Drive will be Erased|If you are using an existing removable Hard Disk from a previous course, you must allow the Installation DVD to "wipe" all previous contents prior to proceeding with this lab (no exceptions). Failure to the USB flash driveerase existing contents can cause problems in subsequent labs such as running out of hard disk space...|}}
===Investigation 4 - How do you create hard {{Admon/important|Using Entire Hard Disk|You may be "hesitant" to want to use the entire disk partitions?===for just one operating system, but we will be using software that will allow us to run virtual machines for other Fedora installs (while your host system called '''f16host''' is also running).|}}
* Enter the command <code>fdisk -l /dev/sda</code> and describe the output in your log book. The output may be similar to the following:
<ol> <li value="13">When prompted, make certain to select '''Fresh Install''' in order to erase any previous contents of the hard disk.</li> <li>You will be prompted to confirm the options that you have chosen prior to performing the DVD install. If you are not certain, you can "Go Back". As soon as you are satisfied with your selections, then click '''Write Changes to Disk '''.</devli> <li>Record briefly in your lab logbook what activity occurs during this installation process.</sda: 12.0 GBli> <li>Select in the next screen the '''Graphical Desktop''' applications, 12072517632 bytes 255 headsand in the additional repositories section (at the bottom) accept the default settings, 63 sectorsthen proceed.</track, 1467 cylindersli> Units = cylinders <li>Add in your lab logbook a brief description of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System the term "software repository" and what its major purpose serves (what you think it does).We will not add any existing repositories since we are not currently connected to the Internet.Therefore, we will customize the repositories later.</li>* Read and study this [http: <li>'''Proceed with the installation. This may take some time'''. Record in your lab log-book the <u>general<//tldpu> steps in the installation process (displayed in the dialog box).org</HOWTO/Partition/fdisk_partitioningli> <li>When installation is complete, a screen will confirm completion, and ask the user to remove the DVD, and reboot the computer.html reading] about how to use Write in your lab log-book the fdisk command before you go on time it took to the next stepperform this DVD Fedora install.</li>* Review <li>Remove the man page for the fdisk commandFedora Installation DVD, and click '''Reboot'''.</li></ol>
{{Admon/caution important| Important/warning! Boot-up Issues (Fedora16) in Seneca's Computer labs| The following operation will erase the contents of your hard disk. If you have any useful data stored on your disk, Each time 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 to lose boot from your data.}}# Enter the command fdisk /dev/sda to start the removable hard disk partition program.# At the fdisk command prompt, enter the letter '''p''' to print out the current partition table of the hard disk. If there are any partitions, use the '''d''' option to delete all of them, starting with the highest partition number first.# At the fdisk command prompt, use the '''n''' and '''t''' commands to create these three partitionsdrive: /dev/sda1 - 300MB (primary, Linux Native) /dev/sda2 - the rest of the hard disk (extended) /dev/sda5 - 300MB (logical, Linux Native) * Use the '''p''' option the display the new partition and record it in your log book.* Remember to use the '''w''' option to write the new partitions information instead of the '''q''' option to quit without saving.* Logout and restart Fedora.
Answer :* '''Press the Investigation 4 question in your lab log bookfunction key F10 and specify the hard disk device to boot'''<br />(eg. SATA drive). :* If the user is prompted for a password, '''simply press ENTER''' <br />(without typing any password) at the password prompt.}}
<ol> <li value===Investigation 5 - How "21">When the system starts, set or accept the time and date default.</li> <li>Create a user account for yourself using the same name as your learn account, and create a suitable password (do not forget password!).</li> <li>Normally, you create 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 access a Linux filesystem on a hard disk partition?===your created (i.e. your name).</li> <li>Proceed to Investigation 2</li> </ol>
# After rebooting Fedora, open up a Terminal Window and enter '''Answer the command <code>fdisk -l Investigation 1 observations /dev/sda</code> to display the hard disk partition table. Verify that you have partitioned questions in your hard disk correctly.# Create a Linux 3rd extended filesystem (ext3) on the 300MB primary partition /dev/sda1# Create the empty directory <code>/mnt/harddisk</code> to serve as a mount point 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/passwd</code> and <code>/var/lab log/messages</code> to the mounted partition. Can you do this with a single command?# Unmount the partitionbook.'''
Answer ==Investigation 2: How many file packages and files are installed on the Investigation 5 question in your lab log book.system?==
===Investigation 6 '''For the rest of the tasks in this lab, you must login to your installed Fedora system using your Learn account, open a terminal and execute the following listed Linux commands to obtain information for your lab- How can logbook''' (lab1). If you save an image of get a Permission Denied message when trying to execute a filesytem?===command, then switch to the '''superuser''' account by running the command '''su -''' and type in your password for "root" (since you are the main administrator for your Fedora system). Once the intended command is executed, type "exit" to exit from the superuser account and return to your regular Learn account.
# Your <code>/dev/sda1</code> partition is formatted with an ext3 filesystem and contains 2 files. You can now create an "image" of that device and duplicate it.
# First create an image of the device using the following command:
#*<code>dd if=/dev/sda1 of=sda1.img</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 <code>/media/sda1-image</code> and mount the image file using the following command:
#* <code>mount -o loop -t ext3 sda1.img /media/sda1-image</code>
#* (The <code>-o loop</code> option is used 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 <code>/var/log/boot.log</code> to the mount point.
# Unmount the image.
Answer {{Admon/important|Using Superuser Privilege|Throughout this course, you may need to execute commands using the Investigation 6 question in privileges of the the administrative user (username "root", also called the "superuser"). To switch from your lab logbook.account to the root account, type the command: <code>su</code>
===Investigation 7 - How to restoreAfter switching user notice and make note of the change in your shell prompt. Also note the difference in output for the <code>whoami</duplicate image of a filesystem?===code> and<code>pwd</code> commands.
# <code>/dev/sda5</code> was '''Whenever this is required, make 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 to note of it without any loss of data.# Remember that <code>/dev/sda5</code> was unformatted. Restore the image file by using the <code>dd</code> command:#* <code>dd if=sda1, and determine why superuser privilege is required.img 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?'''
{{Admon/important|Duplicate Filesystem Serial Numbers|Since When you have copied are finished using the filesystem on /dev/sda1 root account type exit to /dev/sda5return to your previous account. '''Avoid using the superuser account unless absolutely necessary, because the filesystem serial number (UUID) will be the same on bothsuperuser account has unlimited privilege and a typo can destroy your system. Use this command to clear the filesystem /dev/sda1 so that it does not cause problems in the next lab: <code>mkfs -t ext3 /dev/sda1</code>}}'''
Answer In some documentation, you may see the Investigation 7 question command <code>su -</code> used in your lab logbookplace of <code>su</code>. The dash argument causes <code>su</code> to go through the steps that would normally be performed when the root user logs in, including (1) running the startup scripts (such as<code>/etc/profile</code> and <code>/root/.bash_profile</code> and (2) changing to the root user's home directory (<code>/root</code>).
===Investigation 8 - Accessing a compressed file system image=== # Download [https://cs.senecac.on.ca/%7Efac/ops235/lab1-image.bin lab1-image.bin] and copy Note that file to your mounted hard disk partition the root user's home directory (you may need to enter your Learn ID and password). The default download location is <code>~/Downloadsroot</code># To determine ) is ''not'' the same as the file type root directory of the file system (<code>lab1-image.bin</code>, enter the command:#* <code>file lab1-image.bin</code># Record the output). What was It is also in a different directory than the original name rest of the uncompressed file?# The home directories, which are typically in <code>file/home</code> command in -- the previous step should also report reason for this is that <code>lab1-image.bin/home</code> is sometimes on a gzip compressed data file. # Use network filesystem shared by another server (as is the <code>gunzip</code> command to uncompress the file.# You will probably receive an error message when you run the <code>gunzip</code> command. You may need to rename the file before you can uncompress case on Matrix), and it successfully. See 's important that 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>, 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 administrator be similar able to what you used log in investigation 6.# Copy the contents of the file system image to your desktop.# To display the specific information about the ext3 file system contained in even if the file <code>lab1-imagenetwork is not operating normally.img</code>, enter the command:#* <code>dumpe2fs lab1-image.img</code># 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 device, or a hard disk partition, we can also create a Linux file system on a regular disk file.}}
Answer the Investigation 8 question in your lab logbook.
===Investigation 9 - How do you create Navigate through your Graphical Fedora system, '''locate and run a file system terminal program (in order to issue Linux commands). Issue and record the commands used and the output generated in a regular file?===each of the following steps:'''
# Create an empty The name of the installation log file that is exactly 3 MB in size using the following command:#* <code>dd if=/devroot/zero of=install.log</tmp/fstest bs=1k count=3072code> -- It is an ASCII file (how can you be sure?) which can be viewed with the <code>less</code>command. # How does You can make use of this file to determine how many packages have been installed: complete the following command ensure that to count the file is 3 MB in size? # What is number of packages listed in the installation log file at first?:# Create an ext3 filesystem within the newly-created file :: <code>grep ________________ /tmproot/fstestinstall.log | wc -l</code>.# Note <ol> <li value="3">Using the warning message<code>rpm</question that appears.# Mount code> command: you can also use the filesystem (remember following commands to use 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 loopback <code>-a</code> option; refer to Investigation 8 if requiredmeans all (in other words, query all installed software packages). Use a mountpoint Did you get the same number of packages from the above two methods?</li> <li>Some of the files on your choosingsystem 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.# Copy 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</etc/servicescode><ol> <li value="6">This combines the <code>-q</code> and (query) option with the <code>-l</etccode> (list filenames) option</protocolsli> <li>You can pipe the outupt through <code>wc -l</code> to count the filesystem mounted 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 8, get a count of the previous steptotal number of files installed by all of the software packages on your system.</li># Unmount <li>To find out the name that you have assigned to your Linux system, enter the filesystem.command: <code>hostname</code></li># Test <li>To find out the kernel version of your filesystem to be sure that GNU/Linux workstation and the date it was created, enter the files command: <code>uname -r</etccode></servicesli><li>To find out all the system processes running on your GNU/Linux workstation, enter the command: <code> and ps -ef</code></etcli><li>To capture the list of all the system processes to a file called <code>ps.lst</protocolscode>, enter the command: <code>ps -ef > ps.lst''</code> were in fact copied into the filesystem within </li><li>Copy the installation log file named <code>/tmproot/fstestinstall.log</code>and the file ps.lst to a USB memory key, or scp to your matrix account as a backup.</li># How much space is left in that filesystem? <li>View the section below to learn about and perform an update on your fresh Fedora16 install (Hint: you may have to find spare time to perform this install if you are running short on lab time). '''Do <codeu>df -hnot</codeu>)proceed to Investigation 3 without performing an update'''.</li></ol>
Answer {{Admon/tip |Updating Fedora|The Fedora 16 software is updated frequently to add features, fix bugs, and upgrade security. '''Perform a system update to get the Investigation 9 question latest versions of the packages installed in your lab logbookFedora: Start the Firefox web browser, turn off popup window blocking (select ''Edit>Preferences'', then select the Content tab and uncheck the box to Block Popups), then login to SeneNET. Open a terminal and type <code>su</code> to start a shell as root. Enter the command <code>yum update</code>''' This will download and install all of the packages that have been updated since the installation DVD image was created. If you complete this command at Seneca it should run quite fast as Seneca College hosts a Fedora Repository mirror (a copy of all of the current fedora packages, on a local web server).}}
==='''Answer the Investigation 10 - How can you backup the MBR (Master Boot Record)?===2 observations / questions in your lab log book.'''
{{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 == Investigation 3: What 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.}}network configuration? ==
# We can duplicate To check the first 512 bytes of a hard disk using network configuration settings obtained from the DHCP server, run the dd command. Use this command to backup following commands, describing the MBR of output in your hard disklog book: <code#* '''ifconfig'''#* '''route'''#* '''netstat -rn'''#* '''nslookup''' (at the >dd if=/dev/sda of=mbrprompt, enter the word "server" (do not type the quotes) and record the output. Type exit to leave nslookup).bak bs=512 count=1<br /code>#* <code>if<br /code> is # Find the following information in the input file or deviceoutput of the above commands:#* <code>'''MAC address''' (physical or hardware address) of</code> is the output file or deviceethernet network interface#* <code>bs</code> is the block size -- 512 bytes '''The IP address''' (1 sectorlogical address) in this caseassigned by the DHCP server#* <code>count</code> is the number of blocks to be copied'''The default route''' (gateway)# Under what circumstances do you think this will be useful?* '''The DNS nameserver'''
'''Answer the Investigation 10 question 3 observations / questions in your lab logbooklog book.'''
== Completing the Lab ==
{{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:}}
# 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 ( )# Complete and detailed lab notes# '''Disk pack is labelled with your name and contact information ( )'''= Completing the Lab =
== Preparing for '''Check off the Quizzes ==following items before asking your instructor to check your lab:'''
The online readings linked on the course web page contain some useful * '''Task 1''' - Install GNU/Linux Workstation using Fedora * '''Task 2''' - Collect system information about Free and Open Source Softwareafter installation. Use them and Internet searches to answer the following questions to help you prepare for the quizzes:* '''Task 3''' - Fedora Updated* '''Task 4''' - Collect network information
# Who is Linus Torvalds?# Name 3 open source software projects widely used today?# What license agreement does GNU/Linux use?# What are 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 '''Arrange evidence for each of data a file contains?# What are 3 journalled filesystems supported by Linux?# What command will create a Linux ext3 file system these items on <code>/dev/sdb5</code>your screen, with a volume label called "ops235"?# What is the main function of the <code>fdisk</code> utility?# What command is used then ask your instructor to attach the file system review them and sign off 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's completion:'''
==Useful Information==* Can login with your "learn" account name* Has the package count* Has the correct IP address and MAC address* Find out the default route (gateway)* IP of the DNS name server* Name and contact information on your disk pack
Hard disk partition names (disk drive is '''x''')
{|class="sortable" border="1" cellspacing="0" width="80%"
|-
!Partition
!1
!2
!3
!4
!5
!6
!...
|-|Type|primary, extended|primary, extended|primary, extended|primary, extended|logical|logical|logical= Preparing for the Quizzes =
|-# How many packages were installed?|Linux Name|/dev/sdx1# How many files (correct to the nearest hundred) were installed?|/dev/sdx2# How many users were created automatically on your system (do not count your learn account)?|/dev/sdx3# What is your learn account's UID and GID?|/dev/sdx4# What is your learn account's home directory?|/dev/sdx5# What is the home directory for the user "root"?|# How do you determine the host name of your GNU/dev/sdx6Linux workstation?|/dev/sdx7 -- sdx15# What command can display the NIC's MAC address?
{{Admon/important|Unbind your MAC address|Before moving your disk pack to another system, [[Unbinding MAC Addresses on Fedora|unbind your MAC address]].}}