Hello,
The "cplv" manual says:
"To copy the contents of logical volume lv02 to a smaller, existing logical volume, lvtest, without requiring user confirmation, type:
cplv -e lvtest -f lv02
"
So, for test I performed the following steps:
# lspv
hdisk0 002226912c981ff6 rootvg
hdisk1 002226918798d854 rootvg
hdisk2 00222691e476ec7b None
hdisk3 00222691e4856e64 None
# mkvg -s 32 -y test1 hdisk2
test1
# mkvg -s 32 -y test2 hdisk3
test2
# mklv -y big_lv test1 5
big_lv
# mklv -y small_lv test2 3
small_lv
# crfs -v jfs -d big_lv -m /bigfs
Based on the parameters chosen, the new /bigfs JFS file system
is limited to a maximum size of 134217728 (512 byte blocks)
New File System size is 327680
# mount /bigfs
# dd if=/dev/zero of=/bigfs/50Mb.file count=50000 bs=1k
50000+0 records in
50000+0 records out
# ls -la
total 100024
drwxr-sr-x 3 sys sys 512 Nov 14 08:51 .
drwxr-xr-x 44 root system 1536 Nov 14 08:48 ..
-rw-r--r-- 1 root sys 51200000 Nov 14 08:51 50Mb.file
drwxrwx--- 2 root system 512 Nov 14 08:48 lost+found
# df /bigfs
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/big_lv 327680 217208 34% 18 1% /bigfs
# umount /bigfs
# cplv -e small_lv -f big_lv
0516-746 cplv: Destination logical volume must have
type set to copy.
cplv: Use chlv command with -t flag to change the type to copy.
# chlv -t copy small_lv
# cplv -e small_lv -f big_lv
0516-748 cplv: Warning, copying to a smaller logical volume --
may lose data. Also, could corrupt any existing filesystem.
cplv: Logical volume big_lv successfully copied to small_lv .
# lslv -l big_lv
big_lv:/bigfs
PV COPIES IN BAND DISTRIBUTION
hdisk2 005:000:000 100% 000:005:000:000:000
# lslv -l small_lv
small_lv:N/A
PV COPIES IN BAND DISTRIBUTION
hdisk3 003:000:000 100% 000:003:000:000:000
# lsvg -l test2
test2:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
small_lv jfs 3 3 1 closed/syncd N/A
# mklv -t jfslog -y jfslog2_lv test2 1
jfslog2_lv
# logform /dev/jfslog2_lv
logform: destroy /dev/jfslog2_lv ?y
# chfs -a dev=/dev/small_lv -a log=/dev/jfslog2_lv /bigfs
# lsvg -l test1
test1:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
big_lv jfs 5 5 1 closed/syncd N/A
loglv01 jfslog 1 1 1 closed/syncd N/A
# lsvg -l test2
test2:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
small_lv jfs 3 3 1 closed/syncd /bigfs
jfslog2_lv jfslog 1 1 1 closed/syncd N/A
# mount /bigfs
# df /bigfs
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/small_lv 327680 217208 34% 18 1% /bigfs
Please let me know why the "small_lv" which sill have 3PPs (8MB PP size) on "df" output is shown 327680 512-blocks (the same as for big_lv which has 5PPs each 8MB)?
best regards,
M.
The "cplv" manual says:
"To copy the contents of logical volume lv02 to a smaller, existing logical volume, lvtest, without requiring user confirmation, type:
cplv -e lvtest -f lv02
"
So, for test I performed the following steps:
# lspv
hdisk0 002226912c981ff6 rootvg
hdisk1 002226918798d854 rootvg
hdisk2 00222691e476ec7b None
hdisk3 00222691e4856e64 None
# mkvg -s 32 -y test1 hdisk2
test1
# mkvg -s 32 -y test2 hdisk3
test2
# mklv -y big_lv test1 5
big_lv
# mklv -y small_lv test2 3
small_lv
# crfs -v jfs -d big_lv -m /bigfs
Based on the parameters chosen, the new /bigfs JFS file system
is limited to a maximum size of 134217728 (512 byte blocks)
New File System size is 327680
# mount /bigfs
# dd if=/dev/zero of=/bigfs/50Mb.file count=50000 bs=1k
50000+0 records in
50000+0 records out
# ls -la
total 100024
drwxr-sr-x 3 sys sys 512 Nov 14 08:51 .
drwxr-xr-x 44 root system 1536 Nov 14 08:48 ..
-rw-r--r-- 1 root sys 51200000 Nov 14 08:51 50Mb.file
drwxrwx--- 2 root system 512 Nov 14 08:48 lost+found
# df /bigfs
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/big_lv 327680 217208 34% 18 1% /bigfs
# umount /bigfs
# cplv -e small_lv -f big_lv
0516-746 cplv: Destination logical volume must have
type set to copy.
cplv: Use chlv command with -t flag to change the type to copy.
# chlv -t copy small_lv
# cplv -e small_lv -f big_lv
0516-748 cplv: Warning, copying to a smaller logical volume --
may lose data. Also, could corrupt any existing filesystem.
cplv: Logical volume big_lv successfully copied to small_lv .
# lslv -l big_lv
big_lv:/bigfs
PV COPIES IN BAND DISTRIBUTION
hdisk2 005:000:000 100% 000:005:000:000:000
# lslv -l small_lv
small_lv:N/A
PV COPIES IN BAND DISTRIBUTION
hdisk3 003:000:000 100% 000:003:000:000:000
# lsvg -l test2
test2:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
small_lv jfs 3 3 1 closed/syncd N/A
# mklv -t jfslog -y jfslog2_lv test2 1
jfslog2_lv
# logform /dev/jfslog2_lv
logform: destroy /dev/jfslog2_lv ?y
# chfs -a dev=/dev/small_lv -a log=/dev/jfslog2_lv /bigfs
# lsvg -l test1
test1:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
big_lv jfs 5 5 1 closed/syncd N/A
loglv01 jfslog 1 1 1 closed/syncd N/A
# lsvg -l test2
test2:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
small_lv jfs 3 3 1 closed/syncd /bigfs
jfslog2_lv jfslog 1 1 1 closed/syncd N/A
# mount /bigfs
# df /bigfs
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/small_lv 327680 217208 34% 18 1% /bigfs
Please let me know why the "small_lv" which sill have 3PPs (8MB PP size) on "df" output is shown 327680 512-blocks (the same as for big_lv which has 5PPs each 8MB)?
best regards,
M.