Cloning an LVM2 thin pool with all the snapshots
up vote
1
down vote
favorite
Need to clone a 400gb pool onto another machine. Will this work?
First I collect the data about the existing pool:
[root@oktest-prod-db-2 ~]# lvdisplay --units B vg_oktestdb2/pool
--- Logical volume ---
LV Name pool
VG Name vg_oktestdb2
LV UUID tPfUzG-bHW2-jepz-1Sf6-BSmw-jKz4-Tf6djR
LV Write Access read/write
LV Creation host, time oktest-db-2, 2015-03-31 18:55:17 +0300
LV Pool transaction ID 134
LV Pool metadata pool_tmeta
LV Pool data pool_tdata
LV Pool chunk size 262144 B
LV Zero new blocks yes
LV Status available
# open 0
LV Size 474031849472 B
Allocated pool data 10.16%
Allocated metadata 7.66%
Current LE 113018
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5
Then create a new pool with the same size:
[root@oktest-prod-db-1-new ~]# lvcreate -L 474031849472b -T vg_oktestdb1/pool --chunksize 256k
Logical volume "lvol0" created
Logical volume "pool" created
And lastly copy it over ssh:
[root@oktest-prod-db-2 ~]# dd bs=128k if=/dev/mapper/vg_oktestdb2-pool | ssh root@oktest-prod-db-1-new 'dd bs=128k of=/dev/mapper/vg_oktestdb1-pool'
Now I just sit and wait for several hours
Upd: it did work back then.
lvm snapshot
add a comment |
up vote
1
down vote
favorite
Need to clone a 400gb pool onto another machine. Will this work?
First I collect the data about the existing pool:
[root@oktest-prod-db-2 ~]# lvdisplay --units B vg_oktestdb2/pool
--- Logical volume ---
LV Name pool
VG Name vg_oktestdb2
LV UUID tPfUzG-bHW2-jepz-1Sf6-BSmw-jKz4-Tf6djR
LV Write Access read/write
LV Creation host, time oktest-db-2, 2015-03-31 18:55:17 +0300
LV Pool transaction ID 134
LV Pool metadata pool_tmeta
LV Pool data pool_tdata
LV Pool chunk size 262144 B
LV Zero new blocks yes
LV Status available
# open 0
LV Size 474031849472 B
Allocated pool data 10.16%
Allocated metadata 7.66%
Current LE 113018
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5
Then create a new pool with the same size:
[root@oktest-prod-db-1-new ~]# lvcreate -L 474031849472b -T vg_oktestdb1/pool --chunksize 256k
Logical volume "lvol0" created
Logical volume "pool" created
And lastly copy it over ssh:
[root@oktest-prod-db-2 ~]# dd bs=128k if=/dev/mapper/vg_oktestdb2-pool | ssh root@oktest-prod-db-1-new 'dd bs=128k of=/dev/mapper/vg_oktestdb1-pool'
Now I just sit and wait for several hours
Upd: it did work back then.
lvm snapshot
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Need to clone a 400gb pool onto another machine. Will this work?
First I collect the data about the existing pool:
[root@oktest-prod-db-2 ~]# lvdisplay --units B vg_oktestdb2/pool
--- Logical volume ---
LV Name pool
VG Name vg_oktestdb2
LV UUID tPfUzG-bHW2-jepz-1Sf6-BSmw-jKz4-Tf6djR
LV Write Access read/write
LV Creation host, time oktest-db-2, 2015-03-31 18:55:17 +0300
LV Pool transaction ID 134
LV Pool metadata pool_tmeta
LV Pool data pool_tdata
LV Pool chunk size 262144 B
LV Zero new blocks yes
LV Status available
# open 0
LV Size 474031849472 B
Allocated pool data 10.16%
Allocated metadata 7.66%
Current LE 113018
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5
Then create a new pool with the same size:
[root@oktest-prod-db-1-new ~]# lvcreate -L 474031849472b -T vg_oktestdb1/pool --chunksize 256k
Logical volume "lvol0" created
Logical volume "pool" created
And lastly copy it over ssh:
[root@oktest-prod-db-2 ~]# dd bs=128k if=/dev/mapper/vg_oktestdb2-pool | ssh root@oktest-prod-db-1-new 'dd bs=128k of=/dev/mapper/vg_oktestdb1-pool'
Now I just sit and wait for several hours
Upd: it did work back then.
lvm snapshot
Need to clone a 400gb pool onto another machine. Will this work?
First I collect the data about the existing pool:
[root@oktest-prod-db-2 ~]# lvdisplay --units B vg_oktestdb2/pool
--- Logical volume ---
LV Name pool
VG Name vg_oktestdb2
LV UUID tPfUzG-bHW2-jepz-1Sf6-BSmw-jKz4-Tf6djR
LV Write Access read/write
LV Creation host, time oktest-db-2, 2015-03-31 18:55:17 +0300
LV Pool transaction ID 134
LV Pool metadata pool_tmeta
LV Pool data pool_tdata
LV Pool chunk size 262144 B
LV Zero new blocks yes
LV Status available
# open 0
LV Size 474031849472 B
Allocated pool data 10.16%
Allocated metadata 7.66%
Current LE 113018
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:5
Then create a new pool with the same size:
[root@oktest-prod-db-1-new ~]# lvcreate -L 474031849472b -T vg_oktestdb1/pool --chunksize 256k
Logical volume "lvol0" created
Logical volume "pool" created
And lastly copy it over ssh:
[root@oktest-prod-db-2 ~]# dd bs=128k if=/dev/mapper/vg_oktestdb2-pool | ssh root@oktest-prod-db-1-new 'dd bs=128k of=/dev/mapper/vg_oktestdb1-pool'
Now I just sit and wait for several hours
Upd: it did work back then.
lvm snapshot
lvm snapshot
edited Nov 21 at 11:58
asked Aug 27 '15 at 15:16
basin
260312
260312
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Not sure how it goes trough a pipe to a SSH session, but I'm used to do this with netcat
first launch a listening netcat on the destination server :
netcat -p 1237 -l | dd of=<destination lv path/name> obs=$((1024*1024)) ibs=8192
Then on the source server
dd ibs=$((1024*1024)) obs=8192 <source lv path/name> | pv | netcat <ip of destination server> 1237
you can skip the "pv" part of course and change the port "1237" to whatever will pass trough your firewalls.
Also you can pipe it into gzip but from my experience this is not a big
gain.
Was it a thin pool?
– basin
Aug 27 '15 at 17:05
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Not sure how it goes trough a pipe to a SSH session, but I'm used to do this with netcat
first launch a listening netcat on the destination server :
netcat -p 1237 -l | dd of=<destination lv path/name> obs=$((1024*1024)) ibs=8192
Then on the source server
dd ibs=$((1024*1024)) obs=8192 <source lv path/name> | pv | netcat <ip of destination server> 1237
you can skip the "pv" part of course and change the port "1237" to whatever will pass trough your firewalls.
Also you can pipe it into gzip but from my experience this is not a big
gain.
Was it a thin pool?
– basin
Aug 27 '15 at 17:05
add a comment |
up vote
0
down vote
accepted
Not sure how it goes trough a pipe to a SSH session, but I'm used to do this with netcat
first launch a listening netcat on the destination server :
netcat -p 1237 -l | dd of=<destination lv path/name> obs=$((1024*1024)) ibs=8192
Then on the source server
dd ibs=$((1024*1024)) obs=8192 <source lv path/name> | pv | netcat <ip of destination server> 1237
you can skip the "pv" part of course and change the port "1237" to whatever will pass trough your firewalls.
Also you can pipe it into gzip but from my experience this is not a big
gain.
Was it a thin pool?
– basin
Aug 27 '15 at 17:05
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Not sure how it goes trough a pipe to a SSH session, but I'm used to do this with netcat
first launch a listening netcat on the destination server :
netcat -p 1237 -l | dd of=<destination lv path/name> obs=$((1024*1024)) ibs=8192
Then on the source server
dd ibs=$((1024*1024)) obs=8192 <source lv path/name> | pv | netcat <ip of destination server> 1237
you can skip the "pv" part of course and change the port "1237" to whatever will pass trough your firewalls.
Also you can pipe it into gzip but from my experience this is not a big
gain.
Not sure how it goes trough a pipe to a SSH session, but I'm used to do this with netcat
first launch a listening netcat on the destination server :
netcat -p 1237 -l | dd of=<destination lv path/name> obs=$((1024*1024)) ibs=8192
Then on the source server
dd ibs=$((1024*1024)) obs=8192 <source lv path/name> | pv | netcat <ip of destination server> 1237
you can skip the "pv" part of course and change the port "1237" to whatever will pass trough your firewalls.
Also you can pipe it into gzip but from my experience this is not a big
gain.
answered Aug 27 '15 at 16:05
JFL
27314
27314
Was it a thin pool?
– basin
Aug 27 '15 at 17:05
add a comment |
Was it a thin pool?
– basin
Aug 27 '15 at 17:05
Was it a thin pool?
– basin
Aug 27 '15 at 17:05
Was it a thin pool?
– basin
Aug 27 '15 at 17:05
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f963678%2fcloning-an-lvm2-thin-pool-with-all-the-snapshots%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown