Uberblock location

Matt Churchyard matt.churchyard at userve.net
Sun Jul 5 17:11:26 UTC 2015



> On 5 Jul 2015, at 16:24, Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com> wrote:
> 
>> On Fri, Jul 3, 2015 at 6:09 PM, Julian Elischer <julian at freebsd.org> wrote:
>> which? the kernel code or the bootblock code?
>> I believe the bootblock version /usr/src/sys/boot/zfs from woudl be easier
>> to start with.
> 
> Yes, I'm basing in the bootblock code.
> 
>> define "path".. in a way that is OS independent and meaningful when running
>> in a bios environment (bootblocks).
> 
> Yes, its not meaningful for the boot, but my point was not that the
> boot code doesn't handle the info, but instead that the partition does
> not contain this info, which would be very useful for a user program.
> 
> Surely the zfs pool handling tools must store this info somewhere
> (probably somewhere in /etc) if the partition itself doesn't contain
> it.

All the information is on disk. There's a cache of imported pool config on the system but it's not required. Each disk stores the details, including device path, for each disk in the same vdev. If you'd created a mirror, both disks would have the details for each other. As a stripe, you have 2 vdevs, each only containing their own config. All vdevs do know the total number of vdevs though.  So if an entire vdev is missing, ZFS knows it's missing, but can't tell the disks involved.

I assume you're aware of 'zdb -l device', which outputs exactly what ZFS config is stored in the label on a disk. Your code is already outputting this information, but the zdb command is useful to neatly display exactly what is on each disk.

> 
>> i should be from the base of the partition containing the filesystem but I
>> feel you are
>> probably already doing this of you probably wouldn't have got this far.
> 
> Yes, I meant partition start.
> 
> Anyway, I think I figured out myself, it looks like that the offsets
> are relative to VDEV_LABEL_START_SIZE
> 
> thanks,
> -- 
> Felipe Monteiro de Carvalho
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"


More information about the freebsd-fs mailing list