Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Nathan Fowler on May 23, 2001, 10:13:44 PM

Title: SWAP file not working
Post by: Nathan Fowler on May 23, 2001, 10:13:44 PM
The swap file is not present on my system.

[root@c979493-a /webapps]# swapon -s
Filename                        Type            Size    Used    Priority

Manually starting it does not work:
[root@c979493-a /webapps]# swapon /dev/md2
swapon: /dev/md2: Invalid argument

[root@c979493-a /webapps]# cat /etc/fstab
/dev/md1                /                       ext2    defaults        1 1
/dev/md0                /boot                   ext2    defaults        1 2
/dev/cdrom              /mnt/cdrom              iso9660 noauto,owner,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner    0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/pts                devpts  gid=5,mode=620  0 0
/dev/md2                none                    swap    sw              0 0

[root@c979493-a /webapps]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 hdc1[1] hda1[0] 264000 blocks [2/2] [UU]
md0 : active raid1 hdc5[1] hda5[0] 11968 blocks [2/2] [UU]
md1 : active raid1 hdc6[1] hda6[0] 975616 blocks [2/2] [UU]
unused devices:



Anyone seeing the same thing on their end?  Thanks,
NF
Title: SWAP partition is working (was Re: SWAP file not working)
Post by: Charlie Brady on May 23, 2001, 10:41:47 PM
Nathan Fowler wrote:
>
> The swap file is not present on my system.
>
> [root@c979493-a /webapps]# swapon -s
> Filename                        Type            Size  
> Used    Priority

You don't have a swap file, you have a swap partition. Type "free" and you will see it active.

Regards

Charlie
Title: Re: SWAP partition is working (was Re: SWAP file not working
Post by: Nathan Fowler on May 23, 2001, 11:01:42 PM
Negative,

[root@c979493-a /root]# free -m
             total       used       free     shared    buffers     cached
Mem:            93         86          6         42         20         17
-/+ buffers/cache:         48         45
Swap:            0          0          0


Free is 0 Megabytes...and during bootup the swap activiation returns the same error as :
[root@c979493-a /root]# swapon /dev/md2
swapon: /dev/md2: Invalid argument

Notice output from dmesg:
[root@c979493-a /root]# dmesg |grep swap
Starting kswapd v 1.5
Unable to handle swap header version 921974503
Unable to handle swap header version 921974503
Unable to handle swap header version 921974503
Unable to handle swap header version 921974503
Unable to handle swap header version 921974503

Any additional ideas?  Thanks in advance.
Title: Re: SWAP partition is working (was Re: SWAP file not working
Post by: Charlie Brady on May 23, 2001, 11:27:31 PM
Nathan Fowler wrote:

> Negative,
>
> [root@c979493-a /root]# free -m
>              total       used       free     shared  
> buffers     cached
> Mem:            93         86          6         42        
> 20         17
> -/+ buffers/cache:         48         45
> Swap:            0          0          0

I stand corrected.

> Free is 0 Megabytes...and during bootup the swap activiation
> returns the same error as :
> [root@c979493-a /root]# swapon /dev/md2
> swapon: /dev/md2: Invalid argument
>
> Notice output from dmesg:
> [root@c979493-a /root]# dmesg |grep swap
> Starting kswapd v 1.5
> Unable to handle swap header version 921974503
> Unable to handle swap header version 921974503
> Unable to handle swap header version 921974503
> Unable to handle swap header version 921974503
> Unable to handle swap header version 921974503
>
> Any additional ideas?

The swap partition, for some reason, does not have a valid swap signature. Make sure that you have a safe backup, and then use the mkswap command to reinitialise your swap partition. Let bugs@e-smith.com know if you find any evidence as to what caused your problem.

Regards

Charlie
Title: Re: SWAP partition is working (was Re: SWAP file not working
Post by: Nathan Fowler on May 24, 2001, 01:46:44 AM
[root@c979493-a /root]# mkswap /dev/md2
Setting up swapspace version 1, size = 270331904 bytes
[root@c979493-a /root]# swapon /dev/md2
[root@c979493-a /root]# free -m
             total       used       free     shared    buffers     cached
Mem:            93         90          2         47         18         18
-/+ buffers/cache:         53         39
Swap:          257          0        257

mkswap worked perfectly.  Charlie, thanks for your input and assistance.  /dev/md2 is the type df (Linux Autodetecting RAID), I'm assuming that if I lose one of the drives because the drive is a mirror set and the swap partition is a member of the RAID array that the swap partition will still be active, just like any other partition?

Thanks again.

Nathan