Re: Adding a disk
- From: "Green, Simon" <Simon.Green@xxxxxxxxxxxxx>
- Date: Tue, 15 Aug 2006 12:28:34 +0200
This is simpler than you think, provided you keep it within rootvg. And if
you don't want to do that, I'd do it slightly differently to what you have
planned...
First: within rootvg.
Add the physical drives.
Run cfgmgr, to get them defined on the system.
(No need to reboot, assuming you've got hot-plug devices of some
description. If they're not, and you have to shutdown your server to add
the disks then there's no need to run cfgmgr.)
extendvg rootvg hdiskX hdiskY
chlv -a e lv00
If you're going to use an entire drive, you want it to start at the edge not
the middle so that the whole thing is nicely contiguous.
You should probably check the LV characteristics, (lslv lv00). In
particular, "UPPER BOUND" must be at least 3, (that's the number of disks
the LV can use: during migratepv it'll briefly use three disks), and MAX
LPs, which will need to be enough for the new LV size, eventually. If you
need to reset them you do that with chlv, too. e.g. chlv -x 537 -u 3 lv00
migratepv -l lv00 hdisk0 hdiskX
migratepv -l lv00 hdisk1 hdiskY
Each of these copies every partition of lv00 from the first disk to the
second one. The LV remains fully useable throughout the operation. It can
take a while for a large LV: I'd guess about 10 minutes for yours, but it
depends on the disk and CPU performance.
You might like to run lslv -m lv00 after the first one, to make sure that
the partitions are where you want them.
Increase the filesystem size to whatever you want.
I would normally do extendlv lv00 XXX,
where XXX is the number of extra partitions to add, (run lspv hdiskX and
use the FREE PPs value)
Then I use a little script to increase the filesystem size. (That's just
formatting the extra partitions.)
#!/bin/ksh
#
# Increase the size of a filesystem to that of its logical volume.
#
Filesystem=$1
lsfs -q $Filesystem |tail -1|awk {'print $3 $6'} | tr ',' ' ' |read LV_Size
FS_Size
if [ $LV_Size -ne $FS_Size ]
then
chfs -a size=$LV_Size $Filesystem
else
echo Filesystem already uses all of Logical Volume.
fi
The filesystem will remain accessible throughout this work.
If you want to move this to a different volume group it's a little tougher,
but not too bad. The main thing is that the filesystem doesn't remain
available. It's generally not a bad idea to keep your application data out
of rootvg as it tends to make administration easier in the long run, in my
experience. It's not required, though, and every case is different.
Assuming that you want this in a brand new VG of its own, and that lv00 is
to be a JFS, not a JFS2...
Add the disks as before.
mkvg -y sirsivg hdiskX hdiskY
chvg -Q n sirsivg
varyoffvg sirsivg
varyonvg sirsivg
mklv -a e -c 2 -t jfslog -s s -y loglv01 sirsivg 1 hdiskX
logform /dev/loglv01
mklv -a e -t jfs -s s -y sirsilv01 -c 2 sirsivg 542 hdiskX
Check the number of partitions (542) but I think that'll be correct.
crfs -v jfs -d sirsilv01 -m /snew -A yes
You might want to consider additional options. In particular, I'd
recommend "-a nbpi=16384"
Mount /snew.
umount /s
chfs -p ro -m /sold /s
mount /sold
cd /sold
find . -print | cpio -pd /snew
That'll take a while...
umount /snew
chfs -m /s /snew
mount /s
mirrorvg -m sirsivg hdiskY
That'll take a while. If it makes mention of having to vary off the VG for
the change in Quorum to take effect, you can ignore that since we did it
earlier.
Once you're happy that everything is OK...
umount /sold
rmfs -r /sold
rmdir /snew
Do check the commands: I think that's all correct but I wouldn't rule out
typos or other stupid mistakes.
If you're unfamiliar with this sort of thing, go take a look at the Redbook
site, (see link in my sig). In particular I'd recommend the various
Certification Study Guides and the LVM A-Z (two volumes).
--
Simon Green
Altria ITSC Europe s.a.r.l.
AIX-L Archive at https://lists.princeton.edu/listserv/aix-l.html
<https://lists.princeton.edu/listserv/aix-l.html>
New to AIX? http://publib-b.boulder.ibm.com/redbooks.nsf/portals/UNIX
<http://publib-b.boulder.ibm.com/redbooks.nsf/portals/UNIX>
N.B. Unsolicited email from vendors will not be appreciated.
Please post all follow-ups to the list.
-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@xxxxxxxxxxxxx] On Behalf Of
Karen Boddy
Sent: 14 August 2006 16:45
To: aix-l@xxxxxxxxxxxxx
Subject: Adding a disk
AIX 5.3 ML4
I have 2-18GB disks mirrored, single volume group [rootvg] and need to add
two additional 36GB disks. Below is my current configuration. What I'd like
to do is move the lv00 with file system /s to the new physical volume,
making it as large as the system will allow, and mirror the two 36GB disks.
I wasn't able to find any documentation on moving, just copying....
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 48 96 2 open/syncd N/A
hd8 jfslog 1 2 2 open/syncd N/A
hd4 jfs 39 78 2 open/syncd /
hd2 jfs 86 172 2 open/syncd /usr
hd9var jfs 31 62 2 open/syncd /var
hd3 jfs 2 4 2 open/syncd /tmp
hd1 jfs 1 2 2 open/syncd /home
hd10opt jfs 4 8 2 open/syncd /opt
lv00 jfs 320 640 2 open/syncd /s
This task is a bit over my head. In the past we've only installed after a
drive failure and it was done by IBM maintenance so my solo experience is
limited. After reading the documentation these are the steps I think I need
to take:
Install the drives
Reboot
Unmirror the rootvg
Create a volume group on one of the new physical drives [sirsivg].
Copy the logical volume [lv00] and create a new one on the new physical
volume which is done by:
Stop using the logical volume and unmount filesystem
Stop any access
cplv lv00
Mount the file systems and restart application using the new logical volume.
Remirror rootvg and mirror the new drives.
Does it automatically copy over the /s file system? Do I need to remove the
old logical volume and file system? Any common errors I need to be aware of?
- Prev by Date: Re: Adding a disk
- Next by Date: Re: FTP /performance issue question
- Previous by thread: Re: Adding a disk
- Next by thread: Re: Adding a disk
- Index(es):
Relevant Pages
|
|