blog

Recent Posts

Archived Posts

Editing fstab for mounting at startup.

I use Plex as a media server on my laptop in order to categorise my local tv/movie content which exists in two external hard drives connected to my wireless router. This way I can cast all of my local media to my tv using a chromecast with a netflix-like interface.

The only hard* part about setting up Plex on a linux computer is permanently mounting networked hard drives. In order to do this go to /etc in your root folder as the super-user/root. There are a few different ways to open a folder as root depending on your linux distro and I'll leave that part to the reader. Also check that in your root folder that there exists a /media folder, and if not, create one.

Once you have fstab in your favourite text editor, you need to append the following line (all on one line) to the bottom of the page:

//192.168.1.2/[HARD-DRIVE-NAME] /media/[hard-drive-folder]/ cifs username=[YOUR-USERNAME],password=[YOUR-PASSWORD],vers=1.0,iocharset=utf8,uid=1000 0 0

Where:

  • 192.168.1.2 is the directory of my wireless router. This could be different for your network.
  • [HARD-DRIVE-NAME] is the name of your hard drive in the network;
  • [hard-drive-folder] is the name you want to call your hard drive folder; and,
  • [YOUR-USERNAME] and [YOUR-PASSWORD] are your root linux username and password.

Once you've saved the fstab file, make sure your hard drive/s is/are connected properly and reboot your machine. You should find the hard drives have been safely mounted at startup!

*: hard for me. Probably obvious to a lot of linux users.