In this lesson,
we're going to go over how to uniquely identify our USB drive.
Now, I went ahead and went to the VirtualBox manager,
just in case anybody has any issues
with having the virtual machine recognize the device.
So what you're going to do
is you're go to the properties up here,
I want you select the virtual machine you're using,
and then you can go to USB,
then you're going to use this green plus sign.
It's going to add particular device,
so just locate your USB device,
and then we'll be able to connect it to the virtual machine.
Now, once you have it plugged in,
it might not be recognized initially once you get on there,
but if that's the issue,
just unplug it and plug it back in
and it should recognize it for you.
So also just to make things a little easier,
we can recognize the vendor ID,
product ID and serial number
that's going to be useful for us later.
So let's hop right into this.
So the first thing we're going to do
it's going to use the lsblk command
and it's going to identify the USB device.
And again, you have to realize
whenever is first loaded on there,
the system gives it a generic name
and we're trying to avoid it.
So sdb, that's going to be the USB hard drive
that I have connected now.
And that's again, and I say it, sdb.
So we're going to use the udev admin command.
So the udev, that's the manager
for all the devices and hardware.
So we're going to use this to get some information
about that really quick.
Use dev/sdb.
Now we see it gives us a lot of detailed information
about the device itself,
we see it identified as sdb.
So information's going to be particularly useful,
it's going to be the ID serial number,
so about five down from the bottom,
iOS device flash drive.
And it's going to be all zeros, HH31,
it's going to be very useful for us.
Scroll down a little bit,
get the ID vendor ID.
Now to get more specific attribute information,
we use the -a symbol.
And now this where we're get into the format
that the files that we'll use
to customize the unique identification,
this is how it's going to identify these things.
So that thing's going to be labeled in the ATTR
type of manner once we're going through this.
So again, this screen walks through each pairing device
starting with the target device
you read in instructions here,
in the information.
Again, a lot of just key information about the device.
Now we'll get into the weeds
about everything that's going on.
So what we want to do is,
let's try to look up the serial number.
Remember, to search in this,
we're going to do /serial,
remember this is piped under the less command.
So we found the serial number under attributes.
This connected to the USB.
And again, while we're on the screen
we're going to look for the ID vendor,
which is right here.
And they're going to annotate the ID product,
just right here.
And we're just going to keep this window up
'cause we're going to need it once we start configuring,
it'll be a little easier that way.
Next we're going to create a udev rule
to automatically link the custom device name
to the USB drive when it's plugged in.
So we're going to use sudo.
Now we're going to put all this on one line.
See, I went ahead and typed this out
just to make sure everything works properly,
'cause this file is very sensitive.
So make sure that you copy everything exactly.
So you see how it says KERNELS here?
1-1.
So we go back, so that's the one,
kernals 1-1,
ID vendor, 05e3,
serial number, 00000000HH31,
ID product here, 0738.
And the symlink is what I want to name it,
so again, this is what the system will recognize
the device as,
so instead of being sdb,
it's going to be myHDD,
that's what we're going to recognize it on the system.
Now all of this is going to be on one line,
so if you see down here,
it's one line,
so type in directly,
going to be KERNELS==,
type in the name that you have for your particular device,
comma space attributes, ATTRS,
and then use the curly brackets,
then you'll start putting in
the attribute names,
==, and then so on and so forth.
Just make sure you go very slow what you're typing.
Let's go over here.
Now once you have that complete,
what you want to do is use the sudo udev admin control
under reload rules.
Now it usually reloads the rules automatically
but again, we just want to make sure everything is done.
So the next one we'll use is udev admin trigger.
Now the trigger rules also is done when it's connected,
but again, we want to ensure that
once we unplug it and plug it back in
that it's going to work for us.
All right, click this out.
Now we're going to go to our applications,
our favorites files,
and we're going to unmount this first,
we're going to unplug it.
Plug it back in.
So now when we go to our lsblock,
we should be able to find this directly,
'cause you know I can use dev and just say sda, right?
We're going to be able to do the same thing,
but it's going to be myHDD.
So we see now
that we can associate a specific type of name
to instead of sdb1,
it's going to be myHDD.
So whenever we're looking for unique type of information
again, serial numbers or whatever,
it's all going to be associated with myHDD.
But you have to realize
there's so many different USB devices,
and when they're connected to different machines,
in order to uniquely identify them,
instead of having to always look up the serial number
or the product ID,
you can just use as myHDD,
or whatever you want to call it,
install, Sarah's hard drive,
whatever it is,
this is where you would do it.
Now, it's not a common practice,
but it's something that we should be familiar with.
Another way to make sure that
the symbolic link was correctly captured,
is if you start the dev and scroll up,
you'll see right here, myHDD,
again, it's pointing to sdb1.
Next, we're going to walk through how to
install a virtual printer.
Now, the system that we're going to use to do is called CUPS.
CUPS is a print management system for Linux
that enables a computer to function as a print server.
So the first thing we want to do is,
we're actually going to go to the GUI,
and we want to take a list of the printers,
just to verify that there's no printers
actually currently present.
Go to application,
in system tools,
go to the settings.
Scroll to the bottom, under devices,
go to printers here.
And we can see we don't have anything installed.
So we're going to change that really quick
by installing a virtual PDF printer.
So with this command,
we're going to use the yum package manager,
and this is going to allow us to install the package,
so we have to download it from the external repository.
So we're going to just go ahead and click enter here.
And this is a well known error with this,
so we might have to actually do this twice
for it to fully go through with this,
just to make sure everything went through.
Now let's go back to the settings here,
and now we can see that the CUPS PDF
is ready for print for us.
Now we need to make this our default printer,
so we're going to unlock this here.
Enter our password.
Let's just move the screen over a little bit
so we can see the settings.
We can go to settings,
and we'll use this printer by default.
Next thing we're going to do,
going to use the lpr command,
which is pretty much, it's a print command,
and we're going to use our computer list file
that we used earlier,
and this going to default and send it to our desktop.
So we should be able to go to desktop now,
and we can see the PDF version of that file here.
So that was very quick, very easy.
We just went over how to install a virtual PDF printer,
and also how to customize how Linux recognizes
our external USB devices.
Thank you for sticking through this walkthrough,
and I'll see you in the next lesson.