What does mounting really mean in Linux?
And where/when can I use the mount
command?
I'm new to Linux so I would appreciate a detailed answer.
What does mounting really mean in Linux?
And where/when can I use the mount
command?
I'm new to Linux so I would appreciate a detailed answer.
Mounting means that you associate specific part of your hard drive with a folder on system. If you mount USB drive, it will be associated with some folder , for example /mnt/usbdisk. You then can go into that folder, and browse files (if disk is mounted with appropriate permissions). But until you mount it, you cant go there.
Disk can be physically inserted into machine, but mounting is software concept. So even though a disk might be connected physically, you cannot use it until you mount it.
You can mount any filesysyem, in general. It could be a network drive, for example,too.
Mounting isn't a Linux specific concept: other *nixes do it too. Windows, otoh, assigns devices to a volume letter, so the root of that device is the volume letter. In GNU/Linux distributions, the device could be mounted on any point of the filesystem (well, in Windows too, but that's another story), it could be mounted right under / or /home/username... or really any other place.
Lets say you insert a USB stick, in some GNU/Linux systems, like Ubuntu Desktop, a daemon may automatically mount it for you, on Ubuntu it will normally mount it under /media/{username}.
You can manually do this. Imagine that for any reason you want to mount the stick under your home directory, we would do it this way:
First, create a dir: mkdir ~/usb_tmp
Then, mount it there: mount /dev/sdb1 ~/usb_tmp
.
Note: I use "/dev/sdb1" for this example's purposes, but this really is a representation of your USB stick and it could vary. You would need to figure that with sudo fdisk -l
.
Afterwards you could navigate there, as you would with any other directory, and see the contents of the USB stick.