linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] can't use swap after switch to LVM
@ 2006-04-09 17:31 Joel Uckelman
  2006-04-09 22:11 ` Joel Uckelman
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Uckelman @ 2006-04-09 17:31 UTC (permalink / raw)
  To: linux-lvm

I just switched my desktop FC5 system from using software RAID over regular
partitions to using software RAID over LVM; everything works fine, except
I can't enable my swap.

On boot, I get the following messages:

   device-mapper: device 9:1 too small for target
   device-mapper: dm-linear: Device lookup failed
   device-mapper: error adding target to table
   .
   .
   .
   Unable to find swap-space signature

My swap volume is listed like this in my /etc/fstab:

   /dev/VolGroup00/LogVol01 swap swap defaults 0 0

If I try to format the swap volume, mkswap tells me that it's too small:

   # mkswap /dev/mapper/VolGroup00-LogVol01
   mkswap: error: swap area needs to be at least 40kB

But 'lvm lvs' reports that's it's 1GB:

   LogVol01 VolGroup00 -wi-d-     1.00G

I've tried deleting and recreating the swap volume:

   # lvm lvremove VolGroup00/LogVol01
   # lvm lvcreate -L 1024M -n LogVol01 VolGroup00
   device-mapper: reload ioctl failed: Invalid argument
   Failed to activate new LV.

Does anyone have an idea of what's going wrong here?

-- 
J.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-lvm] can't use swap after switch to LVM
  2006-04-09 17:31 [linux-lvm] can't use swap after switch to LVM Joel Uckelman
@ 2006-04-09 22:11 ` Joel Uckelman
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Uckelman @ 2006-04-09 22:11 UTC (permalink / raw)
  To: LVM general discussion and development

Thus spake Joel Uckelman:
> I just switched my desktop FC5 system from using software RAID over regular
> partitions to using software RAID over LVM; everything works fine, except
> I can't enable my swap.
> 
> On boot, I get the following messages:
> 
>    device-mapper: device 9:1 too small for target
>    device-mapper: dm-linear: Device lookup failed
>    device-mapper: error adding target to table
>    .
>    .
>    .
>    Unable to find swap-space signature
> 
> My swap volume is listed like this in my /etc/fstab:
> 
>    /dev/VolGroup00/LogVol01 swap swap defaults 0 0
> 
> If I try to format the swap volume, mkswap tells me that it's too small:
> 
>    # mkswap /dev/mapper/VolGroup00-LogVol01
>    mkswap: error: swap area needs to be at least 40kB
> 
> But 'lvm lvs' reports that's it's 1GB:
> 
>    LogVol01 VolGroup00 -wi-d-     1.00G
> 
> I've tried deleting and recreating the swap volume:
> 
>    # lvm lvremove VolGroup00/LogVol01
>    # lvm lvcreate -L 1024M -n LogVol01 VolGroup00
>    device-mapper: reload ioctl failed: Invalid argument
>    Failed to activate new LV.
> 
> Does anyone have an idea of what's going wrong here?

Finally the cause of my problem dawned on me: The two drives in my
software RAID are not exactly the same size (despite being the same
"model"). I created the volume group on the drive which is about 1GB
larger, and then put the two drives together as a software RAID.
Thus, my swap partition, which was coincindentally also 1GB, "fell off
the end" of the volume group when creating the RAID chopped off the
last 1GB of it.

I solved this by:

1. Using resize2fs to reduce the size of the filesystem in one of my
logical volumes by 1GB.

2. Shrinking the logical volume by 1GB.

3. Creating another logical volume for my swap partition.

-- 
J.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-09 22:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-09 17:31 [linux-lvm] can't use swap after switch to LVM Joel Uckelman
2006-04-09 22:11 ` Joel Uckelman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).