All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Murphy <lists@colorremedies.com>
To: Hendrik Friedel <hendrik@friedels.name>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: btrfsck does not fix
Date: Mon, 10 Feb 2014 18:45:23 -0700	[thread overview]
Message-ID: <837FAEE6-9A8E-4A88-AEDF-B9B2B3C3B618@colorremedies.com> (raw)
In-Reply-To: <52F73E2B.9080103@friedels.name>


On Feb 9, 2014, at 1:36 AM, Hendrik Friedel <hendrik@friedels.name> 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

  reply	other threads:[~2014-02-11  1:45 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-03 19:41 btrfsck does not fix Hendrik Friedel
2014-01-03 23:33 ` Chris Murphy
2014-01-04 21:21   ` Hendrik Friedel
2014-01-05 13:36     ` Hendrik Friedel
2014-01-05 16:55     ` Chris Murphy
2014-01-07 20:38       ` Hendrik Friedel
2014-01-10 23:53         ` Hendrik Friedel
2014-01-11  1:05           ` Chris Murphy
2014-01-12 22:31             ` Hendrik Friedel
2014-01-14  0:40               ` Chris Murphy
2014-01-14  6:03                 ` Duncan
2014-01-14  7:49                   ` Chris Murphy
2014-01-14  9:30                     ` Duncan
2014-01-14  9:38                       ` Hugo Mills
2014-01-14 17:17                       ` Chris Murphy
2014-01-18  7:20                         ` Chris Samuel
2014-01-14  8:16                 ` Hugo Mills
2014-01-19 19:37               ` Martin Steigerwald
2014-01-21 20:00                 ` Hendrik Friedel
2014-01-21 20:01                   ` Hendrik Friedel
2014-02-08 22:01                   ` Hendrik Friedel
2014-02-09  0:45                     ` Chris Murphy
2014-02-09  8:36                       ` Hendrik Friedel
2014-02-11  1:45                         ` Chris Murphy [this message]
2014-02-11  2:23                           ` Chris Murphy
2014-02-16 19:18                             ` Hendrik Friedel
2014-02-16 19:54                               ` Chris Murphy
2014-02-17  3:20                                 ` Duncan
2014-02-17  9:41                                   ` Goswin von Brederlow
2014-02-18 21:55                                   ` Hendrik Friedel
2014-02-18 22:12                                     ` Chris Murphy
2014-03-02 18:39                                       ` Hendrik Friedel
2014-03-03 22:35                                         ` Chris Murphy
2014-03-04  6:42                                           ` Hendrik Friedel
2014-03-04 17:02                                             ` Chris Murphy
2014-03-03  1:09                                 ` Russell Coker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837FAEE6-9A8E-4A88-AEDF-B9B2B3C3B618@colorremedies.com \
    --to=lists@colorremedies.com \
    --cc=hendrik@friedels.name \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.