LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-30-2003, 10:50 AM   #16
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64

Pulled out the man for ya, here's the terminology it uses:
Code:
 uid=value and gid=value
              Set  the  owner  and group of the files in the file
              system (default: uid=gid=0).
HTH

Cool
 
Old 06-30-2003, 03:25 PM   #17
linuus
LQ Newbie
 
Registered: Jun 2003
Distribution: Redhat 8 with kde 3.1.1
Posts: 4

Rep: Reputation: 0
DOH. Thanks
 
Old 06-30-2003, 03:53 PM   #18
ironz
Member
 
Registered: Jun 2003
Location: Montréal, Québec
Distribution: red hat 9
Posts: 84

Original Poster
Rep: Reputation: 15
thx
 
Old 07-01-2003, 04:41 AM   #19
Thoddy
Member
 
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106

Rep: Reputation: 15
Wink

Quote:
Originally posted by MasterC
It specifies that the drive is mounted as owner user, check your /etc/passwd file and see which user is uid500

Similar with gid in /etc/group

Cool
Hi master,

I do not have problems mounting my vfat partition, works as always... but I have a security question: is it possible to set rights when mounting -- i.e. not only setting UID and GID but also do something like chmod -R o-rwx *, which of course does not work on vfat partitions... but are there possibilities to set this when mounting???

I am asking because I gave accounts to my computer to sime frineds and they should not be able to see my vfat partition...
 
Old 07-01-2003, 05:41 AM   #20
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Sure, assuming you only want root to see it (you could do this several ways...) you can use:
/dev/blah /mnt/blah vfat users,uid=500,gid=500,umask=077,rw 0 0

However, that would be pointless. A better way:
Assuming your "friends" are in group users, and you don't want them to be able to see it, simply mount with:
/dev/hdx /mnt/blah vfat defaults,uid=0,gid=0,umask=077,rw 0 0

This would only allow root to see it. Now if you had these same users in a specific group, and maybe you and a "special" user in another "special" group, say, l33t is the group name, and the gid for that group is 200, then:
/dev/hdx /mnt/whatever vfat users,noexec,uid=0,gid=200,umask=007,rw 0 0

This would be ideal. Then, only root and the users that you have in group "l33t" with the gid of 200 would be able to do things on this drive. The umask of 0 is equal to a chmod of 7, and the opposite for 7. If you wanted other things, such as to give them write access, but no read (there are times when this could be valuable...) simply choose the correct umask, which is proportional to the chmod equivilent:
7=0
6=1
5=2
and so on.



Cool
 
Old 07-01-2003, 06:43 AM   #21
Thoddy
Member
 
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106

Rep: Reputation: 15
Quote:
Originally posted by MasterC
Now if you had these same users in a specific group, and maybe you and a "special" user in another "special" group, say, l33t is the group name, and the gid for that group is 200, then:
/dev/hdx /mnt/whatever vfat users,noexec,uid=0,gid=200,umask=007,rw 0 0
This really seems to be ideal - then I can mount as user=myself (UID500) and give me rw access and for a special group (e.g. l33t ) only r access...

Should be:
/dev/hdx /mnt/whatever vfat noexec,uid=500,gid=200,umask=027,rw 0 0

This seems to be it
I'll try when I'm at home in the evening and let you know!


P.S.: what exactly does the "users" do? Does this have something to do with the group or does it allow (non-root) users to mount the partition??

Last edited by Thoddy; 07-01-2003 at 06:44 AM.
 
Old 07-01-2003, 10:19 AM   #22
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Users allows non-root users to mount the partition, so if you are going with the above fstab, then that is exactly what you want. If you are going with only root access, then you'd remove that.



Cool
 
Old 07-01-2003, 11:14 AM   #23
Thoddy
Member
 
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106

Rep: Reputation: 15
Quote:
Originally posted by MasterC
Users allows non-root users to mount the partition, so if you are going with the above fstab, then that is exactly what you want.
Thanx Dude! - This rocks!
Now my private stuff cannot be seen by others anymore!
 
Old 07-01-2003, 11:24 AM   #24
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
That's great

As I'm sure you know:
"Security by obscurity is no security at all" However, you are also secure from the permissions you've placed, so it's not obscurity alone, and therefore is slightly... OK

If you really wanted to get crazy with it you could look into mounting it elsewhere, such as inside your users home directory, this would also keep them from being able to access it, and of course, allow you to.



Cool
 
Old 07-23-2003, 09:52 PM   #25
Becker004
LQ Newbie
 
Registered: Jul 2003
Posts: 8

