Are you sure you want to cancel your subscription?

If you cancel, your subscription will remain active through the paid term. You will be able to reactivate the subscription until that date.

Sorry to see you go

Your subscription will remain active until . If you change your mind, you may rectivate your subscription anytime before that date.

Are you sure you want to reactivate?
Welcome Back!

Your subscription has been reactivated and you will continue to be charged on .

Reactivate Subscription

Thank you for choosing to reactivate your subscription. In order to lock in your previous subscription rate, you owe: .

Your Subscription term is from - .

Questions? Call Sales.

Payment Due:

Auto-Renew Subscription

To auto-renew your subscription you need to select or enter your payment method in "Your Account" under Manage Payments.

Click continue to set up your payments.

CBT Nuggets License Agreement

Unless otherwise stated all references to “training videos” or to “videos” includes both individual videos within a series, entire series, series packages, and streaming subscription access to CBT Nuggets content. All references to CBT or CBT Nuggets shall mean CBT Nuggets LLC, a Delaware limited liability company located at 44 Country Club Road, Ste. 150, Eugene, Oregon.

A CBT Nuggets license is defined as a single user license. Accounts may purchase multiple users, and each user is assigned a single license.

  • GRANT OF LICENSE. CBT Nuggets grants you a non-transferable, non-exclusive license to use the training videos contained in this package or streaming subscription access to CBT content (the “Products”), solely for internal use by your business or for your own personal use. You may not copy, reproduce, reverse engineer, translate, port, modify or make derivative works of the Products without the express consent of CBT. You may not rent, disclose, publish, sell, assign, lease, sublicense, market, or transfer the Products or use them in any manner not expressly authorized by this Agreement without the express consent of CBT. You shall not derive or attempt to derive the source code, source files or structure of all or any portion of the Products by reverse engineering, disassembly, decompilation or any other means. You do not receive any, and CBT Nuggets retains all, ownership rights in the Products. The Products are copyrighted and may not be copied, distributed or reproduced in any form, in whole or in part even if modified or merged with other Products. You shall not alter or remove any copyright notice or proprietary legend contained in or on the Products.
  • TERMINATION OF LICENSE. Once any applicable subscription period has concluded, the license granted by this Agreement shall immediately terminate and you shall have no further right to access, review or use in any manner any CBT Nuggets content. CBT reserves the right to terminate your subscription if, at its sole discretion, CBT believes you are in violation of this Agreement. CBT reserves the right to terminate your subscription if, at its sole discretion, CBT believes you have exceeded reasonable usage. In these events no refund will be made of any amounts previously paid to CBT.
  • DISCLAIMER OF WARRANTY AND LIABILITY. The products are provided to you on an “as is” and “with all faults” basis. You assume the entire risk of loss in using the products. The products are complex and may contain some nonconformities, defects or errors. CBT Nuggets does not warrant that the products will meet your needs, “expectations or intended use,” that operations of the products will be error-free or uninterrupted, or that all nonconformities can or will be corrected. CBT Nuggets makes and user receives no warranty, whether express or implied, and all warranties of merchantability, title, and fitness for any particular purpose are expressly excluded. In no event shall CBT Nuggets be liable to you or any third party for any damages, claim or loss incurred (including, without limitation, compensatory, incidental, indirect, special, consequential or exemplary damages, lost profits, lost sales or business, expenditures, investments, or commitments in connection with any business, loss of any goodwill, or damages resulting from lost data or inability to use data) irrespective of whether CBT Nuggets has been informed of, knew of, or should have known of the likelihood of such damages. This limitation applies to all causes of action in the aggregate including without limitation breach of contract, breach of warranty, negligence, strict liability, misrepresentation, and other torts. In no event shall CBT Nuggets’ liability to you or any third party exceed $100.00.
  • REMEDIES. In the event of any breach of the terms of the Agreement CBT reserves the right to seek and recover damages for such breach, including but not limited to damages for copyright infringement and for unauthorized use of CBT content. CBT also reserves the right to seek and obtain injunctive relief in addition to all other remedies at law or in equity.
  • MISCELLANEOUS. This is the exclusive Agreement between CBT Nuggets and you regarding its subject matter. You may not assign any part of this Agreement without CBT Nuggets’ prior written consent. This Agreement shall be governed by the laws of the State of Oregon and venue of any legal proceeding shall be in Lane County, Oregon. In any proceeding to enforce or interpret this Agreement, the prevailing party shall be entitled to recover from the losing party reasonable attorney fees, costs and expenses incurred by the prevailing party before and at any trial, arbitration, bankruptcy or other proceeding and in any appeal or review. You shall pay any sales tax, use tax, excise, duty or any other form of tax relating to the Products or transactions. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. Any notice to CBT under this Agreement shall be delivered by U.S. certified mail, return receipt requested, or by overnight courier to CBT Nuggets at the following address: 44 Club Rd Suite 150, Eugene, OR 97401 or such other address as CBT may designate.

CBT Nuggets reserves the right, in its sole discretion, to change, modify, add, or remove all or part of the License Agreement at any time, with or without notice.

Billing Agreement

  • By entering into a Billing Agreement with CBT Nuggets, you authorize CBT Nuggets to use automatic billing and to charge your credit card on a recurring basis.
  • You agree to pay subscription charges on a monthly basis, under the following terms and conditions:
    • CBT Nuggets will periodically charge your credit card each monthly billing cycle as your subscription charges become due;
    • All payments are non-refundable and charges made to the credit card under this agreement will constitute in effect a "sales receipt" and confirmation that services were rendered and received;
    • To terminate the recurring billing process and/or arrange for an alternative method of payment, you must notify CBT Nuggets at least 24 hours prior to the end of the monthly billing cycle;
    • You will not dispute CBT Nugget’s recurring billing charges with your credit card issuer so long as the amount in question was for periods prior to the receipt and acknowledgement of a written request to cancel your account or cancel individual licenses on your account.
  • You guarantee and warrant that you are the legal cardholder for the credit card associated with the account, and that you are legally authorized to enter into this recurring billing agreement.
  • You agree to indemnify, defend and hold CBT Nuggets harmless, against any liability pursuant to this authorization.
  • You agree that CBT Nuggets is not obligated to verify or confirm the amount for the purpose of processing these types of payments. You acknowledge and agree that Recurring Payments may be variable and scheduled to occur at certain times.
  • If your payment requires a currency conversion by us, the amount of the currency conversion fee will be determined at the time of your payment. You acknowledge that the exchange rate determined at the time of each payment transaction will differ and you agree to the future execution of payments being based on fluctuating exchange rates.

