To auto mount secondary hard-drive in ubuntu, you have to do edit /etc/fstab
- Use list block devices (lsblk) command to determine device,
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 475.9G 0 disk └─sda1 8:1 0 475.9G 0 part /mnt/tmp sdb 8:16 0 238.5G 0 disk ├─sdb1 8:17 0 206.5G 0 part / ├─sdb2 8:18 0 1K 0 part └─sdb5 8:21 0 32G 0 part [SWAP] sr0 11:0 1 1024M 0 rom
Let’s assume that our targeted device is sda1 so we will refer it as /dev/sda1.
- Use blkid command, to determine UUID of the disk.
$ sudo blkid /dev/sda1: UUID="2a2037b2-41a1-4c0c-b6ca-be81c40bb091" TYPE="ext4" /dev/sdb1: UUID="93431b31-e46c-4ae3-86dc-94fe788d64d3" TYPE="ext4" /dev/sdb5: UUID="433d261b-1123-49d0-803d-9057e272e604" TYPE="swap"
Make note of the UUID label of the /dev/sda1, In our case it is 2a2037b2-41a1-4c0c-b6ca-be81c40bb091.
- Create a folder to mount second hard-drive
sudo mkdir /secondstorage
- Edit /etc/fstab to have following line
UUID=2a2037b2-41a1-4c0c-b6ca-be81c40bb091 /secondstorage ext4 defaults,noatime 0 2
- Reboot the machine.
- Once your second hard-drive is mapped for auto-mounting, you will not find hard-drive icon in Ubuntu launcher toolbar.