Operating System - Linux
1752808 Members
5890 Online
108789 Solutions
New Discussion юеВ

Upgrading disk in LVM - RHEL4

 
Rakesh Jha_1
Advisor

Upgrading disk in LVM - RHEL4

We have installed HP Proliant DL380 with 6x72.8GB Ultar380 running RHEL4. We configured LVM raid5 before/during linux installtion.
Please see below -
[root@xxxxx ~]# pvscan
PV /dev/cciss/c0d0p2 VG VolGroup00 lvm2 [338.66 GB / 32.00 MB free]
Total: 1 [338.66 GB] / in use: 1 [338.66 GB] / in no VG: 0 [0 ]
[root@xxxxx ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/cciss/c0d0p2 VolGroup00 lvm2 a- 338.66G 32.00M
[root@xxxxx ~]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 8 0 wz--n- 338.66G 32.00M
[root@xxxxx ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
[root@xxxxx ~]# lvscan
ACTIVE '/dev/VolGroup00/LogVol00' [8.00 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol06' [14.66 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol05' [244.00 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol07' [29.31 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol03' [5.00 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [14.66 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol02' [7.00 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol04' [16.00 GB] inherit

Now we are facing space crunch and want to upgrade the disks. My question can we upgrade /replace hard drive with 146GB one by one without loss of any data?
Do I need to shutdown the server?

Any help is appreciated. thanks
Rakesh
5 REPLIES 5
Court Campbell
Honored Contributor

Re: Upgrading disk in LVM - RHEL4

Just to clarify a little. You can't have and lvm raid5. You have a raid5 config and are using lvm. I am not sure how to answer this question, but to say i wouldn't attempt it that way. It's not as if just adding the larger drives is going to automagically add all the space on the fly. You are either going to need to add some external storage and start moving files off to it, or you will need to backup your system and layout everything anew on the larger disks. I wish I had a simplistic answer for you. Maybe you can try using mondo rescue in some capacity to solve this issue. But I can never stress enough, TAKE A BACKUP BEFORE YO START YOUR PROJECT.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Rakesh Jha_1
Advisor

Re: Upgrading disk in LVM - RHEL4

I have now more details -
Server HP Proliant DL380 G4, Disk 6x72.8 Ultra380 SCSI. RAID controller Smart Array P400i. The HP-ACU-CLI shows -

# hpacucli ctrl slot=0 show status

Smart Array 6i in Slot 0
Controller Status: OK
Cache Status: OK


# hpacucli ctrl slot=0 ld all show status

logicaldrive 1 (339.2 GB, RAID RAID 5): OK

# hpacucli ctrl slot=0 pd all show status

physicaldrive 2:0 (port 2:id 0, 72.8 GB): OK
physicaldrive 2:1 (port 2:id 1, 72.8 GB): OK
physicaldrive 2:2 (port 2:id 2, 72.8 GB): OK
physicaldrive 2:3 (port 2:id 3, 72.8 GB): OK
physicaldrive 2:4 (port 2:id 4, 72.8 GB): OK
physicaldrive 2:5 (port 2:id 5, 72.8 GB): OK

Can I upgrade the disk one by one using hpacucli utility?

Rakesh
Steven E. Protter
Exalted Contributor

Re: Upgrading disk in LVM - RHEL4

Shalom,

I've done this with a RAID 1 (hardware) based LVM system.

Unfortunately the big file system was part of a volume group that did not have enough capacity for the new larger disks at upgrade.

I eventually played a game of moving the data around and created a new larger volume group and file system, into which I copied the data.

So no data loss, a few reboots as I tried technology like acronis to expand the logical volume.

I'd definitely have a good backup and have some contingency downtime from the server users.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Johannes Krackowizer
Occasional Advisor

Re: Upgrading disk in LVM - RHEL4

i have never done this with a hardware raid but i think if you replace one 73GB disk with a 146GB disk the 73GB will be rebuild (thanks to raid5) and the other 73GB remainig space will be lost (raid5 uses only equaly large space on every disk). even if you replace step by step every disk in the array at last ther will be every disk half used.

another way could be to create a new raid5 arry with the new disks (don't touch the original array).

1. create a new pv on the new array (pvcreate /dev/cciss/cXdXpX).
2. extend the existing vg with the new pv (vgextend VolGroup00 /dev/cciss/cXdXpX)
3. move anything from the old pv to the new pv (pvmove -v /dev/cciss/c0d0p2)
4. remove the old pv (73GB disks) from the vg (vgreduce VolGroup00 /dev/cciss/c0d0p2)

This could all be done without a shutdown only poor performance during pvmove (all data will be moved from one partition to another partation)

next thing is to make sure you can boot after this procedure. so you need a tool to move your boot partion (and any other non lvm partition to the new disk array (properly needs a reboot).

than you need to restart with a rescue disk to correct your /etc/fstab mount the non lvm disks properly and reinstall your bootloader on the new array. after that you can remove the old array and reboot.

you should only unplug the old array disks and don't destroy the array until you are sure booting will work fine from the new array.

so you can do the big part of work without shutdown. only for non-lvm partitions and reconfiguration (fstab / bootloader) you need to reboot.
21 is only the half truth
Rakesh Jha_1
Advisor

Re: Upgrading disk in LVM - RHEL4

Thanks Johannes. I think I cannot do any thing except connecting a external storage or whole box replacement.

On the server there are 6 slots and all occupied.

Thanks to all who replied on my query.

This thread can be closed.