LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > 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
  Search this Thread
Old 09-11-2003, 11:56 PM   #1
BlandoCal
Member
 
Registered: Sep 2003
Location: Ames, IA
Distribution: Fedora Core 3
Posts: 92

Rep: Reputation: 15
Post Mounting Drives


I am running Redhat9 and I have 2 hard drives on my computer and I am trying to mount the partitions on my other hard drive so that a user other than root can have read/write/execute access to the mounted drive. I have succeeded in mounting the partitions w/ read/write/execute access for my other user, however it puts the drives on the desktop and I can't figure out how to move them, hide them, or make it so it doens't do that. Any suggestions welcome. Thanks in advance.
 
Old 09-12-2003, 01:06 AM   #2
croakofonix
LQ Newbie
 
Registered: May 2003
Location: Melbourne, Victoria, Australia
Distribution: RH9.0, Fedora Core 1, Fedora Core 2
Posts: 19

Rep: Reputation: 0
BlandoCal,

You'll need to play around with the "dreaded" command line for this.

Go to the command line either using Ctrl+Alt+F1 or open the Konsole. Use fdisk -l to see a listing of the available partitions. Note down the partition that you wish to mount, eg. hda1,hdb1,etc.
Then open the /etc/fstab either thru vi or some other editor. At the end, add a line as :
Suppose you wish to mount the hdb2 partition and the partition type is FAT32.
/dev/hdb2.
Use Tab(s) to get to the next column. Provide the mount point here.
/mnt/drivename.
Use Tab(s) to get to the next column. Provide the file system type here.
vfat
Use Tab(s) to get to the next column.
0 0
Press return.
Save the file and exit.
Go the the /mnt folder and create a directory here using
mkdir drivename
Whenever u wish to mount the drive, simple give the command mount /mnt/drivename

Hope that helps.

-Akshar
 
Old 09-12-2003, 08:14 AM   #3
BlandoCal
Member
 
Registered: Sep 2003
Location: Ames, IA
Distribution: Fedora Core 3
Posts: 92

Original Poster
Rep: Reputation: 15
Thanks for the Advice croakofonix

Yea that's basically how I did it originally, by putting it in the fstab file the way I did, it mounts automatically at startup, instead of haivng to type the mount command whenever I want to access the partitions, but the problem i was having was when I had it mount auto in the fstab file it placed the mounted harddrives on the desktop. Basically I would like to know if there was a way to take them off the desktop and still have read/write/execute access w/ my user (not root). At work we have to have about 8 drives mapped for some programs to work and we need to have read/write/execute to all drives, when I mapped them and gave them full permissions it puts all 8 on the desktop. I was hoping by figureing out how to do this @ home I could apply that knowledge to make it work at work. Does that make sense? Here's what my fstab file looks like for home.

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda5 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom1 /mnt/cdrom1 udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hdb5 /mnt/hdb5 vfat noauto,user,uid=500,gid=500 0 0
/dev/hdb6 /mnt/hdb6 vfat user,uid=500,gid=500 0 0
/dev/hdb7 /mnt/hdb7 vfat user,uid=500,gid=500 0 0

Thanks again.
 
Old 09-12-2003, 08:56 AM   #4
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
To make a vfat partition read/write/execute, use the umask option.
For example, to give full access:
Code:
/dev/hdb6 /mnt/hdb6 vfat defaults,umask=000 0 0
To only allow members of the admin group.
Code:
/dev/hdb6 /mnt/hdb6 vfat defaults,uid=admin,gid=admin,umask=022 0 0
 
Old 09-12-2003, 07:29 PM   #5
BlandoCal
Member
 
Registered: Sep 2003
Location: Ames, IA
Distribution: Fedora Core 3
Posts: 92

Original Poster
Rep: Reputation: 15
Thanks alot Mathieu you are the man. It worked just the way I wanted it to. Do you think that will work for mounting network drives? Or will I have to supply username and password for that? Example:

//SERVER/cdrive /mnt/smb/SERVER/cdrive ??????????
 
Old 09-12-2003, 08:35 PM   #6
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Yes, you can mount a network share by adding it to the fstab.
It can look something like this:
Code:
//SERVER/cdrive /mnt/smb/SERVER/cdrive smbfs user,uid=admin,gid=admin,username=username,password=password 0 0
For more information on the options, take a look at the MAN pages for smbmount and mount.

Last edited by Mathieu; 09-12-2003 at 08:37 PM.
 
Old 09-12-2003, 08:46 PM   #7
BlandoCal
Member
 
Registered: Sep 2003
Location: Ames, IA
Distribution: Fedora Core 3
Posts: 92