CBT Nuggets reserves the right, in its sole discretion, to change, modify, add, or remove all or part of the Billing Agreement at any time, with or without notice.

This video is only available to subscribers.
Start your 7-day free trial today.

A free trial includes:

  • Unlimited 24/7 access to our entire IT training video library.
  • Ability to train on the go with our mobile website and iOS/Android apps.
  • Note-taking, bookmarking, speed control, and closed captioning features.

LPIC1 & CompTIA Linux+ Intro

Hardware Settings

00:00:00 - And welcome to the very first section of our LPIC-1 training.
00:00:05 - Now the first chapter or the first section is 101.1,
00:00:08 - and its talking about hardware settings. Now this section
00:00:12 - has a weight of two, which means on the test, you can probably
00:00:15 - expect to have, honestly, just about two questions that have
00:00:19 - to do with the subject matter we're gonna talk about, however, we don't
00:00:22 - know exactly what topics it's gonna be on, and as you can see
00:00:25 - here, there's all kinds of stuff to learn. So, we'll just teach
00:00:29 - everything, and then you'll at, get asked two questions, it'll be easy
00:00:32 - and you'll just be terribly proud of yourself. So anyway, basically we
00:00:36 - have two sections so we're going to talk about how we determine
00:00:39 - settings on hardware, and then how we configure settings for
00:00:42 - hardware. We're going to talk about HAL, which is not the, the
00:00:46 - robot from Space Odyssey, although that's cool. We're gonna talk about
00:00:50 - dbus and udev, the sys directory, the proc directory, the dev directory,
00:00:55 - lsmod, lsusb, lspci, have you fallen
00:00:58 - asleep on me yet, because we're not quite done. Then we're gonna
00:01:01 - learn how to configure those things, and that's gonna
00:01:04 - be the section after we learn how to discover stuff. So let's
00:01:08 - dig right in and learn about, first of all, what some of these things
00:01:10 - mean, and then what we can learn by, by looking at them.
00:01:15 - Okay, now before I actually show you some of these things in action,
00:01:18 - we have to define some terms. Now we're talking about HAL here,
00:01:22 - which again, is not the robot from 2001 Space Odyssey,
00:01:25 - that would be HAL 9000, but no, HAL in Linux is,
00:01:30 - the Hardware Abstraction Layer. Now what that means basically
00:01:36 - is, let's say you have a server with like three different network
00:01:40 - cards in it, okay. One network card is an Intel card, another
00:01:44 - card is a 3COM card, and, let's say, the third card is, you
00:01:48 - know, just something you found on the shelf, and you're not even sure
00:01:50 - what brand it is, but Linux is probably going to support it, because Linux
00:01:53 - usually does, but you plug them all in. Now in some other operating
00:01:57 - systems, like FreeBSD, depending on the brand, they're
00:02:00 - going to have different device names, like how you refer to
00:02:03 - them in your configurations. What the hardware abstraction layer
00:02:06 - in Linux does, is it says, okay, you plugged in an Ethernet
00:02:09 - card, I know it's an Ethernet card, so we're going to say that,
00:02:12 - since it's the first one I've seen, the name of it is e-t-h 0,
00:02:17 - or eth0. Now it doesn't matter if it's an Intel card,
00:02:20 - doesn't matter if it's a, you know, a 3COM card, it's your network
00:02:23 - card, its eth0. So it's a really nice way that you, it really
00:02:27 - does add it, abstracts out the idea of what brand devices
00:02:32 - you're putting in, which is a great way to make replacing
00:02:35 - hardware easier, for example, if your network card dies, plug in a
00:02:39 - new one, bam, it's gonna be eth0. Really, really, really nice.
00:02:43 - Next we have dbus. Now I actually like to think of dbus as an actual
00:02:48 - bus, here, I'll draw a bus, because it's getting kinda dry, okay. So it's an actual
00:02:53 - bus, wheels, windows, looks a little bit like a plane, maybe,
00:02:58 - without wings, anyway, dbus is the way that the kernel, or HAL,
00:03:02 - the Hardware Abstraction Layer, communicates with things like
00:03:05 - the desktop manager, or other hardware. For example, if you plug
00:03:09 - in a USB drive, dbus can tell the oper, tell the GNOME
00:03:14 - desktop, or whatever desktop you're using, hey, I found something
00:03:17 - here, I'm not going to tell you what brand, but it happens to be a USB drive,
00:03:21 - you want to do something with it, and then the, you know, the GNOME operating
00:03:25 - system, or the, your KDE Desktop, can do what ever it wants with
00:03:28 - that information, but dbus is the way that, that information
00:03:32 - is traversed between applications and the hardware abstraction
00:03:35 - layer. So anyway, that's what dbus is, it's a communication
00:03:39 - methodology, or communication pathway, for the different
00:03:43 - things to talk, and again, I think of it as a bus,
00:03:46 - but if I had to give it a definition, I guess communication with
00:03:49 - hardware and software, so, do with that what you will, or
00:03:53 - just remember the bus, because it's easy to remember.
00:03:57 - Now udev is the last thing on our list. Now what makes udev
00:04:00 - neat is, in traditional UNIX or, or Linux file systems, or
00:04:04 - device file systems, like dev, which we're going to talk about
00:04:07 - in a little bit, you would have a whole list of devices. I
00:04:12 - mean, there'd be just a huge list, dev/sda, dev/sdb, dev,
00:04:21 - wow, my handwriting's horrible, s-d-c, all the way down
00:04:25 - the list, and you would plug in something, and when you plugged it
00:04:28 - in, the first one would be on the node sda, the second one
00:04:33 - would be sdb, and you just kinda had to guess, and hope, and try
00:04:37 - to do some weird testing to figure out where things were when
00:04:40 - they plugged in. Well, that's where udev comes in. Right now, when
00:04:43 - your system starts, it doesn't have those devices. It actually
00:04:46 - creates them on the fly, so instead of just this long list of
00:04:50 - devices that you just hope to guess, and this was really a problem
00:04:53 - with things like Palm Pilots, because you just never knew exactly
00:04:57 - what, what device they were, but what udev does is it says,
00:05:00 - okay, it's communicated to buy the hardware abstraction layer,
00:05:04 - and it says, okay, I've plugged in a block device. It's says, great,
00:05:08 - it's a block device, let me look at it a little bit, see what it is, okay,
00:05:11 - turns out it's, it's a USB drive, so we're going to assign it to
00:05:16 - dev/sda, because that's not used yet, so this is going
00:05:19 - to be the drive, but then you can write udev rules, and
00:05:23 - take it even further, so it's going to look at what sda is,
00:05:27 - and, and look at the serial number, or, you know, other specifics
00:05:31 - that it can get from the device, and say, okay, I, I sniffed it or,
00:05:34 - you know, I wrote this rule and, and I discovered that, not
00:05:38 - only is it a USB drive, but it's like my new 16 gig
00:05:41 - Toshiba flash drive, and I always want that mounted under dev
00:05:48 - awesome,
00:05:52 - because I'm really proud of my flash drive apparently. So dev/sda
00:05:57 - is now symlinked to dev/awesome, and udev had that happen. So
00:06:02 - basically, what it said is, okay, I mounted it as dev/sda because it
00:06:06 - was plugged in, but then looking at the rules, the udev rules
00:06:09 - that were written, I saw that it's this particular device,
00:06:13 - and I want to call that dev/awesome. Now you don't normally
00:06:15 - get things like dev/awesome. Really, what normally happens is
00:06:18 - you say, oh, it's a Canon camera, so let's also, instead of awesome,
00:06:23 - let's say, okay, I plugged in my, my Canon camera, right, so
00:06:26 - what are we going to do, well, we're gonna link that to dev/camera,
00:06:30 - and then, using the dbus system,
00:06:35 - GNOME says, hey, I know dev/camera, I, when, when dev/camera
00:06:40 - pops up and appears, or it, you know, is transmitted on the dbus
00:06:43 - system that dev/camera came online, I'm supposed to
00:06:46 - open up gPhoto, and suck all the camera pictures out of it,
00:06:50 - right, but it can't listen if it's just dev/sda, because that could
00:06:53 - be any USB device that was plugged in. It's only when the
00:06:57 - udev rules that then creates dev/camera, that dbus says,
00:07:01 - oh yeah, I know dev/camera, that's what I want, so again, udev
00:07:04 - let's you do more fine tuning of the devices as they're
00:07:08 - plugged in, and it's a huge improvement over just this long list
00:07:11 - of pre-existing nodes that populated in order that they were
00:07:15 - plugged in. It used to be a real mess, but with udev, things are
00:07:18 - a lot simpler, and next we're going to look at what those different
00:07:22 - file systems look like when they're populated, like the dev directory,
00:07:25 - and the sys directory, and the proc directory, and see what all those
00:07:29 - things mean, but you have the jist here. You have the hardware
00:07:32 - abstraction layer, you know that that means it's going to say,
00:07:34 - you know, USB drive is sda or an Ethernet card is eth0. Dbus
00:07:39 - is the way they communicate that, with like the desktop manager,
00:07:43 - GNOME or KDE, and then udev does some really cool, not
00:07:47 - quite magic, but some pretty nifty stuff, where it will determine
00:07:50 - exactly what kind of hardware you have, based on udev
00:07:53 - rules, and create links like called camera, when you plug in a camera.
00:07:57 - So anyway, that's it, we're going to move on to what's actually in those
00:08:00 - files, we get to look at a real computer. Woo, woo!
00:08:05 - Okay, so next we're going to look at the sys directory, which
00:08:08 - is the sys file system, or sysfs. Now this, I know I
00:08:11 - said we're going to look at a computer, and we are, bear with
00:08:13 - me, but this is where HAL
00:08:18 - keeps its database of devices that are connected to the computer.
00:08:22 - Now I know this seems a little bit like what udev does
00:08:25 - with the dev directory, but you'll see it is a little bit
00:08:27 - different. So again, the system, or sys directory, the sysfs,
00:08:32 - is where HAL, the Hardware Abstraction Layer, keeps all the information
00:08:36 - on the stuff that's, that's connected to the system. So that's
00:08:40 - where it keeps its database of everything connected, and let's
00:08:42 - look at that right now.
00:08:45 - So here we are, this is my Ubuntu system. We're going to start a
00:08:48 - terminal, and we're gonna go to the sys directory. Again,
00:08:51 - this is the sys file system. Now if you look, this is pretty
00:08:55 - simple looking. It's divided into a bunch of different categories,
00:08:59 - block devices, for example, we'll look at block devices. These are different
00:09:04 - devices that are connected to the system, one, let's look at
00:09:07 - the bus directory. Now in here you're going to see a bunch
00:09:12 - of different things. You're gonna see usb, usb-serial, pci,
00:09:15 - pci-express, and this is where you're gonna start to understand
00:09:19 - the difference between the sys directory, and the udev,
00:09:23 - dev directory, that we're gonna talk about a minute, because,
00:09:25 - remember I said that HAL abstracts things out? Again, the computer,
00:09:31 - the, the programs running on the computer, don't really care whether
00:09:33 - it's a PCI card, or a USB this or that. They just want to know
00:09:38 - what kind of device it is. So while here, we look at USB, and there's
00:09:42 - devices and drivers,
00:09:45 - ls usb/devices, here's the different things that are connected,
00:09:48 - usb1, usb2. Let's look in the pci folder. These are the
00:09:54 - same kind of things, and the different PCI devices that
00:09:57 - are plugged in. Now see, this is where it just keeps its database of things
00:10:00 - that are connected, but this isn't very user friendly. This isn't
00:10:03 - something that's easy for us to see, and that's why HAL uses
00:10:08 - udev to turn those things into devices as they're inserted
00:10:11 - and removed. So, the sys directory is HAL, or the, the Hardware
00:10:17 - Abstraction Layer, boy, that's a tongue twister, the Hardware Abstraction
00:10:20 - Layer database is kept inside the sys directory. The next
00:10:24 - thing we're going to look at is the proc
00:10:27 - directory, so let's look at that right now.
00:10:34 - So the proc file system is where the kernel keeps all of
00:10:36 - its running commands. It's important to know that it's not
00:10:40 - a real file system, in that it's not written to a hard disk.
00:10:43 - The proc file system,
00:10:46 - it's created in RAM when the computer boots. So again, it's
00:10:50 - created every time the computer boots. Now another thing about
00:10:53 - it, the, the proc file system is where, oh, all sorts of
00:10:59 - different configurations are stored. Now, I'm gonna put an asterisk
00:11:02 - here. You can read and write information about the running
00:11:06 - kernel in the proc file system, but there are, there, there's
00:11:09 - some caveats there. So, just so you know, the proc file system,
00:11:14 - you can read things from it,
00:11:16 - but it's only going to be temporary. Again, since it's created every
00:11:19 - time the computer boots, if you make changes to the proc system,
00:11:22 - when you reboot, those changes are going to be gone, and one
00:11:25 - last thing to know, in the, in all the nuggets that we do, we're pretty
00:11:29 - much going to assume that you're root, because that's what the
00:11:32 - LPIC exams assume is that you're a root user, but specifically
00:11:36 - with, dealing with the proc file system, you
00:11:39 - must be
00:11:43 - root. You must be the root user if you're going to manipulate the
00:11:46 - proc file system, especially if you're going to try to write
00:11:49 - to it. So let's look at the proc file system, and see some
00:11:51 - of the things that are in there for us to discover.
00:11:56 - So here I am, back in my terminal window, and you notice I'm root,
00:11:58 - I'm the root user. Let's look into, let's click in here, let's look in
00:12:04 - the proc directory, and this is just a virtual file system.
00:12:07 - Now, the first thing you're gonna notice is all these numbers. Now, what's
00:12:11 - important about these numbers is what the proc file system,
00:12:13 - again, it's all of the things currently running in memory, right?
00:12:16 - Well, all of these are process id's. For example, one of these
00:12:20 - numbers is correlated to this GNOME terminal that I have
00:12:23 - open. The number one is the init process, the very first
00:12:27 - thing that boots on the Linux computer when it starts up,
00:12:29 - but that's just the process ids, there's all these other things,
00:12:32 - let's look at, let's look at a couple of them. We'll do the
00:12:35 - cat command so that we can see what it is. Cpuinfo. This is
00:12:39 - in the proc directory, it's called cpuinfo, and it basically
00:12:42 - tells us all the things about the cpu and the computer. You'll
00:12:46 - see that it's an Intel i7 CPU, 2.67 GHz.
00:12:51 - It has the cache size, the megahertz, it has all
00:12:55 - this information about the CPU, again, it created this as
00:12:59 - it booted up, that's how I got the information. There are some other
00:13:02 - things like mounts.
00:13:06 - This shows all of the currently mounted file systems on this
00:13:09 - computer, again, it even shows proc, proc is one of those file
00:13:14 - systems that's mounted, it's, it's at /proc; that's where
00:13:17 - we are right now. So it shows all the mounted file systems
00:13:20 - on the system right now. Now you'll notice, maybe you didn't notice,
00:13:23 - but rw, that stands for read and write, because some of these
00:13:28 - things you can change settings as well. Now let's go, for example,
00:13:32 - into the sys folder, and we'll go into fs, file system folder, and
00:13:38 - in here's a whole bunch of stuff. Now, I'm gonna look at this
00:13:41 - file-max, okay. 50,000. Now what that means is, a user
00:13:46 - can have 50,000 files open at one time, which sounds
00:13:49 - like a lot, however, if that user's running like a database, like
00:13:53 - an Oracle database, well, 50,000 files fills up pretty quick.
00:13:56 - So what you can do, is you can change this on the fly to some
00:14:01 - really big number, like a million.
00:14:04 - Echo that into file-max, and now if we look, file-max is up
00:14:11 - at a million. Now what does that mean? Well, it means that
00:14:13 - we instantly changed the number of like maximum files to be
00:14:17 - open. Its changed, so right now, a user could have that many files
00:14:20 - open. There is a problem, remember that asterisk I put on the
00:14:23 - slide, on the whiteboard? Well, the problem is, that if we reboot the
00:14:27 - computer, since this is generated on the fly, it's not going
00:14:31 - to show that for us. Same thing with anything else that
00:14:34 - we do. For example, if we go back and we do something, oh
00:14:39 - gosh, I'm trying to think, if we go into the net folder.
00:14:44 - All right, in here we have net, ipv4.
00:14:49 - Okay, all this stuff in here. Now one of the things that you
00:14:52 - can do, is, I don't know if you're familiar with NAT systems, or IP
00:14:57 - forwarding, but, let's see, ip_forward, zero. So right now, we are
00:15:04 - not doing network address translation. Now, if we wanted our
00:15:07 - computer to do that, we can, not cat, echo 1 > ip_forward,
00:15:16 - and now, all of a sudden, in real time, our computer is going
00:15:19 - to forward traffic. How cool is that? It's pretty cool, right?
00:15:22 - Well, the problem is, when we reboot, it's not gonna do that anymore. The place
00:15:26 - that that information is stored, is in a file called sysctrl.conf.
00:15:31 - Now, inside here you'll see all of these
00:15:35 - different things that get added
00:15:38 - to the kernel on boot, this is, you know, this is what it uses
00:15:42 - to create that file that we talked about, and the reason I just
00:15:45 - showed you that IPv4 forward,
00:15:48 - see we changed it in real time, but if we wanted that to happen every
00:15:51 - single time we booted up, all we would do is uncomment this.
00:15:56 - Oops, we're trying to anyway.
00:16:00 - Oh, yeah, get rid of that comment, and now,
00:16:06 - next time we reboot, that's going to be populated with IP forwarding
00:16:09 - turned on, although, all the time. So that etc/sysctl.conf file
00:16:14 - is where all of those settings are stored, and that's where you
00:16:17 - need to change them if you want them to be persistent. So there's
00:16:20 - all kinds of information to learn about in the proc file system.
00:16:23 - It's worth looking around and investigating. There are some
00:16:26 - things you can actually set, but you need to remember that
00:16:28 - they're only going to be temporary. So let's look, one more
00:16:31 - time, at the dev directory. Now we didn't actually go and look
00:16:35 - at the dev directory before,
00:16:37 - but we talked about it a lot, so I'm just going to give you a quick view.
00:16:40 - Now, remember, this is created by udev, and what it
00:16:43 - does, it creates, remember we talked about the sda sdb stuff? Well this
00:16:48 - sda right here, this is my hard drive. This is going
00:16:52 - to be a serial ATA hard drive, and sda1 is a partition,
00:16:57 - sda2 is a partition, sda5 is a partition, and what
00:17:00 - it does, it creates those on the fly, with,
00:17:04 - as things are put into the system.
00:17:07 - Here. Here's what I wanted to show you. The other thing, remember we
00:17:10 - talked about that camera, like, oh, I know what that is, it's a
00:17:13 - camera, well, the same thing with cdrom. Now the CD-ROM, it's
00:17:16 - hard to say if it's a serial ATA CD-ROM. It would be down
00:17:20 - here in sda. If it's an IDE CD-ROM, it would be up here, let's see,
00:17:26 - where is h?
00:17:28 - No, it's not HDA. It's hard to say what it is, but that's
00:17:31 - okay, because udev knows, when the CD-ROM is put in, it's
00:17:36 - supposed to be linked to cdrom, so whatever this is, we can
00:17:40 - actually look, if you want, let's look.
00:17:43 - ls -l, we're gonna
00:17:45 - go up to cdrom, oh, it's sr0, that's the actual
00:17:51 - place that udev placed the CD-ROM, but it linked it to cdrom,
00:17:55 - using those udev rules, so that now we can just know that dev cdrom is a CD-ROM,
00:17:59 - and this is the folder, this is what it looks like,
00:18:02 - inside the, the you, or inside the dev folder that udev
00:18:05 - creates and manages. So those are the places to find the information,
00:18:10 - and next we're going to talk about how to modify that information.
00:18:13 - We already looked a little bit at the proc file system, but
00:18:15 - next we're going to look at how to change some other things
00:18:18 - that are running in the kernel. So, let's look at that right now.
00:18:23 - You know what, I'm a horrible person, I lied to you. Before
00:18:26 - we talk about configuring, I have to show you a couple more ways you can look
00:18:30 - at information, but because I feel so bad, I'm gonna draw you cat,
00:18:33 - because, you know, cat's are just so, so friendly. So,
00:18:37 - nose, eyes, whiskers, whiskers.
00:18:40 - It's a happy cat, because it's really happy to learn
00:18:43 - about udev rules, and I'm not going to try a body, because
00:18:48 - this has already gone too far. So anyway, let's learn about lsmod.
00:18:52 - Now lsmod, lspci and lsusb, if you're
00:18:57 - familiar with Linux, you know that ls is a listing command, right?
00:19:00 - Well, that's what it does. Lsmod shows
00:19:06 - kernel modules;
00:19:10 - lspci, can you guess what that shows?,
00:19:15 - pci devices,
00:19:18 - and lsusb,
00:19:21 - gives you the weather. No. It shows you all of the USB
00:19:25 - devices that are connected.
00:19:28 - So let's look at what those look like, and then, I promise, we'll move
00:19:31 - on to how to configure more stuff. So, these three things we're
00:19:34 - gonna show, it will determine exactly the types of hardware
00:19:38 - that's plugged in, and then we can see what we can do with that.
00:19:41 - Meow, and let's go look at the command line.
00:19:44 - Okay, this'll just be a really quick section. Basically, we just typed
00:19:47 - the command.
00:19:50 - Let me get up in there, lsmod will show you the kernel modules
00:19:55 - that are currently active in the system. All these on the left, these
00:19:58 - are all the kernel modules that are currently running
00:20:01 - in the, in the current computer. Now, you can tell by some of these,
00:20:05 - that I probably am running a virtual computer, running vmware,
00:20:08 - vmxnet is a prime example that'll teach you that, you
00:20:12 - know, well, yes, this is a virtual machine that it's currently
00:20:14 - running in, but these are all of the different kernel modules
00:20:17 - that are running. Now, the same kind of thing with lspci,
00:20:19 - but the information is a little bit different. Basically, oh, yep,
00:20:23 - see there, it gave me away. Lspci shows all of the
00:20:27 - current PCI devices that are plugged in to the computer.
00:20:31 - So you'll see, let's
00:20:33 - look at something that's not vmware. Intel Corporation,
00:20:36 - here, the AGP bridge, it, it recognizes that it's an Intel AGP
00:20:42 - video-type device, right, the PCI bridge. ISA bridge for
00:20:47 - using ISA devices. IDE interface, all these different things,
00:20:51 - these are PCI devices. Even though it's a virtual one,
00:20:55 - it sees this PCI device as a SCSI controller. It
00:20:59 - actually thinks it's an LSI Logic, even though it's really just vmware,
00:21:02 - but it shows you detailed information on all the different
00:21:05 - PCI devices that are plugged into the computer. For example,
00:21:09 - the u-s, whoa, for example, the USB Controller is actually a
00:21:13 - PCI device, right, and speaking of which, what a great segue into
00:21:18 - lsusb, which is going to demonstrate the different
00:21:22 - USB devices that are plugged in. Now, right now, it turns out
00:21:26 - I don't have any USB devices plugged into my virtual machine,
00:21:30 - which is fine, because it, you know, it just would show a list
00:21:34 - of different things but Bus 001 and Bus 002, these are both just root
00:21:37 - hubs, these are the USB devices themselves, but I don't have
00:21:41 - any other things plugged in. Let me plug something in real quick.
00:21:52 - So there, lsusb now shows us that I plugged in this
00:21:56 - SanDisk Imagemate 6-in-1 card reader, and it just shows
00:22:01 - us that because, again, I plugged it in, l-s, oh, I need to go over here,
00:22:05 - lsusb is what I just typed, and there it shows it. So again, the three commands,
00:22:10 - lspci shows PSI devices, lsusb shows USB devices,
00:22:14 - and lsmod shows current kernel modules that are installed.
00:22:19 - Now let's talk about adding and removing some of those modules,
00:22:23 - next. So we learned about a whole bunch of different commands, all right,
00:22:31 - and the different commands, here I'm gonna write them out for you,
00:22:34 - and I know what you're thinking, whoa, Shawn, what's with the extra commands?
00:22:37 - Well, along with these, ah, that's not real clear,
00:22:39 - it's not lsmud. With lsmod, lspci,
00:22:41 - lsusb, there's also things like lspcmcia, lshal,
00:22:47 - for the hardware abstraction layer, and lshw for hardware.
00:22:51 - All of those will show you different things about the current
00:22:54 - things in your system. Showing all of them in real time is gonna
00:22:57 - just take more of your time, but just go ahead and play with those,
00:22:59 - and they all just show different aspects of the running system.
00:23:03 - So now, we know what's running, but what if we want to add or remove
00:23:07 - kernel modules for different drivers. Now, here's the deal.
00:23:10 - Linux is really good about detecting proper hardware, but
00:23:13 - sometimes you still need to add and remove kernel modules,
00:23:17 - or drivers for devices. One really good example that I have
00:23:21 - the fortune of being able to demonstrate, is the idea of the virtual
00:23:25 - network driver inside a vm, and this is something that
00:23:28 - we're gonna, I'll show you how to do, but see the thing is, when you're
00:23:31 - running a vm, you can get a specialized network card that
00:23:35 - works better, a driver for it, but the kernel doesn't detect it automatically,
00:23:40 - so you need to insert that. So let's look at how you would actually
00:23:43 - insert and remove kernel modules, right now.
00:23:48 - All right, here we are at the terminal window, we're gonna do an lsmod for showing
00:23:51 - the kernel, the running modules right now, and, remember I talked
00:23:54 - about that vmxnet being the driver specific for
00:23:58 - virtual machines. Well, at first when I installed it, it actually
00:24:01 - recognized it, I think it was as a like pcnet driver, as
00:24:06 - opposed to vmxnet, and what you have to do is, rmmod.
00:24:10 - Now rm should look familiar, if you're familiar with the
00:24:12 - Linux command line, we're removing the module, rmmod
00:24:16 - vmxnet.
00:24:19 - All right, oh, now if you look, a-ha, look at that nice pop-up, whoa,
00:24:23 - wire, wired connection is gone, you have no connection,
00:24:25 - oh my goodness. In fact, as far as a kernel knows, we don't
00:24:28 - have any Ethernet card at all, so how you would historically insert
00:24:33 - the module is insmod
00:24:37 - vmxnet, right? Oh,
00:24:40 - that's the problem, a lot of times, like if you're
00:24:43 - trying to install a package and there are other dependencies,
00:24:47 - you can't do things like just insmod, and that's where this awesome
00:24:51 - tool came around, and this is really the only one you're ever going
00:24:54 - to use. I doubt you'll ever use insmod for insert the module.
00:24:58 - Modprobe, what it does, it probes for any other dependencies
00:25:01 - that will be required. So vmxnet.
00:25:06 - Okay, ah, well this is just warnings, these aren't errors, all configs, blah, blah, blah, blah, blah,
00:25:10 - because of vmware tools, and you'll see it, it installed
00:25:14 - it, and now I have that connection established up there, just
00:25:17 - inserting the module. Now, what I had to do before, was I had to
00:25:21 - rmmod, it was like pcnet32, now it's going to say,
00:25:24 - there is no such module, but I had remove that, and then
00:25:28 - I had to modprobe that vmxnet in, okay, and yes, see it's already,
00:25:33 - it's already inserted, but modprobe, mod, probe, is how you
00:25:38 - insert modules into the running kernel, and rmmod is how
00:25:43 - you remove them.
00:25:49 - So now what about if you want them to do it automatically?
00:25:52 - Well, here I'm in Ubuntu, there's a couple ways. The old fashioned way would be
00:25:56 - to edit this etc/mod, nope,
00:26:02 - modules, so the etc/modules file, and see here, you can
00:26:06 - add things to a line, every, everything
00:26:10 - that, or every module on its own line, it'll modprobe those things
00:26:13 - as the system boots up,
00:26:16 - but, if you go into, then
00:26:23 - you'll see all of these things. Now what these are, are different
00:26:26 - things that, let's see, vi,
00:26:30 - okay, what this does, it gives it different commands, and this is
00:26:35 - a little bit beyond the scope of just how to insert and remove
00:26:37 - modules, but this is the, the method that you use to add these
00:26:43 - things to, to the running kernel on boot up, so either the
00:26:47 - etc modules,
00:26:50 - or, in the etc/modprobe.d folder, all
00:26:53 - these different files that you can use, and basically, that
00:26:56 - will allow you to add things to the running kernel, just like
00:26:59 - that etc/sysctrl.conf file did for the,
00:27:04 - for the things in the proc directory, to add things into the
00:27:07 - modular kernel when it boots up the drivers and stuff, this is where
00:27:11 - you would put them, and that is close to it. There are two more
00:27:14 - things that I want to show you really quick, back at the whiteboard.
00:27:17 - There's always the exception to the rule, right? Well,
00:27:22 - I talked about dev, the dev file system, making nice little convenient
00:27:26 - symlinks to different files, like USB drives or your camera
00:27:29 - or your scanner, things like that. Well, what happens if you have
00:27:33 - several hard drives that you want to mount in a specific place.
00:27:36 - For example, you want one to be your
00:27:39 - home directory. You want one to be your root directory. You want
00:27:43 - one to be the var directory, you know, you have all these
00:27:46 - different things and you want a specific hard drive on there. Well,
00:27:49 - you can't just say like dev hard drive, and dev other hard drive,
00:27:53 - and dev other hard drive. So what you can do is mount
00:27:56 - the specific folders, based on the UUID. Now, you can also mount
00:28:02 - USB drives with this, but the hard drives are a really good example
00:28:06 - of why you would use UUID. Basically, what you do when you mount
00:28:10 - the thing, instead of specifying a specific device, like instead
00:28:15 - of dev/sda, partition one, you would specify, well,
00:28:21 - let's just go look, that's even simpler, if we just go look.
00:28:26 - Back here, at the command line, let's look at that mounts thing
00:28:30 - in the pro, oop, at the mounts
00:28:32 - thing in the proc folder, proc,
00:28:36 - cat mounts. Okay, so here we have, this is a perfect example.
00:28:41 - Now what we have done, instead of mounting this as the root
00:28:46 - directory, right, I just have one partition here. Instead of mounting
00:28:49 - forward slash on like dev/sda1, what we're going to
00:28:53 - do is mount it on dev/disk/by-uuid, and every single
00:28:59 - device is going to have its own UUID. So what that means
00:29:03 - is, if you pop in another hard drive, it's not going to take
00:29:07 - the place of this mount. It's not gonna try to mount
00:29:09 - a different hard drive on there. You can specify, based on this
00:29:12 - ID that it mounts right there. So that's basically, instead of
00:29:16 - depending on udev to figure out what hard drive it is, you
00:29:20 - say, this exact hard drive, named Bob, because apparently in computer,
00:29:23 - this is how you spell Bob, just bear with me. Bob is always going
00:29:27 - to be mounted on slash, on the, the root directory, it's always
00:29:30 - going to be there. Same thing, now you don't have to do that. For
00:29:33 - example, what else do we have here? I guess that's the only drive
00:29:37 - that I have mounted,
00:29:40 - yeah, so that's the only one I can show you. This is a basically,
00:29:44 - this is the fuse mount that GNOME uses for having all the
00:29:49 - things on the desktop, and it just says, basically, the, you know,
00:29:52 - where the directory is, and what it is that's being mounted,
00:29:56 - but it doesn't give you an actual device, because it's more of
00:29:58 - a virtual file system. So, basically, if you want to mount a
00:30:03 - device, based on u-o-u-i-d, instead of any entry in the dev
00:30:08 - directory that is auto created, this is going to work no matter
00:30:12 - what, that hard drive is all that's going to be mounted, pop in another
00:30:15 - hard drive, it's not going to mount there unless you change the UUID,
00:30:17 - and really, that's about all there is left to understanding
00:30:23 - how to manage and configure the hardware. There's a couple things
00:30:27 - you should know, like what hot plug versus cold plug is, and
00:30:30 - basically, that means hot plug is you plug it in when the computer's
00:30:33 - running, like a USB disk, and cold plug means you turn the
00:30:36 - computer off, so it gets cold, like if you're going to put in
00:30:39 - a new video card, well, you can't hot plug that, although I did
00:30:43 - know somebody that tried to, to hot plug an Ethernet card, that doesn't
00:30:46 - usually work really good either.
00:30:49 - So, hot plug and cold plug, and I think that's about it,
00:30:52 - so let's go back through, a quick recap, and I'll send you on
00:30:56 - your way to the next lesson.
00:31:00 - So, a quick recap of 101.1, the Hardware Settings,
00:31:03 - how to determine settings. Now we learned about HAL in the hard,
00:31:07 - the hardware abstraction layer, and it's important to note that
00:31:10 - HAL is, runs actually as a daemon, which is like a server
00:31:13 - process, so you may actually see it referred to as hold, for
00:31:16 - daemon. Dbus is the method that they use to communicate,
00:31:21 - remember my example of the actual bus that drives information back
00:31:24 - and forth, and udev is the applica, or the, the program,
00:31:28 - the daemon that's running in the background that determines what
00:31:31 - system fire, or what devices are mounted at in the dev directory,
00:31:34 - so this is basically in charge of the dev directory. Then
00:31:37 - we learned about different directories. We learned about the
00:31:40 - sys directory. Now the sys directory, you remember, is basically
00:31:44 - just HAL's database of all the stuff connected to the hard
00:31:47 - drive. It talks about whether it's PCI, mini PCI, how it's connected,
00:31:51 - where it's connected, why it's connected, its serial numbers, all that kind of
00:31:54 - stuff. It has a whole database of stuff. The proc directory
00:31:59 - is the directory that's dynamically created as soon as the
00:32:02 - thing, as soon as your computer boots up. There aren't any actual files,
00:32:05 - they're all just stored in RAM. They can be changed, but they won't keep
00:32:09 - that setting on reboot, remember that it's important to know that those
00:32:12 - are volatile, and they will disappear, and then the dev directory, again,
00:32:16 - udev controls those things, and that's where your devices
00:32:18 - show up. With udev rules, you can actually make them friendly,
00:32:22 - like you plug in your camera, instead of just, you know,
00:32:24 - dev/sda1, it's dev/camera, which is a really convenient way
00:32:29 - to, to do that, and that is what the dev directory is. Now, then
00:32:34 - we learned about all these ls commands. We actually learned about a couple extras,
00:32:37 - too. Lsmod shows kernel modules; lsusb shows USB devices ; lspci
00:32:42 - shows the PCI devices, and then we have lshal
00:32:46 - and lshw and lspcmcia. All those different, different
00:32:50 - programs will show you what's in the current computer, what's
00:32:53 - plugged into it,
00:32:55 - and then we, finally, after all that learning, learned how to configure
00:32:58 - some stuff. We learned about how to set device UUID, or
00:33:02 - had to mount things, based on the UUID. Remember, that's the
00:33:05 - UUID, and that is how you can mount a hard drive,
00:33:10 - or like a flash drive, based on its exact unique identifier,
00:33:15 - so it's not just like, you know, devh. It's not just like
00:33:19 - dev/sda. It's going to be dev by UUID, and
00:33:25 - the whole long string of numbers that specifically identifies
00:33:29 - every single block device. So you're never going to have the same
00:33:32 - thing twice, everyone is unique. We learned about what kernel
00:33:36 - modules are, remember our little example about the network module,
00:33:40 - the vmxnet that I had to, I removed and readded, that's how
00:33:43 - you manage kernel modules. The lsmod showed you what they were,
00:33:47 - but we, we used, the two tools that we used for that are
00:33:50 - rmmod, oops, rmmod, to remove them, and
00:33:57 - modprobe to put them back in. We can also use insmod, but remember,
00:34:02 - that's kinda outdated, because it doesn't look for dependencies, so
00:34:04 - rmmod and modprobe, for managing kernel modules, and then adding
00:34:09 - and removing devices, but we just talked about that in length, didn't we?
00:34:12 - We talked about what happens in the dev directory,
00:34:16 - what udev does, how it communicates with GNOME or KDE,
00:34:19 - via dbus, and we learned all about adding, removing, configuring,
00:34:24 - identifying, about devices. We've learned more information
00:34:28 - in this lesson than we probably ever knew existed on virtual
00:34:31 - file systems and stuff, so,
00:34:34 - I think that just about covers it. I hope that this has
00:34:38 - been informative for you, and I'd like to thank you for viewing.

