Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] raidreconf & pvresize with LVM2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
dreadnought
n00b
n00b


Joined: 09 Jun 2004
Posts: 21
Location: Linz, Austria

PostPosted: Fri Mar 18, 2005 1:33 pm    Post subject: [HOWTO] raidreconf & pvresize with LVM2 Reply with quote

I just spent 2 days to expand my 6x160G RAID5 array by 2x160 disks, so I thought I better share my knowledge (no pain, no gain):

First I wasn't really sure about raidreconf, but a quick look at the source code and some reports on successful resize operations eventually convinced me
Code:
raidstop /dev/md0
raidreconf -o /etc/raidtab.old -n /etc/raidtab -m /dev/md0


The resizing of the raid array had been successful, but I now had to somehow convince my lvm2 to resize the pv as I used the whole /dev/md0 as a pv and not just some partitions. The command pvresize actually exists, however it just drops out with a
Code:
Command not implemented yet.


As backing up the whole data and starting again was not an option here is how i managed to resize the pv myself
Code:
pvcreate -ff -u[the uuid of the raid] /dev/md0
vgcreate testing /dev/md0
vgcfgbackup --file raidnewsize testing
vgremove testing
rm /etc/lvm/archive/testing*


The new volume group I temporarily created uses the correct size of the pv, so the trick is to merge the backup file of the old volume group (in my case /etc/lvm/backup/raid_array) with the backup file of the temporary testing volume group. You just have to replace the following line in the backup file of the old vg
Code:
pe_count = 228940       # 894.296 Gigabytes


Now restore the modified backup and proceed as if pvresize has ever existed
Code:
vgcfgrestore --file raidnewsize raid_array
lvextend -l 228940 /dev/raid_array/backup
resize2fs /dev/raid_array/backup


Enjoy. However if things go terribly wrong it's always comforting to have a backup.... :roll:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum