hello everybody this is teca and in this
video what i'm going to be doing is
showing you how to
auto mount drives in linux now there may
be a wide variety of reasons you want to
do this for me
the example i'm going to be using in
this video is the backup drive i have in
my system
i like to automatically mount it because
i have time shift running and i don't
want it to be unmounted and cause an
issue down the road
so i set it up to automatically mount
and you can see it's right here you see
that little icon
that means that it is not mounted i just
rebooted my system to ensure this
and you could always mount your drives
by just opening up the actual drive
you can see it mounted it and we can
right click to
unmount so the purpose of this video is
to automate this
so getting right into it what you're
going to want to do
is go ahead and set up the actual
mounting directory
get some of the drive information
particularly the
uuid and then we're going to go ahead
and edit the
fstab folder down the road so first
we're going to want to actually make
the directory now on my system i already
have the directory because
i made it a little bit ago because i've
already done this
so this is the directory that i will be
mounting all my drives
but to make this directory all you're
going to want to do is go ahead and open
up your terminal
just like so and then we're going to
type the make directory command
so sudo mkdir for make directory
and then in the actual location that
you'd like it mounted
now it's common practice to mount it
into a media directory
and root uh you could technically mount
it wherever but i prefer to keep it this
way because this is how
linux is designed to do it so media and
then the actual name
of the drive or backup or whatever you
want your folder to be
in my example it is going to be backup
so you do that
type enter and it's not going to do it
because it already exists
but that's what you're going to want to
do to start out is actually make that
directory you're going to be mounting it
to
next we're going to go ahead and get
some of the drive information
so you can see over here it is the
backup drive
so if i click on that there's multiple
ways to get this information you could
either
go to properties so here you can see the
actual mounted
from dev sdb1 so you could just get it
there and then skip a command
or you could even go into something like
disks
and go to the disk management and media
if we go to this one right here you can
see it
the sdb1 sdb1 this is the drive you can
pull the uuid from here
and this is really all the information
so you could just pull it from here
but what i'm going to do is i'm going to
show you how to see this in the terminal
as well if you prefer to use that so we
have our terminal here and what we're
going to do
is show you a couple commands to get the
same information
so if you do sudo f disk
dash l it will list all the partitions
on your system so this is where you can
pull
the mounted from so the one we're going
to be messing with here is
this device you could see it's uh no
it's not that device
it's going to be this device right here
the sdb
one and it gives you some information on
the drive you can see uh the bytes the
name of it the size available so that's
one way to see your partition data but
the command that is most important
is sudo bl kid
and what that's going to do is it's
going to open up the drive information
and
the uuid and this is going to be what we
need
i have labels on all my drives so that
makes it even easier so if you do
reformat your drives i would recommend
adding a label that you can easily
identify
but we can see here this is the backup
drive we match it up with the sdb1
so we are all good to go here so i'm
going to copy
this uuid copy
and then what we're going to do is edit
the fstab folder
now you need to be really careful when
editing this folder because this is
how your system reads your boot drive as
well
so you don't want to mess around with
anything other than
adding information so we're going to go
sudo nano nano is a text editor that's
built into terminal it works great for
quick edits like this type e
t c slash and s
stab just like that hit enter and
we see here this is the f-stab the
static
file system information and um
right here is our boot partition and
then right below this this is our main
home directory root partition so what
we're going to want to do is add
an entry so this is all controlled with
the
keyboard so we're going to go ahead and
tap it tab on down
go to the very end of this and then
go down and then from here i'm actually
going to add a note
so i can easily identify what this is
so we're going to type something like a
hashtag or number pound whatever you
want to call it
and i'm going to call this backup and
then i'm going to do
the actual mounting point so for this
it's slash
dev s db one
i believe sdb1 yep sdb1
so i know what drive it is and now here
is when it gets fun
you're gonna do that uu id equals
and then paste in that uuid you copied
earlier so
paste that in and now don't hit space
here you're going to just want to hit
tab once and then here is that mount
point you created earlier
so just do slash media slash
backup or whatever you called your file
and it is case sensitive so do be
careful on that don't
mess that up because linux can actually
recognize
case sensitivity within its file systems
and then
we're going to hit the tab you can see
here this is kind of a key
it goes the file system which does this
the mount point which is here
the type so we're going to want to get
our file system type you could pull this
from the terminal but i just have it
right here
it is the linux file system or the ext4
so i go ahead and type ext4
you want to hit tab again and for this
i'm going to go with
defaults now if you're curious on what
this
is i will have a link in the description
to some more details it's basically a
profile
of how this is going to work with the
defaults profile
it's part of it is the auto mounting and
it has all the read write privileges
that you're gonna want
hit tab again go with zero tab again
zero and like i said there'll be a link
in the description let you know what
this is but this is basically the dump
or backup utility it's a
0 or 1 whether or not if you want to use
that and this one's fsck
which is a in simplest terms it's kind
of like error checking
so i set that to off for this drive but
as that is
it should have no issues and what we're
going to do now is
save this and just as another i'm going
to say it again
don't mess with any of this you will
make it so you can't boot into your
system and then you'll have to go get a
live disk and get into it fix it
all that fun stuff so to save it you can
see right here
right out so it's just control and 0
and then you're going to want to make
sure it's the etc stab
hit enter and you should be good to go
so if i go control
i think it's x for exit we are now
exited
to the terminal so now what we're going
to do
is run a quick command to make sure that
it mounted properly and that is just
pseudo mount dash a
just like that and if we go in here
it should be mounted so actually i'm
going to unmount it real quick
run this command one more time i'll just
do sudo
mount m-o-u-n-t dash
a hit enter and this drive is mounted
so you see it didn't bring up any issues
it should be okay if you really want to
double check
you can go ahead and go to your root
directory go into your etc
folder and then find that fstab
file right here
double click on that and then you can
see that this has been added
so we're going to close this out and
that's really about it i tested it
through the command but you could go
ahead and reboot your system to make
sure it worked that way
and that is how you mount your hard
disks ssds
you could even do this with usbs sd
cards
whatever you want in linux i hope this
has helped you out in some certain way i
have tons of great linux content you can
check it out
right there it's a whole playlist of
everything you're going to want to know
comment rate if this has helped you out
if you disliked it you know what to do
subscribe for more have a great day and
goodbye
auto mount your hard drives or disks in
windows jesus
ah not windows