[SOLVED] Cannot access Samba share after hard drive replacement
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
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??
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.
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.
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?
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.