LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-06-2003, 02:06 AM   #1
aiims1777
Member
 
Registered: Oct 2003
Location: India
Distribution: Kubuntu Dapper Drake, Edgy Eft;Red Hat Linux 9 Personal Edition
Posts: 39

Rep: Reputation: 15
Cool copying files from linux to windows partition as user


I have my windows partition mounted automatically at /mnt/Windows as I had made the appropriate entry in my fstab.
When logged on as a user, I can see and open the files on this partition in Nautilus but I can't move or copy files between linux and windows with a message saying "you do not have the permission to do this"
I can do it when logged on as root.
I changed the user permission for /mnt/Windows to rwx for user and in my fstab entry for this mount point user is included. but it still does not wok.
Any suggestions? Thanks.
 
Old 11-06-2003, 02:54 AM   #2
Mitchell
LQ Newbie
 
Registered: Nov 2003
Posts: 9

Rep: Reputation: 0
I had this same problem with windows and redhat 9, I don't know exactly why this worked but it did, ok so my c:\ drive was mounted on /dev/hda1 and my d:\ drive
was mounted /dev/hda5, you can find out what your drives are mounted under by entering "less /etc/fstab" on the command line, this is assuming your fstab file is located in the /etc directory if not try entering "locate fstab" on the command line. Ok so when I need to write stuff from linux to the drives, At the command line I log in as root or "su" to root and unmount those two drives using umount /dev/hda1 and then again with umount /dev/hda5 then I "exit" the root account or log off from the root account, now as the given user who is wishing to write to the drive, I mount the two drives by entering mount /dev/hda1 and then again with mount /dev/hda5. I can now write or copy whatever information to the drives. You only have to this once for a session meaning that if you log out and reboot you will have to enter this again the next time you wish to write to the drives again, maybe someone could write a script! anyways I hope that this works for you and is helpful!
 
Old 11-06-2003, 03:11 AM   #3
Y0jiMb0
Member
 
Registered: Jul 2003
Location: Valencia (Spain)
Distribution: slackware 11, FEDORA CORE 4, RHEL3, Gentoo...
Posts: 361

Rep: Reputation: 30
Hi!
I don't know if it helps, but what I did was to write in '/etc/fstab' a line like
Code:
/dev/hda1 /mnt/windows vfat rw,suid,dev,exec,auto,uid=501,gid=501,umask=002,async 0 0
where the uid and gid numbers are those of your user.
Anyway, check 'man mount', under 'FILESYSTEM SPECIFIC MOUNT OPTIONS' section and then under 'Mount options for fat' subsection.
Regards
 
Old 11-06-2003, 03:56 AM   #4
x4n0b1
Member
 
Registered: Oct 2003
Posts: 43

Rep: Reputation: 15
Quote:
Originally posted by Y0jiMb0
Hi!
I don't know if it helps, but what I did was to write in '/etc/fstab' a line like
Code:
/dev/hda1 /mnt/windows vfat rw,suid,dev,exec,auto,uid=501,gid=501,umask=002,async 0 0
where the uid and gid numbers are those of your user.
Anyway, check 'man mount', under 'FILESYSTEM SPECIFIC MOUNT OPTIONS' section and then under 'Mount options for fat' subsection.
Regards
that's seems a gentle solution rather than just 'su' ing every time i need to write/read to win partition... i'll try on my box
 
Old 11-06-2003, 04:21 AM   #5
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
If its a FAT32 filesystem try these options in the 4th field of the relevant /etc/fstab line

umask=000,defaults

ie - something like:(substitute in your partition name)

/dev/hda1 /mnt/windows vfat umask=000,defaults 0 0
 
Old 11-06-2003, 07:35 AM   #6
WindowsBurner
Member
 
Registered: Nov 2003
Location: In chaos
Distribution: OpenSuse
Posts: 293

Rep: Reputation: 30
Question

I was wondering if anyone knows how to copy files to a windowsXp(NTFS)
drive other than emailing them?

If you want me to write the script you asked for then just sat so and I will
 
Old 11-07-2003, 03:54 AM   #7
aiims1777
Member
 
Registered: Oct 2003
Location: India
Distribution: Kubuntu Dapper Drake, Edgy Eft;Red Hat Linux 9 Personal Edition
Posts: 39

Original Poster
Rep: Reputation: 15
Problem solved!
Thanks to Skyline.
Adding umask=000 to the line in my fstab worked. The line now reads
/dev/hda1 /mnt/Windows vfat auto,user,owner,umask=000 0 0
Now when I log on as a user my windows partition (hda1) is loaded and an icon appears on my desktop for it. I can,as a user,move files to and from windows.
Mitchell,you may find this a simpler method.
 
Old 11-07-2003, 04:51 AM   #8
codec
Member
 
Registered: Sep 2003
Location: mad.es.eu
Distribution: ubuntu 5.04 knoppix Slack91/10 freebsd51 vector4 redhat9
Posts: 304

Rep: Reputation: 30
I use umask=007 instead, I don't want my sister touching my HDD
 
Old 11-12-2003, 04:21 PM   #9
linuxfond
Member
 
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Rep: Reputation: 30
Quote:
Originally posted by aiims1777
Problem solved!
Thanks to Skyline.
Adding umask=000 to the line in my fstab worked. The line now reads
/dev/hda1 /mnt/Windows vfat auto,user,owner,umask=000 0 0
Now when I log on as a user my windows partition (hda1) is loaded and an icon appears on my desktop for it. I can,as a user,move files to and from windows.
.
I have done exactly the same. An icon appear but I can move any files. What's up?
 
Old 11-12-2003, 05:01 PM   #10
Mitchell
LQ Newbie
 
Registered: Nov 2003
Posts: 9

Rep: Reputation: 0
Thanxs aiims1777 your right! much easier that's for sure, I sure feel dumb with my previous post, buy hey it worked for what it's worth, but I have to agree that this is the most efficient way to do this, Thanks to all who posted!. While I'am here I'll think I will ask a question, I know kind of what the umask stuff is all about, correct me if Iam wrong but is it not kind of like a template for permissions, so when files are created on the file system they will be set with permissions based on the umask? and if this is right, what would be the best set of permission for the drive? I have noticed some debate here on whether to use 000, 002, or 007.
 
Old 11-13-2003, 01:31 AM   #11
aiims1777
Member
 
Registered: Oct 2003
Location: India
Distribution: Kubuntu Dapper Drake, Edgy Eft;Red Hat Linux 9 Personal Edition
Posts: 39

Original Poster
Rep: Reputation: 15
Mitchell,
I discovered the meaning of these numbers after umask.Linux sets permissions for three sets of people as follows
owner r read (400) w write (200) x execute(100)
group r read (40) w write (20) x execute(10)
others r read (4) w write (2) x execute(1)
The number you specify with umask= sets these permissions
000 all get rwx permissions
007 owner and group get rwx others get none.
How this works is this : To exclude permissions you add up the numbers assigned to the permissions and set that as umask=
Thus umask=077 gives rwx to owner and no permissions to group(40+20+10=70) or others (4+2+1=7) and 70+7=77 or 077
which is the value set for umask.Various combinations of numbers can be used by adding up to set different permission combinations.
You are right umask does set the default for all newly created files and directories.
Hope you find this useful.
 
Old 11-13-2003, 01:39 AM   #12
aiims1777
Member
 
Registered: Oct 2003
Location: India
Distribution: Kubuntu Dapper Drake, Edgy Eft;Red Hat Linux 9 Personal Edition
Posts: 39

Original Poster
Rep: Reputation: 15
Linuxfond,
Can you please post the contents of your /etc/fstab here?
Also where is your windows partition? In a terminal at the command line type df -k to see your partitions and the device letter allotted to them like hda1 etcetera.
Logged in as root right click your windows icon and see properties.This will open up a dialog box from where you click permissions. Tick mark all the boxes and click apply then ok. Log out , log in as user and try moving the files from windows .Right click a file in the windows listing and select copy.then right click in your home directory on your linux partition and choose paste.
 
Old 11-13-2003, 02:31 AM   #13
Mitchell
LQ Newbie
 
Registered: Nov 2003
Posts: 9

Rep: Reputation: 0
aiims1777 thanks for taking the time to explain that to me, I fully understand the logic behind that now, I had the right idea just backwards. I thought 0 == --- instead of 0 == rwx like chmod. Again thanks!
 
Old 11-13-2003, 06:44 AM   #14
linuxfond
Member
 
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Rep: Reputation: 30
Aiims1777, thanks. Here it goes:

/dev/hdc1 / ext3 defaults 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hdc6 /home ext3 defaults 1 2
none /mnt/cdrom supermount dev=/dev/hdb,fs=auto,ro,--,iocharset=utf8,umask=0 0 0
none /mnt/cdrom2 supermount dev=/dev/scd0,fs=auto,ro,--,iocharset=utf8,umask=0 0 0
none /mnt/floppy supermount dev=/dev/fd0,fs=auto,--,iocharset=utf8,sync,umask=0 0 0
/dev/hda1 /mnt/win_c ntfs auto,user,owner,umask=000 0 0
/dev/hda5 /mnt/win_d vfat auto,user,owner,umask=000 0 0
none /proc proc defaults 0 0
/dev/hdc5 swap swap defaults 0 0
/dev/ide/host0/bus0/target1/lun0/cd /mnt/cdrom auto ro,noauto,user,exec 0 0
/dev/scsi/host0/bus0/target0/lun0/cd /mnt/cdrecorder auto ro,noauto,user,exec 0 0
 
Old 11-15-2003, 01:17 AM   #15
aiims1777
Member
 
Registered: Oct 2003
Location: India
Distribution: Kubuntu Dapper Drake, Edgy Eft;Red Hat Linux 9 Personal Edition
Posts: 39

Original Poster
Rep: Reputation: 15
Dear Linuxfond,
Are you able to access the vfat partition from linux and move the files there?Is the problem only with the ntfs partition(C: in windows)? Or with both partitions?
Also please log in as root and check the permissions for your /mnt/win_c and /mnt/win_D directories by right clicking on them and clicking the permissions tab.Tick all the permission boxes there.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copying files from linux to windows Nigel Robinson Linux - Newbie 11 07-27-2005 02:41 PM
Windows files copied to my linux partition are locked when logged in as a normal user necbrownie Slackware 8 10-15-2004 08:11 AM
Copying files form a windows-burnt CD to a linux designation? Timme Linux - Newbie 6 09-13-2004 04:00 PM
copying files from linux to windows jonnypop00 Linux - Newbie 2 09-17-2003 04:32 PM
copying files from windows to linux susyq78 Linux - Newbie 6 08-10-2003 09:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:28 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