Re: RAID1 fails to recover chunk tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Murphy posted on Thu, 30 Oct 2014 12:04:48 -0600 as excerpted:

>> Rob, That second drive was immediately put to use elsewhere. I figured
>> having only the metadata on that drive, it wouldn't matter. The data
>> stayed single and wasn't part of the second drive, only the metadata
>> was. I must not be capable of understanding why that wouldn't work.
> 
> single profile means all devices get btrfs chunks. If you do something
> like:
> 
> # mkfs.btfs /dev/sda
> 
> By default you get data profile = single, and metadata profile = DUP. If
> you then
> 
> # btrfs add /dev/sdb /mnt/btrfs # btrfs -mconvert=raid1  /mnt/btrfs
> 
> you now have a volume that is data = single and metadata = raid1. The 
way
> the allocator works is that it will first allocate 1GiB data chunks to 
the
> device with the most free space remaining, so if that's /dev/sdb it will
> allocate 1GiB data chunks there until free space is the same for both 
sda
> and sdb. And once they have equal space btrfs allocates 1GiB data chunks
> alternating sda and sdb.
> 
> Single profile doesn't mean only one device gets data chunks. Is that 
the
> misunderstanding?

Just what I was going to say.

Single profile means there's just one copy, and the normal chunk 
allocation algorithm allocates new chunks from the device with the most 
space left.  The freshly added device almost certainly had the most space 
left, so as soon as the existing data chunk was full, probably all new 
data chunks were allocated from the freshly added device.

Then you (OP) go and kill that device as far as btrfs is concerned, and 
all that new data written to it in single mode is ONLY on it because it 
was written in single mode, so now it has suddenly disappeared!

No WONDER that filesystem's having problems!

Even old files, due to copy on write, would have likely been partially or 
entirely moved to the new chunks on the new device if they were updated 
during the time the filesystem was mounted writable with the new device 
there.  And some desktop environments, for instance, have a habit of 
rewriting what might well be the exact same thing back to their config 
files, every time they shutdown, or sometimes as soon as they read it in 
at startup, as well.  So much of your desktop config may well have been 
on that second device, even if you didn't actively change any config 
during that time.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

--
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




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux