Disk format

1,002 views
Skip to first unread message

tsuraan

unread,
Jun 4, 2008, 12:36:32 PM6/4/08
to zfs-fuse
The ZFS disk format used by zfs fuse is the same as any other zfs
implementation would use, right? I'm going to be making a home file
server later this summer, and I want to use zfs. I can deal with the
performance penalties of fuse for now, but I just want to make sure
that if Linux were to get a kernel implementation, the data that I've
accumulated would be usable with that new implementation, or if I were
to move the disks to a Solaris 10 machine, they would be usable there
as well.

Ricardo M. Correia

unread,
Jun 4, 2008, 1:19:45 PM6/4/08
to zfs-...@googlegroups.com
On Qua, 2008-06-04 at 09:36 -0700, tsuraan wrote:
The ZFS disk format used by zfs fuse is the same as any other zfs
implementation would use, right?

Sort of. Solaris doesn't like raw ZFS filesystems on a disk without any partitioning.

Another complication is that GPT labels created by ZFS on Solaris have a few issues, you can see this bug for more information:
https://bugzilla.lustre.org/show_bug.cgi?id=14548


  I'm going to be making a home file
server later this summer, and I want to use zfs.  I can deal with the
performance penalties of fuse for now, but I just want to make sure
that if Linux were to get a kernel implementation, the data that I've
accumulated would be usable with that new implementation, or if I were
to move the disks to a Solaris 10 machine, they would be usable there
as well.

I recommend creating a partition (with fdisk) on your disk for ZFS, and creating the ZFS pool in that partition (IOW, using "zpool create hda1" instead of "zpool create hda"). You should do this for all disks in your pool.
Since there is no "ZFS" partition type, you can use the "Linux" partition type (this can be easily changed in the future, if necessary).
I have verified this to work on Linux and Solaris, and it should work on other implementations as well.

Cheers,
Ricardo
--
Ricardo Manuel Correia
Lustre Engineering

Sun Microsystems, Inc.
Portugal
Phone +351.214134023 / x58723
Mobile +351.912590825
Email Ricardo....@Sun.COM
6g_top.gif

tsuraan

unread,
Jun 4, 2008, 2:08:39 PM6/4/08
to zfs-fuse
> I recommend creating a partition (with fdisk) on your disk for ZFS, and
> creating the ZFS pool in that partition (IOW, using "zpool create hda1"
> instead of "zpool create hda"). You should do this for all disks in your
> pool.
> Since there is no "ZFS" partition type, you can use the "Linux"
> partition type (this can be easily changed in the future, if necessary).
> I have verified this to work on Linux and Solaris, and it should work on
> other implementations as well.

fdisk (PC-BIOS MBR, really) doesn't like drives over (I think)
~500GB. For an array of terabyte hard drives, what would you
recommend? Also, when setting up the pool, one should use the /dev/
disk/by-id/ links instead of the sda/hda links, right? Does that
affect Solaris or BSD, since they don't have those device entries?

Ricardo M. Correia

unread,
Jun 4, 2008, 2:22:14 PM6/4/08
to zfs-...@googlegroups.com
On Qua, 2008-06-04 at 11:08 -0700, tsuraan wrote:
fdisk (PC-BIOS MBR, really) doesn't like drives over (I think)
~500GB.  For an array of terabyte hard drives, what would you
recommend?

In that case, you should probably use GPT labels.
You can do that with "parted" as follows:

$ parted /dev/sde
(parted) mklabel gpt
(parted) mkpart zfs 128KB 4GB (replace 4GB by whatever size the partition should have).
(parted) quit

After that, you can use sfdisk to force the kernel to re-read the partition table:

$ sfdisk -R /dev/sde

And then create the pool in the partition you just created:

$ zpool create /dev/sde1

Note that there are a few compatibility issues with GPT labels, but I've verified this to work on Solaris and Linux.


  Also, when setting up the pool, one should use the /dev/
disk/by-id/ links instead of the sda/hda links, right?

Right.


  Does that
affect Solaris or BSD, since they don't have those device entries?

No, there is no problem at all. Solaris and BSD have their own device naming mechanisms and the device names are discovered automatically when doing "zpool import".
6g_top.gif

Ricardo M. Correia

unread,
Jun 4, 2008, 2:24:59 PM6/4/08
to zfs-...@googlegroups.com
On Qua, 2008-06-04 at 19:22 +0100, Ricardo M. Correia wrote:
Note that there are a few compatibility issues with GPT labels, but I've verified this to work on Solaris and Linux.

Just to make it clear: I've verified it with parted 1.7.1, I haven't checked other versions.
I know there were bugs in parted with GPT labels some time ago, but if you need to know the details you'll have to ask in the parted mailing list..
6g_top.gif

tsuraan

unread,
Jun 4, 2008, 2:31:29 PM6/4/08
to zfs-fuse
> In that case, you should probably use GPT labels.
> You can do that with "parted" as follows:
>
> $ parted /dev/sde
> (parted) mklabel gpt
> (parted) mkpart zfs 128KB 4GB (replace 4GB by whatever size the
> partition should have).
> (parted) quit

Ok, cool. I've never looked at GPT before (and for anybody reading
this email, kernel support for it is under File Systems -> Partition
Types -> Advanced Partition Selection -> EFI Guid Partition Support).
Sounds interesting.

> And then create the pool in the partition you just created:
>
> $ zpool create /dev/sde1
>
> Note that there are a few compatibility issues with GPT labels, but I've
> verified this to work on Solaris and Linux.

Ok, good.

> No, there is no problem at all. Solaris and BSD have their own device
> naming mechanisms and the device names are discovered automatically when
> doing "zpool import".

Sounds good then. Thanks for the help!
Reply all
Reply to author
Forward
0 new messages