Skip to contentSkip to conversation

Swap on LVM - swapoff problem - SOLVED

linux-lvm George Karaolides 2 participants 2 messages Apr 9, 2003

lore
Share & tools
lore
#0 lore raw

Hi all,

I've solved the problem with swapoff and LVM swap devices on Debian woody; and the solution may well apply to installations with the root fs on LVM using other distributions as well.

The root filesystem on my machines is in a logical volume device, and to mount this at boot time I needed to create an initrd with lvmcreate_initrd. This starts LVM before the root fs is mounted. The init scripts installed by the Debian LVM package then start LVM again, which seems to cause the problem.

Removing the symlink /etc/rcS.d/S25lvm and rebooting seems to have solved it:

# free
             total       used       free     shared    buffers    
Swap:       786424          0     786424
# swapoff /dev/vg1/swap
# free
             total       used       free     shared    buffers    
Swap:            0          0          0
# swapon /dev/vg1/swap
# free
             total       used       free     shared    buffers    
Swap:       786424          0     786424

Best regards,

|   George Karaolides                      Planitis Communications Ltd.,
|
|   tel:   +357 22 45 65 00              Office 102, 11 Florinis Street,
|
|   web:   www.planitis.net                             Nicosia CY 1065,
|
|   email: [email protected]           Republic  of Cyprus.
|
#1 lore raw
Quoted 11 lines · George Karaolides

Hi all,

I've solved the problem with swapoff and LVM swap devices on Debian woody; and the solution may well apply to installations with the root fs on LVM using other distributions as well.

The root filesystem on my machines is in a logical volume device, and to mount this at boot time I needed to create an initrd with lvmcreate_initrd. This starts LVM before the root fs is mounted. The init scripts installed by the Debian LVM package then start LVM again, which seems to cause the problem.

I suspect that the right device node for the swap LV only really exists on the initrd used for booting

patrick