UNIX – Mounting a partition in Linux

In order to mount a hard drive we need to add an entry to the file /etc/fstab. This entry will allow us to not lose our drive mounting after a system reboot.

/dev/sdb1       /mypartition       ext3    defaults        0       0

Then to action the changes run the following command,

root@server:/# mount -a

Finally check that the drive is now mounted.

root@server:/# df -h
Filesystem            Size Used Avail Use% Mounted on
/dev/sda1             8.8G  3.5G  4.9G  42% /
/dev/sdb1             182G  104G   69G  61% /mypartition

Rick Donato

Want to become a UNIX expert?

Here is our hand-picked selection of the best courses you can find online:
UNIX Administration Fundamentals
Vim Masterclass
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial