A start job is running for raise network interfaces (5 mins 1 sec) in ubuntu16.04 부팅 딜레이
By 때찌때찌맴매 - 3월 12, 2018
# vi /lib/systemd/system/networking.service 21:TimeoutStartSec=10sec (기본으로 5min설정되있었고, 작성자는 10초로 변경)
@echo off ipconfig | find "IPv4" > c:\ipcheck_tmp set /p ip_check= < c:\ipcheck_tmp sc query | find "MSiSCSI" /c > c:\iscsistart set /p iscsistart= < c:\iscsistart if "%iscsistart%" == "1" GOTO MENU if "%iscsistart%" == "0" ( sc config MSiSCSI start= auto net /y start MSiSCSI GOTO MENU ) :MENU cls echo ************************************************************ echo * 1. 『추가』 또는 『추가,제거 업데이트』 * echo * 2. 『완전 제거』 * echo * 3. 종료 * echo ************************************************************ set /p no=NO.: if "%no%" == "1" ( GOTO ATT ) if "%no%" == "2" ( GOTO DET ) if "%no%" == "3" ( del c:\ipcheck_tmp del c:\iscsistart exit ) else ( GOTO MENU ) :ATT powershell get-iscsitargetportal | find "3260" /c > c:\tmptarget set /p target= < c:\tmptarget if "%target%" == "0" GOTO NEWATT if "%target%" == "1" GOTO UPDATE :NEWATT cls powershell new-IscsiTargetPortal -TargetPortalAddress "{iscsi target ip}" | find "오류" /c > c:\tmpportal set /p portal= < c:\tmpportal if "%portal%" == "1" GOTO ERRATT if "%portal%" == "0" GOTO NEWATT_1 :NEWATT_1 powershell Connect-IscsiTarget -NodeAddress iqn-%ip_check:~31,44% | find "대상 이름은 찾을 수 없거나" /c > c:\tmpnoconn set /p noconn= < c:\tmpnoconn if "%noconn%" == "0" ( powershell Update-IscsiTarget cls echo ************************************************************ echo * 블록스토리지『신규 추가』가 완료되었습니다. * echo ************************************************************ del c:\tmpportal del c:\tmptarget del c:\tmpnoconn del c:\ipcheck_tmp del c:\iscsistart GOTO DISK_CHECK ) else ( cls echo ************************************************************ echo * 블록스토리지 『추가』를 실패하였습니다. * echo ************************************************************ powershell Remove-IscsiTargetPortal -TargetPortalAddress "{iscsi target ip}" -confirm:$false del c:\tmpportal del c:\tmptarget del c:\tmpnoconn del c:\ipcheck_tmp del c:\iscsistart GOTO END ) :UPDATE cls echo ************************************************************ echo * 블록스토리지『추가,제거 업데이트』중 입니다. * echo ************************************************************ powershell Connect-IscsiTarget -NodeAddress iqn-%ip_check:~31,44% | find "대상 이름은 찾을 수 없거나" /c > c:\tmpnoconn set /p noconn= < c:\tmpnoconn if "%noconn%" == "0" ( powershell Update-IscsiTarget cls echo ************************************************************ echo * 블록스토리지 『추가,제거 업데이트』가 완료되었습니다. * echo ************************************************************ del c:\tmptarget del c:\tmpnoconn del c:\ipcheck_tmp del c:\iscsistart GOTO DISK_CHECK ) else ( cls echo ************************************************************ echo * 블록스토리지 『추가,제거 업데이트』를 실패하였습니다. * echo ************************************************************ powershell Remove-IscsiTargetPortal -TargetPortalAddress "{iscsi target ip}" -confirm:$false del c:\ipcheck_tmp del c:\iscsistart GOTO DISK_CHECK ) :ERRATT cls echo ************************************************************ echo * 블록스토리지『연결 실패』하였습니다. * echo ************************************************************ powershell Remove-IscsiTargetPortal -TargetPortalAddress "{iscsi target ip}" -confirm:$false del c:\tmpportal del c:\tmptarget del c:\ipcheck_tmp del c:\iscsistart GOTO END :DET cls echo ************************************************************ echo * 현재 연결되어 있는 블록스토리지를『완전제거』합니다. * echo ************************************************************ set /p YN= * 블록스토리지를『완전제거』하시겠습니까(Y/N)? if /i "%YN%" == "y" GOTO YES if /i "%YN%" == "n" GOTO NO GOTO DET :NO cls echo ************************************************************ echo * 블록스토리지『완전제거』를 취소하였습니다. * echo ************************************************************ GOTO END :YES powershell get-iscsitargetportal | find "3260" /c > c:\tmpdisc set /p target= < c:\tmpdisc if %target% == 1 ( powershell Disconnect-IscsiTarget -NodeAddress iqn-%ip_check:~31,44% -confirm:$false powershell Remove-IscsiTargetPortal -TargetPortalAddress "{iscsi target ip}" -confirm:$false powershell update-IscsiTarget cls echo ************************************************************ echo * 블록스토리지가 정상적으로『완전제거』되었습니다. * echo ************************************************************ del c:\tmpdisc del c:\ipcheck_tmp del c:\iscsistart GOTO DISK_CHECK ) else ( cls echo ************************************************************ echo * 현재 블록스토리지가 연결되어 있지 않습니다. * echo * 확인 후 다시 진행해 주시길 바랍니다. * echo ************************************************************ del c:\tmpdisc del c:\ipcheck_tmp del c:\iscsistart GOTO END ) :DISK_CHECK diskmgmt.msc GOTO END :END pause
** iSCSI 대상 포털 추가 PS C:\> New-IscsiTargetPortal -TargetPortalAddress "{iscsi target IP}" InitiatorInstanceName : InitiatorNodeAddress : InitiatorPortalAddress : InititorIPAdressListNumber : 4294967295 IsDataDigest : False IsHeaderDigest : False TargetPortalAddress : {IP} TargetPortalPortNumber : 3260
** iSCSI 대상 포털 삭제및 갱신 PS C:\> Remove-IscsiTargetPortal -TargetPortalAddress "{iscsi target IP}" -confirm:$false
삭제시 명령의 확인을 무시하려면 -confirm:$false 사용 삭제 후 포탈은 삭제 되도 검색된 대상은 보이기 때문에 삭제 후 업데이트함 PS C:\> Update-IscsiTarget
[ iscsi 대상 연결 및 해지 ] The first command gets iSCSI targets by using the **Get-IscsiTarget** cmdlet.The second command gets iSCSI targets, and then stores them in the $Target variable. The third command disconnects the iSCSI target identified by its **NodeAddress** by using the **Disconnect-IscsiTarget** cmdlet. The final command connections the iSCSI target identified by its **NodeAddress**. PS C:\> Get-IscsiTarget IsConnected NodeAddress ----------- ----------- True iqn.1991-05.com.contoso:testiscsi-deepcore-target PS C:\> $Target = Get-IscsiTarget => 변수 상태로 받게 되면 접근할 수 있는 모든 target 연결 PS C:\> Disconnect-IscsiTarget -NodeAddress $Target.NodeAddress Confirm Are you sure you want to perform this action? Performing operation '' on Target ''. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): **Y** PS C:\> Connect-IscsiTarget -NodeAddress $Target.NodeAddress AuthenticationType : NONE InitiatorInstanceName : ROOT\ISCSIPRT\0000_0 InitiatorNodeAddress : iqn.1991-05.com.contoso:deepcore.contoso.com InitiatorPortalAddress : InitiatorSideIdentifier : 400001370000 IsConnected : True IsDataDigest : False IsDiscovered : True IsHeaderDigest : False IsMultipathEnabled : False IsPersistent : True NumberOfConnections : 1 SessionIdentifier : fffffa800d008430-400001370000000b TargetNodeAddress : iqn.1991-05.com.contoso:testiscsi-deepcore-target TargetSideIdentifier : 0100 ** 단일 대상 연결 (단일 연결로 많이 사용함) PS C:\> Connect-IscsiTarget -NodeAddress {iqn_numb} ** 단일 대상 해지 PS C:\> Disconnect-IscsiTarget -NodeAddress {iqn_numb} -confirm:$false