Partitions
Partitions
Required Materials
CentOS 7 Machine
EXERCISES (Warmup to quickly run through your system and familiarize yourself)
1. cd ~
2. ls
3. mkdir lab1_Prolug
4. mkdir lab1_Prolug/test/round1 #this fails
5. mkdir -p lab1_Prolug/test/round1 #this works, think about why? man (mkdir)
6. cd lab1_Prolug
7. pwd
8. touch testfile1
9. touch testfile2 #this is going to take too long
10. touch testfile{3..17}
11. mv testfile* test
12. cd test
13. pwd
14. ls
LAB
If we want to add a disk to this system we have to edit hardware in our VMware Player. Your
system will likely have to be off for this to occur, but in an enterprise environment we have tools
to keep the system on. We will perform this as though we are on an enterprise system
Add disk through whatever method you use
Perform a bus scan on your system (may have to check /sys/class/scsi_host/ and scan all hosts0-
3)
d. echo "- - -" > /sys/class/scsi_host/host0/scan
e. echo "- - -" > /sys/class/scsi_host/host1/scan
f. echo "- - -" > /sys/class/scsi_host/host2/scan
Re-run fdisk and verify your system has a new disk presented
a. fdisk –l
2. Check what partitions you have mounted
a. mount
3. Check what should mount when your system comes up
a. cat /etc/fstab
How does this compare to the partitions that are mounted?
4. Check your LVM Status
It’s possible in the last few commands you saw a lot of strange mounted partitions and things
that didn’t make sense. To make sense of Logical Volume management these show commands
help greatly.
a. pvs
This is going to show you physical volumes on your machine. Disks and disk partitions
can be assigned as physical volumes for use by LVM
b. vgs
Once LVM has physical disks they can be assigned in Volume Groups. Volume groups can
be raw disks, or even RAID disk systems. The challenge with using RAID here is that disks
are added directly into the raid. In large data environments, and to mirror SAN style
disks, it is sometimes better to first carve raids with MDADM and take the md devices
and create physical volumes off of them
c. lvs
Once a Volume Group has been created it can be carved into Logical volumes. These
logical volumes can then have mkfs.xfs or any mkfs.<filesystem> command run to build
filesystems that are usable by our Linux environment.
Research a little for 10 minutes on LVM as it relates to CentOS. There are some good
Redhat and other tutorials out there on how this carving works.