Mount

The Concept...


The first thing we need to understand is... the basic entity in the Linux file system... the file. In fact... in Linux... everything is a file. In fact... in Linux the File is like the atom.

So... to access a device we need to add it to the file system. We do that by creating a file... in this case a directory... that acts like a wrapper around that device. When we access that directory we access the device.

The mount command is how we create that wrapper.

CREATED 2021-03-01 10:55:50.0

010-00-06-36

UPDATED 2021-03-01 14:27:54.0

The Mount


As with most commands there is a myriad of switches to customize the mount command but most always we need just two parameters. The name of the device and the directory we want to mount it to. In psudo code it would look like this...

mount [options] <DeviceName> <MountPoint>

DeviceName: When you plug a device in to Linux... it creates a file in the /dev directory... that stands for device. The name will start with sd for special device. For example the primary drive would be something like /dev/sda... that's Special Device A. Each partition on the device will be followed by a number. Example: /dev/sda1

Use the lsblk command to find the name of the device. It will list all the devices on your system. The output looks like this...

Directory: known as the mount point is just a directory in the file system. Since root has to mount the device you need to be root when you do this.

In the end it looks like this:

# mount /dev/sdc1 /my/mount/point

Change directory to /my/mount/point and you are in like flint!

CREATED 2021-03-01 14:27:56.0

010-00-06-37

UPDATED 2021-03-01 14:28:06.0

Cleaning up...


As with anything you need to clean up when you are done. To unmount the device use the umount command. It only needs one parameter... the name of the directory or mount point you mounted the device on... the wrapper.

umount /my/mount/point

That's it... now you know the basics of mounting a device. The device can be anywhere within reach... i.e. the local machine... or another machine on the network or any network you can reach.

CREATED 2021-03-01 15:05:16.0

010-00-06-38

UPDATED 2021-03-01 15:07:12.0

Knowledge

L
I
N
K
S

DBID: db.wam

Page Server: Ithica

©2012 Leistware Data Systems

      Hello anonymous