0

When I reboot my Linux server the swap space reads 0 in top.

  • I am running a vanilla install of CentOS 5.2
  • /etc/fstab looks fine from what I can tell

    /dev/VolGroup00/LogVol01 swap swap defaults 0 0
    
  • swapon -a returns "invalid params" error message for /dev/VolGroup00/LogVol01

Doing a mkswap /dev/VolGroup00/LogVol01 and then swapon -a works.

But each time I reboot the swap space goes back to 0 in top.

warren
  • 17,829
  • 23
  • 82
  • 134
Jared Brown
  • 247
  • 2
  • 6
  • 15
  • 1) Are you sure the error is "invalig params" not "invalid argument"? Don't retype manually, copy-paste everything. 2) Can you test whether reading from the logical volume is possible without errors (`dd if=/dev/VolGroup00/LogVol01 bs=512 count=10 of=/dev/null`)? – Aleksander Adamowski Jun 11 '11 at 08:16

2 Answers2

6

In /etc/fstab, all fields should be separated by whitespace. You have the last 2 fields' (fs_freq and fs_passno) values (zeros in both cases) separated by a comma.

Instead of this:

/dev/VolGroup00/LogVol01 swap swap defaults 0,0

You should have:

/dev/VolGroup00/LogVol01 swap swap defaults 0 0
1
/dev/VolGroup00/LogVol01 swap                   swap    defaults        0 0

-

# swapoff -a
# umount /dev/VolGroup00/LogVol01
# mount -a

then post the output.

dmourati
  • 24,720
  • 2
  • 40
  • 69