Skip to content

HOWTO: ZFS Create new zpool and zfs mountpoints on FreeBSD 9

March 29, 2012

Assuming installed freebsd9 on zfs zpool (a.k.a. zroot)

Asumming we have two gparted devs with labels disk1 and disk3:

1. Create and verify zpool (I name it zstore )

db2# zpool create zstore mirror /dev/gpt/disk1 /dev/gpt/disk3

db2# zpool list

NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
zroot 19.9G 2.28G 17.6G 11% 1.00x ONLINE –
zstore 49.8G 109K 49.7G 0% 1.00x ONLINE –

2. Create mountpoint in the created pool ( I will use it for mysql and postgresql datadirs )

db2# zfs create -o mountpoint=/db/mysql zstore/mysql
db2# zfs create -o mountpoint=/db/pgsql  zstore/pgsql

That’s all, no need to write them in any confs or files, just verify:

db2# zfs list

NAME USED AVAIL REFER MOUNTPOINT
zroot 4.34G 15.2G 556M /
zroot/swap 2.06G 17.3G 322K –
zroot/tmp 35K 15.2G 35K /tmp
zroot/usr 1.65G 15.2G 561M /usr
zroot/usr/empty 31K 15.2G 31K /usr/empty
zroot/usr/home 31K 15.2G 31K /usr/home
zroot/usr/ports 442M 15.2G 442M /usr/ports
zroot/usr/run 31K 15.2G 31K /usr/run
zroot/usr/src 687M 15.2G 687M /usr/src
zroot/usr/tmp 31K 15.2G 31K /usr/tmp
zroot/var 84.6M 15.2G 84.6M /var
zroot/var/empty 31K 15.2G 31K /var/empty
zroot/var/tmp 32K 15.2G 32K /var/tmp
zstore 189K 49.0G 31K /zstore
zstore/mysql 31K 49.0G 31K /db/mysql
zstore/pgsql 31K 49.0G 31K /db/pgsql

Advertisements

From → FreeBSD

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: