- All right.
So the next assignment was to manage storage
on a second disc that is added to the server.
And on this disc you create an LVM volume group VG exam
with the size of two gigabytes.
And this volume group should use two physical
volumes that are created as partitions.
And in this VG exam volume group
you create a logical volume
with the name lvexam formatted ext4 mounted
on slash exam and copy all files bigger
than one megabyte from the /etc directory
to the new volume which is mounted on /exam.
So that was all, let's have a look at the solution.
Okay, so I need to check my storage.
LSBLK will do that.
And you can see SDB, SDC.
So I'm going to use SDB G disk
on dev sdb creating a new partition number one
with size of one gigabyte.
So last sector plus one application G
and hex code.
That will be eight E zero zero.
And then we create petition number two.
First sector is just a default last sector
plus one gigabyte.
And here also the hex code 8 0 0,
using P to verify.
Looking good.
So V, yes we want to proceed.
So next step would be vgcreate,
vgcreate, vgexam,
dev SDB one,
dev SDB two.
And I'm a little bit lazy here.
You can create the physical volume before using pvcreate.
I choose not to do that because this is more efficient.
We have the volume group vgexam.
Next we need to create this logical volume
with the name lvexam.
So lvcreate minus N LV exam
minus lowercase L 100%
free VG exam.
This minus lowercase L 100% free.
Well that explains itself and that avoids me
from having to think
about extents that they use for metadata and such.
So it's a bit easier.
MKFS ext4 on dev vgexam.
Lvexam to format it
and then we can put it in ETC FS step.
Of course you can also use a systemD
mount fell with ETC FS step for most people is easier.
And on the exam I would always go for the solution
that you are most comfortable with.
So we need to mount it on slash exam,
ext4.
Defaults N zero zero.
Let's create slash exam and do amount minus A.
There we go.
So next and final part, we need to copy all files
with a size grade and one megabyte from the ETC directly
to the new volume which is mounted on slash exam.
That will be fine.
So find slash ETC
minus type F
to make sure
that it copies fail only,
minus size plus one M
and that'll find the files for us.
And I like to, to learn this command to verify
that indeed it finds the files
and there's two of them, only two.
Well that's good enough.
I'm going to copy them using the minus XX statement
on find so minus XX CP curly braces to refer
to the result of the fine command.
And then we copy that to slash exam.
At the end of the line,
backslash semicolon to close the minus XX statement.
And that should do it LS on slash exam.
And there we go.
We are good.
Don't worry about the loss plus found.
Loss plus found directory is always
a standard directory that you will find
on any ext file system.
That's all.