Nate
Thanks very much for the reply.
If that volume is not in use by anything else you should be perfectly able to do:
mkswap /dev/VolGroup00/swap swapon /dev/VolGroup00/swap
then add something like this to fstab: /dev/VolGroup00 swap swap defaults 0 0
Well it doesn't show up when I do 'df':
[root@mail ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 4.8G 446M 4.1G 10% / /dev/mapper/VolGroup00-LogVol02 1.9G 316M 1.5G 18% /var /dev/mapper/VolGroup00-LogVol03 9.5G 2.3G 6.7G 26% /usr /dev/sda1 99M 32M 63M 34% /boot tmpfs 1.9G 0 1.9G 0% /dev/shm /dev/mapper/VolGroup00-LogVol04 9.9G 172M 9.2G 2% /home /dev/mapper/VolGroup00-LogVol05 1.9G 35M 1.8G 2% /tmp
Also, as I said /dev/VolGroup00/swap is not listed in /etc/fstab, but it is listed in /dev/mapper/. Is that good enough confirmation that it is not in use?
I'm very curious how I managed to get into this situation, using the GUI install method. Any ideas on that? I'd prefer not to be in this situation again.
Thanks
Ian Masters
Ian Masters wrote:
Also, as I said /dev/VolGroup00/swap is not listed in /etc/fstab, but it is listed in /dev/mapper/. Is that good enough confirmation that it is not in use?
what does
# swapon -s
show?
for example, one of my systems shows...
# swapon -s Filename Type Size Used Priority /dev/md0 partition 2096376 294864 -1
and in turn, md0 is...
# mdadm -D /dev/md0 /dev/md0: Version : 00.90.03 Creation Time : Wed Jun 25 12:44:15 2008 Raid Level : raid1 Array Size : 2096384 (2047.59 MiB 2146.70 MB) Used Dev Size : 2096384 (2047.59 MiB 2146.70 MB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 0 Persistence : Superblock is persistent
Update Time : Mon Oct 27 23:29:04 2008 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0
UUID : 9dcfc53d:d1f69e6b:d91b109f:9e659e4c Events : 0.4
Number Major Minor RaidDevice State 0 8 2 0 active sync /dev/sda2 1 8 18 1 active sync /dev/sdb2
John R Pierce wrote:
what does
# swapon -s
show?
According to 'man swapon', swapon -s means:
Display swap usage summary by device. Equivalent to "cat /proc/swaps". Not available before Linux 2.1.25.
for example, one of my systems shows...
# swapon -s Filename Type Size Used Priority /dev/md0 partition 2096376 294864 -1
which show your swap partition, whereas on my problem system, 'swapon -s' produces no output at all.
Christopher Chan wrote:
Maybe you configured the swap lv but forgot to tell the installer to use it as swap.
Well that's entirely possible. The logical volume manager had me fairly confused.
I would have thought the installer might have told me that I had not set its file system type ...
Ian Masters wrote:
Christopher Chan wrote:
Maybe you configured the swap lv but forgot to tell the installer to use it as swap.
Well that's entirely possible. The logical volume manager had me fairly confused.
I would have thought the installer might have told me that I had not set its file system type ...
Well...it won't do that...but it should raise a flag on no swap being configured after you were done partitioning and assigning/setting filesystems.
Christopher Chan wrote:
Well...it won't do that...but it should raise a flag on no swap being configured after you were done partitioning and assigning/setting filesystems.
As far as I can remember there was no such 'flag'. That's precisely the kind of thing that would have made me jittery at the install stage.
Ian Masters wrote:
Christopher Chan wrote:
Well...it won't do that...but it should raise a flag on no swap being configured after you were done partitioning and assigning/setting filesystems.
As far as I can remember there was no such 'flag'. That's precisely the kind of thing that would have made me jittery at the install stage.
Was it Centos 5 that you installed? IIRC, the Centos/RHEL 4 installer would have asked you about the lack of swap assigned. I have only done one Centos 5 installation and I did not miss telling it to use the swap lv as swap so I cannot say whether the Centos 5 installer will do that.
Christopher Chan wrote:
Was it Centos 5 that you installed? IIRC, the Centos/RHEL 4 installer would have asked you about the lack of swap assigned. I have only done one Centos 5 installation and I did not miss telling it to use the swap lv as swap so I cannot say whether the Centos 5 installer will do that.
It was CentOS 5.2.
To me it seems slightly unlikely that functionality in v4 would be missing in v5. Having said that, it was my first CentOS install, and first experience of using LVM.
On Tue, 2008-10-28 at 00:21 -0700, John R Pierce wrote:
Ian Masters wrote:
which show your swap partition, whereas on my problem system, 'swapon -s' produces no output at all.
ok, that confirms your supposition, you have no swap configured.
All this raised a question in my mind. What's the value of have a swap managed by LVM? ISTM that: 1) swap is usually configured to be the maximum needed (depending on system usage and who you're talking to, 1, 2 times real memory usually), 2) additional overhead with no gain (I know several claim little to no overhead but background tells me there is always *some* even if small), 3) if you *do* increase this LV size to increase swap size, another mkswap is needed to "map" the new space, 4) more swap can be added by defining more LVs for swap, a partition dedicated to swap or a swap file with a file system and then mkswap and activating it.
I always just define a partition for that, flag it as swap in the partitioning process and go with that set up. I can envision the convenience of being able to temporarily disable swap, slapping a file system on it and addressing some need. Or even destroying the LV and freeing the PV for other use. But that sounds sort of far-fetched.
My *guess* is that the OP failed to mark a partition type of 82 for swap during install and thus ended up with this odd configuration. It's only a guess though.
Wouldn't it be better to vgremove/pvremove that thing and flag it as type 82, mkswap, etc.?
<snip sig stuff>
William L. Maltby wrote:
All this raised a question in my mind. What's the value of have a swap managed by LVM? ISTM that: 1) swap is usually configured to be the
I think the main reason would be simplicity, assuming you have other volumes created and not just a single VG with a single LV in it for swap.
Though I don't use LVM on the internal disks of my systems, have had too many headaches over the years with anaconda puking during installation with kickstart when using LVM. I only use LVM on SAN volumes.
nate
nate wrote:
William L. Maltby wrote:
All this raised a question in my mind. What's the value of have a swap managed by LVM? ISTM that: 1) swap is usually configured to be the
I think the main reason would be simplicity, assuming you have other volumes created and not just a single VG with a single LV in it for swap.
Though I don't use LVM on the internal disks of my systems, have had too many headaches over the years with anaconda puking during installation with kickstart when using LVM. I only use LVM on SAN volumes.
Centos/RHEL 5's anaconda has that licked. Feel free to do it with kickstart again. I have eight new boxes setup with kickstart doing lvm on mirrored partitions. /boot on its own mirrored partition.
Nate
If that volume is not in use by anything else you should be perfectly able to do:
mkswap /dev/VolGroup00/swap swapon /dev/VolGroup00/swap
then add something like this to fstab: /dev/VolGroup00 swap swap defaults
0 0
Shouldn't the fstab entry be:
/dev/VolGroup00/swap swap swap defaults 0 0
Just want to double-check before I dive in.
Thanks
Ian Masters
Hello,
Just in case anyone wants to follow my original problem in the future, I resolved my no swap problem according to Nate's advice as follows:
1. Confirmed that /dev/VolGroup00/swap was not in use by the system 2. Ran the following commands: mkswap /dev/VolGroup00/swap swapon /dev/VolGroup00/swap 3. Added the following to fstab: /dev/VolGroup00/swap swap swap defaults 0 0
Swap partition now showing as follows, using 'free': total used free shared buffers cached Mem: 3960252 463208 3497044 0 30876 350164 -/+ buffers/cache: 82168 3878084 Swap: 2031608 0 2031608
Thanks to the list and Nate in particular for the assistance.
Ian Masters
On Tue, 2008-10-28 at 00:21 -0700, John R Pierce wrote:
Ian Masters wrote:
which show your swap partition, whereas on my problem system, 'swapon -s' produces no output at all.
ok, that confirms your supposition, you have no swap configured.
Although I disagree, some on this list have proclaimed that a "properly configured" (for the intended use I guess) system needs no swap.
<snip>
on 10-28-2008 3:25 AM William L. Maltby spake the following:
On Tue, 2008-10-28 at 00:21 -0700, John R Pierce wrote:
Ian Masters wrote:
which show your swap partition, whereas on my problem system, 'swapon -s' produces no output at all.
ok, that confirms your supposition, you have no swap configured.
Although I disagree, some on this list have proclaimed that a "properly configured" (for the intended use I guess) system needs no swap.
<snip>
A properly configured system "can" need no swap for day to day operations, but you only need *one* runaway process to max out the memory and bring the system to a crashing halt. A little swap is just like a cheap insurance policy. You hope you don't need it, but if you do, you are glad it was there.
Even though the recommended swap is 2 times system memory, I have never made a swap partition over 2 GB. Maybe I am also flirting with disaster, but haven't been bit yet in years. Usually a run away process that hits into swap gives enough time for the kernel to kill it off before the whole system dumps.
Even though the recommended swap is 2 times system memory, I have never made a swap partition over 2 GB. Maybe I am also flirting with disaster, but haven't been bit yet in years. Usually a run away process that hits into swap gives enough time for the kernel to kill it off before the whole system dumps.
I am sorry but that 'recommended' swap should be twice the of RAM installed is complete nonsense and I treat the LPI certificate as rubbish precisely because they subscribe to that nonsense. The roots of swap = 2xRAM comes from an old release of Solaris which REQUIRED swap be 2xRAM. In today's environment, there is no standard rule for how much swap to configure. If there is one, it is simply 'configure as much as you need and want.'