LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Mounting windows partition (https://www.linuxquestions.org/questions/linux-general-1/mounting-windows-partition-292848/)

drguitarum2005 02-21-2005 01:16 AM

Mounting windows partition
 
I am using Gentoo with Kde 3.3.2 and have successfully mounted my existing windows partition via /mnt/windows but only as root. I am unable to access that partition as my regular user and even as root I can't seem to use xmms or mpg123 to play songs on that partition. Can anyone help me so my regular user can mount it and I can easily access all the files? Thanks!

Also, I reinstalled a program that I accidentally messed up but its the same messed up one when i launch it. How can I uninstall it (it was a normal tarball and i did make | make install etc) so I can install clean? Thanks.

musicman_ace 02-21-2005 01:36 AM

For the windows files, is it NTFS. If so, I imagine that the everyone group has to have read access to the files. XP SP2 should have removed the everyone group from files.

vharishankar 02-21-2005 01:36 AM

Just post the content of your /etc/fstab file. I'll tell you which line to modify to allow users to mount and unmount the partition.

Davidian1024 02-21-2005 01:37 AM

mount options
 
I'm not too familiar with Gentoo, but I believe I can help.

In order to grant normal users access to mounting filesystems you must specify this in /etc/fstab.

Example (my /etc/fstab):
# Begin /etc/fstab

# File system Mount-point FS-type Options Dump FSCK-order

/dev/sda1 / ext2 defaults 1 1
proc /proc proc defaults 0 0
sys /sys sysfs defaults 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
/dev/sdb1 /media/usbkey/1 vfat noauto 0 0
/dev/sdb2 /media/usbkey/2 ext2 noauto 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/dvd /media/dvd auto noauto,user 0 0
/dev/fd0 /media/floppy auto noauto 0 0

# End /etc/fstab

Note the /dev/dvd line. The fourth item is 'noauto,user'. The user option allows normal users to mount this filesystem.


The other problem you mentioned was normal users not being able to access files within that filesystem. This is probably because the mount point /mnt/windows does not have the appropriate permissions set.

vharishankar 02-21-2005 01:41 AM

No. On some systems (e.g. like BeOS and Windows > 9x), you cannot access certain files from Linux even as root because the permissions are set from the other OS.

The only way to solve it is to reboot to the other OS as administrator and set the permissions for each file you want to allow users to read and/or write.

drguitarum2005 02-21-2005 01:42 AM

Code:

# /etc/fstab: static file system information.
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:0$
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                $

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/hda1              /mnt/windows    ntfs            defaults,noatime      $
/dev/hda2              /boot          ext3            defaults,noatime      $
/dev/hda4              /              ext3            noatime                $
/dev/hda3              none            swap            sw                    $
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660        noauto,user            $
#/dev/fd0              /mnt/floppy    auto            noauto                $

# NOTE: The next line is critical for boot!
none                    /proc          proc            defaults              $

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
# Adding the following line to /etc/fstab should take care of this:

none                    /dev/shm        tmpfs          defaults


vharishankar 02-21-2005 01:47 AM

Try changing the line
Code:

/dev/hda1              /mnt/windows    ntfs            defaults,noatime
to
Code:

/dev/hda1              /mnt/windows    ntfs            user,defaults,noatime
To be able to access those files that even root cannot access, you need to change file permissions from your other OS (Windows NT/2000/XP I guess) to allow users to read and/or write.

kornerr 02-21-2005 11:24 AM

Type in console:
man mount
This will provide you with the great amout of info about NTFS,FAT32,EXT2,EXT3... partition options, access options, etc...
Mans sometimes help:cool:

drguitarum2005 02-22-2005 11:13 PM

99% of the time I seem to be able to mount it fine as root . When I use mpg123 in console to play a song on the windows partition when im root, itll usually play (well it has been lately), sometimes with a little hesitation but thats not the issue. When I am as my regular user, access is denied to me at /mnt/windows. How can my regular user access it?

Davidian1024 02-22-2005 11:22 PM

I think Harishankar was right when he said the permissions are set from the other OS. You'll have to change them from there. And I have no idea how you would do that.

drguitarum2005 02-22-2005 11:25 PM

I'll gladly try that when I figure out how to do it but isn't it weird how root can access but regular user can't? That seems like a linux issue to me

Davidian1024 02-22-2005 11:34 PM

I tried mounting my NTFS partition to see what the permissions were like. Here's an example:
Code:

total 1573468
-r--------  1 root root          0 Dec 14 03:45 AUTOEXEC.BAT
-r--------  1 root root          0 Dec 14 03:45 CONFIG.SYS
dr-x------  1 root root      4096 Dec 14 23:56 Documents and Settings
-r--------  1 root root          0 Dec 14 03:45 IO.SYS
dr-x------  1 root root          0 Dec 26 03:14 Incoming
-r--------  1 root root          0 Dec 14 03:45 MSDOS.SYS
-r--------  1 root root      34724 Dec 14 03:53 NTDETECT.COM
dr-x------  1 root root      4096 Dec 15 00:09 Program Files
dr-x------  1 root root          0 Dec 14 23:56 RECYCLER
dr-x------  1 root root          0 Dec 14 03:49 System Volume Information
dr-x------  1 root root      40960 Dec 26 03:29 WINNT
dr-x------  1 root root          0 Dec 14 04:06 WUTemp
-r--------  1 root root    150528 Jun 19  2003 arcldr.exe
-r--------  1 root root    163840 Jun 19  2003 arcsetup.exe
dr-x------  1 root root          0 Dec 26 03:42 bcd
-r--------  1 root root        192 Dec 13 22:40 boot.ini
-r--------  1 root root    214432 Dec 14 03:53 ntldr
-r--------  1 root root 1610612736 Jan 16 22:02 pagefile.sys

The R's are only set for the user who owns that file. And if you look at the owner it is root.

Davidian1024 02-22-2005 11:49 PM

I was just thinking about another possibility. NTFS is a proprietary to Microsoft. The module that comes with Linux for accessing NTFS partitions was made by kernel hackers through reverse engineering. Microsoft is not about to provide them with NTFS documentation. The NTFS module is far from complete. It just recently started providing write access to NTFS partitions, and this is extremely limited. What I'm getting at is that the linux NTFS module may simply be giving Linux some safe permissions. It may not know how to read them from the NTFS partition. You might be stuck with this the way it is. I was looking through more of my NTFS filesystem and here's what I found:

All files have this permission set: -r--------
All directories have this permission set: dr-x------
Everything's owning user and group is set to 'root'

I find it hard to believe that the permission setup in windows is so uniform.

cagey0 02-24-2005 02:30 PM

I'm having the same problem.

FAT32, to my knowledge doesn't have user access lists similar to, say NFTS, Ext2/3. Even so, I've set Shares on the root and folders
I'm interested in to no avail.

root is owner and any attempts to change access rights to the
mount point /mnt/media make no difference.

Not an answer but hopefully a useful pointer.

:scratch:

cagey0 02-24-2005 04:26 PM

Getting there.

Looks like all options must be specified at the time of reading /etc/fstab whilst booting. Has nothing to do with security settings
in windows, as previously suspected.

try:
/dev/hdb1 /mnt/media vfat user,gid=users,umask=0002 0 0

Not too sure on the mask at present (mount should hold answers when i get round to reading it ;) but comma bit as follows:

user -> allows user to mount this volume(?)
gid=users -> makes users the group owner of the mount point
umask -> does something magical i don't yet understand.

Main thing is IT WORKS!!!

:D

now just to get the damn printer working:confused:


All times are GMT -5. The time now is 12:50 PM.