1847696 Members
5960 Online
110265 Solutions
New Discussion

Re: Swap volume problem

 
SOLVED
Go to solution
Manuel G
Frequent Advisor

Swap volume problem

 
8 REPLIES 8
Sebastian Galeski_1
Trusted Contributor

Re: Swap volume problem

Hi
Firs of all increasing swap is hard to do because it have to be continious, so your firs swap is on 2nd lvol, so after lvol2 already exist lvol3. The best method is to add second swap.
To add second swap use SAM is the simplest method.

hope it help You
John Palmer
Honored Contributor

Re: Swap volume problem

Just supply the -f flag to swapon.

It's warning you that the diskspace that you intend to use contains a filesystem.

See man 1m swapon fro details.

Regards,
John
Rainer von Bongartz
Honored Contributor

Re: Swap volume problem

you once had a file system on this newly created logical volume
lvcreate does not!! format you logical volume.
now swapon seen that there is an existing file system on this lvol.
No problem to use this as a swap volume if you are sure you created your lvol fine

Regards
rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Ravi_8
Honored Contributor

Re: Swap volume problem

hi,

swapon -e -f -p 1 -u /dev/vg00/swap2
should work.
After this make an entry in /etc/fstab
never give up
Krishna Prasad
Trusted Contributor

Re: Swap volume problem

I also saw from your output of pvdisplay c2t5d0 that /dev/vg00/lvswap2 is not on that drive.

From looking at you lvcreate command you did not specify a drive. It is possible that lvswap2 is on a different drive then c2t5d0.

What do you get when you do a
lvdisplay -v /dev/vg00/lvswap2?

In either case there once was a filesystem on the drive /dev/vg00/lvswap2 is on.

Positive Results requires Positive Thinking
Manuel G
Frequent Advisor

Re: Swap volume problem

Just for clarifying:

Ron:

pvdisplay info. attached was reported before creating swap2 lvol.

For all:

If swap2 is a new lvol how could it any file system on it before???????

Do you think is safe to use -f option?

Thanks to all.
Wodisch
Honored Contributor
Solution

Re: Swap volume problem

Hello Manuel,

just by creating a new LV you do actually NOT write that much to the disk drive(s) - and NOTHING to the place allocated to the new LV!
Hence, if those sectors were used by the (beginning) of another LV (which did contain a file-system), those sectors STILL contain it! And when "swapon" read the first block from that LV, it gets the former "super-block" of the previous file-system - and complains!
Exactly for those cases you have the force option (-f).

The other problem is much more difficult - your kernel can only address as much space as given as the product of the kernel parameters "maxswapchunks" times "swchunksize" (usually 2MB each). You will have to generate a new kernel with those parameters increased - in m opinion it is always safer to have about 25% more swap space addressable as used. Only then you can add swap-space online without downtime (a new kernel needs a reboot to start working).

Just my ???0.02,
Wodisc
John Palmer
Honored Contributor

Re: Swap volume problem

The disk area that your new swap volume occupies must have held a filesystem at some time. lvcreate doesn't overwrite the contents of the volume in any way.

Did you have another volume starting at the same point on the disk before?

swapon is just being extra careful before overwriting what it thinks could be a valid filesystem. It's perfectly acceptable to use the -f option and quite safe.

Regards,
John