From owner-freebsd-questions@FreeBSD.ORG Tue Nov 6 05:36:17 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D66ECD23 for ; Tue, 6 Nov 2012 05:36:17 +0000 (UTC) (envelope-from mueller23@insightbb.com) Received: from mail.insightbb.com (smtp2.insight.synacor.com [208.47.185.24]) by mx1.freebsd.org (Postfix) with ESMTP id 836228FC0C for ; Tue, 6 Nov 2012 05:36:16 +0000 (UTC) X_CMAE_Category: 0,0 Undefined,Undefined X-CNFS-Analysis: v=2.0 cv=ZYCfx7pA c=1 sm=0 a=Dm9TOXL4taQ+Gy1KovpL+A==:17 a=X1Pz4l4wW6YA:10 a=jLN7EqiLvroA:10 a=9YQ-1ebCAAAA:8 a=LVshqx-NByoA:10 a=6I5d2MoRAAAA:8 a=paBbSDWzXxprWZzxozsA:9 a=Dm9TOXL4taQ+Gy1KovpL+A==:117 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Authentication-Results: smtp02.insight.synacor.com header.from=mueller23@insightbb.com; sender-id=softfail Authentication-Results: smtp02.insight.synacor.com smtp.mail=mueller23@insightbb.com; spf=softfail; sender-id=softfail Received-SPF: softfail (smtp02.insight.synacor.com: transitional domain insightbb.com does not designate 74.130.198.7 as permitted sender) Received: from [74.130.198.7] ([74.130.198.7:38331] helo=localhost) by mail.insightbb.com (envelope-from ) (ecelerity 2.2.3.49 r(42060/42061)) with ESMTP id 0E/27-23131-AC1A8905; Tue, 06 Nov 2012 00:36:10 -0500 Date: Tue, 06 Nov 2012 00:36:10 -0500 Message-ID: <0E.27.23131.AC1A8905@smtp02.insight.synacor.com> From: "Thomas Mueller" To: freebsd-questions@freebsd.org Subject: Re: Groupping restored partitions into slices Cc: Snow Mountains X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2012 05:36:17 -0000 > Short version: Is it possible to group existing partitions into slices > without affecting data? > Long version: > I had a disk sliced/partitioned like this: > ad4s1 > ad4s1a > ad4s1b (swap) > ad4s1d > ad4s1e > ad4s1f > ad4s2 (storage) > ad4s3 > ad4s3a > ad4s3b (swap) > ad4s3d > ad4s3e > ad4s3f > Then, I accidentally deleted *something* (wrong use of boot0cfg), > which left me with /dev/ad4 only! > scan_ffs correctly detected where all 9 data partitions begin. I > created new bsdlabel table, wrote it to ad4, so I now have > ad4a (former ad4s1a) > ad4b (former ad4s1b - swap) > ad4d (former ad4s1d) > ad4e (former ad4s1e) > ad4f (former ad4s1f) > ad4g (former ad4s2) > ad4h (former ad4s3a) > and beginning sectors of the rest (former ad4s3d-f). Of course, I > can't make more than 8 labels. > I can mount all of them and I see my data. I can even 'swapon ad4b'. > Now, the question: how can I restore s1, s2 and s3? As you can guess, > s1 and s3 were working systems. > Processing all this from FreeBSD-8/amd64 on another disc. > Thanks! > Sergi M For FreeBSD as opposed to NetBSD, and I believe, OpenBSD, disklabels/bsdlabels are for the slice rather than the whole disk, unless you partition the disk in "dangerously dedicated" mode. So you should create one bsdlabel for ad4s1 and install to the beginning of that partition, and ahother bsdlabel for ad4s3 and install to the beginning of ad4s3. Installation would be using bsdlabel. That's what I think, I could possibly be wrong. You can check the bsdlabel man page, accessible online from www.freebsd.org, even if you have no working installation of FreeBSD. One, or actually twice, NetBSD overwrote my FreeBSD disklabel/bsdlabel. The first time, I lost my FreeBSD installation but had nothing really to save, it was time to upgrade to FreeBSD 8.0. The second time, I had much software installed, but had the bsdlabel information saved in a file. I booted a FreeBSD rescue CD and restored the FreeBSD disklabel/bsdlabel, and was back in business. Tom