CT320 Partitioning Lab                

Introduction                
For this lab, you will create a new disk partition and use it in various ways.                 
Create a document that will hold your numbered results. Show it to the TA for credit when you’re done.                 
Many commands in this lab will have to be done as the super-user,
root. Do this by putting sudo in front of the necessary commands.
I won’t clutter the writeup with all the sudos.
                
Note that the opposite of the mount command is umount, not
unmount.
                
Part 1 — Boot from DVD                
- Boot from DVD, as shown in the Installation lab.
- Select “Try Xubuntu”.
- Do not install Xubuntu again.
- After some time, desktop screen will appear. You’re now booted from the DVD with a RAM volume as your root disk.
- Run
gparted, the Gnome Partition Editor.
Part 2 – Create a new partition                
- There should be two large partitions,
/(on the left) and/home(on the right). - If you’re doing this lab in the morning, then the size of your new partition will be 30MB. Otherwise, it will be 60MB.
- Shrink the
/homepartition, to free space for your new partition.- Right-click on
/home - Select Resize/Move
- Set Free space following to the size of the new partition (30MB or 60MB).
- Click the Resize/move button
- Right-click on
- Create a new partition in the unused space:
- Right-click on the unused space.
- Make it as big as you can (roughly 30MB or 60MB).
- Change the Label to your name.
- Click “Add”.
- Click the green check mark.
- Let it do its job.
- Close
gparted. - Reboot to Linux from the hard disk, as usual (remove the DVD).
Part 3 — Verify                
- Look at
/proc/partitions, figure out which one is the new partition, based on its size./proc/partitionssizes are in kilobytes.- It’ll have a name like
sdletter digit, for example,sda2. - In commands, put
/dev/in front of the name.
- Record the device name in your document.
Part 4 — Manually mount & unmount                
The mount point for this new partition will be /Spare.
                
rm -rf /Spare- In case there’s one left over from a previous lab.
mkdir /Sparechmod a+rwx /Spareuptime >/Spare/upmountdevice-name/Spare- Is
/Spare/upstill there? - Create a few files, named after dogs, in
/Spare. ls /Spareumount /Spare- What’s in
/Spare, now? - Record your results in your document.
Part 5 — /etc/fstab                
It’s tedious to have to manually mount filesystems.
Think of /etc/fstab as setting up an association between
directories (mount points) and partitions (file systems).
                
- Edit
/etc/fstab, and add an entry to mount your new partition.- Find the entry for
/homeand imitate that. - Change the first field to the device name (
/dev/sdawhatever) or you can useLABEL=your-name
- Find the entry for
umount /Spare- It should be no longer mounted. How can you tell?
mount /Spare- Note that no device name is given, just a directory.
- It should be mounted, now. How can you tell?
- Record your results.
Part 6 — Busy due to current directory                
cd /Spareumount /Spare- How did that go?
cd /tmpumount /Spare- Record your results.
Part 7 — Busy due to open file                
mount /Sparecd /tmpsleep 10m >/Spare/output &umount /Spare- How did that go?
kill %%umount- Record your results.
Part 8 — Dual Mount                
mount /Sparerm -rf /Extramkdir /Extra- Manually mount your partition onto
/Extra(mount /dev/sdawhatever/Extra), while leaving it also mounted onto/Spare. - Create a file in
/Extra. Did it show up in/Spare? - Unmount both
/Spareand/Extra. rm -rf /Extra- Record your results.
Part 9 — Read-Only                
- Mount
/Spare, but do it read-only.man mountis your friend.
- Copy a file to
/Spareusing thecpcommand. - Record the results. If there was an error message, copy it exactly.
- Unmount the
/Sparepartition
Part 10 — noexec                
Many systems allow non-super-user mounting of CDs and USB drives, but don’t want executables to be run off of those devices.                 
mount -o noexec /Sparecp -a /bin/date /tmp/tmp/datecp -a /bin/date /Spare/Spare/date- Record the results. If there was an error message, copy it exactly.
Part 11 — Cleanup                
- Unmount the
/Sparepartition rm -rf /Spare- Run
gpartedfrom Linux (don’t use the DVD) and deallocate your new partition. You don’t have to merge it the free space back into/home; you can just leave it unallocated.
Part 12 — Credit                
Show your work to the TA.