fir3net
PPS-Firenetbanner-780.5x190-30-03-17

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

About the Author

RDonato

R Donato

Rick Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001