1 [[!meta title="Setting up swapcache"]]
3 This page was created from my notes of setting up my SSD as a swapchache.
4 I used the Intel 40 GB X25-V SATA II MLC.
8 # Formatting new drive for swap
10 After you install your dive you should be able to find it from dmesg.
11 For the Intel just grep on INTEL
14 ad6: 38166MB <INTEL SSDSA2M040G2GC 2CV102HB> at ata3-master SATA150
16 So our new drive is ad6.
17 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.**"]]
19 # dd if=/dev/zero of=/dev/ad6 bs=1k count=1
21 # disklabel64 -B -w -r ad6s1 auto
22 # disklabel64 -e ad6s1
24 Now you should be in your editor with the disklabel data.
25 Arrow down to the bottom of the screen.
26 You should see some sample labels
32 After the last line add :
38 Create a new file system on your drive.
42 # Adding Disk to fstab
44 Edit /etc/fstab and comment out any exisiting swap partitions. Just add a # in front of the line.
46 #/dev/serno/JPC550HN25.s1b none swap sw 0 0
48 Add your new device to fstab
50 /dev/ad6s1b none swap sw 0 0
52 # Setting swapcache to start on boot
54 To enable swapcache on boot edit /etc/sysctl.conf and add
56 vm.swapcache.read_enable=1
57 vm.swapcache.meta_enable=1
58 vm.swapcache.data_enable=1
60 See [swapcache(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#swapcache§ion8) for other sysctl options.
62 # Activating the swapcache
64 The easiest way at this point is to just reboot the machine.