From: dylanr Date: Sun, 23 May 2010 23:09:06 +0000 (-0700) Subject: (no commit message) X-Git-Url: https://gitweb.dragonflybsd.org/ikiwiki.git/commitdiff_plain/6262f29a15630e75006656c11aac563c1a017ad5 --- diff --git a/docs/howtos/swapcache/index.mdwn b/docs/howtos/swapcache/index.mdwn new file mode 100644 index 00000000..0cdeff76 --- /dev/null +++ b/docs/howtos/swapcache/index.mdwn @@ -0,0 +1,65 @@ +[[!meta title="full page title"]] Setting up Swapcache + +This page was created from my notes of setting up my SSD as a swapchache. +The I used the Intel 40 GB X25-V SATA II MLC. + +[[!toc]] + +# Formatting new drive for swap + +After you install your dive you should be able to find it from dmesg. +For the Intel just grep on INTEL + + # dmesg | grep INTEL + ad6: 38166MB at ata3-master SATA150 + +So our new drive is ad6. +Now setup to the drive [[!color foreground=red text="**If you choose the wrong device you might/WILL destroy all your data on that disk.**"]] + + # dd if=/dev/zero of=/dev/ad6 bs=1k count=1 + # fdisk -BI ad6 + # disklabel64 -B -w -r ad6s1 auto + # disklabel64 -e ad6s1 + +Now you should be in your editor with the disklabel data. +Arrow down to the bottom of the screen. +You should see some sample labels + + # EXAMPLE + #a: 4g 0 4.2BSD + #a: * * 4.2BSD + +After the last line add : + + b: * 0 swap + +Now save the file. + +Create a new file system on your drive. + + # newfs /dev/ad6s1b + +# Adding Disk to fstab + +Edit /etc/fstab and comment out any exisiting swap partitions. Just add a # in front of the line. + + # /dev/serno/JPC550HN25.s1b none swap sw 0 0 + +Add your new device to fstab + + /dev/ad6s1b none swap sw 0 0 + +# Setting swapcache to start on boot + +To enable swapcache on boot edit etc/sysctl.conf and add + + vm.swapcache.read_enable=1 + vm.swapcache.meta_enable=1 + vm.swapcache.data_enable=1 + +See [swapcache(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#swapcache§ion8) for other sysctl options. + +# Activating the swapcache + +The easiest way at this point is to just reboot the machine. +