Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Nov 2012 00:36:10 -0500
From:      "Thomas Mueller" <mueller23@insightbb.com>
To:        freebsd-questions@freebsd.org
Cc:        Snow Mountains <snow.mountains.4@gmail.com>
Subject:   Re: Groupping restored partitions into slices
Message-ID:  <0E.27.23131.AC1A8905@smtp02.insight.synacor.com>

Next in thread | Raw E-Mail | Index | Archive | Help
> 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



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?0E.27.23131.AC1A8905>