¿Which is the better way to clone the btrfs system root partition?

classic Classic list List threaded Threaded
51 messages Options
123
Reply | Threaded
Open this post in threaded view
|

¿Which is the better way to clone the btrfs system root partition?

Juan Erbes-2
Because I had to reinstall Leap because crashed the hard drive and I
had to replace it on the computar of a friend, as my internet
connection is slow, I asked a friend to download and record the DVD of
the last beta of Leap 42.3. But as the download of the iso my friend
made it from windows, the dvd was corrupt, and some of the packages
failed in the installation, just like the installation of grub.

I choose to install Leap 42.2, and upgrade with the leap 42.3 beta
dvd, with the internet connection enabled, and most of the packages
were installed from the repositories, but it took about 6 hours to
upgrade.

As on my computer the Leap partition 42.1 was broken, I want to clone
Leap 42.3 from the other disk. On my pc I have installed Leap 42.2, so
no hard disk needs to be mounted, both the source and the destination
to clone Leap 42.3.

¿Which is the better way?

Both partitions, source and destination has about the same size of
about 60 GB (the destination 59.4 GB).

Thanks,
              Juan

--
USA LINUX OPENSUSE QUE ES SOFTWARE LIBRE, NO NECESITAS PIRATEAR NADA Y
NI TE VAS A PREOCUPAR MAS POR LOS VIRUS Y SPYWARES:
http://www.opensuse.org/es/
Puedes visitar mi blog en:
http://jerbes.blogspot.com.ar/
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Carlos E. R.-2
On 2017-07-23 14:01, Juan Erbes wrote:
> Because I had to reinstall Leap because crashed the hard drive and I
> had to replace it on the computar of a friend, as my internet
> connection is slow, I asked a friend to download and record the DVD of
> the last beta of Leap 42.3. But as the download of the iso my friend
> made it from windows, the dvd was corrupt, and some of the packages
> failed in the installation, just like the installation of grub.

I recommend using "DownThemAll!", a Firefox plugin, to do the download
in Windows. It will automatically verify and correct downloads errors.

(recomiendo usar "DownThemAll!", un plugin de Firefox, para descargar en
Windows. Automáticamente verificará y corregirá los errores.)


> As on my computer the Leap partition 42.1 was broken, I want to clone
> Leap 42.3 from the other disk. On my pc I have installed Leap 42.2, so
> no hard disk needs to be mounted, both the source and the destination
> to clone Leap 42.3.
>
> ¿Which is the better way?

There is no good way to clone a btrfs root partition. Better install again.

(no existe un buen sistema para clonar una partición raíz btrfs. Es
mejor instalar de nuevo)

--
Cheers / Saludos,

                Carlos E. R.
                (from 42.2 x86_64 "Malachite" at Telcontar)


signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Richard Brown
On 23 July 2017 at 15:45, Carlos E. R. <[hidden email]> wrote:

>> As on my computer the Leap partition 42.1 was broken, I want to clone
>> Leap 42.3 from the other disk. On my pc I have installed Leap 42.2, so
>> no hard disk needs to be mounted, both the source and the destination
>> to clone Leap 42.3.
>>
>> ¿Which is the better way?
>
> There is no good way to clone a btrfs root partition. Better install again.
>

Carlos, please don't be so inaccurate with your statements when
someone is legitimately asking for help

Juan, you can use btrfs send and receive to clone a system to another disk.

https://www.suse.com/documentation/sles-12/stor_admin/data/sec_filesystems_major_btrfs.html
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Carlos E. R.-2
On 2017-07-23 15:51, Richard Brown wrote:

> On 23 July 2017 at 15:45, Carlos E. R. <[hidden email]> wrote:
>
>>> As on my computer the Leap partition 42.1 was broken, I want to clone
>>> Leap 42.3 from the other disk. On my pc I have installed Leap 42.2, so
>>> no hard disk needs to be mounted, both the source and the destination
>>> to clone Leap 42.3.
>>>
>>> ¿Which is the better way?
>>
>> There is no good way to clone a btrfs root partition. Better install again.
>>
>
> Carlos, please don't be so inaccurate with your statements when
> someone is legitimately asking for help
To my knowledge, there is no way to clone a btrfs filesystem. You have
to format and manually create the volumes and subvolumes, and there is
no listing of which they are on each openSUSE release. The question has
been asked several times, and none has answered it adequately.

My answer, to my knowledge, is perfectly accurate. It is not the first
time I have made the same answer and none has yet proposed a better
method during the years.

