3

I have a Plex media server installed on Ubuntu 14.04, which use two external hard drives (/dev/sdb1 and /dev/sdc1). I would like to automatically mount these at boot to /media/drive1 and /media/drive2 respectively. Is there any way I can do this in Ubuntu?

1

2 Answers 2

3

You can try editing the fstab file. Here is how to access it: nano /etc/fstab. On nano, you can use any editor install in your system, like Vi/Vim. The file will have headings which are self explanatory. It will have Mount point-Where you can the drive to be mounted, e.g /home/media. It will also have Type(File system type, e.g ext4) and others. Once you finish adding your drive(s) there, the drive will automatically be mapping itself there once plugged in.

Here is my edited answer

  1. Check the files system of your drives by running df -T. For example you will see something like this

  Filesystem      Type     1K-blocks      Used   Available   Mounted on
  /dev/sdb1       ext4       10240        0       10240       /home

2. See the help provided in this post if you have problems with file systems.


  1. Edit the fstab like this:

   #Device         #Mountpoint  #fs-type     #options     #dump  #fsck
 /dev/sdb1       /media/drive1    ext4        defaults      0      0
 /dev/sdc1       /media/drive2    ext4        defaults      0      0

You may find nothing configured in the fstab file but it's likely that the default boot drive is configured there. Go ahead and just edit the file exactly as I have shown in step 3.

1
  • 1
    ok if i fstab how do i make sure that the drive i added goes to the right folder ... like i wanna mount sdb1 to media/drive1 and sdc1 to media/drive2? Mar 12, 2017 at 22:46
1

You should put line for each drive in /etc/fstab file like this:

/dev/sdb1   /media/drive1   ntfs-3g defaults,windows_names,permissions,locale=pl_PL.UTF-8,rw    0   0
5
  • TY so much! i still wanna learn why those sequences work but that worked!!! thank you sooo much!! Mar 12, 2017 at 23:43
  • You should mark the answer that has worked for you as accepted Mar 13, 2017 at 10:10
  • @JimRamenson you can read more in system manuals for fstab and mount. Please mark the answer as accepted.
    – Kamil
    Mar 13, 2017 at 12:37
  • Is that a Polish locale though? 🤔 Mar 5, 2019 at 18:22
  • Yes. You can use locale suitable for your preferences.
    – Kamil
    Mar 6, 2019 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.