# too simplistic ZFS approach?



## Anonymous (Nov 30, 2010)

Using gpart, I created the following partitions onto a secondary internal SATA-HD.


```
server:~ root# gpart show ad6
=>        34  1250263661  ad6  GPT  (596G)
          34      409600    1  efi  (200M)
      409634  1249854061    2  freebsd-zfs  (596G)
```

I can mount the freebsd-zfs partition to the newly created mount point /tm simply by using:

[CMD=]mount /dev/ad6p2 /tm[/CMD]

I wrote already a lot of data to it without any errors. As a matter of fact /tm contains already 102 GB, and it seems that I can retrieve all the data without problems.


```
server:~ root# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad4s1a    1.9G    239M    1.5G    13%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ad4s1e    1.9G     19M    1.8G     1%    /tmp
/dev/ad4s1f    1.8T    1.3T    342G    79%    /usr
/dev/ad4s1d    3.9G     66M    3.5G     2%    /var
/dev/ad6p2     577G    102G    429G    19%    /tm
```

Anyway, when diving more and more into the complicated ZFS world, I discovered that I should have used something like zfs mount ... and enable zfs in /etc/rc.conf. Also, I can automatically mount /dev/ad6p2 to /tm at start up only by using "ufs" as the FStype for this partition, since the FStype "zfs" is unknown.

So perhaps, my first ZFS experiments started out too simplistic, and here are my questions:

Is /dev/ad6p2 really a ZFS partition, or is it only named "freebsd-zfs" but in reality it is UFS?

Can I turn this into something truly ZFS on the fly, without loosing the data on the disk, or is it better to start completely over again?

I am not aiming for the bells and whistles of a ZFS system. In this regard, UFS satisfies my needs. I am aiming for a HD partition scheme that would be readable by a ZFS enabled Mac OS X computer.

Many thanks for any response.

Best regards

Rolf


----------



## SirDice (Dec 1, 2010)

rolfheinrich said:
			
		

> Is /dev/ad6p2 really a ZFS partition, or is it only named "freebsd-zfs" but in reality it is UFS?


No and yes.



> Can I turn this into something truly ZFS on the fly, without loosing the data on the disk, or is it better to start completely over again?


No, no and yes.


----------



## usdmatt (Dec 1, 2010)

It's probably worth you reading through a few more ZFS tutorials before starting to put data on it...

gpart creates partitions. Just because you told gpart that you intent to use a partition for freebsd-zfs, doesn't mean you can't format it as something else.

To use ZFS you first need to create a zpool, basically a collection of one or more disks which will store your data. -

[cmd=]zpool create mypool ad6p2[/cmd]

This will create a zpool using just ad6p2, which is automatically mounted on '/mypool'.
Of course you will need to move your data somewhere else first.

Add 
	
	



```
zfs_enable="YES"
```
 to /etc/rc.conf to make the pool available on startup. If you want to move between machines you should do [cmd=]zpool export mypool[/cmd] on one machine, move the disk, then [cmd=]zpool import mypool[/cmd] on the new machine.

If the disk is for nothing other than ZFS, I generally prefer to use the whole disk:

[cmd=]zpool create mypool ad6[/cmd]

Once the pool is created you can see the details and status with [CMD=]zpool list[/cmd]
[cmd=]zpool status[/CMD]

Mirrored or raidz (raid5-ish) pools can be created as follows (shown using both partitions and whole disks):

[cmd=]zpool create mymirrorpool mirror ad6p2 ad8p2[/cmd]
[cmd=]zpool create myraidzpool raidz ad4 ad6 ad8[/cmd]

You can then create child filesystems on the pool using the zfs command - I suggest you read the zfs and zpool manpages.


----------