>
> Juan, you can use btrfs send and receive to clone a system to another disk.
>
> https://www.suse.com/documentation/sles-12/stor_admin/data/sec_filesystems_major_btrfs.html

This does not explain how to clone a btrfs filesystem from scratch. The
word "clone" does not even exist in the entire page. It only explains
how to copy the files and keep them in sync.

--
Cheers / Saludos,

                Carlos E. R.
                (from 42.2 x86_64 "Malachite" at Telcontar)


signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Knurpht-openSUSE
Op zondag 23 juli 2017 16:13:50 CEST schreef Carlos E. R.:
> On 2017-07-23 15:51, Richard Brown wrote:
> > On 23 July 2017 at 15:45, Carlos E. R. <[hidden email]>
wrote:

> >>> As on my computer the Leap partition 42.1 was broken, I want to clone
> >>> Leap 42.3 from the other disk. On my pc I have installed Leap 42.2, so
> >>> no hard disk needs to be mounted, both the source and the destination
> >>> to clone Leap 42.3.
> >>>
> >>> ¿Which is the better way?
> >>
> >> There is no good way to clone a btrfs root partition. Better install
> >> again.
> >
> > Carlos, please don't be so inaccurate with your statements when
> > someone is legitimately asking for help
>
> To my knowledge, there is no way to clone a btrfs filesystem. You have
> to format and manually create the volumes and subvolumes, and there is
> no listing of which they are on each openSUSE release. The question has
> been asked several times, and none has answered it adequately.
>
> My answer, to my knowledge, is perfectly accurate. It is not the first
> time I have made the same answer and none has yet proposed a better
> method during the years.
>
> > Juan, you can use btrfs send and receive to clone a system to another
> > disk.
> >
> > https://www.suse.com/documentation/sles-12/stor_admin/data/sec_filesystems
> > _major_btrfs.html
> This does not explain how to clone a btrfs filesystem from scratch. The
> word "clone" does not even exist in the entire page. It only explains
> how to copy the files and keep them in sync.

Guess you misread, it makes a copy of the filesystem

"Btrfs send/receive
Btrfs allows to make snapshots to capture the state of the file system.
Snapper, for example, uses this feature to create snapshots before and after
system changes, allowing a rollback. However, together with the send/receive
feature, snapshots can also be used to create and maintain

copies of a file system in a remote location. This feature can, for example, be

used to do incremental backups."

i.e. have a backup system ready all the time. Nice, very nice, didn't know
this feature.

--

Gertjan Lettink, a.k.a. Knurpht

openSUSE Board Member
openSUSE Forums Team
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Andrei Borzenkov
23.07.2017 18:52, Knurpht - Gertjan Lettink пишет:

> Op zondag 23 juli 2017 16:13:50 CEST schreef Carlos E. R.:
>> On 2017-07-23 15:51, Richard Brown wrote:
>>> On 23 July 2017 at 15:45, Carlos E. R. <[hidden email]>
> wrote:
>>>>> As on my computer the Leap partition 42.1 was broken, I want to clone
>>>>> Leap 42.3 from the other disk. On my pc I have installed Leap 42.2, so
>>>>> no hard disk needs to be mounted, both the source and the destination
>>>>> to clone Leap 42.3.
>>>>>
>>>>> ¿Which is the better way?
>>>>
>>>> There is no good way to clone a btrfs root partition. Better install
>>>> again.
>>>
>>> Carlos, please don't be so inaccurate with your statements when
>>> someone is legitimately asking for help
>>
>> To my knowledge, there is no way to clone a btrfs filesystem. You have
>> to format and manually create the volumes and subvolumes, and there is
>> no listing of which they are on each openSUSE release. The question has
>> been asked several times, and none has answered it adequately.
>>
>> My answer, to my knowledge, is perfectly accurate. It is not the first
>> time I have made the same answer and none has yet proposed a better
>> method during the years.
>>
>>> Juan, you can use btrfs send and receive to clone a system to another
>>> disk.
>>>
>>> https://www.suse.com/documentation/sles-12/stor_admin/data/sec_filesystems
>>> _major_btrfs.html
>> This does not explain how to clone a btrfs filesystem from scratch. The
>> word "clone" does not even exist in the entire page. It only explains
>> how to copy the files and keep them in sync.
>
> Guess you misread, it makes a copy of the filesystem
>

No, it does not. It copies read-only snapshot of one and only one
volume. It can *not* be used to replicate filesystem - for a start,
there is no way to replicate top-level subvolume at all.

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Knurpht-openSUSE
Op zondag 23 juli 2017 18:33:08 CEST schreef Andrei Borzenkov:

> 23.07.2017 18:52, Knurpht - Gertjan Lettink пишет:
> > Op zondag 23 juli 2017 16:13:50 CEST schreef Carlos E. R.:
> >> On 2017-07-23 15:51, Richard Brown wrote:
> >>> On 23 July 2017 at 15:45, Carlos E. R. <[hidden email]>
> >
> > wrote:
> >>>>> As on my computer the Leap partition 42.1 was broken, I want to clone
> >>>>> Leap 42.3 from the other disk. On my pc I have installed Leap 42.2, so
> >>>>> no hard disk needs to be mounted, both the source and the destination
> >>>>> to clone Leap 42.3.
> >>>>>
> >>>>> ¿Which is the better way?
> >>>>
> >>>> There is no good way to clone a btrfs root partition. Better install
> >>>> again.
> >>>
> >>> Carlos, please don't be so inaccurate with your statements when
> >>> someone is legitimately asking for help
> >>
> >> To my knowledge, there is no way to clone a btrfs filesystem. You have
> >> to format and manually create the volumes and subvolumes, and there is
> >> no listing of which they are on each openSUSE release. The question has
> >> been asked several times, and none has answered it adequately.
> >>
> >> My answer, to my knowledge, is perfectly accurate. It is not the first
> >> time I have made the same answer and none has yet proposed a better
> >> method during the years.
> >>
> >>> Juan, you can use btrfs send and receive to clone a system to another
> >>> disk.
> >>>
> >>> https://www.suse.com/documentation/sles-12/stor_admin/data/sec_filesyste
> >>> ms
> >>> _major_btrfs.html
> >>
> >> This does not explain how to clone a btrfs filesystem from scratch. The
> >> word "clone" does not even exist in the entire page. It only explains
> >> how to copy the files and keep them in sync.
> >
> > Guess you misread, it makes a copy of the filesystem
>
> No, it does not. It copies read-only snapshot of one and only one
> volume. It can *not* be used to replicate filesystem - for a start,
> there is no way to replicate top-level subvolume at all.

I stand corrected, thanks.

--
Gertjan Lettink, a.k.a. Knurpht

openSUSE Board Member
openSUSE Forums Team
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Juan Erbes-2
In reply to this post by Knurpht-openSUSE
2017-07-23 12:52 GMT-03:00 Knurpht - Gertjan Lettink <[hidden email]>:

> Op zondag 23 juli 2017 16:13:50 CEST schreef Carlos E. R.:
>> On 2017-07-23 15:51, Richard Brown wrote:
>> > On 23 July 2017 at 15:45, Carlos E. R. <[hidden email]>
> wrote:
>> >>> As on my computer the Leap partition 42.1 was broken, I want to clone
>> >>> Leap 42.3 from the other disk. On my pc I have installed Leap 42.2, so
>> >>> no hard disk needs to be mounted, both the source and the destination
>> >>> to clone Leap 42.3.
>> >>>
>> >>> ¿Which is the better way?
>> >>
>> >> There is no good way to clone a btrfs root partition. Better install
>> >> again.
>> >
>> > Carlos, please don't be so inaccurate with your statements when
>> > someone is legitimately asking for help
>>
>> To my knowledge, there is no way to clone a btrfs filesystem. You have
>> to format and manually create the volumes and subvolumes, and there is
>> no listing of which they are on each openSUSE release. The question has
>> been asked several times, and none has answered it adequately.
>>
>> My answer, to my knowledge, is perfectly accurate. It is not the first
>> time I have made the same answer and none has yet proposed a better
>> method during the years.
>>
>> > Juan, you can use btrfs send and receive to clone a system to another
>> > disk.
>> >
>> > https://www.suse.com/documentation/sles-12/stor_admin/data/sec_filesystems
>> > _major_btrfs.html
>> This does not explain how to clone a btrfs filesystem from scratch. The
>> word "clone" does not even exist in the entire page. It only explains
>> how to copy the files and keep them in sync.
>
> Guess you misread, it makes a copy of the filesystem
>
> "Btrfs send/receive
> Btrfs allows to make snapshots to capture the state of the file system.
> Snapper, for example, uses this feature to create snapshots before and after
> system changes, allowing a rollback. However, together with the send/receive
> feature, snapshots can also be used to create and maintain
>
> copies of a file system in a remote location. This feature can, for example, be
>
> used to do incremental backups."
>
> i.e. have a backup system ready all the time. Nice, very nice, didn't know
> this feature.
>

They are many ways to do this job, like:

dd if=/dev/sda1 of=/dev/sdb1 bs=1048576

But this riski and it duplicates the UUID of the hard disks.


Other more civilized way is with send btrfs:

The steps to "clone" /source to /target are:

Get a list of subvolumes ordered by ogen: btrfs subvolume list -qu
--sort ogen /source. Sorting is probably enough to guarantee that
snapshots or subvolumes which depend on previous ones are handled
first. This is important for dealing with Copy-on-Write, because we
need to have the base volumes transferred first.

Make all subvolumes read-only using btrfs property set -ts
/source/some-volume ro true.

Now, for each subvolume from the list above, starting at the top, do
the following:

If the volume does not have a parent UUID (displayed as -) or the
parent UUID does not exist anymore in the list, run: btrfs send
/source/some/volume | btrfs receive /target/some/

If the volume does have a parent UUID which still exists, we should
have transferred it already because of --sort ogen and we can use that
as a base to avoid data duplication. Hence, find the parent UUID's
path in the list and run: btrfs send -p /source/parent/volume/ -c
/source/parent/volume/ /source/some/volume/ | btrfs receive
/target/some/ (btrfs would probably guess the -p argument
automatically, but I prefer to be explicit).

After running one of the above commands make the target and source
read-write again: btrfs property set -ts /source/some/volume ro false;
btrfs property set -ts /target/some/volume ro false. This step can be
skipped if the source has been previously read-only.

https://superuser.com/questions/607363/how-to-copy-a-btrfs-filesystem


another way to clone a Btrfs volume is
the seed device. Make A a seed device, and it mounts read-only, add a
new device to the volume, then umount and remount, and it mounts
read-write, then delete the seed device and data is migrated to the
new device. But also, the UUID is unique on the new device. After it's
completely, the seed device can be made a non-seed volume again (no
longer mounts read only).
https://lists.opensuse.org/opensuse/2015-06/msg00694.html


Thanks,
               Juan




--
USA LINUX OPENSUSE QUE ES SOFTWARE LIBRE, NO NECESITAS PIRATEAR NADA Y
NI TE VAS A PREOCUPAR MAS POR LOS VIRUS Y SPYWARES:
http://www.opensuse.org/es/
Puedes visitar mi blog en:
http://jerbes.blogspot.com.ar/
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Anton Aylward-2
In reply to this post by Carlos E. R.-2
On 23/07/17 09:45 AM, Carlos E. R. wrote:
> I recommend using "DownThemAll!", a Firefox plugin, to do the download
> in Windows. It will automatically verify and correct downloads errors.

+1

I often make use of that.
However I don't use Windows.  I do have a spare Linux box.
When I need to download a DVD or similar I use cURL or Wget.

Please do remember that along with each DVD there is a MD5 checksum.
If you are concerned about corruption of the download you should make use of
that to verify its correctness.


--
Over the last few centuries, mathematicians have demonstrated
a remarkable tendency to underestimate the cryptanalytic powers
of blunt and heavy objects.
  -- Jamie Reid, CISSP
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Anton Aylward-2
In reply to this post by Juan Erbes-2
On 23/07/17 08:01 AM, Juan Erbes wrote:
> As on my computer the Leap partition 42.1 was broken,

Just curious.

If the partition was broken then if a fdisk (or equivalent) issue.
If the file system was broken, that's another matter.

--
Even the Four Horsemen of Kidporn, Dope Dealers, Mafia and Terrorists
don't worry me as much as totalitarian governments.  It's been a long
century, and we've had enough of them.
    -- Bruce Sterling
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Juan Erbes-2
2017-07-23 23:49 GMT-03:00 Anton Aylward <[hidden email]>:
> On 23/07/17 08:01 AM, Juan Erbes wrote:
>> As on my computer the Leap partition 42.1 was broken,
>
> Just curious.
>
> If the partition was broken then if a fdisk (or equivalent) issue.
> If the file system was broken, that's another matter.
>

This hard disk is a little old, with more than 7 years, a Western
Digital of 1.5 TB Green series.
The /home is in anther hard disk, a Toshiba of 2 TB SATA 3  with a
little more than 1 year.
Is time to see with smartctl the status of the hard disk.

Thanks,
             Juan