Boot the System

Change Runlevels and Reboot or Shutdown the System

Design Hard Disk Layout

Install a Boot Manager

Manage Shared Libraries

Debian Package Management

RPM & YUM Package Management

Work on the Command Line

Process Text Streams Using Filters

Perform Basic File Management

Use Streams, Pipes, and Redirects

Create, Monitor, and Kill Processes

Process Priorities

Search Text Files with Regular Expressions

Perform Basic File Editing Operations Using vi

Create Partitions and Filesystems

Maintain the Integrity of Filesystems

Control Mounting and Unmounting of Filesystems

Manage Disk Quotas

Manage File Permissions and Ownership

Create and Change Hard and Symbolic Links

Find System Files and Place Files in the Correct Location

This forum is for community use – trainers will not participate in conversations. Share your thoughts on training content and engage with other members of the CBT Nuggets community. For customer service questions, please contact our support team. The views expressed in comments reflect those of the author and not of CBT Nuggets. We reserve the right to remove comments that do not adhere to our community standards.

comments powered by Disqus
Community Standards

We encourage you to share your wisdom, opinions, and questions with the CBT Nuggets community. To keep things civil, we have established the following policy.

We reserve the right not to post comments that:
contain obscene, indecent, or profane language; contain threats or defamatory statements; contain personal attacks; contain hate speech directed at race, color, sex, sexual orientation, national origin, ethnicity, age, religion, or disability; contributes to a hostile atmosphere; or promotes or endorses services or products. Non-commercial links, if relevant to the topic, are acceptable. Comments are not moderated, however, all comments will automatically be filtered for content that might violate our comment policies. If your comment is flagged by our filter, it will not be published.

