Last Updated: February 25, 2016
·
1.439K
· adziendziel

Ubuntu: Mount disk partitions at system startup

Create script like following:

#!/bin/bash
if 
        ! test -x "/media/PartitionA"
then
        mkdir /media/PartitionA
fi

if
        ! test -x "/media/PartitionB"
then
        mkdir /media/PartitionB
fi

mount /dev/sda1 /media/PartitionA
mount /dev/sdb1 /media/PartitionB

Now let's tell Ubuntu that this script must be run at startup:
Edit /etc/rc.local file and add absolute path to your script.

#!/bin/sh -e
#
# ...

#Mount Windows partitions
/home/ubuntuUser/Desktop/mount-partitions.sh

exit 0

Important note!

Remember that /etc/rc.local must be ended with exit 0