Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

(시리즈 글이 6개 있습니다.)
Windows: 111. 복구(Recovery) 파티션 삭제하는 방법
; https://www.sysnet.pe.kr/2/0/2918

Windows: 142. Windows 10의 복구 콘솔로 부팅하는 방법
; https://www.sysnet.pe.kr/2/0/11207

Windows: 143. Windows 10의 Recovery 파티션을 삭제 및 새로 생성하는 방법
; https://www.sysnet.pe.kr/2/0/11209

Windows: 147. 시스템 복구 디스크를 USB 디스크에 만드는 방법
; https://www.sysnet.pe.kr/2/0/11598

Windows: 156. 가상 디스크의 용량을 복구 파티션으로 인해 늘리지 못하는 경우
; https://www.sysnet.pe.kr/2/0/11807

Windows: 263. Windows - 복구 파티션(Recovery Partition) 용량을 늘리는 방법
; https://www.sysnet.pe.kr/2/0/13586




가상 디스크의 용량을 복구 파티션으로 인해 늘리지 못하는 경우


경고!!!!!!!
이 글에서 설명하고 있는 diskpart.exe를 이용해 파티션 삭제 등의 작업을 할 때는 정말, 정말, 정말 주의를 해야 합니다. 자칫 실수로 작업 파티션을 날리면 하드 디스크 복구 업체를 통하지 않고는 데이터 복원이 안되는 사태를 경험할 수 있습니다.





가상 디스크(VHD, VHDX)의 용량이 모자라서 늘리긴 했는데, 다음과 같이 복구 파티션이 중간에 끼이는 경우가 있습니다.

move_recovery_partition_1.png

이 때문에 "볼륨 확장(Extend volume)" 명령을 사용할 수가 없는데, 해결책은 다음의 글에서 이미 설명했습니다.

Windows 10의 Recovery 파티션을 삭제 및 새로 생성하는 방법
; https://www.sysnet.pe.kr/2/0/11209

단순히 삭제 후 새롭게 만들어 주면 되지만 그럴 경우 winre.wim 파일을 다시 만들어야 하는 번거로움이 있으므로 그냥 단순하게 기존의 복구 파티션에 있는 내용을 그대로 재사용하는 것이 더 좋습니다. 따라서 Recovery Partition에 드라이브 문자를 할당하고,

C:\WINDOWS\system32> diskpart

Microsoft DiskPart version 10.0.14393.0

Copyright (C) 1999-2013 Microsoft Corporation.
On computer: TESTPC

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online           45 GB    11 GB
  Disk 1    Online           16 GB  1024 KB
  Disk 2    Online            8 GB  1024 KB

DISKPART> select disk 0

Disk 0 is now the selected disk.

DISKPART> list part

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary            100 MB  1024 KB
  Partition 2    Primary             33 GB   101 MB
  Partition 3    Recovery           450 MB    33 GB

DISKPART> sel part 3

Partition 3 is now the selected partition.

DISKPART> assign letter=k

DiskPart successfully assigned the drive letter or mount point.

다음과 같이 robocopy를 이용해 백업해 둡니다.

C:\WINDOWS\system32> robocopy k:\ d:\temp\Kdrive\ /S

이제 복구 파티션을 삭제하고,

C:\WINDOWS\system32> diskpart

Microsoft DiskPart version 10.0.14393.0

Copyright (C) 1999-2013 Microsoft Corporation.
On computer: TESTPC

DISKPART> sel disk 0

DISKPART> sel part 3

Partition 3 is now the selected partition.

DISKPART> delete part override

DiskPart successfully deleted the selected partition.

아래와 같이 450MB 공간이 남도록 파티션을 재조정합니다.

move_recovery_partition_2.png

그다음, 다시 기존 백업해 두었던 내용을 새로운 드라이브에 복사해 준 후,

robocopy d:\temp\Kdrive\ f:\ /S /XF tracking.log

Recovery 파티션으로써 동작하도록 설정 작업을 마무리합니다.

F:\> reagentc /setreimage /path f:\recovery\WindowsRE\Winre.wim
Directory set to: \\?\GLOBALROOT\device\harddisk0\partition3\recovery\WindowsRE

REAGENTC.EXE: Operation Successful.


F:\> reagentc /enable
REAGENTC.EXE: Operation Successful.

"Windows 10의 Recovery 파티션을 삭제 및 새로 생성하는 방법" 글에서도 설명했지만, 여기까지 하면 복구 파티션으로의 동작은 합니다. 다만 이전과 동일하게 보이지 않도록 만들고 싶다면 다음과 같이 복구 파티션임을 명시하는 작업을 추가합니다.

F:\> diskpart

Microsoft DiskPart version 10.0.14393.0

Copyright (C) 1999-2013 Microsoft Corporation.
On computer: TESTPC

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online           45 GB  1024 KB
  Disk 1    Online           16 GB  1024 KB
  Disk 2    Online            8 GB  1024 KB

DISKPART> sel disk 0

Disk 0 is now the selected disk.

DISKPART> list part

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary            100 MB  1024 KB
  Partition 2    Primary             44 GB   101 MB
  Partition 3    Primary            462 MB    44 GB

DISKPART> sel part 3

Partition 3 is now the selected partition.

GPT 파티션인 경우에는 다음의 명령어로,

DISKPART> set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac

DiskPart successfully set the partition ID.


DISKPART>  GPT attributes=0x8000000000000001

DiskPart successfully assigned the attributes to the selected GPT partition.

DISKPART> detail part

Partition 3
Type    : de94bba4-06d1-4d40-a16a-bfd50179d6ac
Hidden  : Yes
Required: Yes
Attrib  : 0X8000000000000001
Offset in Bytes: 106688413696

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
* Volume 3     F   New Volume   NTFS   Partition    462 MB  Healthy    Hidden

MBR 파티션인 경우에는 다음의 명령어로,

DISKPART> set id=27 override

DiskPart successfully set the partition ID.

수행한 후, 마지막으로 (취향에 따라) 기존에 할당한 드라이브 문자를 제거합니다.

diskpart - remove letter 이후 재부팅 시 다시 드라이브 문자가 할당되는 경우
; https://www.sysnet.pe.kr/2/0/11804




그렇다면, 다음에도 디스크 용량이 부족하면 어떻게 해야 할까요? 당연히 위와 같은 작업을 또 해줘야 합니다. 이쯤에서, 왜??? 복구 파티션이 언제나 앞에 있었는지 그 이유를 알 수 있습니다. ^^

참고로, 여타의 파티션 관리 소프트웨어를 통해 이 작업을 좀 더 편하게 할 수 있습니다. 단지, 대부분의 프로그램들이 유료이거나 믿을 수 없는(untrusted) 소스로부터 다운로드하는 것이어서 개인적으로는 이렇게 직접 작업하는 것을 더 선호합니다. ^^




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 2/16/2023]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 



2019-11-14 07시46분
[궁금해요] 후미에 생성된 복구파티션을 맨 앞으로 옮기는 방법은 없나요..?
[guest]
2019-11-14 08시25분
넵 없습니다. 그렇긴 한데, 제가 알기로는 상용 파티션 도구들은 그런 기능을 제공하는 것도 있는 듯합니다.
정성태
2019-11-14 10시23분
[궁금해요] 그렇군요..답변 감사합니다.
[guest]
2021-01-24 08시51분
[마냥] 사용중인 PC에 복구 파티션 때문에 C 드라이브 크기 조절을 못하고 있었는데 이 글 덕분에 해결했습니다. 고맙습니다^^
[guest]

