Ufsdumps of swap

Good Morning,

When doing ufsdump s would there be any value in doing a ufsdump of the swap? Is it even possible to do?

Well, maybe you can, but it is not a filesystem and the content is not relevant apart from being blocks of memory allocated to running processes, so there is no point, in my humble opinion.

What would you hope to recover from it anyway? Restoring at a later time would just put in memory that could not be accessed. You may crash the receiving server if it tried to use the swap space or if you then boot, the swap space is assumed empty as the system starts.

This is a pointless exercise, so when backing up, you can happily just bypass chunks of disk formatted as swap, be they disk slices or LVMs

On the other hand, if you have swap defined as a file in a mounted filesystem, that needs to be backed up because the OS will expect it to be there at boot time. It will define it as empty for its purposes when the swap file is activated, but it still needs to exist to allocate the space on disk.

I hope that this helps,
Robin

1 Like

Agreed. There is no point in even attempting to ufsdump swap space.

Also, if you have a swap file allocated within a filesystem, ufsdump is intelligent enough to just handle that situation transparently.

1 Like

Awesome.. Thanks!

Also, we aware that, if you are going to depend on such ufsdumps for recovery, then you should be using fssnap every time before ufsdump.

Search this forum for information on that (if you are not already familiar) and/or post your question(s) back here.

1 Like