[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: can't swapon second partition after swapoff, partially solved



On 3/11/08, Marc Shapiro <mshapiro_42@yahoo.com> wrote:
> diane mittnik wrote:
> > I tried googling and checking docs but couldn't find anything relevant.
> > I have 2 swap partitions, /dev/sda6, /dev/sda7. 1 GB of Ram
> > I wanted to wipe my swap partitions, so I did swapoff /dev/sda7, then
> > dd if=/dev/urandom of=/dev/sda7, then mkswap /dev/sda7, then swapon
> > /dev/sda7
> > With swapon /dev/sda7, I get the following error message:
> > # swapon /dev/sda
> > swapon: /dev/sda7: Invalid argument
> The following is from man mkswap:
>
> The PSZ parameter specifies the page size to use. It is
> almost always unnecessary (even unwise) to specify it, but certain old libc
> versions lie about the page size, so it is possible that mkswap gets it
> wrong. The symptom is that a subsequent swapon fails because no swap
> signature is found. Typical values for PSZ are 4096 or 8192.
>
> Is it possible that this is your problem? This does not say what error
> swapon would give, but it certainly sounds like a possibility in this
> case. Does anyone else know more about this situation?
> --
> Marc Shapiro
> mshapiro_42@yahoo.com
> --
The swapon problem self corrected after a reboot.  Prior to the reboot
I setup both swap partitions to use cryptsetup, something separate
from the issues I was having with the swapoff, overwrite, mkswap,
swapon failure.  After setting up cryptsetup and X crashing for some
reason (I never shutdown, the system stays up 24/7 whenever possible),
I took the opportunity to reboot and both swap partitions came up as
/dev/mapper/swap0 and /dev/mapper/swap1, and after setting up
/etc/crypttab and another reboot dmesg says everything is working ok.

otoh,  I still don't have an answer as to why the original failure
without rebooting.

Di.


Reply to: