1834156 Members
2407 Online
110064 Solutions
New Discussion

make a mirror

 
Ignacio Rodríguez Arrós
Frequent Advisor

make a mirror

I have two disk of 18 Gb each in one vg02. I made lvol1 with 9 Gb and mirror (9Gb from each disk), and lvol2 with 18 Gb without mirror (9 Gb from one disk and 9 Gb from the other disk). Now i want to conver the 18 Gb without mirror in a lvol2 of 9 Gb mirrored. ??How must i do it?
3 REPLIES 3
Steven Gillard_2
Honored Contributor

Re: make a mirror

lvol2 will need to be re-created. If you've got data on it, either back it up to tape, or as another possibly faster option you can split the first mirror and create a temporary lvol & file system on the other half to store your data while you recreate lvol2. Then once you've recreated lvol2 you restore your data.

Of course, I assume you don't have more than 9Gig of data on lvol2!

Cheers,
Steve
Thierry Poels_1
Honored Contributor

Re: make a mirror

hi,

- unmount lvol2
- lvreduce -L 9216 /dev/vg02/lvol2
- lvdisplay -v /dev/vg02/lvol2 and check if all extents of lvol2 are on one disk (pvmove remaining extents if necessary)
- lvextend -m 1 /dev/vg02/lvol2
- remount lvol2

and a backup in advance wouldn't hurt anybody ;)

good luck,
Thierry
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Darrell Allen
Honored Contributor

Re: make a mirror

Hello,

Make a backup before doing anything. 2 backups if the data can't be recovered any other way.

If lvol2 is a JFS filesystem and you have online JFS you could try to defrag and reduce the filesystem then reduce the size of the LV:

fsadm -F vxfs -d -D -e -E /mount_point
fsadm -F vxfs -b 9000M /mount_point
lvreduce -L 9000M /dev/vg02/lvol2

fsadm may not be able to reduce the size if the space to be released is actually used by the filesystem. If it fails, you will have to rebuild the filesystem as others have said.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)