Squeezebox Setup

Extending the raid array

If you want to change add an extra disk into the array then there are a few steps. First you need to add the new drive to your existing array:

[root@tranquilpc ~]# mdadm --add /dev/md0 /dev/sdb3
[root@tranquilpc ~]# mdadm --grow --raid-devices=3 /dev/md0

This will caise a restripe – which took 24 hours on my atom box! Dont forget to update your mdadm config file when you’re done:

[root@tranquilpc ~]# mkdir /etc/mdadm/
[root@tranquilpc ~]# echo "DEVICE partitions" > /etc/mdadm/mdadm.conf
[root@tranquilpc ~]# mdadm --detail --scan >> /etc/mdadm/mdadm.conf

Then you need to resize the physical volume everything sits on.

[root@tranquilpc ~]# pvresize /dev/md0
/dev/sdd1: lseek 4611824548366094336 failed: Invalid argument
Physical volume “/dev/md0” changed
1 physical volume(s) resized / 0 physical volume(s) not resized
[root@tranquilpc ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup00
PV Size 37.16 GB / not usable 4.40 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 1189
Free PE 0
Allocated PE 1189
PV UUID lmoOKs-rUhL-O4Ru-y1vD-7zju-3AyH-4oDpA2

--- Physical volume ---
PV Name /dev/md0
VG Name raiddata
PV Size 1.82 TB / not usable 2.06 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 476933
Free PE 238467
Allocated PE 238466
PV UUID YpLMUL-xBmq-u2WI-Xbsg-0aD8-T5YL-biW40T

So you can see that the md0 partition has been made bigger. Next we need to unmount the raid partition, and extend the lvm partition:

[root@tranquilpc /]# umount /home

[root@tranquilpc ~]# lvextend -l 100%VG /dev/raiddata/lvm0
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/dev/mapper/raiddata-lvm0: clean, 204195/122109952 files,
241791122/244189184 blocks
Extending logical volume lvm0 to 1.82 TB
Logical volume lvm0 successfully resized

[root@tranquilpc /]# e2fsck -f /dev/raiddata/lvm0
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes

At this point you are extended, formatted and good to go.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.