0% found this document useful (0 votes)
5 views

Partitions

The document outlines a lab exercise for managing partitions and disks on a CentOS 7 machine, requiring root or sudo access. It includes warm-up exercises for basic command line navigation and disk management tasks, such as checking disk status, adding disks, and verifying partitions. Additionally, it covers Logical Volume Management (LVM) commands and checks for NFS and Samba configurations.

Uploaded by

milukyone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Partitions

The document outlines a lab exercise for managing partitions and disks on a CentOS 7 machine, requiring root or sudo access. It includes warm-up exercises for basic command line navigation and disk management tasks, such as checking disk status, adding disks, and verifying partitions. Additionally, it covers Logical Volume Management (LVM) commands and checks for NFS and Samba configurations.

Uploaded by

milukyone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

ProLug – Partitions Lab (Lab1)

Required Materials

CentOS 7 Machine

Root or sudo command access

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

1. Check the number of disks and adding a disk


a. fdisk –l
When might this command be useful? If you’re adding a disk and want to see if it has
appeared it is good to run this command before adding the disk and then running this
after to verify.

If that is too much information filter it


b. fdisk -l | grep -i /dev/sd
Let’s store this off for later use
c. fdisk –l | grep –i /dev/sd > /tmp/`hostname`.disks

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.

5. Check the size of mounted filesystems


a. df –h
b. df
What are the differences. When might you want to use one or the other?
6. Check if you’re configured and exporting NFS
a. systemctl status nfs
b. cat /etc/exports
c. showmount –e
Do a little google search and figure out what some of these commands mean.
7. Check if you’re configured and exporting Samba (to Windows)
a. systemctl status smb
b. smbstatus
c. testparm
Do a little google search and figure out what some of these commands mean.

You might also like