--
USA LINUX OPENSUSE QUE ES SOFTWARE LIBRE, NO NECESITAS PIRATEAR NADA Y
NI TE VAS A PREOCUPAR MAS POR LOS VIRUS Y SPYWARES:
http://www.opensuse.org/es/
Puedes visitar mi blog en:
http://jerbes.blogspot.com.ar/
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Carlos E. R.-2
In reply to this post by Juan Erbes-2
On 2017-07-23 22:17, Juan Erbes wrote:

> They are many ways to do this job, like:
>
> dd if=/dev/sda1 of=/dev/sdb1 bs=1048576
>
> But this riski and it duplicates the UUID of the hard disks.

The risk with dd is that you make a mistake and write to some unintended
place and destroy it. Otherwise, it is pretty safe if the partitions are
the exact same size.

Well, you can probably change the UUID and Label afterwards, which can
be done with btrfstune (see man page). The destination can be bigger
size, but then you have to grow the filesystem, and this is risky:

https://www.suse.com/es-es/support/kb/doc/?id=7018329

https://www.suse.com/documentation/sles-12/singlehtml/stor_admin/stor_admin.html#sec.resize_fs.btrfs

https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-filesystem


> Other more civilized way is with send btrfs:
>
> The steps to "clone" /source to /target are:
>
> Get a list of subvolumes ordered by ogen: btrfs subvolume list -qu
> --sort ogen /source. Sorting is probably enough to guarantee that
> snapshots or subvolumes which depend on previous ones are handled
> first. This is important for dealing with Copy-on-Write, because we
> need to have the base volumes transferred first.

Ah. This seems better. Good find!



> https://superuser.com/questions/607363/how-to-copy-a-btrfs-filesystem

Notice that this is a support forum like this. Ie, not a categorical
procedure.

There is another interesting method here:

https://unix.stackexchange.com/questions/63528/how-to-clone-btrfs-filesystem-into-different-medium-preserving-snapshots-sharin



Still, if your idea is to upgrade the resulting system to a new release,
you should still consider installing fresh, because the new release may
have a different subvolume structure.


--
Cheers / Saludos,

                Carlos E. R.
                (from 42.2 x86_64 "Malachite" at Telcontar)


signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Juan Erbes-2
2017-07-24 8:30 GMT-03:00 Carlos E. R. <[hidden email]>:

> On 2017-07-23 22:17, Juan Erbes wrote:
>
>> They are many ways to do this job, like:
>>
>> dd if=/dev/sda1 of=/dev/sdb1 bs=1048576
>>
>> But this riski and it duplicates the UUID of the hard disks.
>
> The risk with dd is that you make a mistake and write to some unintended
> place and destroy it. Otherwise, it is pretty safe if the partitions are
> the exact same size.
>
> Well, you can probably change the UUID and Label afterwards, which can
> be done with btrfstune (see man page). The destination can be bigger
> size, but then you have to grow the filesystem, and this is risky:
>
> https://www.suse.com/es-es/support/kb/doc/?id=7018329
>
> https://www.suse.com/documentation/sles-12/singlehtml/stor_admin/stor_admin.html#sec.resize_fs.btrfs
>
> https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-filesystem
>
>
>> Other more civilized way is with send btrfs:
>>
>> The steps to "clone" /source to /target are:
>>
>> Get a list of subvolumes ordered by ogen: btrfs subvolume list -qu
>> --sort ogen /source. Sorting is probably enough to guarantee that
>> snapshots or subvolumes which depend on previous ones are handled
>> first. This is important for dealing with Copy-on-Write, because we
>> need to have the base volumes transferred first.
>
> Ah. This seems better. Good find!
>
>
>
>> https://superuser.com/questions/607363/how-to-copy-a-btrfs-filesystem
>
> Notice that this is a support forum like this. Ie, not a categorical
> procedure.
>

I tryed this, but it do'nt worked for me (can be a ignored step)

> There is another interesting method here:
>
> https://unix.stackexchange.com/questions/63528/how-to-clone-btrfs-filesystem-into-different-medium-preserving-snapshots-sharin
>

I can try this, but first must execute smartctl on the destination
disk, to see if it has phisical damage.

>
> Still, if your idea is to upgrade the resulting system to a new release,
> you should still consider installing fresh, because the new release may
> have a different subvolume structure.
>

In the upgrade procces about 80% of the packages are downloaded from
the online repos, because they are newer than the DVD.

Regards,.
                Juan

