1832526 Members
7989 Online
110043 Solutions
New Discussion

Swap

 
Fusuy Deivan
Occasional Contributor

Swap

Q1. Where secondary device swap should be defined? That is, in the root volume
group or in non root volume group.

Q2. Like primary device swap, should secondary device swap be defined with the
contiguous allocation and no bad block reallocation settings of the logical
volume.

Could not fine any info on these. My feeling is that in with no suggestion
otherwise it may be fine to use non root VG for secondary dev swap. Just want
to hear if any one dealt with this!
3 REPLIES 3
Carlos Riera
Frequent Advisor

Re: Swap

Hi:

A1- Secondary swap can be defined in any vg. Only Primary swap may be defined
on root Vg.

A2- Swap require the contiguous allocation and no bad block reallocation
settings of the logical volume.


I use include all swap devices in root vg.

Regards.

Re: Swap

Just a couple of comments for performance reasons:

A1) put your secondary swap space on any VG but not in the same disk (PV) as
any other swap. Choose the fastest disk you have and give all you swap LVs the
same priority (unless there's great performance differences between the disks).

A2) it's also advisible to turn off mirror cache consistency and recovery (this
is unnecessary overhead for a non filesystem LV): lvchange -c n -M n
Jim Butler_4
Advisor

Re: Swap

A couple things to remember - One device swap per logical volume. Spread the
swap out, but for best performance, do not prioritize it all over the map. I
have found it best to set the priority to 0 or 1. Usually, I use 1 for all my
swap, dev or fs.
You can add filesystem swap after a filesystem has been placed on a filesystem,
but dev swap must be allocated before any files are placed on the lvol.

If you are unsure how much swap to use, add fs swap - that way you can add or
remove it more easily. Once you know how much swap you really need, you can
set up the device swap permanently.