auto mount drive or external drive on boot ubuntu 18.04 (dual boot system)

5,869

Automounting indeed involves adding a line to the configuration file /etc/fstab. The line contains six fields, separated by a space or tab, (1) the reference to the device you want to mount (device name or reference to UUID or LABEL), (2) the mount point, i.e., the folder where the mounted device is going to appear, (3) the file system, (4) the mount options, (5) the "dump" flag and (6) the priority for file system check during startup.

In your specific case, you most likely should substitute fuseblk by the actual file system of your device. You can easily see this in the output of the terminal command sudo blkid. Look in the line for your device, in your case apparently /dev/sdb1, and see what is listed for TYPE=. That will likely be ntfs or vfat for a drive that can also be read by Windows. Substitute fuseblk by the correct file system type as given by the command.

To quickly check whether your change is successful, you do not need to reboot. You can issue a command sudo mount -a to process /etc/fstab again. If all is well, you should see no output and your device will be accessible under /media/user/Downloads.

Ubuntu actually offers a tool that allows you to set up automounting using a graphical user interface rather than the terminal. This tool is "Disks". Select the partition you want to mount, then click the gear icon. One of the menu items allows you to edit mount options.

Share:
5,869

Related videos on Youtube

Pachuca
Author by

Pachuca

Updated on September 18, 2022

Comments

  • Pachuca
    Pachuca over 1 year

    I have a dual boot system with drives that store data which I use to share between windows/linux. I want to setup an automount for these drives. I tried this to setup auto mounting on Ubuntu 18.04. After adding this line to /etc/fstab

    /dev/sdb1 /media/user/Downloads fuseblk defaults 0 2
    

    the system went into emergency mode after reboot. I used vim to delete that line and I'm back to figuring out how to handle auto mounting my hdd on boot so I don't have to do it each time.

    I used findmnt to get the file system info. this was the output:

    ├─/media/user/Downloads               /dev/sdb1      fuseblk         rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096
    

    Does anyone know how to accomplish auto mounting for dual boot systems? Is there a package I can use instead? Please let me know, thank you in advance.

  • Pachuca
    Pachuca almost 5 years
    thank you for the detailed explanation. I'll test it out as soon as I'm done installing a few things. side note I just discovered that fuseblk is not a file system, rather it's how ntfs partition is reported by the mount command.
  • Pachuca
    Pachuca almost 5 years
    tried the same line and changed fuseblk to ntfs than I had to sudo mkdir /media/user/Downloads and it worked!