--
USA LINUX OPENSUSE QUE ES SOFTWARE LIBRE, NO NECESITAS PIRATEAR NADA Y
NI TE VAS A PREOCUPAR MAS POR LOS VIRUS Y SPYWARES:
http://www.opensuse.org/es/
Puedes visitar mi blog en:
http://jerbes.blogspot.com.ar/
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Andrei Borzenkov
In reply to this post by Carlos E. R.-2
On Mon, Jul 24, 2017 at 2:30 PM, Carlos E. R.
<[hidden email]> wrote:
...
>>
>> Get a list of subvolumes ordered by ogen: btrfs subvolume list -qu
>> --sort ogen /source. Sorting is probably enough to guarantee that
>> snapshots or subvolumes which depend on previous ones are handled
>> first. This is important for dealing with Copy-on-Write, because we
>> need to have the base volumes transferred first.
>
> Ah. This seems better. Good find!
>

The result won't match original layout exactly, in particular,
.snapshots subdirectories will be missing, so you won't be able to
even boot (default installation has /etc/fstab entry for /.snapshots
mount point). This of course can be fixed up manually, but who knows
what else will be missing. And manual fixup will still be different
from original. So it is by far not filesystem clone.

>
>
>> https://superuser.com/questions/607363/how-to-copy-a-btrfs-filesystem
>
> Notice that this is a support forum like this. Ie, not a categorical
> procedure.
>
> There is another interesting method here:
>
> https://unix.stackexchange.com/questions/63528/how-to-clone-btrfs-filesystem-into-different-medium-preserving-snapshots-sharin
>

Well, at the end adding new and removing old device (or simply
replacing) is always possible and as long as it runs to completion
before reboot it should be the most simple way to migrate btrfs
between devices. Target device can be of any size as long as it is
large enough for current data amount. Unfortunately there are known
issues with multi-device btrfs on startup, which may come unexpected.

of course you still will need to re-install bootloader after moving device.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Carlos E. R.-2
On 2017-07-24 13:49, Andrei Borzenkov wrote:

