ComputerSecurityStudent (CSS) [Login] [Join Now]




|UNIX >> Ubuntu >> Ubuntu 12.04 Desktop >> Current Page |Views: 10565

(Ubuntu: Lesson 11)

{ Add New Disk, Create Partition Table and Filesystem }


Section 0. Background Information
  1. Summary
    • In this lab we will add a new disk to our Ubuntu VM, create a partition, create a filesystem and mount the filesystem on the /tmp directory.
    • We are create a /tmp filesystem, because VMWare Easy Installer does not allow you to carve out separate partitions and filesystems.

  2. Prerequisite
  3. Lab Notes
    • In this lab we will how to do the following:
      1. We will add a new disk to the Ubuntu VM.
      2. We will create a new partition.
      3. We will create an ext2 filesystem.
      4. We will mount the filesystem on the /tmp directory.

  4. Legal Disclaimer
    • As a condition of your use of this Web site, you warrant to computersecuritystudent.com that you will not use this Web site for any purpose that is unlawful or that is prohibited by these terms, conditions, and notices.
    • In accordance with UCC § 2-316, this product is provided with "no warranties, either express or implied." The information contained is provided "as-is", with "no guarantee of merchantability."
    • In addition, this is a teaching website that does not condone malicious behavior of any kind.
    • You are on notice, that continuing and/or using this lab outside your "own" test environment is considered malicious and is against the law.
    • © 2012 No content replication of any kind is allowed without express written permission.

 

Section 1: Start Ubuntu 12.04
  1. Start VMware Player
    • Instructions
      1. For Windows 7
        1. Click Start Button
        2. Search for "vmware player"
        3. Click VMware Player
      2. For Windows XP
        • Starts --> Programs --> VMware Player

     

  2. Verify Virtual Machine Settings.
    • Instructions
      1. Click on Ubuntu 12.04
      2. Click on Edit virtual machine settings

     

  3. Configure Network Adapter
    • Instructions
      1. Click on Network Adapter
      2. Click on the Bridged Radio Button
      3. DO NOT Click on the Close Button

     

Section 2: Add Hard Drive to Ubuntu 12.04 Virtual Machine
  1. Add Device
    • Instructions:
      1. Click on the Add.. Button

     

  2. Add Hard Disk
    • Instructions:
      1. Click on Hard Disk
      2. Click Next

     

  3. Select a Disk
    • Instructions:
      1. Select "Create a new virtual disk"
      2. Click Next

     

  4. Select Virtual disk type
    • Instructions:
      1. Select SCSI (Recommended)

     

  5. Specify Disk Capacity
    • Instructions:
      1. Maximum disk size (GB): 1.0
      2. Select "Store virtual disk as a single file"
      3. Click Next

     

  6. Name Disk File
    • Instructions:
      1. Take the default name
      2. Click Finish

     

  7. View Results
    • Note(FYI):
      • You should see two disk, the original disk and the New Hard Disk.
    • Instructions
      1. Click the OK button.

     

  8. Start the Ubuntu 12.04 VM
    • Instructions
      1. Click on Ubuntu 12.04
      2. Click on Play virtual machine

 

Section 3: Login to Ubuntu
  1. Change to Gnome Classic
    • Instructions:
      1. Click on the Circle

     

  2. Select Gnome Classic
    • Instructions:
      1. Double Click on GNOME Classic

     

  3. Login to Server
    • Instructions
      1. User: Student
      2. Password: Please supply the student password.

 

Section 4: Become Root and Verify Network Connection
  1. Start up a Terminal
    • Instructions
      1. Click on the Terminal

     

  2. Become Root
    • Instructions
      1. sudo su -
      2. Supply the student password.

     

  3. Verify you have a network connection
    • Instructions
      1. ifconfig -a
        • eth0 is the name of my interface.
        • 192.168.1.106 is my network IP address.
    • Note(FYI):
      • If you do not have an DHCP IP Address try the following:
        • dhclient
          • OR
        • /etc/init.d/networking restart

 

Section 5: Partition New Disk
  1. Update apt-get's package index
    • Instructions
      1. fdisk -l
    • Note(FYI):
      • You should see the following two disk names:
        1. /dev/sda: 16.1 GB
          • This is the original disk.
          • Notice there is a partition table
        2. /dev/sdb: 1073 MB
          • This is the new disk.
          • It contains 130 cylinders.
          • Notice that /dev/sdb does not have a valid partition table.

     

  2. Partition the New Disk
    • Instructions:
      1. fdisk -c /dev/sdb
      2. Select m

     

  3. Partition the New Disk
    • Instructions:
      1. Command (m for help): n
        • Add New Disk
      2. Select default p): p
        • Make Primary Partition
      3. Partition number (1-4, default 1): <Press Enter>
        • "1" is the partition number for disk /dev/sdb.
      4. First section: <Press Enter>
      5. Last sector: <Press Enter>
      6. Command (m for help): p
        • Print the partition table.
      7. Command (m for help): w
        • Write the table to disk and exit

 

Section 6: Create New File System
  1. Create a new filesystem
    • Instructions:
      1. mkfs.ext2 /dev/sdb1
        • Create an ext2/ext3/ext4 filesystem

     

Section 7: Mount New Filesystem
  1. Mount New File System
    • Instructions
      1. df -h
      2. mount /dev/sdb1 /tmp
      3. chmod 1777 /tmp
      4. df -h
      5. ls -ld /tmp

     

Section 8: Add New Filesystem to /etc/fstab
  1. Make a Backup Copy of the /etc/fstab
    • Instructions:
      1. cd /etc/
      2. cp fstab fstab.BKP
      3. ls -l fstab*

     

  2. Open the /etc/fstab
    • Instructions:
      1. vi fstab

     

  3. Create New Line
    • Instructions
      1. Arrow down to the first UUID line.
      2. Press the "o" key to insert a new line underneath this line.

     

  4. Add /tmp to /etc/fstab
    • Note(FYI):
      • <TAB> requires you to press the actual <TAB> Key.
    • Instructions
      1. Type the following Line:
        • /dev/sdb1<TAB>/tmp<TAB>ext2<TAB>defaults<TAB>1<TAB>2
        • (See Picture)
      2. Press the <Esc> Key
      3. Type ":wq!" to save and exit.

 

Section 9: Proof of Lab
  1. Proof of Lab
    • Instructions
      1. df -k | grep tmp
      2. grep tmp /etc/fstab
      3. date
      4. echo "Your Name"
        • Replace the string "Your Name" with your actual name.
        • i.e., echo "John Gray"
    • Proof of Lab Instructions
      1. Press both the <Ctrl> and <Alt> keys at the same time.
      2. Do a <PrtScn>
      3. Paste into a word document
      4. Upload to Moodle

 



Help ComputerSecurityStudent
pay for continued research,
resources & bandwidth