6

I am asked for my password (sudo, I guess) whenever I want to mount an internal drive/partition. Why is that?

Also, its named like

/media/7013bc1d-b3a2-4df6-8c85-828ced85ef0e

How can I get something more meaningful?

2
  • In case you're a Windows user who turned to Ubuntu, the most annoying thing that most migrating users face is that partitions never auto-mount. So, in case you want them to auto-mount, you can customize fstab file located in /etc directory.
    – Kushal
    Jun 6, 2011 at 16:07
  • 3
    If you give your partition a "partition label", that will be used instead of the GUID (the ugly unique code that you see now). You can do that using GNOME Disk Utility, GParted, or the commandline.
    – JanC
    Jun 6, 2011 at 16:29

3 Answers 3

5

It depends on which method you use to mount your internal volume.

Remark: The cryptic numbers are the UUID of your volume. Every partition in the world has its own unique UUID to identify it. Using it as mount-point basically a makeshift. Developers are talking about a better algorithm to find more appropriate, human-readable mount-points involving the disk-label, size, vendor etc. We'll see, what the future brings.

Mounting is done by shell

If you're mounting partitions in a shell and you do not want to enter your password each time, you can configure sudo to run the mount and umount (for unmounting) commands without a password. This will introduce a security risk as a special crafted command can grant the user root privileges.

If you want to sacrifice security for ease of use and enable this rule, you need to edit your sudoers file. Do not edit /etc/sudoers directly, but run sudo visudo. Replace yourUser by your usernameL

yourUser ALL=(yourUser) NOPASSWD:/bin/mount,/bin/umount  # insecure!

To avoid having to type sudo, put the next line in the ~/.bashrc file:

alias mount='sudo mount'

As for the naming: Simply use another mountpoint. That can be any empty folder of your choice you have write permissions to. man mount in shell will tell you how to do that.

Mounting is done by nautilus (in gnome)

In case you are having nautilus (ubuntu's default file manager - similar to windows explorer) auto-mount the system, it's a bit trickier. You need to add the volume to your fstab. As in the shell based method you can specify a mount point there as well to get rid of the cryptic numbers. It goes like in my answer to automounting a ntfs volume with the exception, that you need to replace 'ntfs' by the actual filesystem of your volume.

So you basically just have to add a line similar to tat one to the fstab:

UUID=7258CB9858CB598D /media/win ntfs rw,auto,users,exec,nls=utf8,umask=003,gid=46,uid=1000    0   2

The users option is important to be able to mount and unmount the volume without a password query. Also gid and uid should be set right for that purpose. Note the "Don't reboot with errors" part in my link.

7
  • 1
    -1 for the allowing passwordless mounting as root, it is like giving free root access away. An evil user of the system ("user" can be an exploit abusing a bug too) can mount a folder with malicious applications on /bin or even / with arbitrary options and thereby avoiding any restrictions on file permissions and others. Allowing mount without having to enter a password or sudo is strongly discouraged. With sudo, you'd still have to think about your actions: "oh, I need root privileges, let's check the command again". mount does not always root, running mount shows all mounted fs.
    – Lekensteyn
    Jun 6, 2011 at 17:44
  • Other than that, it's a good answer, but making users system insecure without a clear warning and explanation makes me sad. Please correct that.
    – Lekensteyn
    Jun 6, 2011 at 17:45
  • Yeah sorry, I just copy&pasted mindlessly from the answer I linked. Tunrs out with shutdown it's not so much a problem as with mount. By the way I asked in chat and nobody found an error for some time.
    – con-f-use
    Jun 6, 2011 at 18:16
  • btw. next time I'd prefere a non public bashing of my person and you to propose an edit. Also: There was a warning in the other answer I linked.
    – con-f-use
    Jun 6, 2011 at 18:24
  • I tried adding UID=7013bc1d-b3a2-4df6-8c85-828ced85ef0e /labs ext4 async,auto,dev,exec,rw,users 0 2 to my /etc/fstab and every time I reboot I got a black screen ... I found out that there was errors pastie.org/2051556. can u help me decipher this?
    – Jiew Meng
    Jun 11, 2011 at 10:36
1

FS outside of your home directory does not take effect from your normal user privileges until you perform on the behalf of super user by giving password. it is only possible if you use sudo prefix.

1

I can give you a easy solution. First why did it ask for password? because your account is not root and for security reason (and also to keep your information secure and prevent loss of data) ubuntu does not auto mount other drives excluding root drive (file-system /)

If you want to auto mount all the drives then just install ntfs-config application sudo apt-get install ntfs-config

check all drives for mount and write permissions. if your are in ubuntu 11.04 then just create '/etc/hal/fdi/policy' directory first then run this application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.