LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-09-2016, 03:15 AM   #1
aJens1
LQ Newbie
 
Registered: Jan 2016
Posts: 3

Rep: Reputation: Disabled
Cannot access Samba share after hard drive replacement


Hi!
Having a problem with Samba share that I can't figure out!

A few weeks ago on of the hard drives on my Centos server went bananas so I had to replace it, the disk is only holding my photos that I share using Samba. I also have two other disks in my server sharing other content.

On the new hard drive I created the same folder structure that I had on the old hard drive according to the smb.conf file. I set the user and group policy on the newly created folders the same way that it was on the old hard drive. Run testparm and smb/nmb restarted and everything looks fine. I can see the folders on my network share, but for some reason I cannot access them?? The shares from my other to hard drives works fine.

I have tried several things like creating a new folder on the new drive - same problem. If I create a new folder on one of the two other drives I have no problem accessing them so there has to be something that is connected to the new hard drive, but I can't figure out what??

Any help would be appreciated.
 
Old 01-09-2016, 03:45 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I guess SELinux is the culprit, or rather your failure to set up correct SELinux labels on the shared files. To check if I am right, run setenforce permissive then try accessing the share.

Then see here: https://wiki.centos.org/HowTos/SetUpSamba.
 
1 members found this post helpful.
Old 01-09-2016, 03:56 AM   #3
aJens1
LQ Newbie
 
Registered: Jan 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
I guess SELinux is the culprit, or rather your failure to set up correct SELinux labels on the shared files. To check if I am right, run setenforce permissive then try accessing the share.

Then see here: https://wiki.centos.org/HowTos/SetUpSamba.
You are absolutely correct, after running "setenforce permissive" I can access my new folders!

But I dont understand why I had to run that command? (haven't read the whole text in the link you provided yet). I cannot remember ever using that command setting up my Samba share the first time, guess it has to do something with that hard drive replacement?

Should I undo any changes after running that command and setting up the SELinux correct?
 
Old 01-09-2016, 05:00 AM   #4
aJens1
LQ Newbie
 
Registered: Jan 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Finally, it all came back to me, long time since I configured my Samba share

After running the command setenforce permissive, I ran the command setenforce enforcing to undo the changes.
Then I ran the command: chcon -Rt samba_share_t /Mount Point to new hard drive/Shared folders.

Now I can access my folders on the new drive. Thank you so much for pointing me in the right direction, I completely forgot about this step, even tho i did read the smb.conf file to look for any clue I still missed it
 
Old 01-09-2016, 05:30 AM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
When working with RHEL, Centos and other RHEL clones, and something doesn't work although everything is set up correctly, check into SELinux. I apply this rule all the time, except when I forget it, which is about 50 of the cases. Then I feel like you.
 
  


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
wanted to access the samba share drive from my home.. yerunkar11 Linux - Networking 4 04-24-2015 10:47 AM
SLES 10 RAID Hard Drive Replacement lbollman Linux - Server 0 08-25-2013 11:44 PM
Debian,Raid1, boot and totally destroyed hard drive replacement test Doctor_House Linux - Server 0 03-19-2013 03:44 AM
[SOLVED] Samba share access from XP works - Win 7 share access disappear after about 3 minutes rylan76 Linux - Networking 1 11-03-2012 06:00 AM
[SOLVED] Hardware crash,Repaired,New Install New Hard drive,how to access original Hard drive flatstan Linux - Hardware 7 07-21-2009 06:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:49 PM.

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