Problem
Linux swap partition is disabled after VMware Virtual Machine restore.
Error Message
Backup the Linux Virtual Machine with having swap partition.
When attempt Virtual Machine restore from this backup, linux swap partition is disabled.
For example, the Virtual Machine has swap partition as the following.
RHEL 6.x Guest
fstab ---
UUID=4eb4a4b8-403e-4975-a519-e746196eb85c swap swap defaults 0 0
# swapon -s
Filename Type Size Used Priority
/dev/sda2 partition 1048568 0 -1
# blkid /dev/sda2
/dev/sda2: UUID="4eb4a4b8-403e-4975-a519-e746196eb85c" TYPE="swap"
After restoring this Virtual Machine, this swap parition is disabled.
# swapon -s
Filename Type Size Used Priority
Cause
The metadata area that UUID is stored in vmdk has been overwritten as NULL data.
Solution
This is working as designed. You will have to remove the check from the option "Exclude swap and paging files" to
avoid having to reconfigure the swap drive.
Workaround:
1. Disable "Exclude swap and paging files" option in policy setting.
2. Reconfigure the swap partition with using mkswap command after VMware Virtual Machine restore.
RHEL 6.x
Check UUID for swap partition in fstab.
UUID=4eb4a4b8-403e-4975-a519-e746196eb85c swap swap defaults 0 0
Check swap partition from fdisk command.
Setup swap partition.
mkswap -U 4eb4a4b8-403e-4975-a519-e746196eb85c /dev/sda2
Enable swapping.
swapon /dev/sda2
RHEL 5.x
Check swap partition in fstab.
Setup swap partition
mkswap /dev/sda2
Enable swapping
swapon /dev/sda2