일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- SSH
- OTP
- 2FA
- FIDO2
- OSX
- MYSQL
- 앱스토어
- git
- apple
- Xcode
- Android
- 앱리소스
- 인증
- 애플
- otpkey
- kmip
- SSL
- WebAuthn
- SwiftUI
- SWIFT
- openssl
- albumbook
- MFA
- Nodejs
- 앨범북
- appres
- css
- 안드로이드
- fido
- MSYS2
- Today
- Total
인디노트
How to shrink a VMWare Fusion Linux virtual disk 본문
VMWare Fusion on Mac OSX allows you to shrink virtual disks easily for Windows virtual machines right from the graphical interface (Virtual Machine -> Settings -> General -> Clean Up Virtual Machine) but there isn't the same option to do this with Linux, so you need to do it from the command line.
1. Clean up space
First of all you should clean up whatever space you can on the Linux virtual machine by deleting uncessary files, etc. After doing that, run this command as the root user on the Linux VM to zero out any free space - if you don't do it, then the shrinking process won't reclaim any space:
You'll see this message when it has finished:
That's OK, because the idea was to fill the disk up and then delete the file afterwards.
2. Shut down the virtual machine
You can't reclaim space with the virtual machine running, so shut it down first.
3. Run the shrinking process
Open up Terminal on your Mac, change to the directory the virtual machine files are in (for example I have mine at ~/Virtual Machines/<vm name>) and then run the following commands, replacing "Virtual Disk.vmdk" with the actual name of your virtual disk image.
Note that if the filename contains spaces then the filename parameter to the command needs quotes around it, as in my examples.
The following examples assume VMWare Fusion is installed in Applications at the OSX disk root.
The first command defragments the disk:
I got the message "VixDiskLib: Invalid configuration file parameter. Failed to read configuration file." when running this command. I don't know what this error means, but the command worked successfully and this was the other output:
The second command then shrinks the disk:
Once again, I got the message "VixDiskLib: Invalid configuration file parameter. Failed to read configuration file." but again it all worked fine, and this was the output
I managed to reclaim 9GB of wasted space from doing this.
What is the virtual disk filename?
When you do a directory listing, you'll see a bunch of files and directories like this:
The disk images have the .vmdk file extension and in the above example have been split into 11 different files with numbered filenames. You don't need to defrag and shrink the numbered filenames, just the one without the numbers.
So in the above example, ignore Virtual Disk-s001.vmdk to Virtual Disk-s011.vmdk and run the command on Virtual Disk.vmdk.
If you do attempt to run the command on one of the numbered files, you'll get an error message like this one:
Version used
I ran the above commands on VMWare Fusion 7.1.1 on OSX Yosemite 10.10.3.
'개발 플랫폼 및 언어' 카테고리의 다른 글
pgxc_ctl.conf (0) | 2018.12.11 |
---|---|
Postgres-XL Installation Example on Linux (0) | 2018.11.30 |
[Linux] 리눅스 rsync 설정 방법 (0) | 2018.11.27 |
Tomcat 8 세션 클러스터링 하기 (0) | 2018.11.24 |
톰캣 세션 클러스터링 내가 적용한 것 (0) | 2018.11.24 |