Tip: Use guestfish ‘du’ to get disk usage for a directory

Virt-df lets you see disk usage of your virtual machines by partition.

What if you want to see the usage for a part of the directory hierarchy, eg. everything under /home or in /usr/share/doc? There is no “virt-du” command, but you can use the “du” command in guestfish:

$ echo du /usr/share/doc | guestfish --ro -i Fedora12
282304

The number printed is in kilobytes.

This also works, with a small modification, for Windows VMs:

$ echo du 'win:C:\windows\system32' | guestfish --ro -i Win2003x32
990022

2 Comments

Filed under Uncategorized

2 responses to “Tip: Use guestfish ‘du’ to get disk usage for a directory

  1. Pingback: Tip: Use ‘du’ to see which subdirectories use most space « Richard WM Jones

  2. Pingback: KDE Filelight with guestmount « Richard WM Jones

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s