We will be continually monitoring published comments and any content that violates our policies will be removed. Users who repeatedly violate our comments policy may be prohibited from commenting.

Course Features

Speed Control

Play videos at a faster or slower pace.


Pick up where you left off watching a video.


Jot down information to refer back to at a later time.

Closed Captions

Follow what the trainers are saying with ease.

MP3 Downloads

Listen to videos anytime, anywhere

Annual Course Features

Transcender Practice Exams

These practice tests help you review your knowledge and prepare you for exams.
Available only with the annual subscription.
Shawn Powers

Shawn Powers

CBT Nuggets Trainer

LPIC-1; CompTIA Linux+, A+; Cisco CCNA

Area Of Expertise:

Add training to a playlist
or create a new list
Add to current playlist
or add to an existing list
Add to new playlist
Add New Bookmark

Hardware Settings
Bookmark Title:

Login is required to access this feature.

Your browser cannot access Virtual Labs
Video Options

This advanced buffering is applied to all streams regardless if you installed the doublespeed control or not. Sometimes the advanced buffering causes the video to hang or behave erratically. If you are experienceing issues with video playback please disable the doublespeed buffer.

Remember to re-enable the buffer if you want to use the doublespeed control.

If you are experiencing problems with our content delivery, please click here to switch to our alternate content delivery network or go to our network FAQ.
For other common video playback issues, including firewall and corporate network issues, please visit our Tech Support forum.