Linux, How To Automatically Mount Hard Drive At Bootup/startup
👤 By booup | 📆
Procedure to auto mount drive on boot/startup
I am going to keep this page simple. You will need to modify a file called fstab. Follow these terminal commands:
1. Make a backup copy of your exisitnig fstab:sudo cp /etc/fstab /etc/fstab.bak
2. List the details of your hard drive using the fdsik command:sudo fdisk -l
Example output:
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1050623 1048576 512M b W95 FAT32
/dev/sda2 1052670 41940991 40888322 19.5G 5 Extended
/dev/sda3 41940992 209715199 167774208 80G 83 Linux
/dev/sda5 1052672 41940991 40888320 19.5G 83 Linux
2. Open fstab file. You can use your favorite text editor. I am using nano as example:sudo nano /etc/fstab
3. Add your new drive on the last line of the fstab file:
/dev/hdb /mnt/mydrive ext3 defaults 0 0
4. Close fstab and save your changes.
5. Reboot
6. After reboot, you can create a symbolic link to your new drive
ln -s /mnt/mydrive /home/myuser/Desktop/mydrive