For QuantaStor version 4.0.2 and lower use these steps to install Samba-4:
1) Remove any QuantaStor Active Directory configuration via the CIFS Configuration dialog. QuantaStor cannot be joined to a domain prior to the samba4 install.
2) Stop the existing Samba v3 services:
stop smbd; stop nmbd; service winbind stop
3) Remove the existing samba v3 startup scripts:
rm /etc/init/smbd.conf /etc/init/nmbd.conf
4) Install the Samba 4 packages:
5) Once the samba4 install is complete you can re-join QuantaStor to your Active Directory server via the CIFS Configuration dialog.
6) Check your Share settings with the Modify Network Share dialog as the user and group mappings will have been removed by leaving the domain.
7) Reconfigure the Share settings and share/permissions setting inside of the Windows MMC and Folder share/security properties as that will most likely have changed by leaving/rejoining the domain.