Auto mount a disk drive in ubuntu 14.04 LTS (Bookmark directory not found)

7,116

From the output of lsblk, before and after the link starts working, it appears that your partition is not mounted automatically.

Since it is an NTFS partition (looking at the output of sudo blkid), you can make your partition automount by adding the following line to your fstab file:

/dev/sdb6 /media/angel/DOC ntfs auto
  • If it does not exist already, create the directory to mount into:

    sudo mkdir /media/angel/DOC
    
  • Open the fstab file:

    gksu gedit /etc/fstab
    

    (you might have to install gksu first)

    and add the line:

    /dev/sdb6 /media/angel/DOC ntfs auto
    

    at the end of the file, save the changes.

  • Test your new entry by the command:

    sudo mount -a
    
Share:
7,116

Related videos on Youtube

Mostafiz Rahman
Author by

Mostafiz Rahman

Updated on September 18, 2022

Comments

  • Mostafiz Rahman
    Mostafiz Rahman over 1 year

    I'm using ubuntu 14.04 LTS. When I start my pc and click on any bookmark from the file manager it shows this error:

    Unable to find the requested file. Please check the spelling and try again.
    Unhandled error message: Error when getting information for file '/media/angel/DOC/edu': No such file or directory
    

    But when I open DOC drive and again clink on the same bookmark it works properly. Can anybody tell me why is this happening and how to solve this issue?

    Edit: Output of lsblk is following: (ubuntu is installed in sda5)

    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda      8:0    0 119.2G  0 disk 
    ├─sda1   8:1    0  91.3G  0 part 
    ├─sda2   8:2    0     1K  0 part 
    ├─sda5   8:5    0  24.1G  0 part /
    └─sda6   8:6    0   3.8G  0 part [SWAP]
    sdb      8:16   0 465.8G  0 disk 
    ├─sdb1   8:17   0  93.2G  0 part 
    ├─sdb2   8:18   0     1K  0 part 
    ├─sdb5   8:21   0  93.2G  0 part 
    ├─sdb6   8:22   0  89.3G  0 part 
    ├─sdb7   8:23   0  93.2G  0 part 
    ├─sdb8   8:24   0  93.2G  0 part 
    └─sdb9   8:25   0   3.8G  0 part 
    sr0     11:0    1  1024M  0 rom  
    

    After opening the disk drive the output of lsblk is bellow:

    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda      8:0    0 119.2G  0 disk 
    ├─sda1   8:1    0  91.3G  0 part 
    ├─sda2   8:2    0     1K  0 part 
    ├─sda5   8:5    0  24.1G  0 part /
    └─sda6   8:6    0   3.8G  0 part [SWAP]
    sdb      8:16   0 465.8G  0 disk 
    ├─sdb1   8:17   0  93.2G  0 part 
    ├─sdb2   8:18   0     1K  0 part 
    ├─sdb5   8:21   0  93.2G  0 part 
    ├─sdb6   8:22   0  89.3G  0 part /media/angel/DOC
    ├─sdb7   8:23   0  93.2G  0 part 
    ├─sdb8   8:24   0  93.2G  0 part 
    └─sdb9   8:25   0   3.8G  0 part 
    sr0     11:0    1  1024M  0 rom
    

    The output of sudo blkid gives the following information about sdb6:

    /dev/sdb6: LABEL="DOC" UUID="04280A22280A12FA" TYPE="ntfs"
    
  • Eka
    Eka about 9 years
    I am also facing the same problem as @mostafiz . what is angel? while making a new directory i am getting this error mkdir: cannot create directory ‘/media/angel/DOC’: No such file or directory . If we have more than one ntfs drive do we have to add those to the fstab.. eg /dev/sdb6 /media/angel/DOC ntfs auto ; /dev/sdb5 /media/angel/DOC ntfs auto etc
  • Jacob Vlijm
    Jacob Vlijm about 9 years
    @Eka You will probably not have the directory /media/angel/, so you cannot create the directory /Doc inside it :). You'd probably have enough to use /media/<mountpoint_name> (without the subdirectory /angel/Doc, I assume angel is his name). For every partition, indeed you need to have a separate line in the /etc/fstab file.
  • Jacob Vlijm
    Jacob Vlijm about 9 years
    @Eka not needed in this case, but if you need to create a new directory inside another directory that not yet exists (create directories recursively), you need to use the -poption. e.g. to create directorie(s) /media/monkey/eats/banana inside an empty folder /media: sudo mkdir -p /media/monkey/eats/banana.
  • Eka
    Eka about 9 years
    So i have tried your method and its able to mount drives but some how i cant open bookmarked folder (laucher file manager icon) without manually mounting the drives by clicking on it.
  • Jacob Vlijm
    Jacob Vlijm about 9 years
    Could you test restarting and run lsblk to see if the drive is mounted? If not can you run sudo mount -a to see what is wrong? I am pretty sure the drive is not mounted automatically, it will show nevertheless in the devices section when it is in /etc/fstab :)
  • Eka
    Eka about 9 years
    k i will try that and let you know
  • Eka
    Eka about 9 years
    sorry for the late reply but was working in ubuntu so had to wait to complete my work. I have restarted my system and a lsblk check showed that the disk is mounted after a fresh restart and sudo mount -a didnt showed any results
  • Jacob Vlijm
    Jacob Vlijm about 9 years
    @Eka You might have to recreate the bookmarks. Probably its path has changed.
  • Eka
    Eka about 9 years
    Hey thanks..you are correct it was due to the change in path. I once again made a new bookmark of the folder and after restart its working perfectly. Once more thanks for your help
  • Jacob Vlijm
    Jacob Vlijm about 9 years
    @Eka let's say I have a bookmark to a folder on a mounted volume /media/mountfolder/path/to/folder. The mountpoint is /media/mountfolder/. Now when you add it to your /etc/fstab file, this mountpoint will be different although the foldername is the same. The full path to the folder will nevertheless be different. What you probably need to do is remove the bookmarks in question and recreate them.
  • wjandrea
    wjandrea over 5 years
    /dev/sda1 is a device, not a directory, so part of this answer is unclear.