I have a zpool with two disks in mirror-mode. The zpool is directly mounted to /tank. Now I want to create zfs partitions and no longer mount the whole pool. Therefore I need somehow to move all data from /tank to the new location.

Can I create a new zpool with some partitions and then simply dd the whole /tank to one of the new partitions or is this stupid?

What is the best way to do this?


You can unmount a ZFS drive, but there is no such thing as a ZFS "partition", it's just not how it works. ZFS is both a file system (like EXT or UFS) and a volume manager (like a RAID HBA, or Linux LVM); you can not separate those functions.

If you want to create another ZFS file system in the same tank, just use zfs create tank/new_fs. If you want to mimic old fashion partitions you can assign each file system a space reservation in the zpool, but this is also not necessary. You can also set each with an individual reservation or quota, depending on what you want to accomplish.

  • there is no such thing as a ZFS "partition" This isn't true. ZFS pools can be created with whole disks, partitions or even files as the pool members. There are plenty of good reasons to not use partitions (ZFS can leverage drive cache, grub is harder to setup, etc) but that doesn't mean you can't do it. – notpeter May 14 '12 at 15:52
  • 1
    @notpeter While ZFS can certainly use partitions as a block vdev, it's really not the same idea as traditional "partitions" or "partitioning"; which is the reason I put the term in quotes. Thinking about ZFS paradigms in traditional disk/partition/file-system terminology will usually limit people's understanding, which is why I strongly discourage the use of those terms. – Chris S May 14 '12 at 17:28

As far as I know, the pool will always be mounted. But, don't worry about it.

Set the mountpoint property of the filesystem to where you want to mount it.

zfs set mountpoint=/some/mountpoint tank/filesystemname

If I understand correctly, you want to move a ZFS pool content to another pool.

dd might work assuming the source pool is inactive (in the exported state) and you don't try to have both pools imported at the same time later. However, the supported and more secure way would be to create a snapshot of all datasets present on the source pool and recursively send/receive them.

  • How about zfs send and recv? – 3molo Apr 24 '12 at 5:43
  • That is precisely what I am suggesting. – jlliagre Apr 24 '12 at 9:03
  • Oh yes sorry. I didn't read all of it. :-). – 3molo Apr 24 '12 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.