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

Re: can't swapon second partition after swapoff, overwrite /dev/urandom, swapon



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




Reply to: