lkml.org 
[lkml]   [2008]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: Notes on support for multiple devices for a single filesystem
    From
    Date
    On Wed, 2008-12-17 at 08:23 -0500, Christoph Hellwig wrote:
    > FYI: here's a little writeup I did this summer on support for
    > filesystems spanning multiple block devices:
    >
    >

    Thanks Christoph, I'll start with a description of what btrfs does
    today.

    Every Btrfs filesystem has a uuid, and a tree that stores all the device
    uuids that belong to the FS uuid.

    Every btrfs device has a device uuid and a super block that indicates
    which FS uuid it belongs to.

    The btrfs kernel module holds a list of the FS uuids found and the
    devices that belong to each one. This list is populated by a block
    device scanning ioctl that opens a bdev and checks for btrfs supers.

    I tried to keep this code as simple as possible because I knew we'd end
    up replacing it. At mount time, btrfs makes sure the devices found by
    scanning match the devices the FS expected to find.

    btrfsctl -a scans all of /dev calling the scan ioctl on each device and
    btrfsctl -A /dev/xxxx just calls the ioctl on a single device.
    No scanning is required for a single device filesystem. After the scan
    is done, sending any device in a multi-device filesystem is enough for
    the kernel to mount the FS. IOW:

    mkfs.btrfs /dev/sdb ; mount /dev/sdb /mnt just works.
    mkfs.btrfs /dev/sdb /dev/sdc ; mount /dev/sdb /mnt also works

    (mkfs.btrfs calls the ioctl on multi-device filesystems).

    UUIDS and labels are important in large systems, but if the admin knows
    a given device is part of an FS, they are going to expect to be able to
    send that one device to mount and have things work.

    Even though btrfs currently maintains the device list in the kernel, I'm
    happy to move it into a userland api once we settle on one. Kay has
    some code so that udev can discover the btrfs device<->FS uuid mappings,
    resulting in a tree like this:

    $ tree /dev/btrfs/
    /dev/btrfs/
    |-- 0cdedd75-2d03-41e6-a1eb-156c0920a021
    | |-- 897fac06-569c-4f45-a0b9-a1f91a9564d4 -> ../../sda10
    | `-- aac20975-b642-4650-b65b-b92ce22616f2 -> ../../sda9
    `-- a1ec970a-2463-414e-864c-2eb8ac4e1cf2
    |-- 4d1f1fff-4c6b-4b87-8486-36f58abc0610 -> ../../sdb2
    `-- e7fe3065-c39f-4295-a099-a89e839ae350 -> ../../sdb1
    It makes sense to me to use /dev/multi-device/ instead of /dev/btrfs/,
    I'm fine with anything really.

    -chris




    \
     
     \ /
      Last update: 2008-12-17 15:57    [W:0.215 / U:0.280 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site