Re: No swap on my Debian Sid system
On Sunday 22 Jan 2006 18:07, Jack Malmostoso wrote:
> Hello there list,
>
> I have noticed today that my AMD64 box has no swap!
> I set it up during the installation as the /dev/md1 RAID-1 device, but
> today I found out in free that swap=0:
>
> nostromo:~# free -m
> total used free shared buffers cached
> Mem: 1003 456 547 0 17 235
> -/+ buffers/cache: 203 800
> Swap: 0 0 0
>
> So I tried to set it up manually:
>
> nostromo:~# mkswap -c /dev/sda2
> Setting up swapspace version 1, size = 509960 kB
> no label, UUID=97b4cddf-1209-4c23-81f3-9deec9dd7c8a
> nostromo:~# swapon /dev/sda2
> swapon: /dev/sda2: Invalid argument
>
> If I set up a swapfile, it works flawlessly:
>
> nostromo:~# dd if=/dev/zero of=pippo.swp bs=1024 count=10000
> 10000+0 records in
> 10000+0 records out
> 10240000 bytes (10 MB) copied, 0.121002 seconds, 84.6 MB/s
> nostromo:~# mkswap -c pippo.swp 10000
> Setting up swapspace version 1, size = 10235 kB
> no label, UUID=c46ec37b-360b-4bbc-a73b-bacac52b4562
> nostromo:~# swapon pippo.swp
>
> nostromo:~# free -m
> total used free shared buffers cached
> Mem: 1003 472 531 0 18 247
> -/+ buffers/cache: 206 797
> Swap: 9 0 9
>
>
> Any hints? I have added two swap entries in /etc/fstab but have not
> rebooted yet to try them (work in progress :()...
>
> --
> Best Regards, Jack
> Linux User #264449
> Powered by Debian GNU/Linux on AMD64
If you're using md for RAID-1, then the best way to have your swap partitions
is to have one partition on each drive, *outside* the RAID array, and use
them as separate swap partitions. There's little to no point in slowing down
the system by RAIDing the contents of the swapfile -- under almost any
circumstance in which that might be desirable, there will be worse and more
immediate problems. With the kind of hardware RAID that appears as a single
SCSI drive, you obviously can't avoid RAIDing swap; but at least it isn't
such a performance hit.
Due to the way the "modern" /dev works, you won't see an entry for sda2 at all
if /dev/sda2 has already been appropriated by some RAID array. Check
your /etc/raidtab to make sure that the partitions you want to use for swap
really are available. Reboot, and run `swapon` manually to make sure it
works. If it does, just add appropriate lines for /dev/sda2 and sdb2
to /etc/fstab and forget :)
--
AJS
delta echo bravo six four at earthshod dot co dot uk
Reply to: