LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   write access to a Windows partition folder from Linux (as root) (https://www.linuxquestions.org/questions/linux-newbie-8/write-access-to-a-windows-partition-folder-from-linux-as-root-859465/)

dows 01-29-2011 05:05 PM

write access to a Windows partition folder from Linux (as root)
 
I want to copy a file from Linux to a separate Windows hpfs/ntfs
partition. I have mounted the windows partition on /mnt. Permissions
for /mnt and for files within /mnt show rwx for owner, and owner
as root. I am root. I get a message indicating I am not allowed
access.
I know there have been versions of this question asked before, but
either the replies do not cover my situation or they have not been
helpful.
How can I move ahead? Thanks!

stress_junkie 01-29-2011 05:17 PM

Exactly what command have you used to mount the partition? If this is done using /etc/fstab then copy that line into a reply here.

Also, what distribution are you using? You should always include this information when you ask a question.

jschiwal 01-29-2011 06:18 PM

It would be better to mount an NTFS partition using the uid, gid, fmask and dmask mount options so that you can write to it as a regular user. You would use sudo to mount it as root, but then copy files as a regular user. Make sure you have the ntfs-3g and fuse packages installed before proceeding. Make sure that the fuse kernel module is loaded.

dows 01-30-2011 12:24 PM

To stress junkie and jschiwal
thanks for your replies. I'll respond to stress junkie in some detail and will have to work some more
before I feel comfortable with jschiwal's comments.

My Linux is Debian Lenny, loaded about a week ago, downloading from ftp.debian
Linux is on /dev/sdb1. I'm working as root in Linux.

My Windows XP Pro is on /dev/sda1.
fdisk shows /dev/sda1 as type 7 HPFS/NTFS
There is no reference to /dev/sda1 in fstab, and nothing mounted on /mnt.

I execute mount -t auto /dev/sda1 /mnt -o rw
cd /mnt
now I can read the Windows directory on /mnt. for both /mnt and the files within it both owner and group
are root, and permissions for user are rwx for directories and rw for files.

I execute cp /home/dave/jj .
and get the message " cp cannot create regular file './jj': permission denied.

as an aside...I execute cp ntldr /home/dave/ntldr and the copy works fine.

Perhaps "root" isn't always root? Can you help further so I can copy from Linux to Windows?

gdejonge 02-01-2011 02:01 PM

Make sure your Windows partition really got mounted read-write.
After mounting use command mount again without any parameters.
It should show all mounted partitions and how they are mounted.

Code:

$ mount
/dev/sdb7 on / type ext3 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/sdb1 on /boot type ext2 (rw)
/dev/sda1 on /mnt type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)


dows 02-02-2011 12:37 AM

Thanks for the suggestion, Gdejonge. I had done that already.

Further information that might be useful to know: The computer was loaded as follows using two fresh
scsi drives:
first: load Windows from the installation CD, letting Windows format its partition before loading
the operating system. Check that Windows is operating normally for an initial load.
second: Load Debian using first a bootable CD, then completing the load via ftp.debian. Linux
is loaded to a partition on the second hard drive, partitioning done by Linux.
finally: respond to the Debian installation sugggestion by letting Grub load on the expected boot record
of the Windows partition. This results in the boot-up option of either Linux or Windows. Both boot
correctly.

I still can't write to the Windows partition as root in Linux.

Someone have further comments/suggestions? Please!

Dave


All times are GMT -5. The time now is 08:29 AM.