Breaking raidz and zpool bug?

Mark Powell M.S.Powell at salford.ac.uk
Fri Jul 27 09:32:22 UTC 2007


Hi,
   Have a machine with two identical drives ad[01]. Each have a 4GB slice1 
and the rest as slice 2. Slice 1 contains a gmirrored ufs /boot and swap. 
Slice2 I foolishly raidz'ed and put / on there. All works well.
   I realised the error of making a raidz of only 2 drives and wanted to 
convert this setup to gmirror without any backup/restore or pulling of 
drives to force them to error.
   I assume the difficulty with doing this is from deliberate safeguards to 
prevent data lose in normal usage?
   1st I needed to break the raidz, stop it using one of the drives, so I 
can make the mirror on it. I thought I could just wipe ad1s2, but I am 
prevented from doing that cos it's being used by zfs. Even with 
kern.geom.debugflags=16. I couldn't change the partition details using 
fdisk for ad1s2 as it doesn't allow it for partitions in use.
   So i blanked sector 0 on ad1 and rebooted. zpool status showed the raidz 
as degraded. I thought I'd then create a zpool mirror on ad1s2, but of 
course I can't cos it's still part of the raidz. I could find no way to 
remove ad1s2 from the raidz. zpool detach is only for hot spares.
   I tried to get around the problems of the system not letting me do 
anything with ad1s2, by creating an identical ad1s3 and then changing the 
slice type of ad1s2 to 1 (DOS FAT 16-bit).
   I rebooted, but the zfs root would not mount. I booted into a test 
enviroment and zpool status told me the worst that no replicas could be 
found. At first I assumed I'd made a mess of something, but after 
reflection I was sure I'd not touched ad0.
   I changed the type of ad1s2 back to FreeBSD 165 and the zfs root worked 
fine again albeit in the degraded state.
   It shouldn't be possible to break a raidz simply by changing the slice 
type?
   Is this a bug?
   And does anyone have ideas for what I was trying?
   Cheers.

-- 
Mark Powell - UNIX System Administrator - The University of Salford
Information Services Division, Clifford Whitworth Building,
Salford University, Manchester, M5 4WT, UK.
Tel: +44 161 295 4837  Fax: +44 161 295 5888  www.pgp.com for PGP key


More information about the freebsd-fs mailing list