LinuxQuestions.org
Have you listened to LQ Radio?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Thread Tools
Old 03-18-2008, 07:03 PM   #16
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 12,877
Thanked: 232

[Log in to get rid of this advertisement]
The "sudo" command is used to launch a program as the root user. Most likely you need to be a member of the "wheel" group to use sudo on any command. Sudo looks up whether you have permission to run a command as root by reading the /etc/sudoers file. That file should be well commented including possible an example to mount a cdrom. You may just need to uncomment that example. You could use that example to add another entry for the "eject" command as well.

To edit the /etc/sudoers file, run the "visudo" command as root. This adds error correction. If you make an error, it gives you an opportunity to fix the error or bail out altogether.

The "unhide" option is sometimes needed for some old CD discs where a part of the filesystem is marked as hidden. It may not be necessary, and it has never made a difference for me.

There is another option that is very handy. Especially for mounting removable HDs such as pen drives or external USB drives. The "noauto" that I may have mentioned already prevents a non-connected device from stalling the boot process. That entry is passed over when "mount -a" is run. The "user" and "users" option allow a regular user to mount a filesystem without needing to do so as root. For a usb FAT32 pen drives you could have the options "user,uid=<yourusername>,gid=<yourgroup>,fmask=0117,dmask=0007. The "user" option in /etc/fstab for that device will allow a normal user to mount that drive. The uid & gid options set the owner and group. The fmask and dmask option set the permissions of directories to rwxrwx--- and files to rw-rw----. If an external drive has a linux filesystem on it, chown, chgrp & chmod would be used on the mounted directory instead. This works best by using the LABEL or filesystem UUID instead of the device name in the /etc/fstab entry.

While any user could mount the device, if the fs_uuid or label of the external drive matched an entry, it would be mounted with your ownership permissions and another user on your system would not be able to cd into it if you didn't set "other" permissions allowing it.

If the external drive is normally connected, you could have a mount command in your ~/.bash_login or ~/.bash_profile script. You could have an /etc/fstab entry for an nfs or samba share as well allowing you to mount it without using "su" or "sudo". ( An nfs share could be mounted at bootup instead. The ownership of the remote filesystem would determine the ownership. )
jschiwal is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help mounting cdrw jgmyshko Fedora 7 11-16-2005 07:52 PM
Mounting firewire cdrw kohokuak Slackware 9 09-23-2004 01:47 AM
xinit fails just after Xserver start up, scsi-ide problem while mounting cdrw askjha Red Hat 0 06-03-2004 12:25 PM
xinit fails just after Xserver start up, scsi-ide problem while mounting cdrw askjha Red Hat 0 06-03-2004 10:54 AM
Problem mounting CDRW. puntme Slackware 6 07-12-2003 07:47 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration