copying files from linux to windows partition as user
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Kubuntu Dapper Drake, Edgy Eft;Red Hat Linux 9 Personal Edition
Posts: 39
Rep:
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.
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!
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
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
Distribution: Kubuntu Dapper Drake, Edgy Eft;Red Hat Linux 9 Personal Edition
Posts: 39
Original Poster
Rep:
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.
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?
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.
Distribution: Kubuntu Dapper Drake, Edgy Eft;Red Hat Linux 9 Personal Edition
Posts: 39
Original Poster
Rep:
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.
Distribution: Kubuntu Dapper Drake, Edgy Eft;Red Hat Linux 9 Personal Edition
Posts: 39
Original Poster
Rep:
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.
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!
Distribution: Kubuntu Dapper Drake, Edgy Eft;Red Hat Linux 9 Personal Edition
Posts: 39
Original Poster
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.