## Tell LVM about RAID arrays sudo pvcreate /dev/md2 sudo pvcreate /dev/md3 ## Create a volume group from empty RAID arrays sudo vgcreate VolGroupArray /dev/md2 /dev/md3 ## Create a logical volume named "archive", using all available space sudo lvcreate -l +100%FREE VolGroupArray -n archive sudo lvdisplay ## and create a filesystem on the new logical volume sudo mkfs.ext4 /dev/VolGroupArray/archive ## mount the new filesystem ## and move files from the mount-point of /dev/md1 to /dev/VolGroupArray/archive ## then unmount /dev/md1 ## Add the last RAID array to the volume group sudo pvcreate /dev/md1 sudo vgextend VolGroupArray /dev/md1 ## Update the logical volume to use all available space sudo lvresize -l +100%FREE /dev/VolGroupArray/archive ## And resize the filesystem -- rather slow, maybe faster to unmount it first... sudo resize2fs /dev/VolGroupArray/archive ## Finally, get blkid and update /etc/fstab with UUID and mount options (here, just noatime) sudo blkid
I probably should have made backups before I did this, but everything went smoothly...
Also, I discovered this python tool to do conversions in-place. Again, this appears non-destructive, but back-ups never hurt. Also of interest for a file server is Smartmontools to monitor for hardware/disk failures: a nice review is here.
[REFS]
* http://home.gagme.com/greg/linux/raid-lvm.php
* https://wiki.archlinux.org/index.php/Software_RAID_and_LVM
* http://webworxshop.com/2009/10/10/online-filesystem-resizing-with-lvm
No comments:
Post a Comment