VMware Communities
UlyssesOfEpirus
Enthusiast
Enthusiast

Shrink XFS by means of dump, mkfs, restore

It seems one can make a partition smaller and at the same time shrink a virtual disk as follows: documentation for XFS says an XFS partition can only be made smaller of you "do a complete dump, mkfs and restore."

http://xfs.org/index.php/XFS_FAQ#Q:_Is_there_a_way_to_make_a_XFS_filesystem_larger_or_smaller.3F

This should also do a shrink if the restore is to a brand new empty disk, but what are the specific steps for the following?

"do a complete dump, mkfs and restore"

Reply
0 Kudos
6 Replies
UlyssesOfEpirus
Enthusiast
Enthusiast

And as a side-effect, would this defrag the partition?

Would this work to also convert to a new filing system?

Reply
0 Kudos
WoodyZ
Immortal
Immortal

This should also do a shrink if the restore is to a brand new empty disk, but what are the specific steps for the following?

"do a complete dump, mkfs and restore"

I'd probably start by reading the manpages for xfsdump, xfsrestore and mkfs and then utilize forums centric to XFS and Linux first and then here with VMware specific questions after learning what "do a complete dump, mkfs and restore" means.

Reply
0 Kudos
UlyssesOfEpirus
Enthusiast
Enthusiast

Isn't there something that would work with all filing systems? I mean, just copying files across to a new disk while taking care of special cases like /dev, soft links, hard links etc? You guys must have hit this obstacle of copying special files.

Reply
0 Kudos
WoodyZ
Immortal
Immortal

Isn't there something that would work with all filing systems?

Technology is great however it doesn't work that way, there is no such a thing as one widget fitting all use case scenarios.

If you have a specific issue or a question involving a VMware product it would be much easier if you'd provide VMware product specific information along with explicit and specific information regarding what it is your trying to do and or accomplish and go from there.

Reply
0 Kudos
UlyssesOfEpirus
Enthusiast
Enthusiast

Shrinking that works with all filing systems is not general abstract philosophy but very vmware specific.  And where vmware tools fail, the common sense that says "make a new .vmdk and copy files to it" should do it in all filing systems.

Somewhere in these forums I saw someone recommending something like this, but can't locate that post. Anyone who's bookmarked those instructions?

Reply
0 Kudos
continuum
Immortal
Immortal

> Isn't there something that would work with all filing systems?

Not that I know  about such a thing - however the procedure itself works in all cases


- power off VM

- add new disk

- boot into LiveCD
- wipe blank space on the disk you want to clone

- partition new disk

- copy data disk to disk using the smartest procedure available
- power off VM

- edit vmx and exchange vmdks BEFORE first next boot


for Windows I use robocopy, unstopablecopier or ghost 32, for unknown filesystems I use dd

for Linux you may know the best procedure yourself I guess ... rsync maybe ?

if unsure use dd for the / partition to preserve special files and use rsync or whatever for data partitions

that resizes, defragments and shrinks the vmdk all in one run when you can use "clever" tools like ghost32


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos