Re: btrfsck does not fix

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

 



On Feb 9, 2014, at 1:36 AM, Hendrik Friedel <hendrik@xxxxxxxxxxxxx> wrote:
> 
> Yes, but I can create that space.
> So, for me the next steps would be to:
> -generate enough room on the filesystem
> -btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/BTRFS/Video
> -btrfs device delete /dev/sdc1 /mnt/BTRFS/Video
> 
> Right?

No. You said you need to recreate the file system, and only have these two devices and therefore must remove one device. You can't achieve that with raid1 which requires minimum two devices.

-dconvert=single -mconvert=dup -sconvert=dup

> 
>>> next, I'm doing the balance for the subvolume /mnt/BTRFS/backups
>> 
>> You told us above  you deleted that subvolume. So how are you balancing it?
> 
> Yes, that was my understanding from my research:
> You tell btrfs, that you want to remove one disc from the filesystem and then balance it to move the data on the remaining disc. I did find this logical. I was expecting that I possibly need a further command to tell btrfs that it's not a raid anymore, but I thought this could also be automagical.
> I understand, that's not the way it is implemented, but it's not a crazy idea, is it?

Well it's not the right way to think that devices are raid1 or raid0. It's the data or metadata that has that attribute. And by removing a device you are managing devices, not the attribute of data or metadata chunks. Since you're already at the minimum number of disks for raid0, that's why conversion is needed first.


> 
>> And also, balance applies to a mountpoint, and even if you mount a
> > subvolume to that mountpoint, the whole file system is balanced.
> > Not just the mounted subvolume.
> 
> That is confusing. (I mean: I understand what you are saying, but it's counterintuitive). Why is this the case?

A subvolume is a file system tree. The data created in that tree is allocated to chunks which can contain data from other trees. And balance reads/writes chunks. It's not a subvolume aware command.


> 
>>> In parallel, I try to delete /mnt/BTRFS/rsnapshot, but it fails:
>>>  btrfs subvolume delete  /mnt/BTRFS/rsnapshot/
>>>  Delete subvolume '/mnt/BTRFS/rsnapshot'
>>>  ERROR: cannot delete '/mnt/BTRFS/rsnapshot' - Inappropriate ioctl
>>>  for  device
>>> 
>>> Why's that?
>>> But even more: How do I free sdc1 now?!
>> 
>> 
>> Well I'm pretty confused because again, I can't tell if your paths refer to
> > subvolumes or if they refer to mount points.
> 
> Now I am confused. These paths are the paths to which I mounted the subvolumes:
> my (abbreviated) fstab:
> UUID=xy      /mnt/BTRFS/Video btrfs subvol=Video
> UUID=xy     /mnt/BTRFS/rsnapshot btrfs subvol=rsnapshot
> UUID=xy     /mnt/BTRFS/backups btrfs subvol=backups
> 
> 
> > The balance and device delete commands all refer to a mount point, which is the path returned by the df command.
> So this:
> /dev/sdb1       5,5T    3,5T  2,0T   64% /mnt/BTRFS/Video
> /dev/sdb1       5,5T    3,5T  2,0T   64% /mnt/BTRFS/backups
> /dev/sdc1       5,5T    3,5T  2,0T   64% /mnt/BTRFS/rsnapshot

You can't delete a mounted subvolume. You'd have to unmount it first. And then you'd have to mount a parent subvolume. So if the subvolume you want to delete is in the ID 5 subvolume, you must mount that subvolume, for example:
 
mount /dev/sdb1 /mnt/btrfs
btrfs subvolume delete /mnt/btrfs/<subvolumetodelete>



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