> On Mon, Jul 24, 2017 at 2:30 PM, Carlos E. R. <> wrote:
> ...
>>>
>>> Get a list of subvolumes ordered by ogen: btrfs subvolume list -qu
>>> --sort ogen /source. Sorting is probably enough to guarantee that
>>> snapshots or subvolumes which depend on previous ones are handled
>>> first. This is important for dealing with Copy-on-Write, because we
>>> need to have the base volumes transferred first.
>>
>> Ah. This seems better. Good find!
>>
>
> The result won't match original layout exactly, in particular,
> .snapshots subdirectories will be missing, so you won't be able to
> even boot (default installation has /etc/fstab entry for /.snapshots
> mount point). This of course can be fixed up manually, but who knows
> what else will be missing. And manual fixup will still be different
> from original. So it is by far not filesystem clone.
Oh :-(


>
>>
>>
>>> https://superuser.com/questions/607363/how-to-copy-a-btrfs-filesystem
>>
>> Notice that this is a support forum like this. Ie, not a categorical
>> procedure.
>>
>> There is another interesting method here:
>>
>> https://unix.stackexchange.com/questions/63528/how-to-clone-btrfs-filesystem-into-different-medium-preserving-snapshots-sharin
>>
>
> Well, at the end adding new and removing old device (or simply
> replacing) is always possible and as long as it runs to completion
> before reboot it should be the most simple way to migrate btrfs
> between devices. Target device can be of any size as long as it is
> large enough for current data amount. Unfortunately there are known
> issues with multi-device btrfs on startup, which may come unexpected.
>
> of course you still will need to re-install bootloader after moving device.
Ah, yes.

What about partclone.btrfs?


--
Cheers / Saludos,

                Carlos E. R.
                (from 42.2 x86_64 "Malachite" at Telcontar)


signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Juan Erbes-2
In reply to this post by Andrei Borzenkov
2017-07-24 8:49 GMT-03:00 Andrei Borzenkov <[hidden email]>:

> On Mon, Jul 24, 2017 at 2:30 PM, Carlos E. R.
> <[hidden email]> wrote:
> ...
>>>
>>> Get a list of subvolumes ordered by ogen: btrfs subvolume list -qu
>>> --sort ogen /source. Sorting is probably enough to guarantee that
>>> snapshots or subvolumes which depend on previous ones are handled
>>> first. This is important for dealing with Copy-on-Write, because we
>>> need to have the base volumes transferred first.
>>
>> Ah. This seems better. Good find!
>>
>
> The result won't match original layout exactly, in particular,
> .snapshots subdirectories will be missing, so you won't be able to
> even boot (default installation has /etc/fstab entry for /.snapshots
> mount point). This of course can be fixed up manually, but who knows
> what else will be missing. And manual fixup will still be different
> from original. So it is by far not filesystem clone.
>
>>
>>
>>> https://superuser.com/questions/607363/how-to-copy-a-btrfs-filesystem
>>
>> Notice that this is a support forum like this. Ie, not a categorical
>> procedure.
>>
>> There is another interesting method here:
>>
>> https://unix.stackexchange.com/questions/63528/how-to-clone-btrfs-filesystem-into-different-medium-preserving-snapshots-sharin
>>
>
> Well, at the end adding new and removing old device (or simply
> replacing) is always possible and as long as it runs to completion
> before reboot it should be the most simple way to migrate btrfs
> between devices. Target device can be of any size as long as it is
> large enough for current data amount. Unfortunately there are known
> issues with multi-device btrfs on startup, which may come unexpected.
>
> of course you still will need to re-install bootloader after moving device.

I will try with partclone.btrfs

http://partclone.org/features/

One of the most interesting features is the option of generate a image
file, and I do'nt need to write to the destination HD inmediately, and
I have time to purchase a new HD.

Thanks,
             Juan



--
USA LINUX OPENSUSE QUE ES SOFTWARE LIBRE, NO NECESITAS PIRATEAR NADA Y
NI TE VAS A PREOCUPAR MAS POR LOS VIRUS Y SPYWARES:
http://www.opensuse.org/es/
Puedes visitar mi blog en:
http://jerbes.blogspot.com.ar/
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Ancor Gonzalez Sosa
In reply to this post by Juan Erbes-2
On 07/23/2017 02:01 PM, Juan Erbes wrote:

> Because I had to reinstall Leap because crashed the hard drive and I
> had to replace it on the computar of a friend, as my internet
> connection is slow, I asked a friend to download and record the DVD of
> the last beta of Leap 42.3. But as the download of the iso my friend
> made it from windows, the dvd was corrupt, and some of the packages
> failed in the installation, just like the installation of grub.
>
> I choose to install Leap 42.2, and upgrade with the leap 42.3 beta
> dvd, with the internet connection enabled, and most of the packages
> were installed from the repositories, but it took about 6 hours to
> upgrade.
>
> As on my computer the Leap partition 42.1 was broken, I want to clone
> Leap 42.3 from the other disk. On my pc I have installed Leap 42.2, so
> no hard disk needs to be mounted, both the source and the destination
> to clone Leap 42.3.
>
> ¿Which is the better way?
>
> Both partitions, source and destination has about the same size of
> about 60 GB (the destination 59.4 GB).

FSArchiver usually makes a great job cloning filesystems to partitions
with different sizes. It claims to support btrfs with some limitations,
check if those are acceptable for you:

http://www.fsarchiver.org/

Cheers.
--
Ancor González Sosa
YaST Team at SUSE Linux GmbH
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Juan Erbes-2
2017-07-24 12:20 GMT-03:00 Ancor Gonzalez Sosa <[hidden email]>:

> On 07/23/2017 02:01 PM, Juan Erbes wrote:
>> Because I had to reinstall Leap because crashed the hard drive and I
>> had to replace it on the computar of a friend, as my internet
>> connection is slow, I asked a friend to download and record the DVD of
>> the last beta of Leap 42.3. But as the download of the iso my friend
>> made it from windows, the dvd was corrupt, and some of the packages
>> failed in the installation, just like the installation of grub.
>>
>> I choose to install Leap 42.2, and upgrade with the leap 42.3 beta
>> dvd, with the internet connection enabled, and most of the packages
>> were installed from the repositories, but it took about 6 hours to
>> upgrade.
>>
>> As on my computer the Leap partition 42.1 was broken, I want to clone
>> Leap 42.3 from the other disk. On my pc I have installed Leap 42.2, so
>> no hard disk needs to be mounted, both the source and the destination
>> to clone Leap 42.3.
>>
>> ¿Which is the better way?
>>
>> Both partitions, source and destination has about the same size of
>> about 60 GB (the destination 59.4 GB).
>
> FSArchiver usually makes a great job cloning filesystems to partitions
> with different sizes. It claims to support btrfs with some limitations,
> check if those are acceptable for you:
>
> http://www.fsarchiver.org/
>

Thank You!

I will try it.

USA LINUX OPENSUSE QUE ES SOFTWARE LIBRE, NO NECESITAS PIRATEAR NADA Y
NI TE VAS A PREOCUPAR MAS POR LOS VIRUS Y SPYWARES:
http://www.opensuse.org/es/
Puedes visitar mi blog en:
http://jerbes.blogspot.com.ar/
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Carlos E. R.-2
In reply to this post by Ancor Gonzalez Sosa
On 2017-07-24 17:20, Ancor Gonzalez Sosa wrote:

> FSArchiver usually makes a great job cloning filesystems to partitions
> with different sizes. It claims to support btrfs with some limitations,
> check if those are acceptable for you:
>
> http://www.fsarchiver.org/

It says:

There are several limitations anyway: it cannot preserve filesystem
attributes that are very specific. For instance, if you create a
snapshot in a btrfs volume (the new-generation file system for linux),
FSArchiver won’t know anything about that, and it will just backup the
contents seen when you mount the partition.
...
You can have more details about the _current status_ of that project.

.. current status:

fsarchiver 0.6.10 and more recent versions are considered stable, except
the NTFS support which is experimental. The latest stable version is
0.8.x and it is the recommended version for all users.

--
Cheers / Saludos,

                Carlos E. R.
                (from 42.2 x86_64 "Malachite" at Telcontar)


signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ¿Which is the better way to clone the btrfs system root partition?

Juan Erbes-2
2017-07-24 16:03 GMT-03:00 Carlos E. R. <[hidden email]>:

> On 2017-07-24 17:20, Ancor Gonzalez Sosa wrote:
>
>> FSArchiver usually makes a great job cloning filesystems to partitions
>> with different sizes. It claims to support btrfs with some limitations,
>> check if those are acceptable for you:
>>
>> http://www.fsarchiver.org/
>
> It says:
>
> There are several limitations anyway: it cannot preserve filesystem
> attributes that are very specific. For instance, if you create a
> snapshot in a btrfs volume (the new-generation file system for linux),
> FSArchiver won’t know anything about that, and it will just backup the
> contents seen when you mount the partition.
> ...
> You can have more details about the _current status_ of that project.
>
> .. current status:
>
> fsarchiver 0.6.10 and more recent versions are considered stable, except
> the NTFS support which is experimental. The latest stable version is
> 0.8.x and it is the recommended version for all users.
>

The 2 programs are in the repos.

With partclone.btrfs:

partclone.btrfs -c -s /dev/sdb2 -o r-backup

The log was:

Partclone v0.3.5a http://partclone.org
Starting to clone device (/dev/sdb2) to image (r-backup)
Reading Super Block

btrfsclone.c: btrfs library version = Btrfs v4.2.2
block_size = 16384
usedblock = 759835
device_size = 64428703744
totalblock = 3932416
btrfsclone.c: fs_close
memory needed: 2588708 bytes
bitmap 491552 bytes, blocks 2*1048576 bytes, checksum 4 bytes
Calculating bitmap... Please wait...

btrfsclone.c: btrfs library version = Btrfs v4.2.2

And the image generated has 0 bytes.

With fsarchiver:

fsarchiver savefs r-backup.fsa /dev/sdb2

Statistics for filesystem 0
* files successfully processed:....regfiles=184833, directories=16206,
symlinks=21491, hardlinks=8811, specials=0
* files with errors:...............regfiles=0, directories=0,
symlinks=0, hardlinks=0, specials=0

The generated file has:
2585637456 jul 24 17:25 r-backup.fsa

The info of the file:
fsarchiver archinfo r-backup.fsa
====================== archive information ======================
Archive type:                   filesystems
Filesystems count:              1
Archive id:                     5977577e
Archive file format:            FsArCh_002
Archive created with:           0.6.21
Archive creation date:          2017-07-24_17-18-36
Archive label:                  <none>
Minimum fsarchiver version:     0.6.4.0
Compression level:              3 (gzip level 6)
Encryption algorithm:           none

===================== filesystem information ====================
Filesystem id in archive:       0
Filesystem format:              btrfs
Filesystem label:
Filesystem uuid:                ecb07b1b-4482-436c-a7d7-1b9220ebd14d
Original device:                /dev/sdb2
Original filesystem size:       60.00 GB (64428703744 bytes)
Space used in filesystem:       12.23 GB (13128470528 bytes)


Later I will see waht happens when I write to the new hard disk the FS.

Regards,
                  Juan


--
USA LINUX OPENSUSE QUE ES SOFTWARE LIBRE, NO NECESITAS PIRATEAR NADA Y
NI TE VAS A PREOCUPAR MAS POR LOS VIRUS Y SPYWARES:
http://www.opensuse.org/es/
Puedes visitar mi blog en:
http://jerbes.blogspot.com.ar/
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

123