[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zfs-discuss
Subject:    Re: [zfs-discuss] zpool naming
From:       "Adele.liu () oracle ! com" <adele ! liu () oracle ! com>
Date:       2011-10-25 17:41:46
Message-ID: 4EA6F4DA.408 () oracle ! com
[Download RAW message or body]

David,

Appreciated so much for your sharing.

Best Regards,
Adele


On 10/25/2011 10:23 AM, David Magda wrote:
> On Tue, October 25, 2011 09:42, Adele.liu@oracle.com wrote:
>> Hi all,
>>
>> I have a customer who wants to know what is the max characters allowed
>> in creating name for zpool,
>>
>> Are there any restrictions in using special characters?
> 255 characters. Try doing a 'man zpool':
>
>    Creates a new storage pool containing the virtual devices specified
>    on  the  command  line. The pool name must begin with a letter, and
>    can only contain alphanumeric  characters  as  well	as  underscore
>    ("_"),  dash  ("-"),  and  period  (".").  The pool names "mirror",
>    "raidz", "spare" and "log" are reserved,  as  are  names  beginning
>    with  the  pattern "c[0-9]". The vdev specification is described in
>    the "Virtual Devices" section.
>
> Or, use the source Luke:
>
> Going to http://src.opensolaris.org, and searching for "zpool" turns up:
>
>      http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/zpool/zpool_main.c
>
> Inside of it we have a zpool_do_create() function, which defines a 'char
> *poolname' variable. From there we call a zpool_create() in
> libzfs/common/libzfs_pool.c to zpool_name_valid() to pool_namecheck(),
> where we end up with the following code snippet:
>
>   	/*
>   	 * Make sure the name is not too long.
>   	 *
>   	 * ZPOOL_MAXNAMELEN is the maximum pool length used in the userland
>   	 * which is the same as MAXNAMELEN used in the kernel.
>   	 * If ZPOOL_MAXNAMELEN value is changed, make sure to cleanup all
>   	 * places using MAXNAMELEN.
>   	 */
>   	if (strlen(pool)>= MAXNAMELEN) {
>   		if (why)
>   			*why = NAME_ERR_TOOLONG;
> 		return (-1);
>   	}
>
> Check the function for further restrictions:
>
>      http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/common/zfs/zfs_namecheck.c#288
>
>
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic