In this assignment you will:
- partition a hard drive using the linux installer
- add additional partitions using the cfdisk utility
- mount partitions
/etc/fstabto make those mount permanent
- Create a logical volume
This assignment is worth 15 points.
These parts must be completed in order. All parts are dependent on the part before them.
Create a new linux vm.
- 16 GB hard drive
- 512 MB RAM
- 1 CPU
- IP Base +4
Begin the install using linux(headless)(bionic_server). These are the instructions from assignment 7 here. Make sure to create the machine using the specifications above and then you can follow assignment 7 until you get to the
Partition disks Screen (#7). Watch carefully for this screen. It is immediately after setting the archive mirror.
Creating partitions during install
These slides are from another class but show the screens used to Partition on the bionic_server: here. You will use the specifications below for this assignment.
At the partition disk screen select
- On the next screen selet the QEMU_HARDDISK_QM00001 by pressing ENTER.
- Type in the size. (see chart below)
- Choose the correct format (see chart below).
Choose the correct Mount Point (see chart below).
** Size : Use As : Mount Point : Create** 1. (6GB) : (ext4) : (/) : Done 2. (3GB) : (ext4) : (/home) : Done 3. (2X your ram) : (swap) : None : Done
Finish the partitioning and write the changes. Finish installation as usual.
Reboot your machine by pushing the green power button on
Make sure both the partitions show up via the
mount command after rebooting. You will probably want to use a grep command with
xvda to refine your results.
The swap file will not show using the mount command. Type
swapon -s to see the swap partition.
Create the following partitions (at the following mount points):
- /mnt/movies (500M)(ext4)
- /mnt/videogames (1GB)(ext3)
- /mnt/stuff (100M)(ext4)
To do this - complete the following steps:
Create the partitions with the default type Linux using the
sudo cfdisk command.
- Create a partitions using the remainder of the space.
- Make sure to
properly shutdownusing the command and
restart your vmusing the green button after creating the partitions.
After your computer has restarted
Check that the partitions created correctly using cfdisk. And write down the device ID’s. They will likely be
/dev/sda7, but it could be different.
Format all three partitions by running the
mkfs.ext4command on each partition depending on the partition format type. The command will look something like this
After you have formatted the partitions
- Create all three the mount points by simply creating directories using
- These directories are created on your root partition. When you are done and then cd into the directory it will seamlessly take you to the new partition. The command will look something like this
Now that you have the partitions created and formatted and the mount points created
- Mount all three partitions to the appropriate newly created mount points. Something like
mount /dev/sda6 /mnt/videogames.
Check your work with the
mount command is working correctly in Part II, add the appropriate entries to the end of the
/etc/fstab file so that each of those partitions created in part II are automatically mounted at boot.
Something like this, but not copy-paste:
/dev/sda7 /mnt/stuff auto defaults 0 0
You can just use the defaults arguments on the fstab line. Note that if you mess up your fstab line and you reboot, your system could become unusable and you will have to re-install (or rescue).
Test your work without rebooting by unmounting all three new partitions (
umount /dev/sda5). Test that they successfully unmounted by running the
mount command again. Then run
mount -a to reload the /etc/fstab file.
Check your work with the
mount command again. If your mounts are correctly reloaded, then you correctly edited the
/etc/fstab file and it is safe to restart your machine.
How to pass off
1 Take a screenshot of the
grep showing only your entries and
swapon -s command.
2 Take a screenshot of the
df -h command.
3 Take a screenshot of the newly added lines of
Last Updated 04/02/2019