Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Wednesday, May 14, 2014

windows File server move using robocopy

Often I used to get request to move the file share server to a different server , There are several option available to finish this job, the easiest one would be the robocopy one.

Robocopy will take care of ntfs permission on the folder but will not copy the share permission. If robocopy is used for the file share move then we need to export the share permission from exisitng windows server then import that to the new fileshare server.

Here is the high level steps

1. copy the below command in a text file and save it as filename.bat

@ECHO OFF
SETLOCAL

SET _source=D:\
SET _dest=E:\
SET _what=/COPYALL /SEC /MIR /Z
 :: /COPYALL :: COPY ALL file info
 :: /B :: copy files in Backup mode.
 :: /SEC :: copy files with SECurity
 :: /MIR :: MIRror a directory tree
SET _options=/R:0 /W:0 /LOG:Logfile.txt /NFL /NDL
 :: /R:n :: number of Retries
 :: /W:n :: Wait time between retries
 :: /LOG :: Output log file
 :: /NFL :: No file logging
 :: /NDL :: No dir logging

ROBOCOPY %_source% %_dest% %_what% %_options%

Note : please replace d:\ with the source path and also I:\ with the destination path. Also keep in mind that this will excatly mirror the source to destination , if destination has any extra files or folders that will be deleted.

2.download robocopy and save that exe and filename.bat on same location

3. run the filename.bat on a administrative command prompt.

4. The log file will be generated on the same location which includes start time ,end time , how much size is copied or ignored or failed . If any files copy is failed it will be reported on the log file

5.From the HKEY_LOCAL_MACHINES\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares

6. export the above key from source server and import on the destination server

Note: this will work if you are moving entire file share server .if you are moving only portion of file share server then after import delete the unwanted share key.

 

Monday, March 10, 2014

SQL Server Installation Fails with the error access denied or access right issue

Symptom 

SQL 2012 or SQL 2008  installation failed with access denied or showing the error  "setup account privileges" failed


Root  cause :

the user account used for the sql installation is missing one of the below access

1. SeBackupPrivilege
2. SeDebugPrivilege
3. SeSecurityPrivilege

How to check if the user account have these access or not :

1. download accesschk.exe from http://technet.microsoft.com/en-us/sysinternals/bb664922.aspx
2. open the command prompt with elevated privilege
3. navigate to the accesschk.exe path in the command prompt
4. run the following command  accesschk.exe domain\username *
5. The output will show all the privilege the user have and see if the above three privilege are listed


How to fix the issue :

If any of the above privilege is missing then follow the below steps to add those.

1. click start --->Run ----> gpedit.msc
2. expand local security policy  ----> Local policies ----> User Rights Assignment 

Double click "Backup Files and Directories Properties" and add user or group if SeBackupPrivilege is missing

Double click "Debug Programs" and add user or group if SeDebugPrivilege is missing

Double click " Manage auditing and security log" and add user or group if SesecurityPrivilege is missing

Note: if  add user or group is grayed out then it  might be blocked by your group policy.


Wednesday, February 26, 2014

"Media Is Write protected" error while initializing new disk in windows server 2008

Error Message : media is write protected

symptoms: added a new storage disk to the windows server  and try to initialize the disk under disk managment but it failed with the error "media is write protected"


Root cause: This is due to the san policy in windows 2008 server .If the san policy is VDS_SP_OFFLINE then the disk will be offline and read only disk.

How to fix the issue :

1. Open the command prompt as administrator and type diskpart and hit enter
2. list disk
3.select disk X ( where x is the disk number which is offline)
4.if the disk is offline then type online disk to bring that online
5.type detail disk and check for read only attribute is showing as yes
6.type attribute disk clear readonly to clear the read only attribute
7.exit
8.reinitialize the disk ,if reinitliaze popup doesn't come up then reboot the server and try to reintialize.
 

Friday, February 21, 2014

Making Windows server 2012 as ISCSI target

Windows 2012 comes with the ISCSI target as a built in component, you have to just install the roles and make use of that.

How to install the ISCSI target role

1. Open Server Manager and Click Add Roles and Features
2. on Add Roles and features wizard Click next
3. Select Role based or feature based installation and click next
4. Click select a server from server pool option and select the server which is going to be running as iscsi target and click next
5. Expand file and storage services and select ISCSI Target server and click next
6. on Add roles and feature wizard , check the box include management tools and click Add features
7. Click next
8. Click next on the next window and click install

 How to configure the ISCI target
1. Open Server manager and click File and Storage Service
2. Click ISCSI Virtual Disks option
3. Click the “Launch the new virtual disk Wizard to create a virtual disk”
4. Select the option “type a custom path “
5. Browse to the path you want to create a target for example if you connect the external hard drive and the drive letter is F . then put the path F:\ISCSI-disk1 and click next.
6. On Specify ISCSI Virtual disk name you can give any name for example you can give it as VMdatastore1 or Hypervdatastore1
7. Click next
8. Specify the size of the disk for example 256 GB
9. Now select new ISCSI target option
10. Give any target name, if you using this for vmware cluster give that cluster name or if you using for hyperv cluster give that name
11. Click Add to add the initiators (Initiator will be your esxi host IQN or the iscsi ip address assigned to the esxi port group or if you are using hyperv then it should be the hyperv server ip address or the iqn)
12. Select the option “ Enter a value for the selected type” and select the type as IP address if you want to add ip or select IQN if you want to add ISCSI qualified name (IQN)
13. Click Next
14. Enable authentication, Enable the authentication based on your company policy , if you don’t have any idea then just click next without checking any option on this screen
15. Just go through the configuration overview which you select so far and click create
16. Click close

 How to add access the ISCSI disks now

1. Goto the server which you want to configure the ISCSI disk
2. Goto server manager click on TOOLS and select issi initiator
3. If the ISCSI service is not running then it will ask for the service start prompt click yes to start the ISCSI service
4. On the target tab put the ip address of your ISCSI target server name and click quick connect
5. Once it is able to connect to the target then the IQN of the target is listed under the quick connect and click done
 6. Goto disk management and rescan the disk.