Original Poster
Rep: Reputation: 15
sweet, I'll try that @ work tomorrow, thanx again Mathieu
 
Old 09-13-2003, 05:57 PM   #8
blop
Member
 
Registered: Sep 2003
Distribution: testing Mandrake and Suse + ?
Posts: 57

Rep: Reputation: 15
Hi guys......i have looked at the post and tried what was surggested.........but its says the fdisk command is not recognised!!

Anything else i can do to mount a drive...

"""[user@p3800mhz user]$ fdisk
bash: fdisk: command not found
[user@p3800mhz user]$ fdisk
bash: fdisk: command not found
[user@p3800mhz user]$"""
 
Old 09-13-2003, 06:05 PM   #9
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
the fdisk command is located in the /sbin/ folder and you have to be root to run it, so first i see your not logged in as root, so type:
su -
and then your root password and then run fdisk
if it still says command not found then that means that /sbin is not in your PATH and you will have to specify the whole command like so ::
/sbin/fdisk
which will then give you the output your looking for...
 
Old 09-13-2003, 06:05 PM   #10
BlandoCal
Member
 
Registered: Sep 2003
Location: Ames, IA
Distribution: Fedora Core 3
Posts: 92

Original Poster
Rep: Reputation: 15
hmm, can you post your fstab file?
 
Old 09-13-2003, 06:05 PM   #11
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Only root is allowed to use the fdisk command.

To quickly login as root, type:
Code:
su -
-----
Edit: Triple post... same time...

Last edited by Mathieu; 09-13-2003 at 06:07 PM.
 
Old 09-13-2003, 06:06 PM   #12
BlandoCal
Member
 
Registered: Sep 2003
Location: Ames, IA
Distribution: Fedora Core 3
Posts: 92

Original Poster
Rep: Reputation: 15
oops didn't even notice he wasn't logged in as root
 
Old 09-13-2003, 06:10 PM   #13
BlandoCal
Member
 
Registered: Sep 2003
Location: Ames, IA
Distribution: Fedora Core 3
Posts: 92

Original Poster
Rep: Reputation: 15
the command you were doing was fdisk, which is a windows command, you'll need to change the fstab file to mount drives.
to mount the drive you need to go to the directory /etc
there is a file in there called fstab, you need to edit that file to have drives mounted on boot, i believe after you change the fstab file you can mount the mount points you changed by doing the command:

mount -a

but i'm not entirely sure on that. Example of my fstab file:

#device #mount-point #file-system # options

/dev/hdb5 /mnt/hdb5 vfat defaults,umask=000 0 0
/dev/hdb6 /mnt/hdb6 vfat defaults,umask=000 0 0
/dev/hdb7 /mnt/hdb7 vfat defaults,umask=000 0 0


Last edited by BlandoCal; 09-13-2003 at 06:17 PM.
 
Old 09-13-2003, 06:16 PM   #14
blop
Member
 
Registered: Sep 2003
Distribution: testing Mandrake and Suse + ?
Posts: 57

Rep: Reputation: 15
Yea! ok /sbin/fdisk -l gave me:

[root@p3800mhz user]# /sbin/fdisk -l

Disk /dev/hdc: 4311 MB, 4311465984 bytes
16 heads, 63 sectors/track, 8354 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System

Disk /dev/hdd: 6488 MB, 6488294400 bytes
255 heads, 63 sectors/track, 788 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 1 788 6329578+ 83 Linux

Disk /dev/hda: 17.4 GB, 17410498560 bytes
255 heads, 63 sectors/track, 2116 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 1 8001 df BootIt
/dev/hda2 * 2 13 96390 83 Linux
/dev/hda3 14 1287 10233405 83 Linux
/dev/hda4 1288 1351 514080 82 Linux swap
[root@p3800mhz user]#
 
Old 09-13-2003, 06:17 PM   #15
blop
Member
 
Registered: Sep 2003
Distribution: testing Mandrake and Suse + ?
Posts: 57

Rep: Reputation: 15
although its not correct......i think iam making things difficult by using bootitng
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Mounting Drives JediDB MEPIS 15 08-03-2005 04:50 PM
Mounting Drives anjum Linux - Software 3 07-29-2005 12:12 AM
Help in Mounting my cd drives coderasm Linux - Newbie 3 12-06-2004 05:52 AM
mounting my drives mark alan Fedora 7 12-05-2004 08:52 PM
Mounting mounting extended partition and its Logical drives desbyleo Linux - Newbie 10 02-18-2002 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:59 AM.

Main Menu
Advertisement
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
Twitter: @linuxquestions
Open Source Consulting | Domain Registration