Problem auto mount external hard disk

Asked by MsiaGuy

Everytime I plug in my external hard disk, it can be detected but CANNOT be mounted/ejected by the right-click menu option.

I can only manually mount/eject it by command line in terminal.
sudo -i
mount /dev/sdb1 /home/disk
sudo eject /dev/sdb1

Can anyone help me simplify the way to mount/eject it?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Andrea Corbellini
Solved:
Last query:
Last reply:
Revision history for this message
Andrea Corbellini (andrea.corbellini) said :
#1

Do you get any error message? Please paste here the output of this command:
sudo fdisk -l

Revision history for this message
MsiaGuy (hoonguan) said :
#2

Every time I plug in the USB harddisk, it shows:

Cannot mount volume
You are not privileged to mount this volume.

And then I need to manually type in the command to mount it to /home/disk

Can I make it automatic detect and mounted?

Thanks

On 8/22/07, Andrea Corbellini <email address hidden> wrote:
>
> Your question #11975 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/11975
>
> Status: Open => Needs information
>
> Andrea Corbellini requested for more information:
> Do you get any error message? Please paste here the output of this
> command:
> sudo fdisk -l
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/ubuntu/+question/11975
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Andrea Corbellini (andrea.corbellini) said :
#3

Ok, I know how to solve the problem. In /etc/fstab you should have a line that starts with this:
/dev/sdb1
Cut and paste this line to /etc/mtab. Note: if you want to mount the volume in /home/disk, be sure that after /dev/sdb1 there's /home/disk.

If you are unsure on what to do, please paste here your fstab and mtab and I will do the work for you.

Revision history for this message
MsiaGuy (hoonguan) said :
#4

Here is my ftab content:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda7
UUID=8e8524cf-6859-4894-b770-a63f727244a8 / ext3 defaults,errors=remount-ro 0 1
# /dev/sda1
UUID=443426B63426AB3E /media/sda1 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
# /dev/sda5
UUID=72F01A65F01A2FB9 /media/sda5 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
# /dev/sda6
UUID=b8db228e-c24f-9880-9ee9-cc59c515565d none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/sdb1 /home/hgcc/disk defaults 0 2

mtab content:

/dev/sda7 / ext3 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
/sys /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,noexec,nosuid,nodev,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
procbususb /proc/bus/usb usbfs rw 0 0
udev /dev tmpfs rw,mode=0755 0 0
devshm /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
lrm /lib/modules/2.6.20-16-generic/volatile tmpfs rw 0 0
/dev/sda1 /media/sda1 ntfs rw,nls=utf8,umask=007,gid=46 0 0
/dev/sda5 /media/sda5 ntfs rw,nls=utf8,umask=007,gid=46 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
/dev/sdb1 /home/hgcc/disk ext3 rw 0 0

Revision history for this message
Best Andrea Corbellini (andrea.corbellini) said :
#5

Ok, thanks. Replace the old file with the new ones. Use «sudo gedit» to save changes.

Here the new fstab:

# /etc/fstab: static file system information (I removed the last line).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda7
UUID=8e8524cf-6859-4894-b770-a63f727244a8 / ext3 defaults,errors=remount-ro 0 1
# /dev/sda1
UUID=443426B63426AB3E /media/sda1 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
# /dev/sda5
UUID=72F01A65F01A2FB9 /media/sda5 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
# /dev/sda6
UUID=b8db228e-c24f-9880-9ee9-cc59c515565d none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0

And here the new mtab (in the last line, I've changed /home/hgcc/disk to /home/disk):

/dev/sda7 / ext3 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
/sys /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,noexec,nosuid,nodev,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
procbususb /proc/bus/usb usbfs rw 0 0
udev /dev tmpfs rw,mode=0755 0 0
devshm /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
lrm /lib/modules/2.6.20-16-generic/volatile tmpfs rw 0 0
/dev/sda1 /media/sda1 ntfs rw,nls=utf8,umask=007,gid=46 0 0
/dev/sda5 /media/sda5 ntfs rw,nls=utf8,umask=007,gid=46 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
/dev/sdb1 /home/disk ext3 rw 0 0

Make sure that /home/disk exists with this command:
sudo mkdir /home/disk

Revision history for this message
MsiaGuy (hoonguan) said :
#6

Thanks Andrea Corbellini, that solved my question.

Revision history for this message
cong06 (cong06) said :
#7

what if I want to mount it to a specific directory? your solution auto-mounts to /media/disk{-n}/

Revision history for this message
Steve (stupendoussteve-deactivatedaccount) said :
#8

cong06 wrote:
> Question #11975 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/11975
>
> cong06 posted a new comment:
> what if I want to mount it to a specific directory? your solution auto-
> mounts to /media/disk{-n}/
>

You can create an entry for it in fstab. If you set a label for the
partition using a partition editor (such as gparted), it will mount to
/media/label.

Revision history for this message
cong06 (cong06) said :
#9

ok, I'm sorry. my exact question was, how do you AUTO-mount it to a specific directory. I've only seen editing fstab so it throws errors (or requires "sudo mount -a" ) or mounting to the default.
Can I change the default mount location for a specific UUID and have it automatically mount based on rules I set up?

Revision history for this message
cong06 (cong06) said :
#10

ah! I just found tune2fs, which when used correctly:
sudo tune2fs /dev/sdb1 -L uberdisk
did what I needed to.
now to figure out how to do that on fat32. I think gparted would have (and will) work for me.

Revision history for this message
cong06 (cong06) said :
#11

I meant to say, I set the label, so now when it auto-mounts, it mounts off the label.