CIFS won't start (permissions issue)

Status
Not open for further replies.

Nerevarine

Dabbler
Joined
Sep 20, 2014
Messages
34
Using FreeNAS 9.2.1.9 since that's the latest my system will support.

I recently reinstalled my Windows PC, and ran into an issue with an app needing permission to one of my shared NAS drives to work (iTunes which has its library on my NAS). Not thinking I went and changed permissions for that drive from Windows, forgetting it is my system drive in my NAS as well.

I think the permissions messed things up, and my CIFS shares didn't show up at all in Windows after the next reboot of my NAS. I disabled CIFS to restart it, but then it wouldn't turn back on. Just said "The service could not be started". I tried changing permissions for the volume from Unix to Windows like I read in other threads about similar issues. That didn't work so I did it again and ticked the apply recursively option, still no solution (it is still set on Windows if that matters now).

I didn't have that much set up, so I ended up reinstalling FreeNAS completely and imported my volumes. Before I did so I made sure CIFS was turned on. I then set up my CIFS shares, and tried to connect from my PC, but nothing showed up. It cant find the NAS using either \\FREENAS or \\192.168.1.95

Connecting to the WebUI or via putty works fine.

I once more tried to restart CIFS, but like earlier, it won't turn on once it's off.

I tried to follow instructions to delete the samba4 in /var/db/ and wanted to try to remove the dataset, but cannot find it using the commands I've seen...

What should I do? Please help. How do I recreate the samba4 things completely to get a fresh start for my cifs shares?

Edit: I also tried to change the dataset pool location to a different volume, hasn't made any difference.
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
First off, your hardware specs would be a big help here. Please post your system setup.

I then set up my CIFS shares...
I'm concerned about your configuration. You mentioned that you were earlier sharing your system drive, which should never be how your shares and datasets are set up. I'm wondering if this is something lost in translation, or a very funky setup. Can you post the output of "zpool status -v" (in code tags) and walk me through your share setup like I'm an idiot?
 

Nerevarine

Dabbler
Joined
Sep 20, 2014
Messages
34
First off, your hardware specs would be a big help here. Please post your system setup.


I'm concerned about your configuration. You mentioned that you were earlier sharing your system drive, which should never be how your shares and datasets are set up. I'm wondering if this is something lost in translation, or a very funky setup. Can you post the output of "zpool status -v" (in code tags) and walk me through your share setup like I'm an idiot?

It is a very bad setup, since I set it up as a noob with way too little info. System drive was perhaps not the correct word, though, sorry, meant system dataset pool volume. The system is installed on a USB with nothing else on it. I just wanted a couple of hard drives accessible over network, nothing more, no raid or anything. So I set it up as each hard drive being its own volume, just for storage. I (much) later figured out that was not very clever, but haven't had the option to correct it due to not enough storage to backup everything to start over. Most of it is ok to loose, it's just that I didn't want to wipe it all to fix something that was working just fine for my needs. Which basically only is access storage from my PC, one user, no nothing.

It is a NAS built from an older PC, and a few mixed size hard drives so hardware was never meant for this, but again, it has worked fine for a couple of years. An intel i5 750 system with 16 GB of non-ECC RAM.

I only added a second same-size drive as another earlier this year to have one Mirrored 2TB pool to use for backup of the more important stuff. The other three are still solo drive volumes for basic storage (1, 3 and 4 TB).

It is all wrong, I know. But it worked fine for a couple of years until the permissions changed and my cifs stopped working... Is there any solution to sorting out the permissions (reverting it all to default or something?) and recreate the samba things?


Code:
[root@freenas] ~# zpool status -v
  pool: Mirror_2TB
state: ONLINE
  scan: scrub repaired 0 in 3h22m with 0 errors on Sat Jul 30 18:22:20 2016
config:

        NAME                                            STATE     READ WRITE CKSUM
        Mirror_2TB                                      ONLINE       0     0     0
          mirror-0                                      ONLINE       0     0     0
            gptid/6648d641-152a-11e6-b486-00241dcc389f  ONLINE       0     0     0
            gptid/66a3c0c5-152a-11e6-b486-00241dcc389f  ONLINE       0     0     0

errors: No known data errors

  pool: Seagate_1TB
state: ONLINE
  scan: scrub repaired 0 in 2h48m with 0 errors on Sat Jul 16 17:48:09 2016
config:

        NAME                                          STATE     READ WRITE CKSUM
        Seagate_1TB                                   ONLINE       0     0     0
          gptid/d9346476-4120-11e4-8978-00241dcc389f  ONLINE       0     0     0

errors: No known data errors

  pool: Seagate_4TB
state: ONLINE
  scan: scrub repaired 0 in 7h32m with 0 errors on Sat Jul  9 22:32:43 2016
config:

        NAME                                          STATE     READ WRITE CKSUM
        Seagate_4TB                                   ONLINE       0     0     0
          gptid/23ef8ec6-40a4-11e4-9af0-00241dcc389f  ONLINE       0     0     0

errors: No known data errors

  pool: WD_3TB
state: ONLINE
  scan: scrub repaired 0 in 5h57m with 0 errors on Sat Jul 23 20:57:19 2016
config:

        NAME                                          STATE     READ WRITE CKSUM
        WD_3TB                                        ONLINE       0     0     0
          gptid/a4ed52cc-148f-11e6-a75a-00241dcc389f  ONLINE       0     0     0

errors: No known data errors
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,477
Please post your solution so when others search, they will be able to see your solution.
 

Nerevarine

Dabbler
Joined
Sep 20, 2014
Messages
34
Please post your solution so when others search, they will be able to see your solution.
Of course, sorry. Was very tired last night after all this trouble.

What I did was basically this (I hope I remember it correctly):

1. I detached all my volumes. Had the box ticked that removed any shares associated with that volume (NOT the one that destroys the data of course).
2. With no volumes attached, I could turn CIFS on.
3. I auto-imported a volume that had no old dataset on it, a certain blank slate in that regard.
4. Shared that with a CIFS share, and checked that it turned up, which it did.
5. I auto-imported another volume that had an old (probably now corrupt dataset on it), and even though it should be inactive, still somehow messed things up.
6. I opened a shell (via putty if that matters) and used the command unmount -f /mnt/volumename/.system on the volume with the corrupt dataset.
7. I ran the command rm -rf /mnt/volumename/.system on the same volume
8. I double checked that no old corrupt stuff remained, then created a new CIFS share for the volume.
9. I repeated steps 5-8 for the remaining volumes.

I also figured out how to get iTunes to accept my library being on a shared network folder again, by only adding full permissions in Windows to that folder. Still can't fully get Windows to use the correct permissions for my CIFS shares though it seems, or this might not even had been an issue in the first place. Need to read up on that and see what I find. For now all works fine again however, and I have learned a tiny bit about what to not ever do regarding setting permissions.

The solution was probably very straight forward if one knew anything about Unix and/or FreeNAS, and I still don't. xD

Also, If I'd only had say two volumes, and had tried moving the dataset to the second volume before, and therefore was worried I would've had maybe corrupt datasets on all my volumes I would simply had unmounted both, then imported one first to have the active datasets on, then the second. Then do the force unmount and force remove commands on the SECOND imported volume. Detach both again, and import the other way around to clear the still suspicious lingering dataset. Again, probably basics, but when in panic-mode it's hard to think at times.
 
Status
Not open for further replies.
Top