Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I resized with lvresize the swap from 4 to 2G and can't turn it on.

swapon /dev/VolGroup/lv_swap
swapon: /dev/VolGroup/lv_swap: swapon failed: Invalid argument

lvdisplay /dev/VolGroup/lv_swap
  --- Logical volume ---
  LV Name                /dev/VolGroup/lv_swap
  VG Name                VolGroup
  LV UUID                h7DEfK-cdVr-UzeQ-8qDJ-rAhH-ejYS-k2wyY6
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                2.06 GiB
  Current LE             66
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1
share|improve this question
up vote 3 down vote accepted

You need to run mkswap on that device:

# mkswap /dev/VolGroup/lv_swap

Resizing the device will not, by itself, re-prepare the device for swapping.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.