gmirror on existing filesystem (was Fresh install on gmirror'ed disks?)

Eric Anderson anderson at centtech.com
Thu Apr 6 19:56:53 UTC 2006


Pawel Jakub Dawidek wrote:
> On Tue, Apr 04, 2006 at 05:51:26PM -0400, Mike Jakubik wrote:
> +> >>>Can someone with knowledge of the UFS internals please confirm one way
> +> >>>or the other if this is dangerous or not?
> +> >>>  
> +> >>
> +> >>I'm curious to know this as well, as i have some systems using gmirror, that were setup in this fashion. Could someone knowledgeable on the matter shed some light?
> +> >
> +> >
> +> >I've gmirrored existing disks/slices before, and it's worked fine.  I'm not 100% certain about all cases, but it's possible that the filesystem could be right up against 
> +> >the last block of the partition, and it could get stomped on I suppose.
> +> >
> +> >I'm not sure what this command tells you for sure, but it dumps the last block of a slice, or disk, or whatever:
> +> >
> +> >
> +> >dd if=/dev/ad0s3a iseek=`diskinfo ad0s3a | perl -ne '@d = split; print ($d[2]/$d[1] - 1)'` count=512 | hexdump
> +> 
> +> Could someone provide an authoritative answer to this please? Pawel, it would be nice to see some support for your own code from you. This is a very easy method to create a 
> +> mirror on an existing system, but if its going to cause problems then its useless (All the more reason for geom enabled installer).
> 
> I can't give you an authoritative answer, because I don't know UFS
> internals so well. All I know is that it (UFS) thinks the last sector is
> available and may want to use it at some point getting EIO then.
> I'm not using this method, but I've heard of many people using it
> without problems.
> 
> Speaking about installer. I don't think I'll be able to add
> configuration of my GEOM classes to the sysinstall in the near future
> (and I hope never - I'd prefer to wait for a new installer).
> One can still see how many sectors exactly has the partition he is going
> to create file system on and add additional newfs(8) flag
> '-s <sectors-1>'.
> 


I suppose one could look at the output of diskinfo, and compare against 
the output of df, and see if there is a spare 512+ bytes at the end of 
the partition.  I think there's a possibility that newfs won't use the 
last chunk if it's less than BLOCKSIZE bytes..


Eric





-- 
------------------------------------------------------------------------
Eric Anderson        Sr. Systems Administrator        Centaur Technology
Anything that works is better than anything that doesn't.
------------------------------------------------------------------------


More information about the freebsd-stable mailing list