# Help with SWAP on FreeBSD 9.1



## mefizto (Jan 22, 2013)

Greatings all,

inspired by Vermaden's excellent HOWTO at Thread 12082, I have accomplished installation of the base system onto a USB flash drive.

I would now like to add a zpool comprising a mirror of two hard drives for SWAP and data.  So I have formatted the two hard drives X=1,2, as follows:


```
gpart create -s gpt adaX
gpart add -t freebsd-swap -l SWAP0X -s 5GB adaX
gpart add -t freebsd-zfs -l DATA0X adaX
```

I do not want the swap to be mirrored, so I think the next step is to create mirror on the data partition as follows:


```
zpool create data mirror ada0p2 ada1p2
set mountpoint=/data data
```

However, I do not know how to deal with the swap partition.  Do I mount it via /etc/fstab? And if so, how do I deal with the two swap partitions?

Any help would be greatly appreciated.

Kindest regards,

M


----------



## SirDice (Jan 23, 2013)

mefizto said:
			
		

> Do I mount it via /etc/fstab?


Yes.


> And if so, how do I deal with the two swap partitions?


Add more entries:

```
/dev/ada1s1b            none            swap    sw              0       0
/dev/ada2s1b            none            swap    sw              0       0
```


----------



## mefizto (Jan 23, 2013)

SirDice,

thank you very much.

Kindest regards,

M


----------

