hide💡July 26 marks the anniversary of the Americans with Disabilities Act.
Accessibility and Inclusion is at the heart of what we do, learn with Amara.org about the role of captions in ADA compliance!

< Return to Video

CompTIA Linux+: Logical Volumes & Filesystem Hierarchy #5

  • 0:00 - 0:04
    You're watching ITPRO.TV.
  • 0:04 - 0:06
    Hello, and thank you for watching ITPRO.TV,
  • 0:06 - 0:08
    helping you level up with IT learning
  • 0:08 - 0:10
    everywhere you go. I'm your host, Zach
  • 0:10 - 0:12
    Memos, for this episode of CompTIA Linux Plus.
  • 0:12 - 0:15
    Logical Volume Manager is the name of
  • 0:15 - 0:16
    this episode, but you knew that, didn't
  • 0:16 - 0:19
    you? And the person we know and we love
  • 0:19 - 0:21
    and we trust, Don Pezet, is here to help us out.
  • 0:21 - 0:22
    Don, good to see you. Hey. Glad to
  • 0:22 - 0:24
    be back. And, you know, tackling a pretty
  • 0:24 - 0:25
    cool technology this episode, we're going
  • 0:25 - 0:27
    to be looking at the LVM, or the Logical
  • 0:27 - 0:30
    Volume Manager. It's a really neat
  • 0:30 - 0:32
    utility that allows us to have a lot of
  • 0:32 - 0:34
    flexibility with our file systems.
  • 0:34 - 0:35
    In previous episodes, I talked about how
  • 0:35 - 0:37
    we don't want to change file systems
  • 0:37 - 0:39
    after we create them. LVM actually makes
  • 0:39 - 0:40
    that a lot easier. So in this episode,
  • 0:40 - 0:42
    we're going to see,
  • 0:42 - 0:43
    you know, what the LVM is, obviously, but
  • 0:43 - 0:45
    how to install it, how to get it
  • 0:45 - 0:47
    configured, how to arrange our disks
  • 0:47 - 0:49
    using the LVM, and then provide us that
  • 0:49 - 0:51
    flexibility down the road. So that's all
  • 0:51 - 0:52
    coming up right here in this episode.
  • 0:52 - 0:53
    So what do we need to know to get our
  • 0:53 - 0:56
    system ready for the LVM? Alright. So
  • 0:56 - 0:58
    the odds are that your distro supports
  • 0:58 - 1:00
    the LVM. It might not be installed, but
  • 1:00 - 1:02
    you should have support for it. Most of
  • 1:02 - 1:03
    them do have it installed by default.
  • 1:03 - 1:06
    Unless you do, like, a minimal install, it might not.
  • 1:06 - 1:07
    We can check that really easily, so that's
  • 1:07 - 1:09
    going to be kind of step one. The other
  • 1:09 - 1:10
    thing is we're gonna need some hard
  • 1:10 - 1:14
    drives. Right? The LVM is a Logical
  • 1:14 - 1:17
    Volume Manager. It's requiring, to
  • 1:17 - 1:18
    create logical volumes or kind of
  • 1:18 - 1:20
    virtual disks, and those have to lay on
  • 1:20 - 1:22
    top of actual physical disks.
  • 1:22 - 1:24
    So we're going to need some in order to do this.
  • 1:24 - 1:28
    Now, you can use LVM with your, you know,
  • 1:28 - 1:30
    with your root directory and your home
  • 1:30 - 1:31
    and so on. So you can have a lot of
  • 1:31 - 1:33
    things mounted that way. In fact, when you
  • 1:33 - 1:35
    install Linux, you probably had the
  • 1:35 - 1:37
    choice to pick to use the LVM. If you
  • 1:37 - 1:40
    watched our installation episodes, I didn't choose that.
  • 1:40 - 1:42
    So my disks are currently set up without using the LVM.
  • 1:42 - 1:44
    If I want to create it from scratch, I'll
  • 1:44 - 1:45
    just have to know a handful of
  • 1:45 - 1:47
    commands. So let me run through a couple
  • 1:47 - 1:49
    of the basics here. The thing, I'm
  • 1:49 - 1:51
    going to make sure that LVM is installed.
  • 1:51 - 1:52
    There's a few ways to do it, but the
  • 1:52 - 1:53
    easiest way is to use your package
  • 1:53 - 1:55
    manager. So I'm going to do a
  • 1:55 - 1:59
    yum list lvm*. The main package
  • 1:59 - 2:01
    you're looking for is called lvm2
  • 2:01 - 2:02
    because it's version 2 of the Logical
  • 2:02 - 2:04
    Volume Manager. And so when I look at
  • 2:04 - 2:06
    mine, I see I've got installed packages:
  • 2:06 - 2:09
    lvm2 and lvm2-libs. The libraries--
  • 2:09 - 2:11
    those are already installed, so I'm good
  • 2:11 - 2:13
    to go. If they weren't installed, I would
  • 2:13 - 2:17
    just do a sudo yum install lvm2.
  • 2:17 - 2:19
    If you're on an Ubuntu machine, I believe
  • 2:19 - 2:20
    the package there is actually just
  • 2:20 - 2:21
    called lvm. I don't think it has the
  • 2:21 - 2:23
    number, but it is version 2 that it
  • 2:23 - 2:27
    installs by default. So I've got it. It's right there.
  • 2:27 - 2:28
    And so now I know that I've got the
  • 2:28 - 2:31
    tools. The next part are the disks.
  • 2:31 - 2:33
    I'm going to need some disks, and I'm going
  • 2:33 - 2:36
    to be attaching them to the LVM system.
  • 2:36 - 2:38
    So when I do that, it actually expects
  • 2:38 - 2:40
    you to already have a partition on the
  • 2:40 - 2:41
    disk. You don't have to format it, but it at
  • 2:41 - 2:44
    least needs to have a partition. And,
  • 2:44 - 2:46
    normally, we fret about the size of the
  • 2:46 - 2:47
    partition and the disk type and all that
  • 2:47 - 2:49
    stuff. LVM really doesn't care about that.
  • 2:49 - 2:51
    It just needs to have a partition in
  • 2:51 - 2:53
    place. So if you've already got one,
  • 2:53 - 2:56
    you're in business. I'm going to do an lsblk,
  • 2:56 - 3:02
    and I've got three disks: sdb, sdc, and sdd. And each of them--
  • 3:02 - 3:03
    they're one-terabyte disks, and
  • 3:03 - 3:06
    they've all got a single partition on
  • 3:06 - 3:08
    them that is one terabyte in size. That's
  • 3:08 - 3:10
    perfect for what I need here in this lab.
  • 3:10 - 3:12
    If your disks don't have a partition, you
  • 3:12 - 3:14
    just need to create one, and we saw that
  • 3:14 - 3:16
    in the last episode--or actually two
  • 3:16 - 3:19
    episodes ago. You can use the fdisk utility.
  • 3:19 - 3:20
    You know, sometimes we worry about using
  • 3:20 - 3:23
    GPT versus MBR. Here, none of that's
  • 3:23 - 3:24
    really going to matter because the
  • 3:24 - 3:25
    logical volumes are what we're going to
  • 3:25 - 3:28
    manipulate. So pick whatever partition type you like,
  • 3:28 - 3:30
    throw it on there. You don't need to
  • 3:30 - 3:31
    format it. We don't need to drop a file
  • 3:31 - 3:33
    system on it. Just have the partition
  • 3:33 - 3:35
    present, and then you'll be ready to
  • 3:35 - 3:36
    launch it with LVM and start to get your
  • 3:36 - 3:38
    volumes set up. So now that we're
  • 3:38 - 3:40
    prepared, how do we actually create
  • 3:40 - 3:42
    logical volumes, Don? Alright. So now we
  • 3:42 - 3:44
    can go in and we start to create this, but
  • 3:44 - 3:45
    it is actually a little bit--
  • 3:45 - 3:47
    I'm going to call it complex. It's not
  • 3:47 - 3:48
    that complex, though, but there's actually
  • 3:48 - 3:50
    three steps we have to get through.
  • 3:50 - 3:52
    Let me bring up a diagram here to show you
  • 3:52 - 3:55
    so we can kind of have a better understanding of this.
  • 3:55 - 3:57
    Inside of the LVM, there's three
  • 3:57 - 3:59
    different things you work with: there's
  • 3:59 - 4:01
    physical volumes, there's volume groups,
  • 4:01 - 4:04
    and there's logical volumes. Alright?
  • 4:04 - 4:05
    We have to create all three.
  • 4:05 - 4:07
    We're going to start with the physical volumes.
  • 4:07 - 4:08
    Now, notice it says physical volumes, not
  • 4:08 - 4:11
    physical disks. Right? I have
  • 4:11 - 4:12
    three physical disks, and they've got a
  • 4:12 - 4:14
    partition on them, but they're not
  • 4:14 - 4:16
    considered volumes yet. We're going to
  • 4:16 - 4:19
    bring those physical volumes--those disks--
  • 4:19 - 4:21
    into LVM. So we've got to create physical
  • 4:21 - 4:23
    volumes, and these will match up with our
  • 4:23 - 4:25
    physical disks. I've got three disks,
  • 4:25 - 4:29
    so I'm going to create three physical volumes. Right?
  • 4:29 - 4:31
    Then we create a volume group.
  • 4:31 - 4:34
    A volume group is where we gather the physical disks
  • 4:34 - 4:37
    together to create a combined pool of storage.
  • 4:37 - 4:39
    Alright? In the diagram here,
  • 4:39 - 4:41
    there's three two-terabyte drives, so
  • 4:41 - 4:46
    they get gathered together into six terabytes of storage.
  • 4:46 - 4:48
    Once that's done, then we can start
  • 4:48 - 4:49
    slicing and pulling from that storage
  • 4:49 - 4:51
    however we want. I can say, alright,
  • 4:51 - 4:53
    I need a three-terabyte disk, and so we can
  • 4:53 - 4:55
    slice that out of the volume group by
  • 4:55 - 4:57
    creating a logical volume. Now,
  • 4:57 - 4:59
    three terabytes is bigger than any one of
  • 4:59 - 5:02
    these physical disks. LVM will manage
  • 5:02 - 5:05
    spreading that data across the disks to
  • 5:05 - 5:07
    be able to allow for that space. And
  • 5:07 - 5:09
    what's really neat is down the road, if I
  • 5:09 - 5:11
    decide, man, I'm running out of space,
  • 5:11 - 5:13
    I need to add another terabyte to that
  • 5:13 - 5:17
    disk--we can go in and expand that logical volume.
  • 5:17 - 5:19
    We can add another terabyte onto the side of it--just slice
  • 5:19 - 5:21
    it right out of the volume group. Or what
  • 5:21 - 5:22
    they've done here in the example is
  • 5:22 - 5:25
    sliced out a second three-terabyte disk
  • 5:25 - 5:27
    and pulled it right out. So LVM lets us
  • 5:27 - 5:32
    do that, but it requires these three components. We're going to have to create each one.
  • 5:32 - 5:34
    Fortunately, we've got tools that do all
  • 5:34 - 5:36
    that. It's all when you install that lvm2
  • 5:36 - 5:40
    package--it installs a whole collection of tools.
  • 5:40 - 5:43
    To help you with this,
  • 5:43 - 5:44
    if you memorize these three names, which
  • 5:44 - 5:46
    you definitely wanna do for the exam,
  • 5:46 - 5:49
    the tools almost always start with
  • 5:49 - 5:50
    letters that match up with what you're
  • 5:50 - 5:52
    doing. So the physical volume tools
  • 5:52 - 5:55
    almost all start with pv, and then the
  • 5:55 - 5:56
    logical volumes start with lv, and the volume
  • 5:56 - 5:58
    groups start with vg. So when you take a
  • 5:58 - 6:01
    look at your system--let me just jump over here.
  • 6:01 - 6:04
    If I take a look inside of /usr/sbin,
  • 6:04 - 6:06
    and I look at--I want to work with
  • 6:06 - 6:08
    physical volumes, so I'll just look for pv*.
  • 6:08 - 6:10
    Alright? I can see right here, I've
  • 6:10 - 6:15
    got pvcreate, pvchange, pvremove, pvresize.
  • 6:15 - 6:17
    These are all my physical volume
  • 6:17 - 6:19
    utilities that let me mess around with
  • 6:19 - 6:20
    them. And then if I want to look at
  • 6:20 - 6:23
    volume groups, I can look for vg*, and
  • 6:23 - 6:25
    I'll find all of them--almost the same as
  • 6:25 - 6:27
    what we saw for physical volumes, except
  • 6:27 - 6:28
    we have some new options in here for,
  • 6:28 - 6:32
    like, vgimport, vgreduce for shrinking and growing--
  • 6:32 - 6:33
    you know, all those different ones.
  • 6:33 - 6:37
    And then lastly, we had logical volumes--that was lv*,
  • 6:37 - 6:39
    and I'll see each of them tucked away
  • 6:39 - 6:42
    inside of there, like the
  • 6:42 - 6:45
    lvdisplay and so on. Some of them are
  • 6:45 - 6:47
    aliases or shortcuts. A lot of them are
  • 6:47 - 6:49
    interchangeable. Like, lvdisplay will
  • 6:49 - 6:51
    show me all of my logical volumes.
  • 6:51 - 6:54
    lvs actually stands for logical volume show.
  • 6:54 - 6:56
    It will show me my logical volume.
  • 6:56 - 6:58
    So, some of these kinds of overlap with each
  • 6:58 - 7:00
    other, but it’s pretty easy to spot the
  • 7:00 - 7:02
    utilities, and we just need to go through
  • 7:02 - 7:03
    creating them. You create from the
  • 7:03 - 7:04
    ground up. We’re going to create our
  • 7:04 - 7:05
    physical volumes, then we’re going to
  • 7:05 - 7:07
    create our logical volume--sorry--
  • 7:07 - 7:08
    we create our physical volumes, then
  • 7:08 - 7:11
    we create our volume groups, then we create
  • 7:11 - 7:13
    our logical volumes on top.
  • 7:13 - 7:14
    So that’s the basic process that we’re going to go
  • 7:14 - 7:15
    through. Let me just run through
  • 7:15 - 7:17
    that. I’m gonna start a little
  • 7:17 - 7:19
    more simple than in this diagram:
  • 7:19 - 7:21
    I’m just gonna do two disks. I’ve got two
  • 7:21 - 7:24
    one-terabyte disks. I’m gonna combine them
  • 7:24 - 7:27
    into a two-terabyte volume group that
  • 7:27 - 7:30
    I can then slice out into a logical volume. Alright?
  • 7:30 - 7:35
    So what I can do is I’m gonna start with pvcreate, alright?
  • 7:35 - 7:37
    And actually, let me sudo this so that
  • 7:37 - 7:38
    I’m an administrator.
  • 7:38 - 7:41
    So I'm gonna sudo the pv create command, and I need to
  • 7:41 - 7:44
    tell it the disks that I'm bringing in.
  • 7:44 - 7:46
    Now remember I said we need a partition
  • 7:46 - 7:47
    on each one. We saw I already have some
  • 7:47 - 7:56
    partitions. So I'm gonna bring in /dev/sdb1 and /dev/sdc1. Alright.
  • 7:56 - 7:58
    Those are the two disks. I have a 1/sdd1.
  • 7:58 - 7:59
    I'm gonna hold on to it because I
  • 7:59 - 8:01
    wanna show you guys adding more
  • 8:01 - 8:03
    storage after the fact. So I'm just going
  • 8:03 - 8:06
    to grab these two. So when I do that, it
  • 8:06 - 8:07
    sees the disk. And remember how I said
  • 8:07 - 8:10
    you don't have to format it? Here's why.
  • 8:10 - 8:11
    It sees I've already got a format on
  • 8:11 - 8:12
    there, and it's gonna wipe it.
  • 8:12 - 8:14
    It's gonna erase whatever's on there.
  • 8:14 - 8:15
    It needs the partition. It doesn't need the
  • 8:15 - 8:17
    file system. So I'll say yes to let it
  • 8:17 - 8:18
    wipe it. It's gonna do the same thing
  • 8:18 - 8:21
    on the other disk. There we go. So they're
  • 8:21 - 8:24
    wiped, and now they've been brought into
  • 8:24 - 8:29
    the LVM. And I should be able to see that by doing pv display,
  • 8:29 - 8:31
    which is my physical volume display. Oops.
  • 8:31 - 8:37
    Non-root user. So let me just rerun that. Whoops.
  • 8:37 - 8:39
    And there we go. And so now it's gonna
  • 8:39 - 8:41
    show me those two physical volumes, sdb1
  • 8:41 - 8:44
    and sdc1. They're one terabyte. They each
  • 8:44 - 8:46
    have a UUID that's been assigned, and
  • 8:46 - 8:47
    I can see all of that right there. So
  • 8:47 - 8:49
    they've been brought in the way that I want them.
  • 8:49 - 8:51
    Now I can create a volume group to
  • 8:51 - 8:53
    combine these two together, and I'm just gonna use,
  • 8:53 - 8:57
    you guessed it, vg create. Now this
  • 8:57 - 8:58
    command is a little bit different.
  • 8:58 - 9:00
    I'm gonna create a volume group, and that
  • 9:00 - 9:02
    volume group needs to have a logical
  • 9:02 - 9:04
    name that I can map to. When I have a
  • 9:04 - 9:05
    hard drive, the hard drive is referenced
  • 9:05 - 9:10
    as /dev/something, right, a device ID.
  • 9:10 - 9:13
    Well, our volume groups need to have device IDs also, and there's a
  • 9:13 - 9:15
    service that's running in the background
  • 9:15 - 9:17
    called the Logical Volume Manager
  • 9:17 - 9:19
    Mapper, the mapper service. And the mapper
  • 9:19 - 9:21
    service is what's gonna create /dev
  • 9:21 - 9:23
    entries for our logical volume, so
  • 9:23 - 9:25
    it's really important. So when I start to
  • 9:25 - 9:27
    create a volume group, I have to give it
  • 9:27 - 9:29
    a name for what I want the volume group
  • 9:29 - 9:31
    to be, and that's gonna become part of
  • 9:31 - 9:33
    the device name for my logical volumes.
  • 9:33 - 9:38
    They'll be /dev/mapper/ and then the
  • 9:38 - 9:40
    volume group name followed by / and the
  • 9:40 - 9:42
    logical volume name. So it gets kind of
  • 9:42 - 9:45
    long. So when I create this one, I need to give it a name.
  • 9:45 - 9:47
    I would normally name this based off of
  • 9:47 - 9:48
    what I intended the pool storage to
  • 9:48 - 9:50
    be used for. But here on the show, just to
  • 9:50 - 9:52
    keep things a little bit easy, I'm gonna
  • 9:52 - 9:54
    call it vg1. This is volume group one.
  • 9:54 - 9:56
    And that way, you guys will easily be able to
  • 9:56 - 9:57
    tell, you know, that I'm working with a
  • 9:57 - 10:00
    volume group. So I'll stick with vg1, and
  • 10:00 - 10:02
    then I need to attach the physical
  • 10:02 - 10:03
    volumes to it. My physical volumes were
  • 10:03 - 10:09
    /dev/sdb1 and /dev/sdc1.
  • 10:09 - 10:10
    Alright. So that's gonna create the
  • 10:10 - 10:12
    volume group, and it's going to attach
  • 10:12 - 10:15
    those two physical volumes to it. If I do a vg display...oh,
  • 10:15 - 10:18
    let me sudo that. There we go. I can see
  • 10:18 - 10:25
    that it's here. I can see that it has somewhere in here,
  • 10:25 - 10:28
    my size here, my volume group size.
  • 10:28 - 10:29
    It's only showing 15 GB right now, so I need
  • 10:29 - 10:31
    to give that a moment for it to kind of
  • 10:31 - 10:33
    sync up. But if I scroll back up here...oh,
  • 10:33 - 10:34
    sorry. I'm looking at the wrong volume
  • 10:34 - 10:36
    group. I already have a volume group for
  • 10:36 - 10:38
    something else. If I looked at the VG
  • 10:38 - 10:40
    name, see how that one's called CentOS? Mhmm.
  • 10:40 - 10:41
    That's one of my, you know, one of the
  • 10:41 - 10:43
    ones the operating system created, not
  • 10:43 - 10:45
    mine. So I need to scroll up.
  • 10:45 - 10:47
    and it's got the right storage thank
  • 10:47 - 10:50
    goodness so i can see right here i have
  • 10:50 - 10:52
    1.95 terabytes of storage available
  • 10:52 - 10:55
    inside of this uh volume group
  • 10:55 - 10:56
    ready to be sliced out into logical
  • 10:56 - 10:59
    volumes and to create those logical
  • 10:59 - 11:01
    volumes we're going to use lv create
  • 11:01 - 11:03
    right which i'm going to sudo one of
  • 11:03 - 11:04
    these days i'll remember to do that
  • 11:04 - 11:06
    right off the bat
  • 11:06 - 11:07
    with the logical volume we're slicing
  • 11:07 - 11:10
    out storage and turning that into a disk
  • 11:10 - 11:13
    so i'm going to do lv create and i need
  • 11:13 - 11:14
    to tell it the size
  • 11:14 - 11:17
    that i want this to be okay i want mine
  • 11:17 - 11:20
    to be um let's say i'll just do 200 gigs
  • 11:20 - 11:22
    or or you know i could do the full two
  • 11:22 - 11:25
    terabytes if i wanted or 1.5 terabytes
  • 11:25 - 11:27
    uh you know maybe i'll do 1500
  • 11:27 - 11:31
    uh gigabytes so i'll put in 1500 g
  • 11:31 - 11:32
    and then i need to tell it the volume
  • 11:32 - 11:34
    group that i'm getting the storage from
  • 11:34 - 11:35
    i might have more than one volume group
  • 11:35 - 11:37
    i just have one so i'll type vg1
  • 11:37 - 11:40
    then i need to give it a name and again
  • 11:40 - 11:43
    normally i would name this like uh web
  • 11:43 - 11:45
    storage or file storage or something
  • 11:45 - 11:47
    that told me what it was for but in this
  • 11:47 - 11:48
    case to keep things easy i'm going to
  • 11:48 - 11:51
    call it lv1 this is logical volume
  • 11:51 - 11:53
    number one all right
  • 11:53 - 11:55
    so when i go to create that it builds it
  • 11:55 - 11:58
    and we can use lv display
  • 11:58 - 12:01
    to be able to verify that all right so
  • 12:01 - 12:02
    when i take a look here again i'm going
  • 12:02 - 12:04
    to ignore the ones the operating system
  • 12:04 - 12:07
    created and find mine here's lv1 that's
  • 12:07 - 12:11
    a part of volume group 1 and it is 1.46
  • 12:11 - 12:13
    or basically one and a half terabytes in
  • 12:13 - 12:16
    size bigger than one of my disks right
  • 12:16 - 12:17
    and so i sliced it out i still have more
  • 12:17 - 12:19
    space available but that one's grabbed
  • 12:19 - 12:20
    right there and if you look at the
  • 12:20 - 12:22
    device name that it assigned
  • 12:22 - 12:27
    we've got slash dev slash vg1 slash lv1
  • 12:27 - 12:29
    right so it's not so hard to remember
  • 12:29 - 12:31
    it's not slash dev sda or sd because
  • 12:31 - 12:33
    there's no physical device these are
  • 12:33 - 12:36
    virtual mappings slash dev vg1 lv1 now
  • 12:36 - 12:38
    in red hat and centos they do a really
  • 12:38 - 12:40
    good job of mapping it that way so it's
  • 12:40 - 12:41
    easy to remember you just do the volume
  • 12:41 - 12:44
    group followed by the logical volume in
  • 12:44 - 12:46
    other distros they'll nest it under a
  • 12:46 - 12:48
    mapper folder which i likely have if i
  • 12:48 - 12:51
    go into slash dev and take a look uh
  • 12:51 - 12:53
    yeah here's that mapper folder that i
  • 12:53 - 12:55
    was talking about and i don't know if
  • 12:55 - 12:57
    it'll let me go into there oh it did so
  • 12:57 - 12:58
    if i go into the mapper folder see
  • 12:58 - 13:01
    there's a folder in there called vg1 lv1
  • 13:01 - 13:03
    so that's another name for that device i
  • 13:03 - 13:06
    could use slash dev slash mapper
  • 13:06 - 13:07
    slash
  • 13:07 - 13:10
    vg1-lv1 like that that would also be a
  • 13:10 - 13:12
    device name that points to the same
  • 13:12 - 13:15
    place but it's kind of nice having slash
  • 13:15 - 13:18
    dev slash vg1 lv1 like that that's
  • 13:18 - 13:19
    easier to remember it makes a little
  • 13:19 - 13:20
    more sense for us humans just know that
  • 13:20 - 13:22
    not every distro does that so look for
  • 13:22 - 13:25
    that mapper folder if you need to but at
  • 13:25 - 13:27
    this point i've created the physical
  • 13:27 - 13:29
    volume i've created the logical volumes
  • 13:29 - 13:30
    uh you know the the volume group in the
  • 13:30 - 13:32
    middle uh we've created all that it's
  • 13:32 - 13:34
    running i use the set of commands that
  • 13:34 - 13:36
    are the most common for me there are
  • 13:36 - 13:37
    more commands though that are available
  • 13:37 - 13:41
    so for example i did uh pv display vg
  • 13:41 - 13:44
    display and so on i could have also done
  • 13:44 - 13:47
    uh pvs
  • 13:47 - 13:50
    and uh whoops it is
  • 13:50 - 13:52
    not liking the fact that i left a bunch
  • 13:52 - 13:54
    of other stuff on that command so let me
  • 13:54 - 13:56
    read that there we go pbs uh which gives
  • 13:56 - 13:58
    us kind of an abbreviated view of the
  • 13:58 - 14:00
    volumes when i did pv display we got a
  • 14:00 - 14:02
    lot more information pvs it's kind of
  • 14:02 - 14:06
    summarized and so i can see the sd b1
  • 14:06 - 14:09
    sdc1 that are attached i also have uh
  • 14:09 - 14:11
    vgs for volume group
  • 14:11 - 14:13
    and so we can see that again kind of
  • 14:13 - 14:17
    summarized and lastly was lvs to see the
  • 14:17 - 14:18
    logical volumes so if you just want a
  • 14:18 - 14:20
    quick view those tools are also really
  • 14:20 - 14:22
    handy to be able to look at
  • 14:22 - 14:24
    and then there's like pv scan which will
  • 14:24 - 14:25
    scan your system and trying to find
  • 14:25 - 14:27
    physical volumes to bring in so there's
  • 14:27 - 14:29
    a number of other utilities too but the
  • 14:29 - 14:30
    basic creation
  • 14:30 - 14:32
    is done with those handful of commands
  • 14:32 - 14:35
    right there are we are able to format
  • 14:35 - 14:36
    and mount the logical volumes like
  • 14:36 - 14:39
    regular disks done oh yeah yeah so after
  • 14:39 - 14:40
    this
  • 14:40 - 14:42
    it acts just like a normal disk it's got
  • 14:42 - 14:44
    a slightly weird name but otherwise the
  • 14:44 - 14:46
    normal disk so for example if i want to
  • 14:46 - 14:48
    format this one let's go
  • 14:48 - 14:52
    ext4 right so i would do sudo
  • 14:52 - 14:54
    mkfs.ext4 so i'm going to format the
  • 14:54 - 14:57
    disk and i'll point to slash dev
  • 14:57 - 15:00
    vg1 slash lv1 and it's going to find
  • 15:00 - 15:03
    that disk and the mkfs command will
  • 15:03 - 15:04
    think it's a physical disk and it'll go
  • 15:04 - 15:06
    in and format it and now i've got a one
  • 15:06 - 15:09
    and a half terabyte disk that's ready uh
  • 15:09 - 15:11
    i can then mount that uh so maybe i'll
  • 15:11 - 15:13
    uh let me create a folder here i'm gonna
  • 15:13 - 15:16
    mount that in slash mnt slash
  • 15:16 - 15:18
    storage
  • 15:18 - 15:21
    and so i will mount slash dev slash vg1
  • 15:21 - 15:24
    slash sg1 all right now if you want lv1
  • 15:24 - 15:26
    and i'm going to mount that into slash
  • 15:26 - 15:28
    mount storage like that so now it's
  • 15:28 - 15:30
    mounted and i can go and start putting
  • 15:30 - 15:32
    files in there and working with it if i
  • 15:32 - 15:35
    do a df-h i can see slash mount size
  • 15:35 - 15:37
    storage right there one and a half
  • 15:37 - 15:39
    terabytes of space available it's ready
  • 15:39 - 15:40
    for me to start dumping things in there
  • 15:40 - 15:43
    and i work with like normal do notice on
  • 15:43 - 15:46
    the left side it's not showing slash dev
  • 15:46 - 15:49
    vg1 lv1 it's showing that mapper folder
  • 15:49 - 15:51
    that i mentioned slash dev mapper slash
  • 15:51 - 15:53
    vg1-lv1 so you may see that notation
  • 15:53 - 15:55
    kind of switch as you work with it but
  • 15:55 - 15:57
    they both function the same way i
  • 15:57 - 15:59
    mounted it it's online
  • 15:59 - 16:01
    i can forget about the lvm at this point
  • 16:01 - 16:04
    and just go on with my life and
  • 16:04 - 16:05
    and never have to think twice about it
  • 16:05 - 16:07
    it functions just like any other disk
  • 16:07 - 16:08
    well are they persistent or do we need
  • 16:08 - 16:11
    to add them to the file system table oh
  • 16:11 - 16:13
    just like a normal disk we would need to
  • 16:13 - 16:15
    add this to the the file system table or
  • 16:15 - 16:17
    f-stab etc f-stab
  • 16:17 - 16:19
    it's not really any different although i
  • 16:19 - 16:21
    will tell you
  • 16:21 - 16:22
    you need to be a little bit careful with
  • 16:22 - 16:25
    the file system table because uh
  • 16:25 - 16:28
    a lot of disks get mounted right away
  • 16:28 - 16:30
    when the system boots and sometimes the
  • 16:30 - 16:32
    lvm service hasn't started yet in which
  • 16:32 - 16:33
    case
  • 16:33 - 16:35
    the mapper might not have had time to do
  • 16:35 - 16:37
    its job so when you're mounting inside
  • 16:37 - 16:38
    of the file system table it's usually
  • 16:38 - 16:41
    better to use the slash dev mapper name
  • 16:41 - 16:44
    as opposed to using the slash dev vg1
  • 16:44 - 16:46
    slash whatever because that name might
  • 16:46 - 16:48
    not exist yet at boot time you can try
  • 16:48 - 16:50
    it out on yours to see what works but
  • 16:50 - 16:52
    basically you would just add that to
  • 16:52 - 16:55
    slash etc f-stab just like any other
  • 16:55 - 16:57
    disk except for the device name well
  • 16:57 - 16:59
    here you can see they've got one already
  • 16:59 - 17:02
    mounted slash var logs audit is slash
  • 17:02 - 17:03
    dev
  • 17:03 - 17:05
    mapper slash whatever uh so as long as
  • 17:05 - 17:07
    you use the mapper name you'll be you'll
  • 17:07 - 17:08
    be in good shape and you can mount it
  • 17:08 - 17:10
    and it'll be persistent so don how would
  • 17:10 - 17:12
    we go about adding more storage all
  • 17:12 - 17:13
    right so i mentioned that beginning the
  • 17:13 - 17:15
    episode i had that third disc that i was
  • 17:15 - 17:17
    holding i got another terabyte so let's
  • 17:17 - 17:18
    just say over over time
  • 17:18 - 17:20
    i
  • 17:20 - 17:21
    fill up this one and a half terabyte
  • 17:21 - 17:22
    storage drive that i just made and i
  • 17:22 - 17:24
    want to add more storage well i actually
  • 17:24 - 17:26
    i've got 500 gigs more storage in this
  • 17:26 - 17:28
    volume group already that i could slice
  • 17:28 - 17:30
    out and add and expanded 2 terabytes but
  • 17:30 - 17:32
    maybe i know that i'm going to add
  • 17:32 - 17:34
    another terabyte of data so i need to
  • 17:34 - 17:35
    add more than that 500 gigs it's
  • 17:35 - 17:38
    available i can go and add another
  • 17:38 - 17:40
    physical disk to my server and i can
  • 17:40 - 17:43
    incorporate that into the lvm i can
  • 17:43 - 17:44
    bring it in as another physical volume
  • 17:44 - 17:46
    and expand out my volume group once i've
  • 17:46 - 17:48
    done that i can expand out my logical
  • 17:48 - 17:50
    volume and then lastly i can expand out
  • 17:50 - 17:52
    my file system and before you know it
  • 17:52 - 17:54
    i'll have more storage so let's uh let's
  • 17:54 - 17:55
    see what that looks like
  • 17:55 - 17:57
    basically i'm going to go to my command
  • 17:57 - 17:58
    prompt and first off i would need to
  • 17:58 - 18:00
    shut my system down add another hard
  • 18:00 - 18:02
    drive right and then we would need to
  • 18:02 - 18:03
    create a partition on it i mentioned we
  • 18:03 - 18:05
    always need to have a partition there if
  • 18:05 - 18:10
    i do a lsblk i can see that sdd disk
  • 18:10 - 18:11
    right there
  • 18:11 - 18:12
    it's already got a partition on it and
  • 18:12 - 18:14
    actually i didn't bring this up earlier
  • 18:14 - 18:16
    but i can see the volume group and
  • 18:16 - 18:18
    logical volume names have been attached
  • 18:18 - 18:20
    inside of lsblk so i can see those guys
  • 18:20 - 18:23
    are tied up into logical volumes
  • 18:23 - 18:26
    all right so i want to incorporate sdd1
  • 18:26 - 18:29
    into my physical volumes so i'm going to
  • 18:29 - 18:30
    bring that in just like we did at the
  • 18:30 - 18:33
    beginning of the show i'll do a sudo pv
  • 18:33 - 18:35
    create i'm creating a physical volume
  • 18:35 - 18:38
    yes and that'll be slash dev
  • 18:38 - 18:41
    sdd1 all right so that's going to bring
  • 18:41 - 18:43
    it in all right now that just makes it a
  • 18:43 - 18:45
    physical volume if it had a partition on
  • 18:45 - 18:46
    it it would have formatted it and and
  • 18:46 - 18:48
    gotten it ready but it didn't actually
  • 18:48 - 18:50
    connect it to the volume group so now i
  • 18:50 - 18:52
    need to add it to the volume group and
  • 18:52 - 18:53
    for that
  • 18:53 - 18:56
    uh it's actually a little bit different
  • 18:56 - 18:58
    when i did it earlier i was creating the
  • 18:58 - 18:59
    volume group and you can add physical
  • 18:59 - 19:01
    volumes at the time well now i've
  • 19:01 - 19:04
    already got a volume group in place so i
  • 19:04 - 19:06
    i can't can't kind of use the same
  • 19:06 - 19:08
    command from before i've already created
  • 19:08 - 19:10
    it so instead i need to use a different
  • 19:10 - 19:14
    command which is the vg
  • 19:14 - 19:17
    extend command all right so vg extends
  • 19:17 - 19:18
    says take the existing volume group and
  • 19:18 - 19:20
    add more to it i do need to sudo this
  • 19:20 - 19:22
    which i've
  • 19:22 - 19:25
    literally forgotten every single time
  • 19:25 - 19:27
    and so i'm going to be extending vg1 and
  • 19:27 - 19:29
    then i need to tell it the disk that i'm
  • 19:29 - 19:31
    adding to it i'm adding slash dev slash
  • 19:31 - 19:34
    sdd1 and so when i run that i'll see
  • 19:34 - 19:36
    volume group 1 successfully extended so
  • 19:36 - 19:39
    what does that mean well if we run
  • 19:39 - 19:41
    pvs
  • 19:41 - 19:43
    we'll see my physical volumes right and
  • 19:43 - 19:46
    i can see sdd1 right here has been added
  • 19:46 - 19:48
    all right under free space i see it's
  • 19:48 - 19:50
    completely free versus the other ones
  • 19:50 - 19:53
    that have had space used up if i do a
  • 19:53 - 19:56
    vgs
  • 19:57 - 19:59
    then i'll see my volume groups and
  • 19:59 - 20:01
    notice how volume group 1
  • 20:01 - 20:04
    shows that it's actually 2.93 terabytes
  • 20:04 - 20:06
    it's 3 terabytes and that it's got one
  • 20:06 - 20:08
    and a half terabytes free there's the
  • 20:08 - 20:10
    500 gigs from the previous volumes that
  • 20:10 - 20:12
    i didn't use and now there's a whole
  • 20:12 - 20:14
    extra terabyte that's been stuck onto it
  • 20:14 - 20:17
    so it's expanded quite a bit
  • 20:17 - 20:18
    but
  • 20:18 - 20:20
    now that i've got that space the volume
  • 20:20 - 20:22
    group has been updated i need to upgrade
  • 20:22 - 20:25
    or update the logical volume and for
  • 20:25 - 20:26
    that i'm going to be extending out the
  • 20:26 - 20:28
    logic volume now before i do that let me
  • 20:28 - 20:30
    just run lvs
  • 20:30 - 20:32
    and so looking at it here i can see lv1
  • 20:32 - 20:34
    right now is one and a half terabytes so
  • 20:34 - 20:37
    i'm going to run sudo
  • 20:37 - 20:41
    lv resize and i'm going to resize that
  • 20:41 - 20:42
    partition i want to grow it by one
  • 20:42 - 20:44
    terabyte i'm going to add some more
  • 20:44 - 20:45
    space to it
  • 20:45 - 20:48
    so i'll come in and just say dash l and
  • 20:48 - 20:49
    then
  • 20:49 - 20:54
    uh plus one g so i'm adding one gigabyte
  • 20:54 - 20:54
    to it
  • 20:54 - 20:56
    and then or i don't need one gig one
  • 20:56 - 20:58
    terabyte there we go something actually
  • 20:58 - 20:59
    is meaningful
  • 20:59 - 21:01
    i'm going to add a terabyte to it plus
  • 21:01 - 21:03
    one t and then i'll specify this is
  • 21:03 - 21:07
    slash dev slash vg1 slash lv1 that's the
  • 21:07 - 21:08
    logical volume that i want to expand or
  • 21:08 - 21:10
    i could use the map or whichever one i
  • 21:10 - 21:12
    wanted all right and when i run that
  • 21:12 - 21:14
    it's going to go and extend it and it
  • 21:14 - 21:16
    tells me that it extended it from
  • 21:16 - 21:19
    1.46 terabytes to 2.46 terabytes it
  • 21:19 - 21:22
    added that extra space to expand that
  • 21:22 - 21:24
    out
  • 21:24 - 21:26
    you might think you're done and
  • 21:26 - 21:27
    technically as far as the lvm is
  • 21:27 - 21:30
    concerned you are done right if i do a
  • 21:30 - 21:33
    lvs and look at my logical volumes it's
  • 21:33 - 21:34
    now two and a half terabytes so great
  • 21:34 - 21:35
    we're done
  • 21:35 - 21:38
    except the file system won't recognize
  • 21:38 - 21:41
    that yet if you do a df-h
  • 21:41 - 21:46
    and take a look at it it still shows as
  • 21:46 - 21:48
    being a one and a half terabyte
  • 21:48 - 21:50
    partition and that's because i formatted
  • 21:50 - 21:53
    it with ext4 right and the ext4
  • 21:53 - 21:55
    partition that's on there is still one
  • 21:55 - 21:57
    and a half terabytes it's got an extra
  • 21:57 - 21:59
    terabyte of free space on it but it
  • 21:59 - 22:01
    doesn't know that
  • 22:01 - 22:03
    the lvm has expanded everything that it
  • 22:03 - 22:04
    can expand now it's up to your file
  • 22:04 - 22:09
    system so if you're running xfs or
  • 22:09 - 22:11
    ext4 or whatever you'll need to use that
  • 22:11 - 22:13
    file systems tooling to be able to
  • 22:13 - 22:15
    expand it out so this is where things
  • 22:15 - 22:17
    start to differentiate i'm running ext4
  • 22:17 - 22:19
    on this one so i can just use its tools
  • 22:19 - 22:22
    with it you have a utility called
  • 22:22 - 22:23
    resize
  • 22:23 - 22:25
    2fs
  • 22:25 - 22:27
    with xfs you have to use the xfs admin
  • 22:27 - 22:29
    command or no actually it's xfs
  • 22:29 - 22:31
    underscore resize i think is the one for
  • 22:31 - 22:32
    that be careful with it if you're
  • 22:32 - 22:34
    running red hat
  • 22:34 - 22:36
    red hat will tell you they do not
  • 22:36 - 22:38
    officially support resizing xfs
  • 22:38 - 22:40
    partitions so you can do it but they
  • 22:40 - 22:42
    don't support it because they tell you
  • 22:42 - 22:44
    you just need to back up format restore
  • 22:44 - 22:46
    so that's kind of how they are but uh
  • 22:46 - 22:48
    but with ext we can just use the resize
  • 22:48 - 22:51
    2fs command and i'll point that at slash
  • 22:51 - 22:53
    dev slash vg1
  • 22:53 - 22:55
    lv1 and if you don't provide any other
  • 22:55 - 22:57
    options this utility will just expand it
  • 22:57 - 22:59
    to fill all the available space so when
  • 22:59 - 23:00
    i run that
  • 23:00 - 23:02
    it sees there's more space it goes and
  • 23:02 - 23:05
    acquires that and if i take a look at my
  • 23:05 - 23:07
    storage now
  • 23:07 - 23:09
    now that disk shows as being two and a
  • 23:09 - 23:11
    half terabytes in size and i did it
  • 23:11 - 23:14
    while it was online i never unmounted it
  • 23:14 - 23:15
    right it stayed mounted the whole time
  • 23:15 - 23:17
    users could have been in the system
  • 23:17 - 23:19
    writing and so on and it just tacks it
  • 23:19 - 23:21
    on adds that space and we just grew it
  • 23:21 - 23:23
    and that's really the big advantage of
  • 23:23 - 23:25
    the lvm is that we can grow our
  • 23:25 - 23:27
    partitions
  • 23:27 - 23:28
    without actually having to kick our
  • 23:28 - 23:30
    users out without having to reboot a
  • 23:30 - 23:31
    server we can do it all dynamically
  • 23:31 - 23:33
    while people are in the system working
  • 23:33 - 23:35
    you know happy shiny people holding
  • 23:35 - 23:37
    hands and all that stuff and it's done
  • 23:37 - 23:41
    if i do a lvs or lv display i can see
  • 23:41 - 23:42
    i've got that two and a half terabytes
  • 23:42 - 23:45
    is available there and the file system
  • 23:45 - 23:47
    sees it as well so we are now expanded
  • 23:47 - 23:50
    and done so after all that i'm going to
  • 23:50 - 23:52
    ask is it difficult to remove the lvm if
  • 23:52 - 23:54
    we no longer need it uh you know it's
  • 23:54 - 23:56
    not difficult to remove it if you're if
  • 23:56 - 23:58
    you're done with it uh well if you want
  • 23:58 - 23:59
    to move it to another computer right
  • 23:59 - 24:01
    maybe i've got this on one server i want
  • 24:01 - 24:02
    to move it somewhere else you can just
  • 24:02 - 24:04
    unmount all this stuff
  • 24:04 - 24:05
    and then take it over to another
  • 24:05 - 24:07
    computer and reincorporate it the pv
  • 24:07 - 24:08
    scan utility is designed to find your
  • 24:08 - 24:10
    physical volumes
  • 24:10 - 24:11
    when it finds them all it'll bring it
  • 24:11 - 24:13
    into the lvm and it'll see the volume
  • 24:13 - 24:14
    group and the logic volumes are all
  • 24:14 - 24:15
    there so it's kind of easy to
  • 24:15 - 24:17
    reincorporate somewhere else but if i'm
  • 24:17 - 24:18
    actually done with it i want to turn
  • 24:18 - 24:19
    these back into regular disks right
  • 24:19 - 24:20
    because right now it's a bit of a mess
  • 24:20 - 24:21
    if i do
  • 24:21 - 24:25
    lsblk you'll see all these different
  • 24:25 - 24:26
    kind of notes in here about what it
  • 24:26 - 24:28
    created with the
  • 24:28 - 24:30
    the volume groups and the logical
  • 24:30 - 24:31
    volumes and so on so if i want to just
  • 24:31 - 24:33
    reset these back to becoming regular
  • 24:33 - 24:34
    disks we can move through a couple of
  • 24:34 - 24:37
    steps first i need to unmount the folder
  • 24:37 - 24:40
    that it's tied to which is slash mnt
  • 24:40 - 24:42
    storage so i'm going to unmount it
  • 24:42 - 24:45
    using the umount command so umount slash
  • 24:45 - 24:47
    mnt storage and then we basically just
  • 24:47 - 24:49
    go through and destroy everything
  • 24:49 - 24:52
    backwards so we start at the top of the
  • 24:52 - 24:53
    diagram with the logical volumes we
  • 24:53 - 24:55
    destroy that then we destroy the volume
  • 24:55 - 24:56
    group then we destroy the physical
  • 24:56 - 24:57
    volumes and when you're done now you've
  • 24:57 - 25:00
    got regular old disks available again so
  • 25:00 - 25:03
    what that looks like is we do sudo
  • 25:03 - 25:05
    lv remove
  • 25:05 - 25:10
    and i'll remove slash dev vg1 slash lv1
  • 25:10 - 25:11
    so i'm going to remove that logical
  • 25:11 - 25:14
    volume and i would remove each one if i
  • 25:14 - 25:16
    had more than one i just have the one
  • 25:16 - 25:18
    that was lv remove then we do
  • 25:18 - 25:21
    vg remove to remove the volume group and
  • 25:21 - 25:24
    that's slash dev vg1 for me so we'll
  • 25:24 - 25:27
    remove it it's gone if it has no logical
  • 25:27 - 25:28
    volumes then you don't get a prompt to
  • 25:28 - 25:30
    confirm because there's no data at that
  • 25:30 - 25:32
    point so it just removes and then lastly
  • 25:32 - 25:34
    we remove the physical volumes which is
  • 25:34 - 25:35
    a little bit harder because we have to
  • 25:35 - 25:39
    type each one so i'll do sudo pv remove
  • 25:39 - 25:41
    and then i'm going to remove dev
  • 25:41 - 25:44
    sdb1 slash dev slash
  • 25:44 - 25:49
    sdc1 and slash dev slash sd1 all right
  • 25:49 - 25:52
    each one removing them and see how it
  • 25:52 - 25:54
    says successfully wiped it actually
  • 25:54 - 25:57
    kills off that uh that file system and
  • 25:57 - 25:59
    now if i do an lsblk
  • 25:59 - 26:02
    i'll see where those guys are just three
  • 26:02 - 26:04
    regular old disks with regular old
  • 26:04 - 26:06
    partitions sitting on them waiting for
  • 26:06 - 26:08
    me to format them and put them back in
  • 26:08 - 26:09
    use as
  • 26:09 - 26:11
    non-lvm disks so pretty easy to remove
  • 26:11 - 26:12
    all this stuff
  • 26:12 - 26:14
    logical volume manager another wonderful
  • 26:14 - 26:16
    episode don thank you very much and
  • 26:16 - 26:18
    before we move on what else would you
  • 26:18 - 26:20
    like to say uh you know most of the
  • 26:20 - 26:23
    distros that are out there turn lv lvm
  • 26:23 - 26:26
    on by default if you're doing a desktop
  • 26:26 - 26:28
    install so you likely already have it
  • 26:28 - 26:30
    on servers it's usually not on by
  • 26:30 - 26:31
    default they're just standard
  • 26:31 - 26:34
    assignments and honestly if you're not
  • 26:34 - 26:36
    going to be expanding your disk storage
  • 26:36 - 26:37
    then the lvm doesn't really bring you
  • 26:37 - 26:39
    any benefits so i've there's some
  • 26:39 - 26:41
    snapshotting features that are kind of
  • 26:41 - 26:42
    nice that we didn't really get into uh
  • 26:42 - 26:44
    but you can actually do that stuff
  • 26:44 - 26:47
    without the lvm too so when i do server
  • 26:47 - 26:49
    deployments it is rare that i use the
  • 26:49 - 26:51
    lvm because there's just no real benefit
  • 26:51 - 26:53
    to it so keep that in mind just because
  • 26:53 - 26:54
    the feature's there doesn't mean you
  • 26:54 - 26:56
    have to use it on desktop though it is
  • 26:56 - 26:57
    kind of nice if you've got a storage
  • 26:57 - 26:58
    disk and you're running out of space
  • 26:58 - 27:00
    that you can add more if you've got a
  • 27:00 - 27:03
    laptop though pretty hard to add extra
  • 27:03 - 27:04
    storage to a laptop you're usually
  • 27:04 - 27:06
    replacing a disk and the lvm doesn't
  • 27:06 - 27:08
    help with that so do understand that
  • 27:08 - 27:09
    it's not
  • 27:09 - 27:11
    always the right solution sometimes it's
  • 27:11 - 27:12
    perfectly fine just go with regular
  • 27:12 - 27:14
    disks and you know create your petitions
  • 27:14 - 27:16
    on there can be a little easier to
  • 27:16 - 27:18
    manage sometimes too great advice thanks
  • 27:18 - 27:19
    don here's some more great advice watch
  • 27:19 - 27:22
    every episode of comptia linux plus
  • 27:22 - 27:23
    you're going to be very glad you did
  • 27:23 - 27:25
    it's going to help you now in the future
  • 27:25 - 27:26
    and don't forget about the supplementary
  • 27:26 - 27:28
    information in our course library and
  • 27:28 - 27:30
    we'll do only one thing help you be more
  • 27:30 - 27:32
    successful so check that out too and
  • 27:32 - 27:33
    tell everybody you know about it pro tv
  • 27:33 - 27:35
    ig pro tv is binge worthy thanks for
  • 27:35 - 27:37
    watching i'm zach memis and i'm don
  • 27:37 - 27:40
    pazette we will see you again soon
  • 27:40 - 27:45
    [Music]
  • 27:45 - 27:50
    thank you for watching i.t pro tv
  • 27:52 - 27:56
    welcome to itpro tv i'm your host rob
  • 27:56 - 27:59
    live from san francisco
  • 28:00 - 28:04
    you're watching it pro tv
  • 28:04 - 28:06
    hello and thank you for watching it pro
  • 28:06 - 28:08
    tv helping you level up with it learning
  • 28:08 - 28:10
    everywhere you go i'm your host zach
  • 28:10 - 28:12
    memphis for this episode of comptia
  • 28:12 - 28:15
    linux plus file system hierarchy
  • 28:15 - 28:17
    standard is the name of this episode and
  • 28:17 - 28:19
    once again don pizet is here to show us
  • 28:19 - 28:20
    the way don good to see you nice to work
  • 28:20 - 28:22
    with you again yep glad to be here and
  • 28:22 - 28:23
    you know we're going to tackle a pretty
  • 28:23 - 28:25
    neat topic here which is that file
  • 28:25 - 28:27
    system hierarchy standard uh many of you
  • 28:27 - 28:28
    as you learn linux have probably
  • 28:28 - 28:30
    experienced where you browse to the hard
  • 28:30 - 28:31
    drive and you see all these crazy
  • 28:31 - 28:33
    folders folders that oftentimes just
  • 28:33 - 28:35
    have three letter names that don't make
  • 28:35 - 28:37
    a whole lot of sense and
  • 28:37 - 28:39
    that's a that's a pretty big obstacle to
  • 28:39 - 28:40
    getting in and learning a new operating
  • 28:40 - 28:42
    system so what we're going to do right
  • 28:42 - 28:44
    here is we're going to take a look at
  • 28:44 - 28:46
    the file system hierarchy standard and
  • 28:46 - 28:48
    see what exactly are those folders what
  • 28:48 - 28:50
    do they do what is their purpose how are
  • 28:50 - 28:51
    they arranged how it varies from distro
  • 28:51 - 28:53
    to distro and get a little bit more
  • 28:53 - 28:55
    familiarity with that file system if
  • 28:55 - 28:56
    you're coming from something like
  • 28:56 - 28:58
    windows
  • 28:58 - 28:59
    well you just have a couple of folders
  • 28:59 - 29:01
    that it uses inside of linux though
  • 29:01 - 29:03
    there's actually a lot of different
  • 29:03 - 29:05
    folders and we need to be familiar with
  • 29:05 - 29:05
    them
  • 29:05 - 29:07
    it'll help you better use the system but
  • 29:07 - 29:08
    it will also help you with
  • 29:08 - 29:10
    troubleshooting and locating
  • 29:10 - 29:12
    configuration so definitely a good skill
  • 29:12 - 29:13
    to have and that's what we're going to
  • 29:13 - 29:14
    be learning about right here in this
  • 29:14 - 29:17
    episode so don who created the
  • 29:17 - 29:19
    fhs all right so the fhs has actually
  • 29:19 - 29:21
    been around a long time right and that's
  • 29:21 - 29:22
    easier to say than file system hierarchy
  • 29:22 - 29:24
    i guess
  • 29:24 - 29:27
    which oddly enough if i also say that
  • 29:27 - 29:29
    file system is actually two words right
  • 29:29 - 29:31
    file and system yeah but in the standard
  • 29:31 - 29:33
    they decided to combine them which is
  • 29:33 - 29:35
    not dictionary correct but but they did
  • 29:35 - 29:37
    so it is the fhs and basically what
  • 29:37 - 29:39
    happened is remember that a lot of the
  • 29:39 - 29:41
    linux stuff that we work with came from
  • 29:41 - 29:44
    the unix world so back in the 1970s at a
  • 29:44 - 29:46
    t bell labs they created the unix
  • 29:46 - 29:49
    operating system and they had to use a
  • 29:49 - 29:51
    file system to identify practically
  • 29:51 - 29:52
    everything even hardware was represented
  • 29:52 - 29:54
    as files well it was just a couple of
  • 29:54 - 29:56
    guys and they were making the stuff up
  • 29:56 - 29:59
    as they went well fast forward to today
  • 29:59 - 30:00
    where you've got
  • 30:00 - 30:04
    linux and freebsd and openbsd and all
  • 30:04 - 30:05
    these different
  • 30:05 - 30:07
    platforms that are all reliant on that
  • 30:07 - 30:09
    same file system structure how are you
  • 30:09 - 30:11
    supposed to create applications that are
  • 30:11 - 30:12
    compatible from one distro to another if
  • 30:12 - 30:13
    you don't know where the files are
  • 30:13 - 30:15
    supposed to go
  • 30:15 - 30:16
    so
  • 30:16 - 30:18
    they teamed up at one point this was
  • 30:18 - 30:21
    decades ago now and came up with a
  • 30:21 - 30:24
    standard that said here's the folders
  • 30:24 - 30:26
    that are the locations that we expect
  • 30:26 - 30:28
    things to be in in order for your system
  • 30:28 - 30:31
    to work and by making consistency that
  • 30:31 - 30:33
    helps with compatibility you know with
  • 30:33 - 30:36
    linux anybody can go out there so you
  • 30:36 - 30:38
    you right now if you want could go and
  • 30:38 - 30:41
    take the linux kernel source code and
  • 30:41 - 30:44
    grab some gnu utilities or any other
  • 30:44 - 30:45
    number of utilities that are out there
  • 30:45 - 30:46
    and package them together and create
  • 30:46 - 30:48
    your own distro and you can map the file
  • 30:48 - 30:50
    system however you want you can create
  • 30:50 - 30:51
    files with whatever name you want
  • 30:51 - 30:53
    folders whatever name you want put
  • 30:53 - 30:54
    configurations wherever you want you
  • 30:54 - 30:57
    have that flexibility it's free right
  • 30:57 - 30:59
    but if you're expecting third-party
  • 30:59 - 31:01
    applications to run
  • 31:01 - 31:04
    they're expecting to see certain folders
  • 31:04 - 31:07
    and that's where we we end up where we
  • 31:07 - 31:08
    are today where we have a standard and
  • 31:08 - 31:09
    the standard was put together i kind of
  • 31:09 - 31:10
    got off tangent so going back to your
  • 31:10 - 31:12
    question who created this thing uh it
  • 31:12 - 31:14
    actually came from the linux foundation
  • 31:14 - 31:16
    and we've talked briefly about the linux
  • 31:16 - 31:17
    foundation i think i've got their web
  • 31:17 - 31:19
    page pulled up here
  • 31:19 - 31:21
    uh whoops the linux foundation is an
  • 31:21 - 31:24
    organization that is or was headed up by
  • 31:24 - 31:26
    linus torvalds himself uh so you know
  • 31:26 - 31:27
    obviously the creator of the linux
  • 31:27 - 31:30
    kernel is going to be involved here but
  • 31:30 - 31:33
    it's actually got members from a number
  • 31:33 - 31:35
    of organizations companies like red hat
  • 31:35 - 31:37
    and canonical are a part of it uh the
  • 31:37 - 31:39
    the individuals that create projects
  • 31:39 - 31:40
    like slackware and other things they're
  • 31:40 - 31:43
    all a part of it and so it was a group
  • 31:43 - 31:46
    effort amongst all the major distros at
  • 31:46 - 31:48
    the time to come up with this standard
  • 31:48 - 31:49
    and it's not like they were really
  • 31:49 - 31:50
    inventing the standard most of it just
  • 31:50 - 31:52
    came from unix and everybody just agreed
  • 31:52 - 31:54
    hey from now on we're going to follow
  • 31:54 - 31:58
    this standard so when i log into a red
  • 31:58 - 32:01
    hat enterprise linux box i can expect
  • 32:01 - 32:03
    slash etc to be there and i can expect
  • 32:03 - 32:05
    configuration files to be in that folder
  • 32:05 - 32:07
    and then when i go to an ubuntu box i
  • 32:07 - 32:09
    can expect slash etc to be there and
  • 32:09 - 32:11
    configuration files to be there and even
  • 32:11 - 32:13
    if i jump outside of linux and i go to a
  • 32:13 - 32:16
    bsd system i can still expect slash etc
  • 32:16 - 32:17
    to be there and that it's going to have
  • 32:17 - 32:19
    configuration files because that's what
  • 32:19 - 32:22
    was agreed upon so the linux foundation
  • 32:22 - 32:23
    they're the ones who put this all
  • 32:23 - 32:25
    together
  • 32:25 - 32:27
    almost everybody adheres to it so it
  • 32:27 - 32:29
    works out pretty well but it does
  • 32:29 - 32:31
    really kind of come from linus torvalds
  • 32:31 - 32:33
    himself as part of of his leadership in
  • 32:33 - 32:35
    the linux foundation well done where can
  • 32:35 - 32:37
    we view the official standard uh so they
  • 32:37 - 32:39
    do publish the standard it's online in
  • 32:39 - 32:42
    what is a spectacularly old web page
  • 32:42 - 32:44
    this is it right here
  • 32:44 - 32:47
    so it does look a bit old if you want to
  • 32:47 - 32:48
    look at it i'll put the link in the show
  • 32:48 - 32:52
    notes but it's uh pathname.com
  • 32:52 - 32:54
    p-a-t-h-n-a-m-e.com pathname.com
  • 32:54 - 32:57
    fhs that'll take you right here to this
  • 32:57 - 33:00
    amazing web page uh which is uh is
  • 33:00 - 33:01
    pretty neat
  • 33:01 - 33:03
    what's really neat about it is how
  • 33:03 - 33:05
    static it's been it hasn't changed much
  • 33:05 - 33:07
    i can see right here the current version
  • 33:07 - 33:10
    is 2.3 which was announced january 29th
  • 33:10 - 33:12
    2004 which means as of the filming of
  • 33:12 - 33:15
    this episode that was 15 years ago there
  • 33:15 - 33:18
    has not been a change to the fhs in 15
  • 33:18 - 33:20
    years it's a long time uh and right on
  • 33:20 - 33:22
    here you can actually come through and
  • 33:22 - 33:25
    view the uh the standard they have it in
  • 33:25 - 33:28
    pdf raw text and also html which is
  • 33:28 - 33:30
    probably the easiest and if you browse
  • 33:30 - 33:33
    into that you'll see the actual standard
  • 33:33 - 33:35
    laid out right here and they're
  • 33:35 - 33:37
    basically defining all the different
  • 33:37 - 33:40
    folders defining which ones are required
  • 33:40 - 33:43
    which ones are optional and what role
  • 33:43 - 33:45
    that folder is supposed to serve what is
  • 33:45 - 33:46
    it supposed to do and you can kind of
  • 33:46 - 33:49
    see that here like slash dev is supposed
  • 33:49 - 33:51
    to contain device files or etc is
  • 33:51 - 33:53
    supposed to have host specific system
  • 33:53 - 33:56
    configuration and if you drill into it a
  • 33:56 - 33:57
    little more deeply
  • 33:57 - 34:00
    we can come in and find specific options
  • 34:00 - 34:02
    about it variations types of files that
  • 34:02 - 34:04
    might be expected to be found in there
  • 34:04 - 34:05
    in earlier episodes we've seen files
  • 34:05 - 34:08
    like the passwd file so right here it's
  • 34:08 - 34:11
    defined the fhs doesn't just define
  • 34:11 - 34:13
    folders it also defines individual files
  • 34:13 - 34:15
    that are inside of it and so if you've
  • 34:15 - 34:16
    ever found yourself like scratching your
  • 34:16 - 34:19
    head what why is the
  • 34:19 - 34:22
    wd file why is it the same everywhere
  • 34:22 - 34:23
    it's because it's right here it's part
  • 34:23 - 34:25
    of the standard everybody adheres to
  • 34:25 - 34:26
    that uh and you can kind of browse
  • 34:26 - 34:28
    through and see it's all freely posted
  • 34:28 - 34:29
    right there online do all linux
  • 34:29 - 34:32
    distributions adhere to the fhs you know
  • 34:32 - 34:33
    i'm gonna say that right eventually the
  • 34:33 - 34:37
    fhs thank you they uh they should but
  • 34:37 - 34:38
    but as is the case with most
  • 34:38 - 34:41
    technologies they they don't all do it
  • 34:41 - 34:42
    uh
  • 34:42 - 34:43
    most vendors are actually really good
  • 34:43 - 34:45
    about it so i mentioned ubuntu around
  • 34:45 - 34:47
    canonical and red hat those are kind of
  • 34:47 - 34:48
    the two biggest commercial players in
  • 34:48 - 34:50
    the linux world uh they adhere to it
  • 34:50 - 34:52
    pretty well but they both deviate a
  • 34:52 - 34:55
    little ways in fact i'm not sure i could
  • 34:55 - 34:57
    name a linux distro that completely
  • 34:57 - 35:00
    conforms to the standard because there's
  • 35:00 - 35:01
    some there's some weird stuff in this
  • 35:01 - 35:04
    standard that maybe was relevant back in
  • 35:04 - 35:05
    2004
  • 35:05 - 35:08
    and today is is not so relevant so uh
  • 35:08 - 35:10
    especially when it comes to security
  • 35:10 - 35:11
    there's some things that have changed
  • 35:11 - 35:12
    there and then the way that we need to
  • 35:12 - 35:14
    lay things out so um when i talk about
  • 35:14 - 35:16
    variations
  • 35:16 - 35:17
    let me give you an example i don't know
  • 35:17 - 35:18
    if i can find this real quick in the
  • 35:18 - 35:21
    standard but uh there's a folder
  • 35:21 - 35:24
    slash s-bin and here they define it
  • 35:24 - 35:26
    right here for system binaries okay so
  • 35:26 - 35:29
    the slash s-bin folder it's got well
  • 35:29 - 35:31
    system binders great well we also have a
  • 35:31 - 35:36
    slash usr slash sbin right uh which is
  • 35:36 - 35:38
    under slash usr so here we've got the
  • 35:38 - 35:40
    slash usr hierarchy under section four
  • 35:40 - 35:43
    and you can find slash usr slash sbin in
  • 35:43 - 35:46
    the list there non-essential
  • 35:46 - 35:48
    standard system libraries so both
  • 35:48 - 35:51
    folders have system libraries but one
  • 35:51 - 35:53
    folder is for essential stuff and one is
  • 35:53 - 35:55
    non-essential
  • 35:55 - 35:56
    well
  • 35:56 - 35:58
    why do we need to separate those out now
  • 35:58 - 36:00
    in the old days there was a case that
  • 36:00 - 36:02
    hard drive space was at a premium maybe
  • 36:02 - 36:04
    you're allocating out partition spaces
  • 36:04 - 36:06
    to say i've got this much space for
  • 36:06 - 36:08
    s-bin and this much more space for slash
  • 36:08 - 36:10
    user spinner or whatever there was a use
  • 36:10 - 36:13
    case for that but today storage is cheap
  • 36:13 - 36:14
    you know
  • 36:14 - 36:16
    we don't necessarily need separate
  • 36:16 - 36:18
    partitions and so a lot of distros have
  • 36:18 - 36:20
    started combining those and you know i'm
  • 36:20 - 36:22
    on a centos system let me show you here
  • 36:22 - 36:24
    this would be the same uh i believe
  • 36:24 - 36:26
    ubuntu is doing the same today so you
  • 36:26 - 36:28
    should be the same on either one but if
  • 36:28 - 36:32
    i navigate in my centos box i can go to
  • 36:32 - 36:34
    cd slash s-bin
  • 36:34 - 36:36
    right and i can take a look inside of
  • 36:36 - 36:38
    there and i see a bunch of of
  • 36:38 - 36:40
    executables right so here's these
  • 36:40 - 36:42
    system binaries and and libraries so
  • 36:42 - 36:44
    there it is
  • 36:44 - 36:47
    and then i can go into slash usr slash s
  • 36:47 - 36:47
    bin
  • 36:47 - 36:50
    and i can take a look and i see a bunch
  • 36:50 - 36:52
    of files and binaries
  • 36:52 - 36:53
    if you're a sharp observer you might
  • 36:53 - 36:55
    notice that they're the same right i'm
  • 36:55 - 36:58
    seeing the same files in both folder and
  • 36:58 - 37:01
    that's because slash usr slash sbin is a
  • 37:01 - 37:03
    real folder
  • 37:03 - 37:05
    if i pull up the full listing here see
  • 37:05 - 37:07
    how i've got s-bin and it's flagged as a
  • 37:07 - 37:10
    directory right there it's a real folder
  • 37:10 - 37:11
    but
  • 37:11 - 37:14
    if i take a look at
  • 37:14 - 37:16
    slash s-bin
  • 37:16 - 37:18
    it's a link it's a sim link so what
  • 37:18 - 37:20
    happened is the centos team really red
  • 37:20 - 37:23
    hat and the rel team um they made the
  • 37:23 - 37:24
    decision that there really wasn't need
  • 37:24 - 37:26
    to separate these out it just creates
  • 37:26 - 37:28
    confusion so they combined everything
  • 37:28 - 37:31
    into slash usr spin and then they just
  • 37:31 - 37:32
    sim linked espen and that's important to
  • 37:32 - 37:35
    note they sim linked it they said it is
  • 37:35 - 37:38
    still important to have slash s-bim
  • 37:38 - 37:40
    because many applications expect that
  • 37:40 - 37:42
    but we're not going to maintain separate
  • 37:42 - 37:43
    files anymore we're going to go ahead
  • 37:43 - 37:44
    and combine it and you'll see that like
  • 37:44 - 37:46
    up here i've got slash bin same kind of
  • 37:46 - 37:47
    thing
  • 37:47 - 37:49
    lib lib64
  • 37:49 - 37:52
    where if a vendor decides to deviate
  • 37:52 - 37:54
    from the standard they normally put sim
  • 37:54 - 37:56
    links in place so that they still
  • 37:56 - 37:58
    technically conform to the standard even
  • 37:58 - 37:59
    though the files are in a different
  • 37:59 - 38:02
    location so if you learn the standard
  • 38:02 - 38:03
    you'll be pretty safe you know if i'm
  • 38:03 - 38:05
    navigating my file system and i go to
  • 38:05 - 38:06
    slash s bin
  • 38:06 - 38:09
    not slash usr slash spin thanks to that
  • 38:09 - 38:11
    sim link i still find everything that i
  • 38:11 - 38:13
    want i can still use the system the way
  • 38:13 - 38:16
    that i expect so it's pretty rare that
  • 38:16 - 38:18
    somebody will deviate from the standard
  • 38:18 - 38:20
    and not put sim links in place to
  • 38:20 - 38:22
    preserve that compatibility it's pretty
  • 38:22 - 38:23
    rare for somebody to step in and say i
  • 38:23 - 38:26
    don't care about compatibility and that
  • 38:26 - 38:28
    usually only happens on really
  • 38:28 - 38:30
    really specialized distributions things
  • 38:30 - 38:32
    like pfsense right that's uh well that's
  • 38:32 - 38:35
    psd not linux but anyhow uh it's
  • 38:35 - 38:37
    specialized for firewalls and they say
  • 38:37 - 38:38
    we don't need compatibility you're not
  • 38:38 - 38:39
    loading other applications it's just
  • 38:39 - 38:42
    gonna run what we've put on there and so
  • 38:42 - 38:43
    those are scenarios where they might
  • 38:43 - 38:45
    deviate but most people do conform to
  • 38:45 - 38:47
    the standard well don where would we
  • 38:47 - 38:49
    normally find applications
  • 38:49 - 38:50
    all right so our applications that we
  • 38:50 - 38:52
    run right i just actually showed two
  • 38:52 - 38:55
    examples right there uh slash bin or
  • 38:55 - 38:58
    sorry slash s bin and slash usr spin but
  • 38:58 - 38:59
    applications can actually come from a
  • 38:59 - 39:02
    number of places uh there's there's
  • 39:02 - 39:02
    really
  • 39:02 - 39:05
    i'd say five locations by default but
  • 39:05 - 39:07
    you can put an application wherever you
  • 39:07 - 39:08
    want and when you install an application
  • 39:08 - 39:10
    it can go anywhere you can end up all
  • 39:10 - 39:11
    over the place that makes it hard to
  • 39:11 - 39:13
    find that's when in earlier episode we
  • 39:13 - 39:14
    learned about some commands to be able
  • 39:14 - 39:17
    to locate applications but for example
  • 39:17 - 39:21
    if i go into my root folder here
  • 39:21 - 39:22
    there's a couple of folders that are
  • 39:22 - 39:25
    really designed to be able to store
  • 39:25 - 39:27
    those applications and
  • 39:27 - 39:29
    me zoom in a little bit here
  • 39:29 - 39:31
    all right the first one is slash bin
  • 39:31 - 39:33
    right slash bin bin is short for
  • 39:33 - 39:35
    binaries right and applications are
  • 39:35 - 39:36
    typically binary files that we flag is
  • 39:36 - 39:39
    executable and they can run so slash bin
  • 39:39 - 39:40
    seems like a really great place for
  • 39:40 - 39:42
    those to be yeah and then there's the
  • 39:42 - 39:44
    usr the user variant of it which is
  • 39:44 - 39:48
    slash usr slash bin same thing for s bin
  • 39:48 - 39:50
    and slash usr
  • 39:50 - 39:52
    s bin so those are a couple places but
  • 39:52 - 39:54
    these folders these aren't where like
  • 39:54 - 39:57
    like if i install openoffice open office
  • 39:57 - 39:59
    isn't going into slash s-bin or at least
  • 39:59 - 40:01
    not normally
  • 40:01 - 40:02
    so
  • 40:02 - 40:04
    applications that i install
  • 40:04 - 40:06
    those are considered optional
  • 40:06 - 40:07
    applications and they will normally go
  • 40:07 - 40:11
    into slash opt so opt right there so
  • 40:11 - 40:13
    that's kind of that fifth place so slash
  • 40:13 - 40:16
    bin slash spin slash user slash bin
  • 40:16 - 40:19
    slash user spin and slash opt now when
  • 40:19 - 40:21
    you install an application there's
  • 40:21 - 40:23
    actually a number of vendors that will
  • 40:23 - 40:26
    maybe not put it in slash opt to let you
  • 40:26 - 40:27
    pick somewhere maybe even runs from your
  • 40:27 - 40:30
    home folder and they may actually create
  • 40:30 - 40:32
    links to their application inside of
  • 40:32 - 40:34
    slash user s bin or somewhere and that
  • 40:34 - 40:36
    that creates that uncertainty of like
  • 40:36 - 40:37
    where where the heck is this app how am
  • 40:37 - 40:39
    i going to find it but let me run over
  • 40:39 - 40:40
    the official standard and what these
  • 40:40 - 40:43
    folders are for right the first one is
  • 40:43 - 40:45
    that slash bin uh this one is what's
  • 40:45 - 40:48
    considered essential command line
  • 40:48 - 40:50
    utilities that are available to all
  • 40:50 - 40:53
    users all right so this is stuff that uh
  • 40:53 - 40:55
    is really considered essential for the
  • 40:55 - 40:57
    system to work and if you were to browse
  • 40:57 - 40:58
    around on a system where these were
  • 40:58 - 41:00
    separated and poke around in there it's
  • 41:00 - 41:02
    going to be things like um you know
  • 41:02 - 41:04
    system ctl uh well actually i'd been
  • 41:04 - 41:05
    administrative commander would be an s
  • 41:05 - 41:07
    pen uh so there's a little variation
  • 41:07 - 41:09
    there but commands that are critical
  • 41:09 - 41:10
    just the regular operation things like
  • 41:10 - 41:12
    mount right in order to mount a file
  • 41:12 - 41:14
    system i need the mount command so it
  • 41:14 - 41:16
    would need to be in slash bin
  • 41:16 - 41:19
    uh slash s-bin on the other hand that
  • 41:19 - 41:21
    stands for system binaries and system
  • 41:21 - 41:24
    binaries are required for the system to
  • 41:24 - 41:26
    boot up if it's missing a particular
  • 41:26 - 41:29
    binary it can't even boot anymore when
  • 41:29 - 41:31
    the linux kernel runs it then needs to
  • 41:31 - 41:32
    fire up the operating system it needs to
  • 41:32 - 41:34
    perform operations and
  • 41:34 - 41:37
    it needs a certain set of commands those
  • 41:37 - 41:39
    are going to be found inside of slash s
  • 41:39 - 41:40
    bin
  • 41:40 - 41:43
    then you've got the user one slash usr
  • 41:43 - 41:44
    bin
  • 41:44 - 41:46
    that one is going to have the the rest
  • 41:46 - 41:48
    of our user commands user commands that
  • 41:48 - 41:50
    aren't considered essential we don't
  • 41:50 - 41:51
    have to have them but they're nice to
  • 41:51 - 41:53
    have so they end up in slash user slash
  • 41:53 - 41:54
    bin
  • 41:54 - 41:58
    and then slash user slash sbin those are
  • 41:58 - 42:00
    non-essential system binaries so the
  • 42:00 - 42:01
    ones for the system to use for the
  • 42:01 - 42:03
    kernel to use really
  • 42:03 - 42:04
    but they're not essential the system
  • 42:04 - 42:07
    would boot up if those were all missing
  • 42:07 - 42:08
    now
  • 42:08 - 42:10
    those four right there really all
  • 42:10 - 42:13
    pertain to system commands not
  • 42:13 - 42:15
    applications and that's where we have
  • 42:15 - 42:17
    slash opt that's where we're going to
  • 42:17 - 42:18
    find things like
  • 42:18 - 42:20
    openoffice or whatever we installed it
  • 42:20 - 42:22
    in fact here let's take a look at mine
  • 42:22 - 42:24
    so on my system i know it's simlinked so
  • 42:24 - 42:27
    if i go to slash bin i'm actually seeing
  • 42:27 - 42:29
    slash usr band they're really the
  • 42:29 - 42:30
    combination of the two
  • 42:30 - 42:33
    and if we look around inside of there
  • 42:33 - 42:34
    we're going to find things like the zip
  • 42:34 - 42:36
    utility if i want to create an archive
  • 42:36 - 42:39
    right uh or i'll probably find gzip in
  • 42:39 - 42:41
    here as well there's yum to be able to
  • 42:41 - 42:43
    do
  • 42:43 - 42:44
    package updates and operating system
  • 42:44 - 42:46
    updates uh
  • 42:46 - 42:48
    i don't know there's a ton of junk in
  • 42:48 - 42:50
    here uh the cat utility and things and
  • 42:50 - 42:51
    these are all these are all really
  • 42:51 - 42:53
    useful utilities ones we use all the
  • 42:53 - 42:55
    time right but they're not essential i
  • 42:55 - 42:57
    don't i don't have to have them in order
  • 42:57 - 42:58
    for the system to boot but i might have
  • 42:58 - 43:00
    to have them in order to perform some
  • 43:00 - 43:02
    kind of operation right uh but it's not
  • 43:02 - 43:03
    like the system depends on them to boot
  • 43:03 - 43:06
    if i look inside of slash s-bin on the
  • 43:06 - 43:08
    other hand i'm gonna see a bunch of
  • 43:08 - 43:09
    things in here that deal with like
  • 43:09 - 43:11
    interacting with the file system right
  • 43:11 - 43:15
    uh things like uh fdisk and so on uh
  • 43:15 - 43:17
    we'll see
  • 43:17 - 43:19
    other utilities in here uh like for
  • 43:19 - 43:21
    interacting with cpu for printing
  • 43:21 - 43:23
    subsystem and so on this is stuff that
  • 43:23 - 43:25
    users aren't normally gonna run
  • 43:25 - 43:26
    sometimes we might though if you watched
  • 43:26 - 43:28
    our storage episodes we used all these
  • 43:28 - 43:30
    logical volume commands when we were
  • 43:30 - 43:31
    working with the logical volume manager
  • 43:31 - 43:33
    lvm well if you look see how they're all
  • 43:33 - 43:35
    glowing blue they're not actually here
  • 43:35 - 43:37
    in this folder they're linked from
  • 43:37 - 43:41
    somewhere else if i do a dash l
  • 43:41 - 43:42
    on that
  • 43:42 - 43:44
    i can see that well actually most of
  • 43:44 - 43:45
    these are just aliases aren't they so
  • 43:45 - 43:47
    they're all just linked to the lvm
  • 43:47 - 43:48
    command which actually is right here in
  • 43:48 - 43:50
    this folder so not not somewhere else uh
  • 43:50 - 43:51
    so some of these aren't even really
  • 43:51 - 43:53
    commands they're just aliases or
  • 43:53 - 43:55
    shortcuts uh the mkfs commands are like
  • 43:55 - 43:59
    that uh if we pull up all of those
  • 43:59 - 44:00
    uh well they actually do show up as
  • 44:00 - 44:03
    binaries mkfs.ext2 and so on but some of
  • 44:03 - 44:05
    them like these guys right here are just
  • 44:05 - 44:07
    aliases off of a base command so you'll
  • 44:07 - 44:09
    see variations there if i look in slash
  • 44:09 - 44:11
    opt actually i don't think i've
  • 44:11 - 44:13
    installed anything on this system uh
  • 44:13 - 44:14
    looks like i have some kind of red hat
  • 44:14 - 44:16
    binaries in here whoops
  • 44:16 - 44:18
    and actually i don't yeah that's an
  • 44:18 - 44:20
    empty empty little world right here i
  • 44:20 - 44:22
    haven't installed any applications on
  • 44:22 - 44:23
    this system because we you know just
  • 44:23 - 44:25
    installed it for the show but if i start
  • 44:25 - 44:27
    installing things like openoffice and
  • 44:27 - 44:29
    firefox and so on if they come from
  • 44:29 - 44:31
    system packages then they may actually
  • 44:31 - 44:33
    end up in the main binary folders but if
  • 44:33 - 44:34
    i'm installing them from a third-party
  • 44:34 - 44:36
    site then they'll typically end up right
  • 44:36 - 44:39
    here inside of slash opt that's that
  • 44:39 - 44:41
    optional software and i've noticed over
  • 44:41 - 44:43
    the years that linux distribution is the
  • 44:43 - 44:45
    worst about using this folder
  • 44:45 - 44:47
    bsd systems are usually the best about
  • 44:47 - 44:49
    always using pushing all sorts of things
  • 44:49 - 44:50
    in there so you'll you'll see variations
  • 44:50 - 44:52
    there but
  • 44:52 - 44:53
    i guess i've just done a really long
  • 44:53 - 44:55
    answer to your short questions actually
  • 44:55 - 44:56
    where are apps those are kind of the
  • 44:56 - 44:58
    five main places where you're going to
  • 44:58 - 45:00
    find the application files what are some
  • 45:00 - 45:01
    of the other key folders we need to be
  • 45:01 - 45:03
    familiar with doc all right there are a
  • 45:03 - 45:06
    lot of other folders in here uh and kind
  • 45:06 - 45:08
    of looking at actually you know let me
  • 45:08 - 45:10
    i'm gonna use the gui i'm gonna cheat i
  • 45:10 - 45:11
    don't normally use the gui
  • 45:11 - 45:13
    uh for whatever reason but let me just
  • 45:13 - 45:15
    browse into the file system here here we
  • 45:15 - 45:16
    go
  • 45:16 - 45:18
    all right so taking a look at these
  • 45:18 - 45:20
    folders when you browse into your file
  • 45:20 - 45:22
    system there's a lot of crazy folders in
  • 45:22 - 45:23
    here some that are
  • 45:23 - 45:26
    super mega insane important right and
  • 45:26 - 45:27
    then there's some that you don't really
  • 45:27 - 45:30
    care about right and if you don't know
  • 45:30 - 45:31
    them if you're not familiar with them
  • 45:31 - 45:32
    then they don't make a whole lot of
  • 45:32 - 45:33
    sense so let's just kind of run through
  • 45:33 - 45:34
    some of the critical ones
  • 45:34 - 45:37
    if you read the fhs standard there's
  • 45:37 - 45:39
    there's actually
  • 45:39 - 45:40
    something like 50 folders that are
  • 45:40 - 45:42
    defined you don't need to know them all
  • 45:42 - 45:43
    for the exam you don't even need to know
  • 45:43 - 45:44
    them all for real life there's really
  • 45:44 - 45:46
    just a handful that we deal with on a
  • 45:46 - 45:48
    regular basis probably the most
  • 45:48 - 45:50
    important one is this guy right here
  • 45:50 - 45:53
    boot right the boot folder it's almost
  • 45:53 - 45:55
    always a separate partition and so this
  • 45:55 - 45:57
    is more of a mount point than a folder
  • 45:57 - 46:00
    and that's because it contains the linux
  • 46:00 - 46:00
    kernel
  • 46:00 - 46:02
    and other files that are basically fired
  • 46:02 - 46:04
    up first when your system boots up in
  • 46:04 - 46:06
    the very beginning this folder gets
  • 46:06 - 46:08
    called if you're doing disk encryption
  • 46:08 - 46:10
    you can't encrypt the boot folder
  • 46:10 - 46:10
    because otherwise you wouldn't be able
  • 46:10 - 46:12
    to read your boot files so this will be
  • 46:12 - 46:15
    a separate partition that's unencrypted
  • 46:15 - 46:16
    it could be combined on a single
  • 46:16 - 46:18
    partition but it you know causes
  • 46:18 - 46:20
    problems with things like lux
  • 46:20 - 46:22
    disk encryption so that's the boot
  • 46:22 - 46:24
    folder and if you ever browse into it
  • 46:24 - 46:25
    you'll see things in there basic
  • 46:25 - 46:27
    configuration files you'll see some
  • 46:27 - 46:28
    stuff about
  • 46:28 - 46:31
    vm limits that's the actual kernel file
  • 46:31 - 46:32
    right there that's the first thing that
  • 46:32 - 46:35
    gets run and i've got grub that's my
  • 46:35 - 46:36
    bootloader that helps it find the
  • 46:36 - 46:38
    partitions of the operating system
  • 46:38 - 46:41
    efi that's my for my uefi bios so that
  • 46:41 - 46:43
    it's able to locate and boot the
  • 46:43 - 46:45
    operating system so all really critical
  • 46:45 - 46:47
    stuff and that's found in slash boot now
  • 46:47 - 46:49
    you rarely mess with what's in slash
  • 46:49 - 46:52
    boot in fact on a lot of distros this
  • 46:52 - 46:54
    will be mounted read only because you
  • 46:54 - 46:56
    don't want somebody messing with the
  • 46:56 - 46:59
    kernel on the disk and so it's kind of
  • 46:59 - 47:01
    flagged that way uh it depends yours may
  • 47:01 - 47:02
    or may not be flag read only and you can
  • 47:02 - 47:04
    always mount it read write and that's
  • 47:04 - 47:05
    what happens when you do an update or
  • 47:05 - 47:07
    you need to change your bootloader uh
  • 47:07 - 47:08
    it'll have to get mounted that way
  • 47:08 - 47:10
    there's slash dev which is short for
  • 47:10 - 47:12
    device and this is where all of our
  • 47:12 - 47:14
    device definitions go
  • 47:14 - 47:17
    in linux every piece of hardware is
  • 47:17 - 47:19
    represented as a file and if you watched
  • 47:19 - 47:20
    our storage episodes we saw that with
  • 47:20 - 47:22
    hard drives all of our hard drives were
  • 47:22 - 47:27
    slash dev slash sda1 or slash dev slash
  • 47:27 - 47:30
    uh uh you know logical mapper slash
  • 47:30 - 47:31
    whatever uh
  • 47:31 - 47:33
    it doesn't just stop with hard drives
  • 47:33 - 47:35
    you'll see that with your console your
  • 47:35 - 47:39
    displays your video card printers all
  • 47:39 - 47:41
    sorts of things will show up in here as
  • 47:41 - 47:43
    a device file so that's kind of what i'm
  • 47:43 - 47:45
    looking at here on this screen is that
  • 47:45 - 47:47
    big list of files
  • 47:47 - 47:50
    for all these different devices and if
  • 47:50 - 47:52
    it's not in here then that means your
  • 47:52 - 47:54
    system doesn't know about that piece of
  • 47:54 - 47:55
    hardware you're probably missing a
  • 47:55 - 47:57
    driver or something else that's critical
  • 47:57 - 47:58
    to make that work so kind of an
  • 47:58 - 47:59
    important folder when it comes to
  • 47:59 - 48:01
    troubleshooting hardware
  • 48:01 - 48:02
    also an important folder if you're
  • 48:02 - 48:05
    trying to mount a partition
  • 48:05 - 48:07
    you'll find the name right inside of
  • 48:07 - 48:08
    here
  • 48:08 - 48:11
    all right let me go back up
  • 48:11 - 48:14
    let's see that was slash dev etc that
  • 48:14 - 48:16
    was super important right uh this is
  • 48:16 - 48:18
    where our systems configuration files
  • 48:18 - 48:20
    will go and we've gone into this folder
  • 48:20 - 48:21
    in a number of episodes already and
  • 48:21 - 48:23
    we'll continue to go into it for some
  • 48:23 - 48:25
    other ones uh but basically
  • 48:25 - 48:27
    when you fire up a service or an
  • 48:27 - 48:28
    application it needs to know a
  • 48:28 - 48:30
    configuration and that configuration is
  • 48:30 - 48:32
    expected to be stored here it's mostly
  • 48:32 - 48:34
    just packed full of text files so it's
  • 48:34 - 48:35
    not a very big folder but those text
  • 48:35 - 48:37
    files are really important because it's
  • 48:37 - 48:38
    telling your system how to configure
  • 48:38 - 48:40
    itself
  • 48:40 - 48:41
    slash home that's where your user home
  • 48:41 - 48:43
    folders go so all your personal files
  • 48:43 - 48:45
    and this will oftentimes be a separate
  • 48:45 - 48:47
    partition as well so that if we fill it
  • 48:47 - 48:49
    up it doesn't mess with the regular os
  • 48:49 - 48:51
    it still has room uh but it doesn't have
  • 48:51 - 48:52
    to be in fact i think on my system it is
  • 48:52 - 48:54
    actually part of my main partition uh
  • 48:54 - 48:56
    but anyhow that that's where your your
  • 48:56 - 48:59
    user stuff will go uh slash lib those
  • 48:59 - 49:02
    are for libraries or linkable libraries
  • 49:02 - 49:04
    when applications run they rely on
  • 49:04 - 49:05
    libraries to provide basic functions and
  • 49:05 - 49:06
    they're usually shared between
  • 49:06 - 49:08
    applications and so you'll find those in
  • 49:08 - 49:10
    that i'm on a 64-bit system so i also
  • 49:10 - 49:13
    have lib64 when linux was created it was
  • 49:13 - 49:16
    all created around a 32-bit ecosystem
  • 49:16 - 49:18
    and so when you see a folder like lib
  • 49:18 - 49:20
    it's expecting 32-bit libraries to be in
  • 49:20 - 49:22
    there
  • 49:22 - 49:25
    uh see some other ones mnt mnt is an
  • 49:25 - 49:26
    optional one you might not have it it's
  • 49:26 - 49:28
    short for mount in the in the olden days
  • 49:28 - 49:30
    when we would mount a hard drive or a cd
  • 49:30 - 49:32
    drive or whatever we would mount it to a
  • 49:32 - 49:35
    folder under mnt a lot of distros don't
  • 49:35 - 49:37
    do that anymore the ones that do auto
  • 49:37 - 49:38
    mount will usually mount it under the
  • 49:38 - 49:41
    run folder and i see i've got run also
  • 49:41 - 49:43
    run is not in the fhs not in the
  • 49:43 - 49:44
    official standard it's just something
  • 49:44 - 49:47
    they made up uh but it's there and it
  • 49:47 - 49:49
    just shows you can choose to deviate if
  • 49:49 - 49:52
    you want to uh let's see slash proc
  • 49:52 - 49:54
    whoops i'm gonna break my system uh
  • 49:54 - 49:55
    slash proc is a really neat one because
  • 49:55 - 49:58
    this looks like a folder actually isn't
  • 49:58 - 50:00
    right this is a virtual file system
  • 50:00 - 50:04
    every program that you run is a process
  • 50:04 - 50:07
    and the process is represented as a file
  • 50:07 - 50:09
    inside of slash proc so it looks like
  • 50:09 - 50:10
    you're navigating around in fact if i
  • 50:10 - 50:12
    let me go back here
  • 50:12 - 50:14
    if i go into
  • 50:14 - 50:18
    slash proc and pull up a listing i see
  • 50:18 - 50:20
    all these numbers right what are those
  • 50:20 - 50:23
    numbers well if i were to pull up a list
  • 50:23 - 50:25
    of applications that are running on my
  • 50:25 - 50:28
    system i see all of these process id
  • 50:28 - 50:31
    numbers right here that's the process id
  • 50:31 - 50:33
    of that binary running in ram well in
  • 50:33 - 50:35
    the file system that all gets
  • 50:35 - 50:37
    represented right here as files and you
  • 50:37 - 50:40
    can even browse inside of them so if i
  • 50:40 - 50:42
    pick one at random like
  • 50:42 - 50:44
    10971
  • 50:44 - 50:46
    and pull up in there i can start to find
  • 50:46 - 50:47
    out information about that application
  • 50:47 - 50:49
    that's running these are not real files
  • 50:49 - 50:50
    this is all virtual it's being
  • 50:50 - 50:52
    dynamically generated as i navigate
  • 50:52 - 50:54
    through and it's part of that whole idea
  • 50:54 - 50:57
    of representing everything as a file not
  • 50:57 - 50:58
    everything in linux is represented as a
  • 50:58 - 50:59
    file there's an operating system called
  • 50:59 - 51:02
    plan nine where they went hardcore and
  • 51:02 - 51:04
    everything literally everything is
  • 51:04 - 51:07
    represented as a file in linux
  • 51:07 - 51:09
    most everything is represented as a file
  • 51:09 - 51:10
    and so that's kind of what we see in
  • 51:10 - 51:12
    slash proc
  • 51:12 - 51:15
    similar to that slash sys if you go into
  • 51:15 - 51:16
    slash sys
  • 51:16 - 51:18
    this one is
  • 51:18 - 51:19
    not showing me information about
  • 51:19 - 51:21
    processes but showing me information
  • 51:21 - 51:23
    about the system the you know the linux
  • 51:23 - 51:25
    kernel and what it's running and so
  • 51:25 - 51:27
    you'll see things like device detection
  • 51:27 - 51:28
    if you're running a hypervisor kernel
  • 51:28 - 51:31
    data that's all tucked away in here
  • 51:31 - 51:33
    and so when you run something like you
  • 51:33 - 51:36
    name dash a to find out what kernel
  • 51:36 - 51:38
    you're running in the version that's
  • 51:38 - 51:40
    actually coming from inside of slash sys
  • 51:40 - 51:42
    it's looking in there to find it uh and
  • 51:42 - 51:45
    represent that uh put it on your screen
  • 51:45 - 51:47
    uh i already talked about slash usr a
  • 51:47 - 51:50
    little bit for slash usr bin and usr
  • 51:50 - 51:51
    spin
  • 51:51 - 51:55
    this one is supposed to contain our
  • 51:55 - 51:56
    uh
  • 51:56 - 51:58
    really binaries and any other kind of
  • 51:58 - 52:00
    data that's designed to be shared
  • 52:00 - 52:02
    between users and i don't mean shared
  • 52:02 - 52:03
    across the network i mean shared between
  • 52:03 - 52:05
    users right here on the system if
  • 52:05 - 52:07
    there's a library file and i have a user
  • 52:07 - 52:09
    account zac has user account there's no
  • 52:09 - 52:10
    point in storing two copies of that
  • 52:10 - 52:12
    library we can put it in usr and now we
  • 52:12 - 52:14
    both have access to it so that was the
  • 52:14 - 52:17
    original intent of slash usr
  • 52:17 - 52:19
    on servers that makes a lot of sense on
  • 52:19 - 52:21
    desktops it doesn't and so it really
  • 52:21 - 52:23
    just kind of became the de facto dumping
  • 52:23 - 52:25
    grounds for everything everything is
  • 52:25 - 52:26
    considered to be shared amongst users
  • 52:26 - 52:28
    these days and that's why you're seeing
  • 52:28 - 52:30
    more and more distros linking to the
  • 52:30 - 52:33
    slash usr folder but if you look there's
  • 52:33 - 52:34
    more than binaries in there there's
  • 52:34 - 52:37
    libraries so i see lib and lib64 you
  • 52:37 - 52:39
    might have an etc folder here for shared
  • 52:39 - 52:42
    configurations source folder
  • 52:42 - 52:44
    games if you've installed games i didn't
  • 52:44 - 52:46
    think i had but apparently oh it's empty
  • 52:46 - 52:48
    all right so so i don't have anything on
  • 52:48 - 52:50
    there but these are things that every
  • 52:50 - 52:51
    user would then have access to inside of
  • 52:51 - 52:54
    slash usr uh neat little fact here this
  • 52:54 - 52:57
    is supposed to be mounted read only
  • 52:57 - 53:00
    based on the fhs that way users can't
  • 53:00 - 53:02
    tamper with binaries that other users
  • 53:02 - 53:03
    might be accessing
  • 53:03 - 53:04
    very few distros actually mount this
  • 53:04 - 53:06
    read only today though so this is
  • 53:06 - 53:07
    another area where a lot of people
  • 53:07 - 53:09
    deviate from the standard
  • 53:09 - 53:12
    and another important folder for us
  • 53:12 - 53:16
    let's see that was usr
  • 53:16 - 53:19
    is var that one which is just short for
  • 53:19 - 53:22
    various uh and this is a various folder
  • 53:22 - 53:24
    uh but it's not too much variety there's
  • 53:24 - 53:25
    actually a couple of things we expect to
  • 53:25 - 53:28
    be in there first off our log files log
  • 53:28 - 53:29
    files for our applications for the
  • 53:29 - 53:32
    system for journal d for all these other
  • 53:32 - 53:33
    different things those log files get
  • 53:33 - 53:37
    dumped into slash var log but also our
  • 53:37 - 53:39
    print spooler right when we print a job
  • 53:39 - 53:40
    it gets written to the hard disk first
  • 53:40 - 53:42
    before being sent to this printer and so
  • 53:42 - 53:45
    that's inside of slash var spool and if
  • 53:45 - 53:47
    you poke around in there you'll find a
  • 53:47 - 53:49
    lot of things like there's spool like i
  • 53:49 - 53:50
    mentioned
  • 53:50 - 53:53
    and log is right above it
  • 53:53 - 53:54
    but you'll see other things if you're
  • 53:54 - 53:56
    running an email server your mail cues
  • 53:56 - 53:58
    will be in there the point about var is
  • 53:58 - 54:00
    that it's supposed to be considered
  • 54:00 - 54:01
    temporary the stuff that's in there
  • 54:01 - 54:03
    isn't supposed to be mission critical if
  • 54:03 - 54:05
    i lose my logs the system's actually
  • 54:05 - 54:08
    fine i'll be okay if i lose my principle
  • 54:08 - 54:10
    it's fine i'll be okay if i lose email
  • 54:10 - 54:12
    in transit that kind of thing it's not
  • 54:12 - 54:15
    really critical it's just temporary and
  • 54:15 - 54:16
    in in the older days you'd put your
  • 54:16 - 54:18
    cheaper storage in slash var because you
  • 54:18 - 54:20
    didn't care about it as much today
  • 54:20 - 54:22
    storage is so cheap and so reliable that
  • 54:22 - 54:24
    slash var is usually pretty stable and
  • 54:24 - 54:25
    so people will put things like security
  • 54:25 - 54:26
    logs in there that they intend on
  • 54:26 - 54:28
    keeping long term even though that's not
  • 54:28 - 54:31
    the original intent of the folder don do
  • 54:31 - 54:32
    we really need to have all these folders
  • 54:32 - 54:34
    memorized once you just went over
  • 54:34 - 54:38
    yeah so um for the exam yes yeah you do
  • 54:38 - 54:40
    at least the ones that i named off right
  • 54:40 - 54:41
    don't don't go and memorize the whole
  • 54:41 - 54:44
    fhs that's crazy uh the ones that i just
  • 54:44 - 54:45
    highlighted those are kind of the
  • 54:45 - 54:46
    critical ones you want to know those for
  • 54:46 - 54:49
    the exam uh in real life land you can
  • 54:49 - 54:51
    actually cheat a good bit if you don't
  • 54:51 - 54:52
    remember these folders it'd be fine
  • 54:52 - 54:55
    because it's so easy to find files in
  • 54:55 - 54:56
    fact we have a whole another episode
  • 54:56 - 54:58
    coming up on how to locate stuff in
  • 54:58 - 55:00
    linux but just to kind of do a preview
  • 55:00 - 55:02
    of that um
  • 55:02 - 55:04
    let me
  • 55:04 - 55:07
    get to a console here so let's say
  • 55:07 - 55:10
    let's say i want to find a file um
  • 55:10 - 55:12
    yeah i'm i'm going to be using the
  • 55:12 - 55:14
    uh would be a good one like the ssh
  • 55:14 - 55:16
    command right i'm going to ssh into a
  • 55:16 - 55:18
    server and i want to make sure that ssh
  • 55:18 - 55:19
    is a certain version and so i need to
  • 55:19 - 55:22
    take a look at the ssh file itself and
  • 55:22 - 55:25
    and you know test it well where is it
  • 55:25 - 55:26
    stored i might have to think to myself
  • 55:26 - 55:28
    all right well is that an essential
  • 55:28 - 55:31
    binary or is it non-essential is it in
  • 55:31 - 55:34
    slash bin slash s bin slash usr bin
  • 55:34 - 55:36
    it could be any number of places or is
  • 55:36 - 55:38
    it in slash opt has it been overwritten
  • 55:38 - 55:40
    where is it at and so you can use
  • 55:40 - 55:42
    commands like which
  • 55:42 - 55:44
    and the which command if you say which
  • 55:44 - 55:45
    followed by a
  • 55:45 - 55:46
    a
  • 55:46 - 55:49
    a binary it's going to figure out which
  • 55:49 - 55:51
    actual binary would be run if i typed
  • 55:51 - 55:53
    that command and so it tells me this one
  • 55:53 - 55:54
    is slash usr
  • 55:54 - 55:55
    bin
  • 55:55 - 55:58
    ssh now there could be more than one
  • 55:58 - 56:00
    copy of ssh though and so we can use a
  • 56:00 - 56:02
    different command which is where
  • 56:02 - 56:04
    is
  • 56:04 - 56:06
    ssh and then it's going to find if
  • 56:06 - 56:08
    there's multiple copies it'll show me
  • 56:08 - 56:10
    the multiple copies and even things like
  • 56:10 - 56:11
    the help documentation and the
  • 56:11 - 56:14
    configuration so it's telling me right
  • 56:14 - 56:17
    here the binary is slash usr slash bin
  • 56:17 - 56:21
    ssh the configuration is slash etc ssh
  • 56:21 - 56:23
    and the help documentation is slash user
  • 56:23 - 56:26
    slash share slash man slash man one
  • 56:26 - 56:29
    slash ssh dot one dot gz
  • 56:29 - 56:31
    rolls right off the tongue so it does it
  • 56:31 - 56:32
    just rolled right off we don't have to
  • 56:32 - 56:34
    remember it if we can remember the where
  • 56:34 - 56:36
    is command right you can run that into
  • 56:36 - 56:38
    it there's also locate and find locate
  • 56:38 - 56:40
    and find i'll cover in another episode
  • 56:40 - 56:41
    but they're useful for finding not just
  • 56:41 - 56:44
    binaries but any file if i if i'm just
  • 56:44 - 56:45
    trying to find a file i forget where i
  • 56:45 - 56:48
    saved it i can use locate i can use find
  • 56:48 - 56:49
    they'll
  • 56:49 - 56:51
    find it obviously let's send the name or
  • 56:51 - 56:54
    locate it and then we can get that so
  • 56:54 - 56:55
    if you don't have it memorized you'll
  • 56:55 - 56:57
    get by just fine in most scenarios but
  • 56:57 - 56:59
    it takes time if you have it memorized
  • 56:59 - 57:00
    and you know exactly where to go you
  • 57:00 - 57:01
    save a lot of time and you're more
  • 57:01 - 57:03
    efficient so that's the way i always
  • 57:03 - 57:05
    look at it when it comes to memorization
  • 57:05 - 57:07
    awesome don file system hierarchy
  • 57:07 - 57:09
    standard and this is another great
  • 57:09 - 57:11
    episode fhs if you please and done
  • 57:11 - 57:12
    before we move on anything else you'd
  • 57:12 - 57:13
    like to say
  • 57:13 - 57:16
    uh you know this is all fairly static it
  • 57:16 - 57:18
    doesn't change very much and i know this
  • 57:18 - 57:20
    is our linux plus show but if you learn
  • 57:20 - 57:22
    the file system hierarchy standard when
  • 57:22 - 57:25
    you jump over to like macs that run mac
  • 57:25 - 57:27
    os they actually conform to a lot of
  • 57:27 - 57:29
    this and if you jump over to bsd a lot
  • 57:29 - 57:32
    of them conform to this too so you learn
  • 57:32 - 57:34
    it once but it applies to more than one
  • 57:34 - 57:35
    operating system that's a pretty cool
  • 57:35 - 57:36
    thing so definitely spend some time and
  • 57:36 - 57:38
    get familiar with it great advice thank
  • 57:38 - 57:40
    you don and a great episode as usual
  • 57:40 - 57:42
    comptia linux plus is a wonderful series
  • 57:42 - 57:44
    and it's designed to help you so make
  • 57:44 - 57:45
    sure you watch every single episode
  • 57:45 - 57:47
    you'll be glad you did and don't forget
  • 57:47 - 57:48
    about our course library where there's
  • 57:48 - 57:50
    supplementary information that's there
  • 57:50 - 57:52
    to do one thing help you go even further
  • 57:52 - 57:53
    so check that out as well and tell
  • 57:53 - 57:55
    everybody you know about it pro tv it
  • 57:55 - 57:57
    pro tv is binsworthy thanks for watching
  • 57:57 - 57:59
    i'm zach memphis and i'm don pizza we
  • 57:59 - 58:02
    will see you again soon
  • 58:02 - 58:07
    [Music]
  • 58:07 - 58:12
    thank you for watching it pro tv
Title:
CompTIA Linux+: Logical Volumes & Filesystem Hierarchy #5
Video Language:
English
Duration:
58:11

English subtitles

Revisions Compare revisions