류짱:Beyond MySelf

cleanmgr를 이용한 Windows Server 디스크 용량 확보 방법 본문

Microsoft/Windows Platform

cleanmgr를 이용한 Windows Server 디스크 용량 확보 방법

リュちゃん 2017. 12. 12. 16:03

C드라이브의 공간을 여유있게 할당 하지 않은 가상화로 운영 중인 Windows Server 2008R2 게임서버들의 디스크 공간확보를 위해서 아래 블로그를 이용해서 Windows update 관련 파일들을 삭제하곤 하였습니다만......
How to Clean up the WinSxS Directory and Free Up Disk Space on Windows Server 2008 R2 with New Update
https://blogs.technet.microsoft.com/askpfeplat/2014/05/13/how-to-clean-up-the-winsxs-directory-and-free-up-disk-space-on-windows-server-2008-r2-with-new-update/
위 방법은
Kb2852386 설치 후 Windows Feature에서 Desktop experience를 설치 해야했고시스템의 재 시작도 필요하여 많은 번거로움이 있었습니다.

이에 다른 방법을 찾아 보다가 최근에 아래와 같은 방법을 찾아서 실 서비스에 적용해 보았으며 문제 없이 동작 하였으니 참고 하시기 바랍니다.

아래 소개 해 드리는 방법은 동일하게 Cleanmgr을 사용하는 것입니다만 Kb2852386Desktop experience를 설치 하지 않은 상태에서 Cleanmgr를 실행하여 불필요 파일의 삭제가 가능 하므로 현재 실행 중인 서버에서 바로 적용이 가능하다는 장점이 있습니다.
물론 파일 삭제 후 재시작은 한번 필요 하지만요..
자세한 방법은 아래와 같습니다.

[Windows Server 디스크 용량 확보 방법]
- 대상 서버 : Windows Server 2008R2

- 상세 방법

먼저 용량이 부족한 서버에 로그온을 합니다.  아래 폴더 위치로 이동하여 cleanmgr.exe 파일을 해당 서버의 c:\windows\system32 폴더에 복사 합니다.

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\



다음으로 아래 폴더로 이동하여 cleanmgr.exe.mui 파일을 해당 OS의 설치 언어를 확인하고 c:\windows\system32\(en-us or ja-jp)  OS의 언어에 맞는 폴더에 cleanmgr.exe.mui를 복사합니다. 

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_ja-jp_e89ba9cb6f9dcbc3\

ex) English

 

Ex) Japanese



위 두 파일의 복사가 완료 되면 관리자 권한으로 명령프롬프트를 실행 한 후 cleamgr.exe 명령어를 실행 한 후 삭제가 가능한 Windows update 관련 파일들을 삭제하고 시스템을 재 시작 합니다.



만약 작업을 하려는 서버에 위 두 폴더가 존재 하지 않는다면 아래 hotfix를 설치 후위 방법을 진행 하시면 됩니다. (핫픽스 설치 재 시작 필요..-__-)

Disk Cleanup Wizard addon lets users delete outdated Windows updates on Windows 7 SP1 or Windows Server 2008 R2 SP1
http://support.microsoft.com/kb/2852386

그리고 Windows Server
2012R2의 경우에는 기본적으로 드라이브 등록 정보에 Disk cleanup이 제공 되므로 해당 등록정보에서 Disk Cleanup 클릭 후 Windows update cleanup 체크 하시고 삭제 진행 후 시스템 재 시작하면 됩니다.


만약  Disk Cleanup 이 보이지 않는다면 아래 블로그를 통해서 확인 가능 합니다만 dism 명령어를 이용해서 용량 확보가 가능하니 참고 하시기 바랍니다.
How to: Disk Cleanup in Windows Server 2012 (R2) – DISM
https://www.saotn.org/windows-server-2012-r2-disk-cleanup-dism/

[참고 자료]
Disk Cleanup option on drive’s general properties and cleanmgr.exe is not present in Windows Server 2008 or Windows Server 2008 R2 by default
https://technet.microsoft.com/en-us/library/ff630161(WS.10).aspx


감사합니다.