Gpart and gmirror 8.2 from 18 januari

Antony Mawer lists at mawer.org
Sat Jan 22 23:04:46 UTC 2011


On Sat, Jan 22, 2011 at 12:55 AM, Ivan Voras <ivoras at freebsd.org> wrote:
> On 21/01/2011 14:22, Andrey V. Elsukov wrote:
>>
>> On 21.01.2011 16:03, Ivan Voras wrote:
>>>
>>> On 21/01/2011 13:56, Johan Hendriks wrote:
>>>>
>>>> Ok the funny thing is, i get the same error on 8.1 Release (the corrupt
>>>> error), but it boots,
>>>> and all seems to work.
>>>
>>> Maybe the boot process was made to be more standard-compliant :)
>>
>> The most strangest is that UFS's label ufsid/4b9545d7d72d5019 is
>> represented
>> as whole disk where GPT is located.
>
> This is how glabel works - if anything within a provider recognizes it as
> its own (e.g. a file system), the whole provider is labeled for it.
>
> Or are you thinking about something else? If you first did gmirror, then
> gpt, then newfs, the UFS label should be created with the same data as the
> gpt partition, not the "whole disk".

On 8.0 (haven't checked 8.1 or later), I have systems running with
gmirror across two disks (say ad4 and ad6), with gpt then configured
over the top of this. I have noticed the occasional "GPT corrupt"
message on bootup on some of these systems - not sure if this is
because it looks at the disk device first at boot time and sees the
last sector is the gmirror metadata, rather than the GPT data?

They seem to operate without function, aside from the slightly scary
warning message.

To build these systems the following commands are used:

        # Initialise the gmirror device
        /sbin/gmirror label -b load gm0 ad4 ad6

        # Partition using gpart
        diskdev="mirror/gm0"
        boot_offset="2032"
        gpart add -l boot -t freebsd-boot -s 16 -b $boot_offset
$diskdev   # boot p1
        gpart add -l root -t freebsd-ufs  -s 2G -b $root_offset
$diskdev   # /    p2
        gpart add -l swap -t freebsd-swap -s 4G
$diskdev   # swap p3
        gpart add -l var  -t freebsd-ufs  -s 4G
$diskdev   # /var p4
        gpart add -l usr  -t freebsd-ufs
$diskdev   # /usr p5

        # Boot code
        gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 $diskdev

        # Mark partition active (older systems)
        echo 'a 1' | fdisk -f - /dev/$diskdev

Any feedback welcome!

--Antony


More information about the freebsd-stable mailing list