[opensuse] using btrfs device remove
Hello, some time ago, I used "btrfs add" to create a raid 1 for my root partition. Now I want to make a clone of the disk with clone zilla, and, of course, clonezilla don't want it. The two raid partition (each on it's own disk, of course) are not part of the image. So, I guess I need to break the raid just for the time of the clone. my config is: # btrfs fi df / Data, RAID1: total=43.00GiB, used=32.17GiB System, RAID1: total=32.00MiB, used=16.00KiB Metadata, RAID1: total=2.00GiB, used=1.14GiB GlobalReserve, single: total=84.41MiB, used=0.00B all the doc I see ask to add a path to the delete command, but what's the use? anyway the delete command seems to be deprecated and replaced by "remove" (see man page) should I run btrfs device remove /dev/sdb2 /mnt or may be btrfs device remove / I see in man: REMOVE DEVICE Device removal must satisfy the profile constraints, otherwise the command fails. For example: $ btrfs device remove /dev/sda /mnt ERROR: error removing device '/dev/sda': unable to go below two devices on raid1 In order to remove a device, you need to convert the profile in this case: $ btrfs balance start -mconvert=dup -dconvert=single /mnt $ btrfs device remove /dev/sda /mnt still the "/mnt"?? thanks jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, Aug 18, 2019 at 9:27 AM jdd@dodin.org <jdd@dodin.org> wrote:
Hello,
some time ago, I used "btrfs add" to create a raid 1 for my root partition.
Now I want to make a clone of the disk with clone zilla, and, of course, clonezilla don't want it. The two raid partition (each on it's own disk, of course) are not part of the image.
So, I guess I need to break the raid just for the time of the clone.
my config is:
# btrfs fi df / Data, RAID1: total=43.00GiB, used=32.17GiB System, RAID1: total=32.00MiB, used=16.00KiB Metadata, RAID1: total=2.00GiB, used=1.14GiB GlobalReserve, single: total=84.41MiB, used=0.00B
all the doc I see ask to add a path to the delete command, but what's the use? anyway the delete command seems to be deprecated and replaced by "remove" (see man page)
should I run
btrfs device remove /dev/sdb2 /mnt
or may be
btrfs device remove /
I see in man:
REMOVE DEVICE Device removal must satisfy the profile constraints, otherwise the command fails. For example: $ btrfs device remove /dev/sda /mnt ERROR: error removing device '/dev/sda': unable to go below two devices on raid1 In order to remove a device, you need to convert the profile in this case: $ btrfs balance start -mconvert=dup -dconvert=single /mnt
Of course you need to wait for balance to complete before going on with actual device removal.
$ btrfs device remove /dev/sda /mnt
So example in manual page provides you exact commands to use in your case. What is your question?
still the "/mnt"??
I do not understand this line, sorry. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 18/08/2019 à 08:37, Andrei Borzenkov a écrit :
still the "/mnt"??
I do not understand this line, sorry.
why is there a /mnt path at the end of the command? I have nothing mounted there, btrfs is / thanks jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, Aug 18, 2019 at 10:11 AM jdd@dodin.org <jdd@dodin.org> wrote:
Le 18/08/2019 à 08:37, Andrei Borzenkov a écrit :
still the "/mnt"??
I do not understand this line, sorry.
why is there a /mnt path at the end of the command?
This is *example*. Examples illustrate formal description. You are not supposed to use them verbatim; of course you are expected to adapt them to your actual configuration.
I have nothing mounted there, btrfs is /
If nothing is mounted there then you can use /mnt as well; you can use any path that is physically on filesystem in question. It is just that using mount point is less ambiguous. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 18/08/2019 à 11:11, Andrei Borzenkov a écrit :
On Sun, Aug 18, 2019 at 10:11 AM jdd@dodin.org <jdd@dodin.org> wrote:
Le 18/08/2019 à 08:37, Andrei Borzenkov a écrit :
still the "/mnt"??
I do not understand this line, sorry.
why is there a /mnt path at the end of the command?
This is *example*. Examples illustrate formal description. You are not supposed to use them verbatim; of course you are expected to adapt them to your actual configuration.
it's the very reason why I ask :-)
I have nothing mounted there, btrfs is /
If nothing is mounted there then you can use /mnt as well; you can use any path that is physically on filesystem in question. It is just that using mount point is less ambiguous.
??? as I said I speak of my root file system, of course mounted as / and it's a laptop, connected to AC, so don't have a risk of power failure ok, will try thanks jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 18/08/2019 à 08:27, jdd@dodin.org a écrit :
In order to remove a device, you need to convert the profile in this case: $ btrfs balance start -mconvert=dup -dconvert=single /mnt $ btrfs device remove /dev/sda /mnt
still the "/mnt"??
# btrfs filesystem show Label: none uuid: 68d9fe9c-e773-4659-a8a6-cbc127fc2974 Total devices 2 FS bytes used 33.31GiB devid 1 size 100.00GiB used 45.03GiB path /dev/sda2 devid 2 size 100.00GiB used 45.03GiB path /dev/sdb2 I want to keep /dev/sda2 and remove /dev/sdb2 may I use btrfs balance start -mconvert=dup -dconvert=single / btrfs device remove /dev/sdb2 / it's root of my main computer, so I don't want to kill it :-) (15.0) jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, Aug 18, 2019 at 10:29 AM jdd@dodin.org <jdd@dodin.org> wrote:
# btrfs filesystem show Label: none uuid: 68d9fe9c-e773-4659-a8a6-cbc127fc2974 Total devices 2 FS bytes used 33.31GiB devid 1 size 100.00GiB used 45.03GiB path /dev/sda2 devid 2 size 100.00GiB used 45.03GiB path /dev/sdb2
I want to keep /dev/sda2 and remove /dev/sdb2
may I use
btrfs balance start -mconvert=dup -dconvert=single / btrfs device remove /dev/sdb2 /
Assuming this filesystem is mounted on /, yes. As you yourself see, nothing in "btrfs filesystem show" identifies mount point so it is impossible to answer your question without additional information, such as "lsblk -f" output.
it's root of my main computer, so I don't want to kill it :-) (15.0)
I cannot guarantee you that there won't be power failure during this operation and that this power failure won't trigger obscure bug in btrfs. As usual, make backup before doing any serious changes to your filesystem (or underlying storage devices for this matter). -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 18/08/2019 à 09:28, jdd@dodin.org a écrit :
may I use
btrfs balance start -mconvert=dup -dconvert=single / btrfs device remove /dev/sdb2 /
it's root of my main computer, so I don't want to kill it :-) (15.0)
works ok lt's try clonezilla, then :-) jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 18/08/2019 à 12:08, jdd@dodin.org a écrit :
Le 18/08/2019 à 09:28, jdd@dodin.org a écrit :
may I use
btrfs balance start -mconvert=dup -dconvert=single / btrfs device remove /dev/sdb2 /
it's root of my main computer, so I don't want to kill it :-) (15.0)
works ok
but no. I could work without problem, but not boot... more on that later :-( thanks jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 18/08/2019 à 19:20, jdd@dodin.org a écrit :
Le 18/08/2019 à 12:08, jdd@dodin.org a écrit :
Le 18/08/2019 à 09:28, jdd@dodin.org a écrit :
may I use
btrfs balance start -mconvert=dup -dconvert=single / btrfs device remove /dev/sdb2 /
but no. I could work without problem, but not boot... more on that later :-(
it may be -or not- a file system problem if not see an other post :-) I was thinking that when separating two raid1 mirror disks (partitions, in fact), I would have two identical partitions as a result. obviously it was not in the command listed above, I kept the /dev/sda2 one and this one is not bootable (see other post), but readable. But the /dev/sdb2 removed is no more a true btrfs bootable file system. I can't even mount it. Is this normal? if so I will try an other thing (that is rebuild the btrfs raid1 and remove the other partition, that is sda2) So my question is: is it normal than the removed partition be unusable? thanks jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Отправлено с iPhone
19 авг. 2019 г., в 11:26, "jdd@dodin.org" <jdd@dodin.org> написал(а):
Le 18/08/2019 à 19:20, jdd@dodin.org a écrit :
Le 18/08/2019 à 12:08, jdd@dodin.org a écrit :
Le 18/08/2019 à 09:28, jdd@dodin.org a écrit :
may I use
btrfs balance start -mconvert=dup -dconvert=single / btrfs device remove /dev/sdb2 /
but no. I could work without problem, but not boot... more on that later :-(
it may be -or not- a file system problem if not see an other post :-)
I was thinking that when separating two raid1 mirror disks (partitions, in fact), I would have two identical partitions as a result.
obviously it was not
in the command listed above, I kept the /dev/sda2 one and this one is not bootable (see other post), but readable.
But the /dev/sdb2 removed is no more a true btrfs bootable file system. I can't even mount it.
Is this normal? if so I will try an other thing (that is rebuild the btrfs raid1 and remove the other partition, that is sda2)
So my question is: is it normal than the removed partition be unusable?
Yes. “btrfs device remove” by design clears metadata on device that is being removed so it is no more part of btrfs. I am not aware of any graceful btrfs split. True splitting would involve at least changing UUID for all subvolumes. And those are interrelated (think about parent or received UUID). I do not know if this is possible at all. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 20/08/2019 à 09:40, Andrei Borzenkov a écrit :
Yes. “btrfs device remove” by design clears metadata on device that is being removed so it is no more part of btrfs. I am not aware of any graceful btrfs split.
yes. with some thinking it's pretty normal. It wouldn't have been a problem if the other disk was bootable :-(
True splitting would involve at least changing UUID for all subvolumes. And those are interrelated (think about parent or received UUID). I do not know if this is possible at all.
they where different on the first place, dunno if they changed thanks jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Errors corrected, all was my fault, BTRFS working dawn good. Not that long to do, but long to explain, so I wrote some blog: http://www.dodin.org/wiki/pmwiki.php?n=Doc.BTRFSRAID jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Отправлено с iPhone
20 авг. 2019 г., в 17:04, "jdd@dodin.org" <jdd@dodin.org> написал(а):
Errors corrected, all was my fault, BTRFS working dawn good. Not that long to do, but long to explain, so I wrote some blog:
Reinstalling boot loader would have been much faster. At least if I understand the problem correctly. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Andrei Borzenkov
-
jdd@dodin.org