... 61  62  63  64  65  66  67  68  [69]  70  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
12211정성태4/27/202019239개발 환경 구성: 486. WSL에서 Makefile로 공개된 리눅스 환경의 C/C++ 소스 코드 빌드
12210정성태4/20/202020687.NET Framework: 903. .NET Framework의 Strong-named 어셈블리 바인딩 (1) - app.config을 이용한 바인딩 리디렉션 [1]파일 다운로드1
12209정성태4/13/202017404오류 유형: 614. 리눅스 환경에서 C/C++ 프로그램이 Segmentation fault 에러가 발생한 경우 (2)
12208정성태4/12/202015963Linux: 29. 리눅스 환경에서 C/C++ 프로그램이 Segmentation fault 에러가 발생한 경우
12207정성태4/2/202015799스크립트: 19. Windows PowerShell의 NonInteractive 모드
12206정성태4/2/202018423오류 유형: 613. 파일 잠금이 바로 안 풀린다면? - The process cannot access the file '...' because it is being used by another process.
12205정성태4/2/202015092스크립트: 18. Powershell에서는 cmd.exe의 명령어를 지원하진 않습니다.
12204정성태4/1/202015089스크립트: 17. Powershell 명령어에 ';' (semi-colon) 문자가 포함된 경우
12203정성태3/18/202017936오류 유형: 612. warning: 'C:\ProgramData/Git/config' has a dubious owner: '...'.
12202정성태3/18/202021196개발 환경 구성: 486. .NET Framework 프로젝트를 위한 GitLab CI/CD Runner 구성
12201정성태3/18/202018434오류 유형: 611. git-credential-manager.exe: Using credentials for username "Personal Access Token". [1]
12200정성태3/18/202018523VS.NET IDE: 145. NuGet + Github 라이브러리 디버깅 관련 옵션 3가지 - "Enable Just My Code" / "Enable Source Link support" / "Suppress JIT optimization on module load (Managed only)"
12199정성태3/17/202016167오류 유형: 610. C# - CodeDomProvider 사용 시 Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path '...\f2_6uod0.tmp'.
12198정성태3/17/202019528오류 유형: 609. SQL 서버 접속 시 "Cannot open user default database. Login failed."
12197정성태3/17/202018810VS.NET IDE: 144. .NET Core 콘솔 응용 프로그램을 배포(publish) 시 docker image 자동 생성 - 두 번째 이야기 [1]
12196정성태3/17/202015942오류 유형: 608. The ServicedComponent being invoked is not correctly configured (Use regsvcs to re-register).
12195정성태3/16/202018262.NET Framework: 902. C# - 프로세스의 모든 핸들을 열람 - 세 번째 이야기
12194정성태3/16/202020992오류 유형: 607. PostgreSQL - Npgsql.NpgsqlException: sorry, too many clients already
12193정성태3/16/202017903개발 환경 구성: 485. docker - SAP Adaptive Server Enterprise 컨테이너 실행 [1]
12192정성태3/14/202019923개발 환경 구성: 484. docker - Sybase Anywhere 16 컨테이너 실행
12191정성태3/14/202021040개발 환경 구성: 483. docker - OracleXE 컨테이너 실행 [1]
12190정성태3/14/202015621오류 유형: 606. Docker Desktop 업그레이드 시 "The process cannot access the file 'C:\Program Files\Docker\Docker\resources\dockerd.exe' because it is being used by another process."
12189정성태3/13/202021205개발 환경 구성: 482. Facebook OAuth 처리 시 상태 정보 전달 방법과 "유효한 OAuth 리디렉션 URI" 설정 규칙
12188정성태3/13/202026020Windows: 169. 부팅 시점에 실행되는 chkdsk 결과를 확인하는 방법
12187정성태3/12/202015576오류 유형: 605. NtpClient was unable to set a manual peer to use as a time source because of duplicate error on '...'.
12186정성태3/12/202017398오류 유형: 604. The SysVol Permissions for one or more GPOs on this domain controller and not in sync with the permissions for the GPOs on the Baseline domain controller.
... 61  62  63  64  65  66  67  68  [69]  70  71  72  73  74  75  ...