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?

- 34,122
- 21
- 114
- 172

- 31
-
Does this answer your question? How to automatically mount usb flash drive at startup – Zoe is on strike Oct 21 '22 at 20:41
2 Answers
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
- 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.
- 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.

- 309
-
1ok 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? – Jim Ramenson Mar 12 '17 at 22:46
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

- 646
-
TY so much! i still wanna learn why those sequences work but that worked!!! thank you sooo much!! – Jim Ramenson Mar 12 '17 at 23:43
-
-
@JimRamenson you can read more in system manuals for fstab and mount. Please mark the answer as accepted. – Kamil Mar 13 '17 at 12:37
-
1
-