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:

  1. Open the terminal and enter the following command to get the UUID of the hard drive to be mounted:
  2. Identify block devices by running the command “sudo blkid”.
  3. Find the UUID of the hard drive that needs to be mounted and make a note of it.
  4. Open the file /etc/fstab for editing.
  5. Edit the /etc/fstab file as a superuser using the nano text editor.
  6. Add the following content to the end of the file (using mounting a disk named “data” as an example):
  7. Use the UUID of your drive and mount it at /mnt/data with NTFS file system using default settings.
  8. 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.
  9. Save and close the file (press Ctrl + X, type Y to confirm saving, press Enter to exit).
  10. 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.

bannerAds