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.

1
  • 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)? Jun 11, 2011 at 8:16

2 Answers 2

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
2
  • nice spotting. I wouldn't have seen that immediately :) Jun 7, 2011 at 18:45
  • I mistyped that line, it does not contain a comma. I just confirmed this on the machine. (I edited the question.) Jun 9, 2011 at 17:04
1
/dev/VolGroup00/LogVol01 swap                   swap    defaults        0 0

-

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

then post the output.

3
  • # umount: /dev/VolGroup00/LogVol01: not mounted Jun 14, 2011 at 14:42
  • When I do swapon -a I get swapon: /dev/VolGroup00/Log01: Invalid argument Jun 14, 2011 at 14:44
  • But doing a mkswap /dev/VolGroup00/LogVol01 and then swapon -a works. Jun 14, 2011 at 14:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .