GEOM_STRIPE device wackiness
Pawel Jakub Dawidek
pjd at FreeBSD.org
Fri Jul 18 09:50:21 UTC 2008
On Sun, Jul 13, 2008 at 02:58:23AM +0200, Kris Kennaway wrote:
> I tried to create a stripe on two disks, after writing a new label to
> overwrite the previous one (all filesystems and swap had been
> unconfigured). No slices were in use on the disk and I did
>
> gstripe label -v -s 131072 data /dev/da0d /dev/da1d
>
> newfs worked fine, etc. Rebooted, and geom decided my da0 needed to
> sprout a da0s1, and that the gstripe should attach there (actually the
> da0? devices were completely gone). The filesystem was corrupt because
> the offsets were now all wrong on one of the disks.
>
> Rebooting into single-user mode the devices were sort of back:
>
> # ls -l /dev/da0*
> crw-r----- 1 root operator 0, 74 Jul 13 00:48 /dev/da0
> crw-r----- 1 root operator 0, 76 Jul 13 00:48 /dev/da0b
> crw-r----- 1 root operator 0, 77 Jul 13 00:48 /dev/da0c
> crw-r----- 1 root operator 0, 83 Jul 13 00:48 /dev/da0cs1
> crw-r----- 1 root operator 0, 87 Jul 13 00:48 /dev/da0cs1b
> crw-r----- 1 root operator 0, 88 Jul 13 00:48 /dev/da0cs1c
> crw-r----- 1 root operator 0, 89 Jul 13 00:48 /dev/da0cs1d
> crw-r----- 1 root operator 0, 78 Jul 13 00:48 /dev/da0d
> crw-r----- 1 root operator 0, 79 Jul 13 00:48 /dev/da0s1
> crw-r----- 1 root operator 0, 84 Jul 13 00:48 /dev/da0s1b
> crw-r----- 1 root operator 0, 85 Jul 13 00:48 /dev/da0s1c
> crw-r----- 1 root operator 0, 86 Jul 13 00:48 /dev/da0s1d
>
> "da0cs1"? Uh ok.
>
> # bsdlabel -r /dev/da0
> # /dev/da0:
> 8 partitions:
> # size offset fstype [fsize bsize bps/cpg]
> b: 33554432 16 swap
> c: 143638992 0 unused 0 0 # "raw" part,
> don't edit
> d: 110084544 33554448 4.2BSD 0 0 0
>
> ...still looks fine
>
> # gstripe destroy data
> GEOM_STRIPE: Disk da0d removed from data.
> GEOM_STRIPE: Device data destroyed.
> # gstripe label -v -s 131072 -h data /dev/da0d /dev/da1d
> GEOM_STRIPE: Device data created (id=2560258567).
> GEOM_STRIPE: Disk da0s1d attached to data.
> GEOM_STRIPE: Disk da0s1d removed from data.
> GEOM_STRIPE: Device data destroyed.
> GEOM_STRIPE: Device data created (id=476052638).
> GEOM_STRIPE: Disk da0d attached to data.
> GEOM_STRIPE: Device data already configured.
> GEOM_STRIPE: Cannot create device data.
> Metadata value stored on da0d.
> GEOM_STRIPE: Disk da1d attached to data.
> GEOM_STRIPE: Device data activated.
> Metadata value stored on da1d.
> Done.
>
> Why all this craziness?
>
> Now I can mount the filesystem again, but still:
>
> # ls -l /dev/da0*
> crw-r----- 1 root operator 0, 74 Jul 13 00:48 /dev/da0
> crw-r----- 1 root operator 0, 76 Jul 13 00:48 /dev/da0b
> crw-r----- 1 root operator 0, 77 Jul 13 00:48 /dev/da0c
> crw-r----- 1 root operator 0, 83 Jul 13 00:48 /dev/da0cs1
> crw-r----- 1 root operator 0, 87 Jul 13 00:48 /dev/da0cs1b
> crw-r----- 1 root operator 0, 88 Jul 13 00:48 /dev/da0cs1c
> crw-r----- 1 root operator 0, 89 Jul 13 00:48 /dev/da0cs1d
> crw-r----- 1 root operator 0, 78 Jul 13 00:49 /dev/da0d
>
> What's going on here?
Most likely trash BSD label metadata. Try doing:
# dd if=/dev/zero of=/dev/da0 count=79
first and then bsdlabel and gstripe it again.
--
Pawel Jakub Dawidek http://www.wheel.pl
pjd at FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20080718/6b93e236/attachment.pgp
More information about the freebsd-geom
mailing list