Rep: Reputation: 0
Quote:
Originally posted by MasterC
I'd try mounting it first to help with defining possible errors:
mount -t vfat /dev/hdx /mnt/point -o user,rw,exec,uid=500
Where /dev/hdx is the actual device
and
/mnt/point
is a mount point of your choice, maybe:
/mnt/fat32

Make sure that directory exists first:
mkdir /mnt/fat32 (or whatever you choose)

If all mounts well, and acts as expected, then proceed to edit your fstab as shown above.

Cool
Sorry,
But how do i tell which is the device. i have windows xp on my c drive and my f drive is the fat32.
Thank you for the help.
 
Old 07-23-2003, 10:04 PM   #26
Becker004
LQ Newbie
 
Registered: Jul 2003
Posts: 8

Rep: Reputation: 0
Quote:
Originally posted by Becker004
Sorry,
But how do i tell which is the device. i have windows xp on my c drive and my f drive is the fat32.
Thank you for the help.
Hey, i figured out my number! it was 4! But i get an error:!

my command: mount -t vfat /dev/hda4 /mnt/fat32 -o user,rw,exec,uid=500

mount: wrong fs type, bad option, bad superblock on /dev/hda4,
or too many mounted file systems
(aren't you trying to mount an extended partition,
instead of some logical partition inside?)


Any clues?
 
Old 07-24-2003, 02:18 AM   #27
Thoddy
Member
 
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106

Rep: Reputation: 15
Quote:
Originally posted by Becker004
Sorry,
But how do i tell which is the device. i have windows xp on my c drive and my f drive is the fat32.
Thank you for the help.
What kind of distribution do you use? In RedHat e.g. there is the Disk Druid for partitioning that can tell you...

I am not too sure, but can't a hard disk only have three primary partisions? Then the 4 would be reserved for the extended partition and the first logical partition in there would have the number 5!

As already mentioned - I am not too sure but you should give it a try. At least I remember from my own experience...

Thoddy
 
Old 07-24-2003, 04:27 AM   #28
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Depends...

You can have 4 primary partitions but this means you will be able to have 0 extended/logical partitions; because there has to be a primary partition to use to create the extended which will contain the logical partition.

If you look at:
fdisk -l (FDISK -L lowercase) or /sbin/fdisk -l (as root) if /sbin isn't in your PATH, then it will usually describe your disk geometry to you. If there are more than 4 entries, you have a logical (likely). It's then that you need to try a different partition, such as /dev/hda5 (which is likely if your extended is the last primary).

Cool
 
Old 07-24-2003, 05:43 AM   #29
Becker004
LQ Newbie
 
Registered: Jul 2003
Posts: 8

Rep: Reputation: 0
fdisk -l

I used fdisk -l
Disk /dev/hda: 255 heads, 63 sectors, 2498 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 4 32098+ de Dell Utility
/dev/hda2 * 5 1796 14394240 7 HPFS/NTFS
/dev/hda3 1797 1809 104422+ 83 Linux
/dev/hda4 1810 2498 5534392+ f Win95 Ext'd (LBA)
/dev/hda5 1810 2433 5012248+ 83 Linux
/dev/hda6 2434 2498 522081 82 Linux swap

Disk /dev/hdb: 255 heads, 63 sectors, 4866 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 4866 39086113+ c Win95 FAT32 (LBA)



The device i want to mount is HDA4.
 
Old 07-24-2003, 05:46 AM   #30
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
hda4 is an extended partition, it's shown there just to show you that it's there. The partitions hda4 is containing as logical partitions are hda5 and hda6 (hda6 is swap though). So if you want to mount hda4 in actuality you want to mount hda5 because that is the only usable partition in the hda4 extended partition.

Extended partitions aren't really partitions that you mount, they are like garages. You part your logical partititions inside the extended ones. You don't use/drive a extended partition/garage but you do use/drive a logical/car

If that helps at all

Cool
 
  


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
How to format to FAT32, and how to mount my FAT32 partition. bonniehandi Linux - Newbie 16 03-05-2006 07:54 PM
external corrupt hdd -> formating to fat32 bobbens Linux - Software 7 01-01-2005 07:50 AM
How to format & mount 2nd hdd after FedCor1 has been installed on 1st hdd? clay394 Fedora 1 05-18-2004 01:50 PM
Problem formatting HDD with FAT32 rafi112 Linux - Newbie 5 02-19-2004 01:30 PM
Fat32 HDD mount problem. L3go1as Linux - Newbie 12 02-02-2004 12:57 PM


All times are GMT -5. The time now is 09:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration