LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 12-29-2011, 09:53 PM   #1
macnab
LQ Newbie
 
Registered: Dec 2011
Posts: 20

Rep: Reputation: Disabled
Does chown user /mnt/sda1 make sda1 writeable over network?


Have a Windows box as main work PC. Have Linux box, booting from flashdrive, as container for all my backup drives. I want a 1-to-1 relationship betwenn in-use drive and backupdrive, not a RAID system.

If I use
Code:
chown user /mnt/sda1
Code:
chown /mnt/sda2
will user have full read/write access to sda1 and sda2?

Here, user is the Windows box logging into the Linux box.

What I need is that if I mount sda1, from the Windows box I should be able to read, write, create folders, move folders, create sub-folders, etc. as I please.
 
Old 12-29-2011, 10:00 PM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
chown changes the ownership.
chmod changes the permissions.
See the manpages for how to use these.

You need to set up samba in order to share files between linux and windows hosts. What you can do with that share will depend on how you have set up samba.

Edit: I should also mention that
Code:
chown user /mnt/sda1
will only set the user ownership, not the group ownership.
Code:
chown user:group /mnt/sda1
will change both.

Last edited by fukawi1; 12-29-2011 at 10:02 PM.
 
Old 12-29-2011, 10:04 PM   #3
ongte
Member
 
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mageia, CentOS, Ubuntu
Posts: 468

Rep: Reputation: 72
Don't quite understand your question. Is Windows accessing a Samba share on the Linux box? or are mounting the Linux disk in Windows?
 
Old 12-29-2011, 10:46 PM   #4
macnab
LQ Newbie
 
Registered: Dec 2011
Posts: 20

Original Poster
Rep: Reputation: Disabled
fukawi1: I have Samba installed, connecting just fine, and from the Windows box I can browse the contents of sda1.

ongte: Windows is accessing a Samba share on the Linux box.

Let me explain things this way. Windows box has 2 drives for data, call them Data1 and Data2. Both 1TB. In the Linux box I have 2 1TB drives, also called Data1 and Data2. The idea is to regularly make Linux/Data1 and Linux/Data2 look exactly the same as Windows/Data1 and Windows/Data2 by running SyncToy on the Windows box. This means full read/write access from Windows box to Linux/Data1 and Linux/Data2.

Using chmod doesn't really help, becuse it only works on the files and folders that are on Linux/Data1 and Linux/Data2 at the time of running it. This means that if a sub-folder is added, chmod needs to be run before a sub-folder can be added.

I need full read/write access for ever and ever.

I mount Linux/Data1 and LinuxData2 to /mnt/sda1 and /mnt/sda2.

Used
Code:
adduser -D -h /mnt nigel-pc

rpcclient
$ createuser nigel-pc -p password
and in smb.conf
Code:
[nigel-pc}
path = /mnt
writeable = yes
valid users = nigel-pc
This gives me read/write permission to /mnt, but I need read/write permission williy-nilly to /mnt/sda1 and /mnt/sda2.

Haven't created any groups.

Hove this clarifies my problem.
 
Old 12-29-2011, 11:06 PM   #5
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
you probably need to extend your samba config to include more options.
Create Mask springs to mind, where files/directories created via the share, are created with a particular set of permissions.

The manpage for smb.conf will have a list of them with descriptions.

Code:
[nigel-pc}
This is wrong too..
 
Old 12-29-2011, 11:20 PM   #6
macnab
LQ Newbie
 
Registered: Dec 2011
Posts: 20

Original Poster
Rep: Reputation: Disabled
I ahve had a look at a manpage for smb.conf and saw CreateMash, but I can't say that the info really sunk in:-). Will go through it again with a view to it helping this particular problem.

The [nigel-pc] entry in smb.conf came from a tutorial. I think the idea is that each user who logs on gets his own home folder.

Will go through smb.conf masks and report my success/failure.
 
Old 12-30-2011, 12:17 AM   #7
macnab
LQ Newbie
 
Registered: Dec 2011
Posts: 20

Original Poster
Rep: Reputation: Disabled
Success!!!

First step was to use chmod on /dev/sda1 and then mount it.

Also added masks to smb.conf and now have full access.

Thanks.
 
Old 12-30-2011, 02:25 AM   #8
macnab
LQ Newbie
 
Registered: Dec 2011
Posts: 20

Original Poster
Rep: Reputation: Disabled
It has all gone downhill again. Firstly, it was odd that Windows was not asked for a password to login. Copied a btach of files, and it did a lot of them and suddenly, half-way through, decided I didn't have the required permissions. Noe despite rebooting both ends, it still doesn't ask for a password and still refuses to allow file copying.

Wanted to do the setup from scratch again, but now rpcclient won't even let me do enumusers, says I must do lsaquery first. This also fails.

I have been struggling for 2 weeks now to set up a Linux box as a file-server and I get nowhere fast. Everytime I get past one stage something else goes wrong again.

It would be nice to have a tutorial on using Linux as a file server where you share more than just one folder.

At the moment I can do nothing because rpcclient won't let me do anything. I'd just trash the whole project if I hadn't already spent so much money on the equipment.
 
  


Reply



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
Sda1 partition shows twice its real size (after using rsync /* /mnt/sdb1) Frank64 Linux - General 6 11-04-2011 03:08 AM
[SOLVED] /mnt/sda1/blogrss_chroot.sh: line 2: [: ==: unary operator expected ted_chou12 Programming 2 04-02-2011 12:51 AM
Need to resize sda1 but sda2 & sda3 is between sda1 and unallocated space. tony128 Linux - Newbie 6 09-13-2010 12:15 AM
Trying to Mount USB mounting /dev/sda1 on /mnt/usb failed: Invalid argument JamesMore Linux - Newbie 9 07-28-2010 03:27 PM
/dev/sda1 already mounted or /mnt busy. (SATA Sil 3112) psamuel01 Red Hat 14 10-10-2008 03:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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