RHCSA MISSED Flashcards
Create a disk with the EXT4 file system, mount it, add data and change the file system to XFS without damaging the data
dd the data to a file
change the file system
dd the data back to the disk
Look at extensive info about a disk
parted /dev/nvme0n2
Using parted, make an ext3 that is primary and 1024 megs big
View the file to confirm if the kernel recognizes the partition
Label the partition as /work
Mount the partition as the label via fstab
Remember, parted won’t make the file system, only prepare your disk for its file system creation.
unit GB (if you want in gigs)
mklabel msdos of gpt
mkpart primary ext3 1024 2048
mkpartfs works too I think
Guide says ext3 isn’t available with mkpartfs so you’ll need to mkfs.ext3
cat /proc/partitions
FOR EXT4
e2label /dev/sda6 /work (label can be anything)
FOR XFS
xfs_admin -L label /dev/sda2
LABEL=/work /work ext3 defaults 1 2
Remove minor number 3 (partition 3) on sda
Resize partition 2
parted /dev/sda
rm 3
resize 2 1024 2048
Can you add /boot partition to a logical volume?
No, the boot loader can’t read it. If / partition is on a logical volume create a separate /boot partition.
What are the three aspects of LVM
Logical Volume Management
Physical Volumes - disks themselves
Volume groups - aggregation of physical volumes
Logical Volumes - assigned mount points and file types. When partitions reach their full capacity free space allocated from volume group can be added to the logical volume.
Can a Logical Volume contain partitions?
Yes, like / and /home
If you don’t want to use LVM and would prefer to use RAID, what would you use?
Disk Druid
What is the LVM default configuration
/boot <- this is a non-lvm partition residing on the disks first partition (sda1)
The remaining space goes into a volume group.
Two logical volumes are created from the volume group.
One goes to swap of the recommended size and the remainder goes to /.
What is VDB
Virtio Block Device
B - second device, A would be the first
What are three ways to display physical volumes
What are the commands to add and remove /dev/sda and /dev/sdb?
pvdisplay
pvs
pvscan
pvcreate /dev/sda /dev/sdb
pvremove /dev/sda /dev/sdb
(if the disks are part of a volume group you’ll have to remove them from that first with vgreduce)
What is an EXTENT?
In the volume group, disk space available to be allocated is divided into fixed-sized units called extents.
In physical volumes extents are referred to as physical extents.
What is the default EXTENT size
Disk space is divided into 4MB extents.
What is the EXTENT size?
Minimum amount of space a logical volume can be increased or decreased.
What option do you use to modify the extent size?
What options do you use to limit the physical and logical volumes the volume group can have?
vgcreate -s
vgcreate -p -l
What are the three different ways to check volume group info?
vgdisplay vg1
vgdisplay
vgs
vgscan
Add vdb3 to your vg1 volume group, then rename it
vgextend vg1 /dev/vdb3
vgrenamevg1 myvg
You have an inactive volume group “databases” that should be added to “myvg”
These will need the same size physical extent sizes
vgmerge -v myvg databases
You need to remove a pv from a vg. You are currently using a pv and need to migrate the data to the other pvs, how do you do this?
Let’s say you have no additional extents to give the data too, create vdb4 as a physcial volume, add it to the vg, and move the data to it
Now remove vdb3 and verify
pvmove /dev/vdb3
pvcreate /dev/vdb4
vgextend myvg /dev/vdb4
pvmove /dev/vdb3 /dev/vdb4
vgreduce myvg /dev/vdb3
pvs
Why would you split a device from a group?
vgsplit is a combo of vgreduce and vgcreate, so it just makes things easier.
Basically a split gives a pv from one vg to another.
vg1 has /dev/vdb1-3 available. give vdb3 to the vg vg2
vgsplit vg1 vg2 /dev/vdb3
Say that you have a logical volume mounted name mylv and want to transfer its volume groups to a new system. How would you do this
umount /dev/mnt/mylv
vgchange -an myvg (this deactivates your vg)
vgexport myvg (make inaccessable from system)
pvscan
plug new disks into server
vgimport myvg
vgchange -ay myvg (activate vg)
Remove LVM volume groups
Use command first to stop lockspace in other servers if clustered first! Don’t do this on the server that you’re performing the removal
VG must contain no logical volumes
vgchange –lockstop vg1
vgremove vg1
Create a logcial volume that has 500Megs named mylv from myvg
What option would you use if you wanted to do a raid configuration rather than linear (normal)?
Looks at your logical volume info in three different ways
make mylv xfs
lvcreate -n mylv -L 500M myvg
–type=raid
lvs
lvdisplay
lvscan
mkfs.xfs /dev/myvg/mylv
Striped logical volumes writes data to a predetermined number of physical volumes in round-robin fashion. I/O can be done in parallel. Even when using LVM this stripes the actual disks themselves, not anything virtual
Create a RAID0 striped logical volume with three strips and a stripe size of 4kB
view the RAID0 stripped logical volume
You need at least 3 physical volumes
lvcreate –type=raid0 -L 2G –stripes=3 –stripesize=4 -n mylv myvg
lvs -a -o +devices,segtyp myvg
You have an LV named mylv1 that’s mounted at /mnt and want to name it mylv
umount /mnt
lvrename myvg mylv1 mylv
OR
lvrename /dev/myvg/mylv1 /dev/myvg/mylv