On 08/08/2011 10:53 PM, Alexandre Oliva wrote: > On Aug 7, 2011, Alexandre Oliva <oliva@xxxxxxxxxxxxxxxxx> wrote: > >> 2. Removing a partition from the filesystem (say, the external disk) >> didn't relocate “single” block groups as such to other disks, as >> expected. > > /me reads some code and resets expectations about RAID0 in btrfs ;-) > > update_block_group_flags is what does this. It doesn't care what was > chosen when the filesystem was created, it just forces RAID0 if more > than 1 disk remains: > > /* turn single device chunks into raid0 */ > return stripped | BTRFS_BLOCK_GROUP_RAID0; > > Is this really intended? Given my current understanding that RAID0 > doesn't mean striping over all disks, but only over two disks, I guess I > might even be interested in it, but... I still think the user's choice > should be honored, but I don't see where the choice is stored (if it is > at all). Well -m single -d single means that we only have one disk and we don't want duplication (usually one just does -m single since metadata is the only thing duplicated by default). But if you add more disks we want to do RAID0 as we should be stripping across all the devices in the fs. > > >> I wonder, why can't btrfs mark at least mounted partitions as busy, in >> much the same way that swap, md and various filesystems do, to avoid >> such accidental reuses? > > Heh. And *unmark* them when they're removed, too... As in, it won't > let me create a new filesystem in a partition that was just removed from > a filesystem, if that was the partition listed in /etc/mtab. > Yeah our "what is busy" thing should be a little smarter. Thanks, Josef -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
