12.04 - How to auto mount partition on startup in Xubuntu?

  • Bas

    I want to auto mount all my partitions on startup. This is how my /etc/fstab file looks like:

    proc    /proc   proc    nodev,noexec,nosuid     0       0
    #Entry for /dev/sda1 :
    UUID=3bf842ea-923b-43fe-b5f9-066fc920aaec       /       ext4    errors=remount-$
    #Entry for /dev/sdb1 :
    UUID=F0C859BDC8598330   /media/Bas      ntfs-3g defaults,locale=en_US.UTF-8    $
    #Entry for /dev/sda3 :
    UUID=146213A76D02F7AD   /media/sda3     ntfs-3g defaults,locale=en_US.UTF-8    $
    UUID=1C33A98704D941F1   /media/sda3     ntfs-3g defaults,locale=en_US.UTF-8    $
    #Entry for /dev/sda5 :
    UUID=ba48c631-5652-4ce7-85a3-bda96b353ca7       none    swap    sw      0      $

    The last line I added myself manually. Can anyone help me with this?

  • Answers
  • Awi

    You have duplicated lines for the same mount point /media/sda3 appears two times. Try creating a new mount point like /media/newdisk and put it in your /etc/fstab I'm taking your input as example, if /media/sda3 works, so should this line.

    UUID=1C33A98704D941F1   /media/newdisk     ntfs-3g defaults,locale=en_US.UTF-8    $

  • Related Question

    11.10 - Unable to Mount an external hard drive (NTFS)
  • Hanynowsky

    Ubuntu 11.10. When I plug my external Drive Western Digital MyPassport (500Go NTFS) I named WD. I get the following error:

    Unable to mount WD
    Error mounting: mount exited with exit code 1: helper failed with:
    mount: according to mtab, /dev/sdb1 is already mounted on /media/WD
    mount failed

    I have no problem with the internal NTFS partitions that auto-mounts on startup (ntfs-config does that).

    If I plug the WD before I boot Ubuntu, upon login, it's recognized and I can access without no problem. But if I remove it using (Safely remove) and then replug it, I get the error above.

    Here is my fstab:

    # /etc/fstab: static file system information.
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc    /proc   proc    nodev,noexec,nosuid 0   0
    #Entry for /dev/sda5 :
    UUID=24540d0f-5803-493c-ace9-e3b3c0cedb26   /   ext4    errors=remount-ro   0   1
    #Entry for /dev/sda3 :
    UUID=E4C43F7EC43F51D2   /media/OS   ntfs-3g defaults,locale=en_US.UTF-8 0   0
    #Entry for /dev/sda2 :
    UUID=6A0070F10070C61B   /media/RECOVERY ntfs-3g defaults,locale=en_US.UTF-8 0   0
    #Entry for /dev/sdb1 :
    UUID=EA6854D268549F5F   /media/WD   ntfs-3g defaults,nosuid,nodev,locale=en_US.UTF-8    0   0
    #Entry for /dev/sda6 :
    UUID=ed077c52-c50e-406c-9120-9cb6f86ec204   none    swap    sw  0   0

    Here is my mtab

    /dev/sda5 / ext4 rw,errors=remount-ro,commit=0 0 0
    proc /proc proc rw,noexec,nosuid,nodev 0 0
    sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
    fusectl /sys/fs/fuse/connections fusectl rw 0 0
    none /sys/kernel/debug debugfs rw 0 0
    none /sys/kernel/security securityfs rw 0 0
    udev /dev devtmpfs rw,mode=0755 0 0
    devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
    tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0
    none /run/lock tmpfs rw,noexec,nosuid,nodev,size=5242880 0 0
    none /run/shm tmpfs rw,nosuid,nodev 0 0
    /dev/sda3 /media/OS fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0
    /dev/sda2 /media/RECOVERY fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0
    /dev/sdb1 /media/WD fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0
    binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
    gvfs-fuse-daemon /home/hanine/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=hanine 0 0

    Appearently it cannot be mounted because upon login, it finds that it is already mounted. Some sort of conflict.

    Does anyone have a clue on how to solve this. Thanks.

  • Related Answers
  • Eliah Kagan

    You can comment out the line for /dev/sdb1 /media/WD in /etc/fstab, and let the drive use dynamic mounting. (That is, edit the file and put a # character at the beginning of the line. Then reboot.) For a drive that is being detached and reattached, that is preferable. Alternatively, you could manually unmount the drive before removing it with umount (as "Safely Remove..." is apparently not sufficient).

    When using dynamic mounting, you can easily unmount the drive just by clicking the eject icon next to its name in the left pane of any Nautilus (i.e., file browser) window.

    If you want to stick with static mounting, then remember to unmount the drive before removing it (sudo umount /media/WD).

    If you need a fix right now without rebooting, try: sudo umount /media/WD, then run sudo fdisk -l or sudo parted -l to find out the current device name of the drive, and assuming it's /dev/sdb1, run sudo mount /dev/sdb1 /media/WD ...or, run sudo rmdir /media/WD followed (without sudo) by udisks --mount /dev/sdb1.

  • Octavian Damiean

    From the bug report WarriorIng64 linked to, it sounds like some people resolved this issue by various means:


    gksudo gedit /etc/lightdm/lightdm.conf

    in a terminal, then removing the autologin-user= YOUR USERNAME line and running

    sudo shutdown -h now

    This suggestion belongs to WarriorIng64. All the credits goes to him.

    I had the same problem. Worked great for me.