LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Auto mount external USB hard drive (https://www.linuxquestions.org/questions/linux-newbie-8/auto-mount-external-usb-hard-drive-4175429819/)

donmaz 10-01-2012 02:22 AM

Auto mount external USB hard drive
 
My main hard drive has Win7 installed but has a partition for VirtualBox within which I have Ubuntu 12.4 installed. I have an external USB hard drive which I need to access from either Win7 or Ubuntu. It is identified as sdb5 in Ubuntu.

In an old setup I had a few years ago the USB drive mounted automatically but with the current setup I have to mount it manually. My /etc/fstab file looks like this:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=3283e77f-ee9c-4b88-b6a0-d34da1de1a5b / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=053d29cf-dde7-4835-a9de-9a520543df67 none swap sw 0 0
/dev/sdb5 /media/sdb5 ntfs nls=iso8859-1,umask=000 0 0
# UUID=01CCDCCBAE468230 /mount/sdb5 ntfs-3g defaults 0 0

I can mount the drive manually with "sudo mount -a" but would like to have the drive mounted automatically the way it used to in my old setup.

I've tried changes to the bottom line with "auto" and with "force" but nothing seems to achieve what I want.

Any advice would be appreciated.

donmaz

jv2112 10-01-2012 05:37 AM

https://help.ubuntu.com/community/Mount/USB

Quote:

To control which programs automatically start when you plug in a device, go to System-Settings - Details - Removable Media.


donmaz 10-01-2012 05:11 PM

Thanks jv2112 for your reply. I had seen the content of my conf-editor previously and couldn't work out what needed to be changed if anything. The details are as follows:

file:///home/don/Pictures/Screenshot%20from%202012-10-02%2006:39:47.png

(I don't know if this will open but automount and automount-open are both ticked, autorun-never is unticked, and of the autorun-x-content boxes the only one with content is the bottom one which has "x-content/software" in the box. If any need to be changed I can't see how to change them.)

I read the article "UsbDriveDoSomethingHowTo" and it is too complex for me.

donmaz

jv2112 10-02-2012 05:22 AM

You never uploaded the image.

donmaz 10-02-2012 05:31 PM

1 Attachment(s)
Thanks jv2112 I was afraid of that so I tried to give a description. I think I've got it right this time with file "Screenshot-Configuration Editor.png".

donmaz

jv2112 10-03-2012 05:27 AM

That is strange. It should work. Please post the output of the command below just after inserting the USB drive.

Code:


sudo tail -n 15 /var/log/messages.log


donmaz 10-03-2012 05:08 PM

The output from that command is:

don@don-VirtualBox:~$ sudo mount /dev/sdb5 /media/sdb5
[sudo] password for don:
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.
don@don-VirtualBox:~$ sudo tail -n 15 /var/log/messages.log
tail: cannot open `/var/log/messages.log' for reading: No such file or directory
don@don-VirtualBox:~$

I then had a look for a file which had recently been written to and which might be of help to you and found "syslog" might be helpful so I ran the same command for it:

don@don-VirtualBox:~$ sudo mount /dev/sdb5 /media/sdb5
[sudo] password for don:
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.
don@don-VirtualBox:~$ sudo tail -n 15 /var/log/syslog
Oct 4 06:57:12 don-VirtualBox kernel: [ 189.295748] sd 3:0:0:0: [sdb] Mode Sense: 23 00 00 00
Oct 4 06:57:12 don-VirtualBox kernel: [ 189.304920] sd 3:0:0:0: [sdb] No Caching mode page present
Oct 4 06:57:12 don-VirtualBox kernel: [ 189.304927] sd 3:0:0:0: [sdb] Assuming drive cache: write through
Oct 4 06:57:12 don-VirtualBox kernel: [ 189.338025] sd 3:0:0:0: [sdb] No Caching mode page present
Oct 4 06:57:12 don-VirtualBox kernel: [ 189.338032] sd 3:0:0:0: [sdb] Assuming drive cache: write through
Oct 4 06:57:12 don-VirtualBox kernel: [ 189.411503] sdb: sdb1 < sdb5 >
Oct 4 06:57:13 don-VirtualBox ata_id[2069]: HDIO_GET_IDENTITY failed for '/dev/sdb': Invalid argument
Oct 4 06:57:13 don-VirtualBox kernel: [ 189.479565] sd 3:0:0:0: [sdb] No Caching mode page present
Oct 4 06:57:13 don-VirtualBox kernel: [ 189.479569] sd 3:0:0:0: [sdb] Assuming drive cache: write through
Oct 4 06:57:13 don-VirtualBox kernel: [ 189.479571] sd 3:0:0:0: [sdb] Attached SCSI disk
Oct 4 06:58:06 don-VirtualBox ntfs-3g[2151]: Version 2012.1.15AR.1 external FUSE 28
Oct 4 06:58:06 don-VirtualBox ntfs-3g[2151]: Mounted /dev/sdb5 (Read-Write, label "ExtHDD", NTFS 3.1)
Oct 4 06:58:06 don-VirtualBox ntfs-3g[2151]: Cmdline options: rw
Oct 4 06:58:06 don-VirtualBox ntfs-3g[2151]: Mount options: rw,allow_other,nonempty,relatime,fsname=/dev/sdb5,blkdev,blksize=4096
Oct 4 06:58:06 don-VirtualBox ntfs-3g[2151]: Ownership and permissions disabled, configuration type 7
don@don-VirtualBox:~$

I don't know if this is of any use to you or not.

donmaz


All times are GMT -5. The time now is 11:55 AM.