0% found this document useful (0 votes)
114 views3 pages

Movelvfromvgtovg

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1/ 3

Example

Task 1 : Ckeck the logical volume and it mount point . In our example we are going to move /my
filesytem from mvg01 to poovg01.
$ df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 0.25 0.20 21% 2514 2% /
/dev/hd2 2.88 0.42 86% 33394 5% /usr
/dev/hd9var 0.25 0.11 58% 4495 7% /var
/dev/hd3 0.12 0.08 34% 375 2% /tmp
/dev/hd1 0.50 0.48 4% 22 1% /home
/proc - - - - - /proc
/dev/hd10opt 0.75 0.26 66% 3996 3% /opt
/dev/lv_admin 0.12 0.12 4% 67 1% /admin
/dev/fslv00 16.00 3.56 78% 31558 4% /sejinstall
/dev/mylv 2.00 2.00 1% 4 1% /my
Task 2 : List the volume group present on the system.
$ lsvg
rootvg
myvg01
poovg01
Task 3 : Identify the Volume Group corresponds to the filesystem and Logical Volume. In this
example mylv is the LV name for filesystme /my and it resides on VG myvg01 .
$ lsvg -l myvg01
myvg01:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
mylv jfs2 8 8 1 open/syncd /my
loglv01 jfs2log 1 1 1 open/syncd N/A
Task 4 : Umount the filesytem .
$umount /my
Task 5 : Copy the mylv to Volume Group poovg1 with new LV name mylvnew.
$ cplv -v poovg01 -y mylvnew mylv
cplv: Logical volume mylv successfully copied to mylvnew .
Task 6: create a jfs2log file with name loglv02.
$ mklv -t jfs2log -y loglv02 poovg01 1
loglv02
Task 7 : Format the log file.
$ logform /dev/loglv02
logform: destroy /dev/rloglv02 (y)?y
Task 8 : Assign the log /dev/loglv02 to the LV /dev/mylvnew.
$ chfs -a dev=/dev/mylvnew -a log=/dev/loglv02 /my

Task 9 : Run filesystem check on the mount point /my.


$ fsck -p /my
The current volume is: /dev/mylvnew
Primary superblock is valid.
J2_LOGREDO:log redo processing for /dev/mylvnew
J2_LOGREDO:logredo: /dev/loglv01 is not a log file
j2_logredo.cpp: ERROR in openFilesystems line 1852, openLog
j2_logredo.cpp: ERROR in j2_logredo line 656, openFilesystems
Failure replaying log: -8
exec module "/sbin/helpers/jfs2/logredo64" failed.
logredo failed (rc=248). fsck continuing.
Primary superblock is valid.
*** Phase 1 - Initial inode scan
*** Phase 2 - Process remaining directories
*** Phase 3 - Process remaining files
*** Phase 4 - Check and repair inode allocation map
*** Phase 5 - Check and repair block allocation map
File system is clean.
Task 10 : Mount the filesystem /my.
$ mount /my
Task 11 : Verify the filesystem /my mounted correctly.
$ df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 0.25 0.20 21% 2518 2% /
/dev/hd2 2.88 0.42 86% 33394 5% /usr
/dev/hd9var 0.25 0.11 58% 4495 7% /var
/dev/hd3 0.12 0.08 34% 375 2% /tmp
/dev/hd1 0.50 0.48 4% 22 1% /home
/proc - - - - - /proc
/dev/hd10opt 0.75 0.26 66% 3996 3% /opt
/dev/lv_admin 0.12 0.12 4% 67 1% /admin
/dev/fslv00 16.00 3.56 78% 31558 4% /sejinstall
/dev/mylvnew 2.00 2.00 1% 6 1% /my
Task 12 : Below out show LV mylv01 is present on myvg01 VG and it is in closed status.
.
$ lsvg -l myvg01
myvg01:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
mylv jfs2 8 8 1 closed/syncd N/A
loglv01 jfs2log 1 1 1 closed/syncd N/A
Task 13 : Remove the LV mylv01 from the system.
$ rmlv mylv
Warning, all data contained on logical volume mylv will be destroyed.
rmlv: Do you wish to continue? y(es) n(o)? y
rmlv: Logical volume mylv is removed.

$ lsvg -l myvg01
myvg01:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv01 jfs2log 1 1 1 closed/syncd N/A
Task 14: Verify the mylvnew is present in poovg01.
$ lsvg -l poovg01
poovg01:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
poolv jfs2 8 8 1 closed/syncd N/A
mylvnew jfs2 8 8 1 open/syncd /my
loglv02 jfs2log 1 1 1 open/syncd N/A
By this way we can move a filesystem from VG to VG .

You might also like