1

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?

nic
  • 11
  • 1

3 Answers3

2

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.

Chris S
  • 77,945
  • 11
  • 124
  • 216
  • `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
0

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
Shane Madden
  • 114,520
  • 13
  • 181
  • 251
0

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.

jlliagre
  • 8,861
  • 18
  • 36