Ubuntu Auto Mount Drive at Boot
In Ubuntu, you can configure automatic mounting of hard drives at startup by editing the /etc/fstab file. Here are the specific steps:
- Open the terminal and enter the following command to get the UUID of the hard drive to be mounted:
- Identify block devices by running the command “sudo blkid”.
- Find the UUID of the hard drive that needs to be mounted and make a note of it.
- Open the file /etc/fstab for editing.
- Edit the /etc/fstab file as a superuser using the nano text editor.
- Add the following content to the end of the file (using mounting a disk named “data” as an example):
- Use the UUID of your drive and mount it at /mnt/data with NTFS file system using default settings.
- In this case, your_uuid_here is the UUID of the hard drive you have recorded, /mnt/data is the mount point where you want to mount the hard drive, ntfs is the type of file system, defaults are the default mounting options, and 0 0 indicates that default dump and fsck options are used when mounting.
- Save and close the file (press Ctrl + X, type Y to confirm saving, press Enter to exit).
- If you restart the system, the hard drive will automatically be mounted to the specified mount point during startup.
Be cautious when editing the /etc/fstab file as incorrect configurations could prevent the system from starting. It is advised to backup the /etc/fstab file before making any edits.