Difference between revisions of "SYA710 Lab01"

From CDOT Wiki
Jump to: navigation, search
(New page: == SYA710 Lab #1 == === Focus: Working With File Systems === === PART A: Perform the following steps: === <ol> <li>Power on your PC and boot up Fedora 8 Test and login as 'joker' with pa...)
 
(SYA710 Lab #1)
Line 1: Line 1:
 
== SYA710 Lab #1 ==
 
== SYA710 Lab #1 ==
 
=== Focus: Working With File Systems ===
 
=== Focus: Working With File Systems ===
=== PART A: Perform the following steps: ===
+
=== PART A (Container is a file): ===
 +
Perform the following steps:
 
<ol>
 
<ol>
 
   <li>Power on your PC and boot up Fedora 8 Test and login as 'joker'
 
   <li>Power on your PC and boot up Fedora 8 Test and login as 'joker'
Line 64: Line 65:
 
   <li>Answer the questions 1 to 4 in PART D, then do PART B.<br>
 
   <li>Answer the questions 1 to 4 in PART D, then do PART B.<br>
 
   </li>
 
   </li>
 +
</ol>
 +
=== PART B (Container is a partition): ===
 +
Perform the following steps:
 +
<ol>
 +
  <li>Use fdisk to make primary partition #4 of about 1GB size.<br>
 +
  </li>
 +
 +
  <li>Inform the kernel of the change in the partition table with the
 +
command:<br>
 +
    <br>
 +
partprobe <br>
 +
    <br>
 +
  </li>
 +
  <li>Make an ext3 file system in the new partition:<br>
 +
    <br>
 +
mkfs -t ext3 /dev/sda4<br>
 +
 +
    <br>
 +
  </li>
 +
  <li>Make a new directory (mkdir /mnt1) and mount the file system onto it like this<br>
 +
    <br>
 +
mount /dev/sda4 /mnt1 <br>
 +
    <br>
 +
  </li>
 +
  <li>Now copy the contents of your /home directory to this new file
 +
system like this:<br>
 +
 +
    <br>
 +
cp -a /home/* /mnt1 <br>
 +
    <br>
 +
  </li>
 +
  <li>Add the following line for your /etc/fstab file<br>
 +
    <pre>/dev/sda4 /home ext3 defaults 1 3</pre>
 +
  </li>
 +
  <li>Unmount /mnt1</li>
 +
  <li>Close the console window and logout of joker.</li>
 +
  <li>Login as root and open a console window.</li>
 +
  <li>Enter the command<br>
 +
    <br>
 +
mount -a <br>
 +
 +
    <br>
 +
  </li>
 +
  <li>Enter the 'df -Thi' command to verify that /dev/sda4 is mounted
 +
as /home.</li>
 +
  <li>Close the console window and logout.</li>
 +
  <li>Login as joker, open a console window and use the df command to
 +
verify that /dev/sda4 is mounted at /home.</li>
 +
  <li>Answer the rest of the questions in PART D.<br>
 +
  </li>
 +
 
</ol>
 
</ol>

Revision as of 06:55, 9 September 2008

SYA710 Lab #1

Focus: Working With File Systems

PART A (Container is a file):

Perform the following steps:

  1. Power on your PC and boot up Fedora 8 Test and login as 'joker' with password 'seneca99'.
  2. Open a console window and switch to superuser with this command:

    su -

  3. Create a regular file (filled with zeros) which will be the container for our file system. Use this command:

    dd if=/dev/zero of=fakedisk bs=1024 count=10000

  4. Use the losetup command to associate your file with /dev/loop0 like this:

    losetup /dev/loop0 fakedisk

  5. Now create a file system in the container:

    mkfs -t ext2 /dev/loop0

  6. Make a directory to be a mount point for the file system:

    mkdir /mnt1

  7. Mount the file system:

    mount /dev/loop0 /mnt1

  8. Record the output of the following command:

    df -Thi /dev/loop0

  9. Unmount the file system

    umount /mnt1

  10. Delete the loop device

    losetup -d /dev/loop0

  11. Delete the fakedisk file.
  12. Answer the questions 1 to 4 in PART D, then do PART B.

PART B (Container is a partition):

Perform the following steps:

  1. Use fdisk to make primary partition #4 of about 1GB size.
  2. Inform the kernel of the change in the partition table with the command:

    partprobe

  3. Make an ext3 file system in the new partition:

    mkfs -t ext3 /dev/sda4

  4. Make a new directory (mkdir /mnt1) and mount the file system onto it like this

    mount /dev/sda4 /mnt1

  5. Now copy the contents of your /home directory to this new file system like this:

    cp -a /home/* /mnt1

  6. Add the following line for your /etc/fstab file
    /dev/sda4 	/home 	ext3 	defaults 	1 3
  7. Unmount /mnt1
  8. Close the console window and logout of joker.
  9. Login as root and open a console window.
  10. Enter the command

    mount -a

  11. Enter the 'df -Thi' command to verify that /dev/sda4 is mounted as /home.
  12. Close the console window and logout.
  13. Login as joker, open a console window and use the df command to verify that /dev/sda4 is mounted at /home.
  14. Answer the rest of the questions in PART D.