From the course: Linux: System Maintenance

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Automatically mount a disk

Automatically mount a disk - Linux Tutorial

From the course: Linux: System Maintenance

Start my 1-month free trial

Automatically mount a disk

- [Instructor] When we add a disc to a system, usually, we want it to be mounted and available to use all the time. We can mount a disc manually or tell the system what it needs to know in order to mount it for us. To mount a disc, we make it available somewhere on the filesystem. A common place to do this is inside the mnt folder. So I'll create a folder inside there that will be a placeholder for our disc. I'll write sudo mkdir /mnt/, and I'll call it external. Now I can tell the system to make my disc available at that path with the mount command. I'll write sudo mount and the path to my partition, dev/sbd1 and then the path where I want it to be, /mnt/external. And now, if I wanted to, I can work with that disc. I can see that it shows up here in my listing of drives, and I can add content to it if I wanted to, say, sudo mkdir /mnt/external/myfolder. And when I'm done with it, I can disconnect the disc with the umount command. I'll write sudo umount /mnt/external. And now the disc…

Contents