From owner-freebsd-questions@FreeBSD.ORG Wed Apr 2 10:33:37 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AEB3980 for ; Wed, 2 Apr 2014 10:33:37 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 219A5A38 for ; Wed, 2 Apr 2014 10:33:36 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id bs8so197545wib.11 for ; Wed, 02 Apr 2014 03:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=xGNC64YmNjtNLadLH3DZZ/owcMRvcZ6Es3NUmFkmaeI=; b=PDrmxwl6DBfC+QNWpCqnRi9/0+Z5y/oV+8ZwJy/TkybO6H+E6M7hRCkOu+Uvds9OGU HE6SXvoxAqg4x+vmXBW99QApL0UJus7j8LlnqA4xt8NYgtH9c7nyt+TZ2ssJvlpfuwrv xNzzgrBmrce8HPbB71KDkbqx4JuRo19vow9VUQIOXIqht4puExZacl2/TbpSilauSt/R FAjIHR+2bjLbZn2X17jRw+NNE6m1JE9aU+0/HyUGm6o31leYW/Wm+Ikdj98Xxov5YqT0 TJNmsN7LuHmYpcUT5/wOz1LhHdkuPXjb0W/qekemRSn4FKnCdZm8TraXSzx/+d9Pct3y Xwuw== X-Received: by 10.180.24.72 with SMTP id s8mr9465766wif.20.1396434814204; Wed, 02 Apr 2014 03:33:34 -0700 (PDT) Received: from [192.168.1.129] ([193.173.55.180]) by mx.google.com with ESMTPSA id m42sm3571797eex.21.2014.04.02.03.33.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Apr 2014 03:33:33 -0700 (PDT) Message-ID: <533BE77E.4070708@gmail.com> Date: Wed, 02 Apr 2014 12:33:34 +0200 From: Johan Hendriks User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Tobias Famulla Subject: Re: Labeling SATA ports References: <533AD768.5080602@famulla.eu> In-Reply-To: <533AD768.5080602@famulla.eu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 10:33:37 -0000 Tobias Famulla schreef: > Hello, > > I use a server with several HDDs in one enclosure. I use ZFS which > identifies the disks via UUID, so the system knows which HDDs are in the > slots, eventhough the naming (ada0...) might change. > I added the HDDs one after another to map the the slots to the 'scbus', > 'target' and 'lun', shown via camcontrol. > Now I would like to label the slots (not the partitions or drives, > because this is done by ZFS) to a name like (slot0...slot7) to put a > sticker on the enclosure to be easily able to change a HDD with a > failure and do not have to guess in which slot the HDD is located. > Of course i could write the scbus, target and lun number on the slots, > but is there an easier way to map these numbers (the physical SATA port) > to a name, for example by using camcontrol or anything else? > > I imaging changing a drive like this: zpool tells me a drive has a > defect, do 'zpool detach tank slot5', go to the server room and put a > new drive in slot with number 5 printed on it, do 'zpool attach tank > slot5', be happy. > > Cheers, > > Tobias > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" I took another route. I label my disks with gpart. Then I label the drive with a sticker matching the gpart label. I create the pool using the gpt labels so I always know which disk is where. This way if zpool tells me disk5 is offline or bad, I can walk into the server room and replace disk5. Even if someone takes out all the disk, shuffles them and insert them in another slot, if zpool tells me disk5 is bad, then i yank out the disk with the sticker disk5 I create my disks like this. ( da0, da1 ....) I insert a disk and then I do the gpart thing, and sticker the disk # gpart create -s GPT /dev/da0 # gpart add -t freebsd-zfs -a4k -l DISK0 /dev/da0 Print a sticker with DISK0 and put it on the front of the disk. Insert the next disk, look which device it is and do the gpart thing again # gpart create -s GPT /dev/da1 # gpart add -t freebsd-zfs -a4k -l DISK1 /dev/da1 Print a sticker with DISK1 and put it on the disk. Then I create the pool (a mirror in this example) I did not do the gnop trick because my example drives are 4k formatted :D. # zpool create tank mirror gpt/DISK0 gpt/DISK1 backup02 ~ # zpool status pool: tank state: ONLINE NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 mirror ONLINE 0 0 0 gpt/DISK0 ONLINE 0 0 0 gpt/DISK1 ONLINE 0 0 0 errors: No known data errors So now even if disks are shuffled around, and even if they change from da(x) to ada(x) as they are in a different box with different hardware, it does not matter any more. DISK0 is still DISK0 regards Johan